Skip to content

Commit

Permalink
update PR for release branch (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisVQ authored Jul 13, 2023
1 parent 063df1d commit ec8348f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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

0 comments on commit ec8348f

Please sign in to comment.