-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
JENKINS-32940 extended the Bitbucket build status notifier both with handling of aborted builds by reporting them as FAILED and with complexity surrounding retried builds. However, the API supports another state, STOPPED, that seems far more appropriate for aborted builds. In Bitbucket's own CI service, Bitbucket Pipelines, STOPPED is the status applied when stopping/cancelling/aborting an in-progress build.
A cursory glance reveals a special-case for aborted builds that forces the status to be FAILED in https://github.com/jenkinsci/bitbucket-build-status-notifier-plugin/blob/1.4.0/src/main/java/org/jenkinsci/plugins/bitbucket/BitbucketBuildStatusHelper.java#L212-L213. It seems like this special-case should be removed.
FYI, this snippet seems to cause aborted builds to be reported as failed so nothing currently is broken or would be broken by this change:
post { success { bitbucketStatusNotify(buildState: 'SUCCESSFUL') } failure { bitbucketStatusNotify(buildState: 'FAILED') } unstable { bitbucketStatusNotify(buildState: 'FAILED') } aborted { bitbucketStatusNotify(buildState: 'STOPPED') } }
- relates to
-
JENKINS-32940 Aborted builds remain in progress in BitBucket
- Resolved