You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
There is the Code Insights functionality provided by BitBucket Server and we are using this together with SonarQube integration to provide feedback from the CI pipeline and have a quality gate as the screenshot below shows:
Now, this is configurable via the UI, but as we are managing a large number of repositories/project, we'd like to keep this configuration in the code and manage it via the API.
However, looking at the REST API for Code Insights and for Repository Management, it seems that BitBucket does not expose a way to manage the Code Insights Requirements settings via API.
Is that possible or would it make sense to add this to the roadmap?
I couldn't find any documentation on this either, but the web interface is using the REST API as well.
From the browsers dev console the API endpoint for repositories seems to be:
https://bitbucket.company.com/rest/insights/latest/projects/PROJECT/repos/REPO/merge-check/KEY
PUT/GET/DELETE calls are supported. For PUT the following json payload can be used
{
"reportKey":"KEY",
"mustPass":true, // true/false
"minProhibitedSeverity":"LOW" // LOW/MEDIUM/HIGH or omit this key
}
For project-wide configuration:
https://bitbucket.company.com/rest/insights/latest/projects/PROJECT/merge-check/KEY
DevConsole always to the rescue! Simplest solution always works, thanks for this!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just to bump the visibility - any hints?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found some documentation here. In the [API](https://docs.atlassian.com/bitbucket-server/rest/7.21.0/bitbucket-code-insights-rest.html#idm45774552126944) we can see the API to _add_ the reports:
http://example.com/rest/insights/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}
but there is no API to configure required reports... ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.