Change Bitbucket server URL validation endpoint to support bitbucket 9+ #3369
+37
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains changes that I believe will address the issues in these community posts: SonarQube with Bitbucket 9.0 and Sonarqube is missing the Authorization token for Bitbucket DC.
I changed the
validateUrl
function to use the/status
endpoint. This endpoint returns a json object containing the current state of Bitbucket (e.g.{"state":"RUNNING"}
), so I created theState
class to read that into. Lastly, I updated thevalidate_url_success
test to test against an expected response.Since I started working on this, SONAR-23470 has been created to address the issue internally within SonarSource.
I built the application twice: once directly from the master branch with no changes, and once with my changes. I then configured the Bitbucket integration using the same token on both.
Master:
This branch: