Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to unified github context string: suse/cloud #3055

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions jenkins/ci.suse.de/cloud-crowbar-testbuild-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,23 +84,24 @@
github_pr_sha=${github_opts[1]}
github_pr_branch=${github_opts[2]}
ghpr_paras="--org ${crowbar_org} --repo ${crowbar_repo} --sha ${github_pr_sha}"
gh_context="suse/cloud"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be gh_context_prefix? It's not the whole context.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree, gh_context_prefix is a more meaningful name for the variable.


function crowbargating_trap()
{
$ghpr --action set-status $ghpr_paras --status "failure" --targeturl ${BUILD_URL} --context "suse/mkcloud/testbuild" --message "testbuild job failed" --debugratelimit
$ghpr --action set-status $ghpr_paras --status "failure" --targeturl ${BUILD_URL} --context "${gh_context}/testbuild" --message "testbuild job failed" --debugratelimit
}

# using a trap to catch all errors of the following commands
trap "crowbargating_trap" ERR

# report that the job has started (status "pending")
$ghpr --action set-status $ghpr_paras --status "pending" --targeturl ${BUILD_URL} --context "suse/mkcloud/testbuild" --message "Started testbuild job"
$ghpr --action set-status $ghpr_paras --status "pending" --targeturl ${BUILD_URL} --context "${gh_context}/testbuild" --message "Started testbuild job"

# do the build
${automationrepo}/scripts/crowbar-testbuild.rb --org $crowbar_org --repo $crowbar_repo --pr $crowbar_github_pr --trigger-gating

# update the status
$ghpr --action set-status $ghpr_paras --status "pending" --targeturl ${BUILD_URL} --context "suse/mkcloud" --message "Queued testbuild PR gating"
$ghpr --action set-status $ghpr_paras --status "success" --targeturl ${BUILD_URL} --context "suse/mkcloud/testbuild" --message "testbuild job succeeded" --debugratelimit
$ghpr --action set-status $ghpr_paras --status "pending" --targeturl ${BUILD_URL} --context "${gh_context}" --message "Queued testbuild PR gating"
$ghpr --action set-status $ghpr_paras --status "success" --targeturl ${BUILD_URL} --context "${gh_context}/testbuild" --message "testbuild job succeeded" --debugratelimit

trap "-" ERR
12 changes: 6 additions & 6 deletions jenkins/ci.suse.de/openstack-mkcloud-log-parser-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
default: SUSE-Cloud/automation:PR_ID:SHA1:master
description: >-
String is a ':' separated list of these values:
$ORG/$repo:$PR_ID:$SHA1:$BRANCH:$context
$ORG/$repo:$PR_ID:$SHA1:$BRANCH:$context_suffix

Note: SHA1 must be latest commit in PR, $context is optional
Note: SHA1 must be latest commit in PR, $context_suffix is optional
(only use if multiple gating runs needed per PR)

wrappers:
Expand Down Expand Up @@ -90,10 +90,10 @@
github_pr_repo=${github_opts[0]}
github_pr_id=${github_opts[1]}
github_pr_sha=${github_opts[2]}
github_pr_context=${github_opts[4]}
ghs_context=suse/mkcloud
if [[ $github_pr_context ]] ; then
ghs_context=$ghs_context/$github_pr_context
github_pr_context_suffix=${github_opts[4]}
ghs_context=suse/cloud
if [[ $github_pr_context_suffix ]] ; then
ghs_context=$ghs_context/$github_pr_context_suffix
fi

echo "testing PR: https://github.com/$github_pr_repo/pull/$github_pr_id"
Expand Down
4 changes: 2 additions & 2 deletions scripts/github_pr/github_pr_cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ pr_processing:
organization: SUSE-Cloud
repositories:
- automation
context: suse/mkcloud
context: suse/cloud
filter: *suse_automation
- config:
organization: SUSE-Cloud
repositories:
- cct
context: suse/mkcloud
context: suse/cloud
filter: *suse_cct
4 changes: 2 additions & 2 deletions scripts/github_pr/github_pr_crowbar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pr_processing:
- crowbar-hyperv
- crowbar-init
- crowbar-openstack
context: suse/mkcloud/testbuild
context: suse/cloud/testbuild
filter: *suse_crowbar
- config:
organization: sap-oc
Expand All @@ -100,5 +100,5 @@ pr_processing:
- crowbar-ha
- crowbar-openstack
- crowbar-monitoring
context: suse/mkcloud/testbuild
context: suse/cloud/testbuild
filter: *sap-oc_crowbar
2 changes: 1 addition & 1 deletion scripts/jenkins/github-pr/parse.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ github_opts=(${github_pr//:/ })
github_pr_repo=${github_opts[0]}
github_pr_id=${github_opts[1]}
github_pr_sha=${github_opts[2]}
github_pr_context=${github_opts[4]:-}
github_pr_context_suffix=${github_opts[4]:-}
github_org=${github_pr_repo%/*}
github_repo=${github_pr_repo##*/}
6 changes: 3 additions & 3 deletions scripts/jenkins/mkcloud/openstack-mkcloud.builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ if [[ $github_pr ]] ; then
# split $github_pr into multiple variables
source ${automationrepo}/scripts/jenkins/github-pr/parse.rc

github_context=suse/mkcloud
if [[ $github_pr_context ]] ; then
github_context=$github_context/$github_pr_context
github_context=suse/cloud
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - github_context_prefix?

if [[ $github_pr_context_suffix ]] ; then
github_context=$github_context/$github_pr_context_suffix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github_context=$github_context_prefix/$github_pr_context_suffix

fi
ghpr_paras="--org ${github_org} --repo ${github_repo} --sha $github_pr_sha --context $github_context"

Expand Down