You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Operating System are you using (both controller, and any agents involved in the problem)?
Windows Server 2012 R2
Reproduction steps
This is a multibranch pipeline project using Bitbucket Branch Source. The pipeline runs the recordIssues step with two tools docFx and msBuild, and I expect each tool to publish checks via Checks API to Bitbucket Server Checks. However, after I installed the GitHub Checks plugin, the pipeline started publishing checks named "Jenkins" as well. Those seem to be status checks enabled by GitHub Checks. The Bitbucket Server Checks plugin does not implement the StatusChecksProperties or AbstractStatusChecksProperties extension point.
Results
Expected result, i.e. what happens without GitHub Checks:
After the recordIssues step has scanned the DocFX log file:
[2021-09-22T17:20:53.335Z] [DocFX] Attaching ResultAction with ID 'docfx' to build 'REDACTED/PR-64 #9'.
[2021-09-22T17:20:53.452Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
[2021-09-22T17:20:53.499Z] [Bitbucket Server Checks] Converted 0 annotations.
[2021-09-22T17:20:53.504Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/DocFX
[2021-09-22T17:20:53.771Z] [Bitbucket Server Checks] Finished publishing.
After the recordIssues step has scanned the MSBuild log file:
[2021-09-22T17:20:53.808Z] [MSBuild] Attaching ResultAction with ID 'msbuild' to build 'REDACTED/PR-64 #9'.
[2021-09-22T17:20:53.942Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
[2021-09-22T17:20:53.948Z] [Bitbucket Server Checks] Converted 0 annotations.
[2021-09-22T17:20:53.948Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/MSBuild
[2021-09-22T17:20:54.111Z] [Bitbucket Server Checks] Finished publishing.
Actual result, i.e. what happens with GitHub Checks:
Unexpected status checks after the initial checkout:
[2021-09-22T17:10:44.632Z] > git.exe rev-list --no-walk 2f957154bd1390a150487e39987faf65f30cf9c6 # timeout=10
[2021-09-22T17:10:44.817Z] [Bitbucket] Notifying pull request build result
[2021-09-22T17:10:44.843Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
[2021-09-22T17:10:44.844Z] [Bitbucket Server Checks] The checks have no output. Preserve the annotations of any existing Code Insights report.
[2021-09-22T17:10:44.844Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/Jenkins
[2021-09-22T17:10:44.951Z] [Bitbucket Server Checks] Finished publishing.
After the recordIssues step has scanned the DocFX log file:
[2021-09-22T17:10:56.800Z] [DocFX] Attaching ResultAction with ID 'docfx' to build 'REDACTED/PR-64 #8'.
[2021-09-22T17:10:56.893Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
[2021-09-22T17:10:56.895Z] [Bitbucket Server Checks] Converted 0 annotations.
[2021-09-22T17:10:56.895Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/DocFX
[2021-09-22T17:10:57.078Z] [Bitbucket Server Checks] Finished publishing.
After the recordIssues step has scanned the MSBuild log file:
[2021-09-22T17:10:57.094Z] [MSBuild] Attaching ResultAction with ID 'msbuild' to build 'REDACTED/PR-64 #8'.
[2021-09-22T17:10:57.191Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
[2021-09-22T17:10:57.193Z] [Bitbucket Server Checks] Converted 0 annotations.
[2021-09-22T17:10:57.193Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/MSBuild
[2021-09-22T17:10:57.356Z] [Bitbucket Server Checks] Finished publishing.
Unexpected status checks after the pipeline finishes:
[2021-09-22T17:11:02.164Z] [Pipeline] }
[2021-09-22T17:11:02.293Z] [Pipeline] // node
[2021-09-22T17:11:02.412Z] [Pipeline] End of Pipeline
[2021-09-22T17:11:02.473Z] [Bitbucket] Notifying pull request build result
[2021-09-22T17:11:02.495Z] [Bitbucket] Build result notified
[2021-09-22T17:11:02.496Z] [Bitbucket Server Checks] Getting REST API parameters from the Bitbucket Branch Source plugin.
[2021-09-22T17:11:02.498Z] [Bitbucket Server Checks] Converted 0 annotations.
[2021-09-22T17:11:02.498Z] [Bitbucket Server Checks] Publishing the report to: https://REDACTED/rest/insights/1.0/projects/REDACTED/repos/REDACTED/commits/2f957154bd1390a150487e39987faf65f30cf9c6/reports/Jenkins
[2021-09-22T17:11:02.659Z] [Bitbucket Server Checks] Finished publishing.
[2021-09-22T17:11:02.687Z] Finished: SUCCESS
The pipeline does not reference any GitHub repository, the settings of the pipeline do not include anything related to status checks, and the Bitbucket Server Checks plugin does not implement anything specific to status checks. Status checks should therefore not be published, but the GitHub Checks plugin seems to be enabling them anyway.
Analysis
I think what happens is that:
GitHubStatusChecksProperties.isApplicable returns true because scmFacade.findGitSCM(job) finds something created by Bitbucket Branch Source.
GitHubStatusChecksProperties.isSkipProgressUpdates calls getConfigurations, which searches for GitHubStatusChecksConfigurations but does not find any because this is not a GitHub project and does not contain any such settings. GitHubStatusChecksProperties.isSkipProgressUpdates then uses DEFAULT_CONFIGURATION instead.
i.e. GitHubStatusChecksProperties believes it is applicable to this job because of the GitSCM, but nothing has been configured, so it will use the default "Jenkins" name and allow status checks.
How to fix
I can think of two ways to fix this:
Make GitHubStatusChecksProperties.isApplicable return false if the project does not use GitHub, according to the same logic as in GitHubChecksPublisherFactory.createPublisher.
Change the API so that each AbstractStatusChecksProperties implementation can only enable status checks to be published via the ChecksPublisherFactory in the same plugin. I haven't planned this in detail.
The text was updated successfully, but these errors were encountered:
Version report
Jenkins and plugins versions report:
(
bitbucket-server-checks
is currently a private plugin for jenkinsci/checks-api-plugin#65.)Reproduction steps
This is a multibranch pipeline project using Bitbucket Branch Source. The pipeline runs the
recordIssues
step with two toolsdocFx
andmsBuild
, and I expect each tool to publish checks via Checks API to Bitbucket Server Checks. However, after I installed the GitHub Checks plugin, the pipeline started publishing checks named "Jenkins" as well. Those seem to be status checks enabled by GitHub Checks. The Bitbucket Server Checks plugin does not implement the StatusChecksProperties or AbstractStatusChecksProperties extension point.Results
Expected result, i.e. what happens without GitHub Checks:
recordIssues
step has scanned the DocFX log file:recordIssues
step has scanned the MSBuild log file:Actual result, i.e. what happens with GitHub Checks:
recordIssues
step has scanned the DocFX log file:recordIssues
step has scanned the MSBuild log file:The pipeline does not reference any GitHub repository, the settings of the pipeline do not include anything related to status checks, and the Bitbucket Server Checks plugin does not implement anything specific to status checks. Status checks should therefore not be published, but the GitHub Checks plugin seems to be enabling them anyway.
Analysis
I think what happens is that:
scmFacade.findGitSCM(job)
finds something created by Bitbucket Branch Source.github-checks-plugin/src/main/java/io/jenkins/plugins/checks/github/status/GitHubStatusChecksProperties.java
Lines 40 to 43 in 9e25889
github-checks-plugin/src/main/java/io/jenkins/plugins/checks/github/status/GitHubStatusChecksProperties.java
Lines 65 to 68 in 9e25889
github-checks-plugin/src/main/java/io/jenkins/plugins/checks/github/status/GitHubStatusChecksConfigurations.java
Lines 65 to 68 in 9e25889
Indeed, if I run in the Script Console:
then the output is:
i.e. GitHubStatusChecksProperties believes it is applicable to this job because of the GitSCM, but nothing has been configured, so it will use the default "Jenkins" name and allow status checks.
How to fix
I can think of two ways to fix this:
Make GitHubStatusChecksProperties.isApplicable return false if the project does not use GitHub, according to the same logic as in GitHubChecksPublisherFactory.createPublisher.
Change the API so that each AbstractStatusChecksProperties implementation can only enable status checks to be published via the ChecksPublisherFactory in the same plugin. I haven't planned this in detail.
The text was updated successfully, but these errors were encountered: