-
Type: Improvement
-
Status: Resolved
-
Priority: Blocker
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 10.3
-
Tags:
-
Sprint:DevOps-25, DevTools-01
The sonar.groovy pipeline currently works with BRANCH and PARENT_BRANCH parameters. BRANCH is set by Jenkins in most situations but not with multibranch job that is used for PR and which populates BRANCH_NAME and CHANGE_TARGET.
BRANCH_NAME For a multibranch project, this will be set to the name of the branch being built, for example in case you wish to deploy to production from master but not from feature branches. CHANGE_ID For a multibranch project corresponding to some kind of change request, this will be set to the change ID, such as a pull request number. CHANGE_URL For a multibranch project corresponding to some kind of change request, this will be set to the change URL. CHANGE_TITLE For a multibranch project corresponding to some kind of change request, this will be set to the title of the change. CHANGE_AUTHOR For a multibranch project corresponding to some kind of change request, this will be set to the username of the author of the proposed change. CHANGE_AUTHOR_DISPLAY_NAME For a multibranch project corresponding to some kind of change request, this will be set to the human name of the author. CHANGE_AUTHOR_EMAIL For a multibranch project corresponding to some kind of change request, this will be set to the email address of the author. CHANGE_TARGET For a multibranch project corresponding to some kind of change request, this will be set to the target or base branch to which the change could be merged.
—
The CHANGE_BRANCH parameter being introduced with branch-api-2.0.0 (JENKINS-41104, JENKINS-47617, JENKINS-43507), here is a workaround to retrieve the PR source branch name from the PR ID:
curl -s -XGET "https://api.github.com/repos/nuxeo/nuxeo/pulls/$CHANGE_ID"|jq -r ".head.ref"
- is related to
-
NXP-25790 Fix "unknown revision" and NPE of nuxeo-master-sonar on PR update
- Open
-
NXP-27633 Fix sonar.groovy default values on maintenance branches
- Resolved
-
NXP-25789 Fix NPE on ClaimPublisher Pipeline step
- Resolved
-
NXP-24011 Move SonarQube pipeline to the source code
- Resolved
- links to