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
Bitbucket Server Implementation? #65
Comments
No determined plan but we'd love to have implementations for other platforms! |
To all: any contributions or a POC are always welcomed! |
For volunteers that are going to implement support for GitLab, BitBucket, etc.: you can get some inspirations from the https://plugins.jenkins.io/violation-comments-to-stash/ and https://plugins.jenkins.io/violation-comments-to-gitlab/ plugins. Maybe it is possible to extract the API calls from there. |
Bitbucket Server has Code Insights feature that is an alternative to GitHub Checks: |
I had requested something like this from Atlassian earlier and the request was split to BSERV-11477. Difficulties:
|
I don't think the Checks API implementation should necessarily be part of the Bitbucket Branch Source plugin. A separate plugin could easily locate the BitbucketSCMSource instance and call its public methods to read the REST API parameters (base URL, project, repository, and credential). Such a separate plugin could later be extended to support the other BitbucketSCMSource from Atlassian's Bitbucket Server Integration plugin as well, or the REST API parameters could even be provided in a BranchProperty or an SCMSourceTrait if the project uses neither of those SCM sources. |
violation-comments-to-stash sends warnings to Bitbucket Server as comments in a pull request. It does not use the newer Code Insights feature, which supports reports on all commits even if they are not in a pull request. |
Bitbucket Cloud appears to have a "reports" API that has the same concepts as Code Insights in Bitbucket Server. However, the URL templates, JSON property names, and enumeration types are different, so it would not be possible to develop the plugin against Bitbucket Cloud and have it just work on Bitbucket Server (and Data Center) as well. |
In addition to the Code Insights API, Bitbucket Server has two ways to report build statuses:
The Bitbucket Branch Source plugin supports only the older build status API. The Bitbucket Server Integration plugin supports both and asks Bitbucket Server whether the newer API is available. Neither of those build status APIs supports annotations on lines of files. The Code Insights API supports that. |
This would not be a problem in practice, because consumer plugins (e.g. the JUnit plugin) do not use ChecksAction yet. Checks API does not currently provide a way for a consumer plugin to be notified when a user chooses an action. The GitHub Checks plugin does not provide that capability, either. Its CheckRunGHEventSubscriber class recognises only |
AFAICT, consumer plugins and WithChecksStep do not set the |
Consumer plugins post HTML tags and emoji shortcodes as well. I guess the Markdown would first have to be rendered to HTML and then stripped of tags. |
ChecksOutput.getSummary() and ChecksOutput.getText() assigned by Warnings Next Generation seem to mainly contain Markdown tables that would be difficult to render usefully for Bitbucket Server. I think the mapping should go like this:
There are also some difficulties in converting the annotations. Checks API does not yet seem to support a property that could be mapped to the VULNERABILITY, CODE_SMELL, BUG enumeration used by Code Insights. The warning codes parsed from MSBuild output are also missing but perhaps that is a problem in Warnings NG rather than Checks API. Microsoft's C# compiler is apparently able to save warnings to a SARIF file. I should compare the SARIF specification to the ChecksAnnotation model; perhaps it defines some properties that would be useful to add. |
Bitbucket Server supports Markdown in pull request descriptions, pull request comments, and commit comments. There, it renders |
There are a few difficulties in having a separate plugin read the REST API URL and credentials from Atlassian's Bitbucket Server Integration plugin:
|
@KalleOlaviNiemitalo just starting to explore using the Bitbucket Server Code Insights feature within a Jenkins shared library, was wondering if you were able to come up with a solution? |
@regicsolutions I have a Jenkins plugin basically working but…
|
That's great that hear that you got a working plugin, would love to test it out if you are clear to release it. |
@KalleOlaviNiemitalo just checking in to see if this is something that could potentially be contributed? |
@KalleOlaviNiemitalo friendly ping 😀 |
Hi, Also posted on the Jira ticket. More than happy to test anything if published to the Jenkins release center. Regards, |
has this been implemented? |
Apparently from a private plugin. I would also need such integration, but is quite huge work. Also without the help from community or even Atlassian I don't see it coming soon. Bitbucket Server in general lack some essential feature compared to SCM like GitHub or GitLab. Even after the release of Atlassian supported https://plugins.jenkins.io/atlassian-bitbucket-server-integration/ integration is still poor 😢 |
On this similar topic - have there been any attempts for GitLab? It is much more complete as a SCM. |
Are there any plans to add an implementation of this check api to the bitbucket branch source?
https://plugins.jenkins.io/cloudbees-bitbucket-branch-source/
Bitbucket has build status api, https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/ that might be similar enough to the Github Checks API
See also: https://jira.atlassian.com/browse/BSERV-11477
The text was updated successfully, but these errors were encountered: