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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.