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

update PR for release branch #1021

Merged
merged 2 commits into from
Jul 13, 2023
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

### Fixed
- Fix SonarQube quality gate report to use the pull request or branch in scope ([#1016](https://github.com/opendevstack/ods-jenkins-shared-library/issues/1016))
- CURL command fix for the sonarqube quality gate report retrieval ([#1020](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1020))
- Fix typos in `build.gradle` ([#1012](https://github.com/opendevstack/ods-jenkins-shared-library/pull/1012))

## [4.3.0] - 2023-07-03
Expand Down
9 changes: 5 additions & 4 deletions src/org/ods/services/SonarQubeService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,16 @@ class SonarQubeService {
String gitBranch,
String bitbucketPullRequestKey) {
withSonarServerConfig { hostUrl, authToken ->
def getStatusUrl = "${hostUrl}/api/qualitygates/project_status?projectKey=${projectKey}"
def getStatusUrl = "${hostUrl}/api/qualitygates/project_status"
def urlEncodingFlags = "--data-urlencode projectKey=${projectKey}"
if (bitbucketPullRequestKey && (sonarQubeEdition != 'community')) {
getStatusUrl += "&pullRequest=" << bitbucketPullRequestKey
urlEncodingFlags += " --data-urlencode pullRequest=${bitbucketPullRequestKey}"
} else if (sonarQubeEdition != 'community') {
getStatusUrl += "&branch=" << gitBranch
urlEncodingFlags += " --data-urlencode branch=${gitBranch}"
}
script.sh(
label: 'Get status of quality gate',
script: "curl -s -u ${authToken}: ${getStatusUrl}",
script: "curl -s -u ${authToken}: --url ${getStatusUrl} ${urlEncodingFlags}",
returnStdout: true
)
}
Expand Down