jenkinsci / bitbucket-branch-source-plugin

Bitbucket Branch Source Plugin
https://plugins.jenkins.io/cloudbees-bitbucket-branch-source
MIT License
216 stars 351 forks source link

NOT_BUILT reported as SUCCESSFUL to Bitbucket #891

Open rittneje opened 2 weeks ago

rittneje commented 2 weeks ago

Jenkins and plugins versions report

n/a

What Operating System are you using (both controller, and any agents involved in the problem)?

n/a

Reproduction steps

Configure a build to report to Bitbucket, and not suppress the NOT_BUILT status. Then abort the build in Jenkins such that it says NOT_BUILT. Then see what it reports to Bitbucket.

Expected Results

It should report FAILED.

Actual Results

If Jenkins reports a status of NOT_BUILT, and you haven't configured it to suppress those notifications, then it will report SUCCESSFUL to Bitbucket.

https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/6cde189c190d7040c7382a6e3dc04ef42a809a6b/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotifications.java#L140-L148

Anything else?

This was previously reported in #538 but was not actually fixed. Instead a new configuration option was added to suppress the result, which does not resolve the issue without additional intervention.

Are you interested in contributing a fix?

No.

tkrah commented 2 weeks ago

Count me in, some of our PRs are passing if a build got e.g. "Superseded by XX", it will get NOT_BUILT but bitbucket got a SUCCESS report - which is a problem, because those PRs, if actually fully built, are failing because of failed tests for example.