-
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
-
[JENKINS-53082] Aborted builds should be reported to Bitbucket as STOPPED
Link |
New:
This issue relates to |
Link |
New:
This issue relates to |
Link |
Original:
This issue relates to |
Description |
Original:
If a build is configured to notify BitBucket when the build starts, and the build is then aborted, the BitBucket build status remains as 'In Progress'. If another build of the same project is started for the same commit, a new build is started in BitBucket, but the status remains as 'In Progress. This appears to be caused by the unique Jenkins build ID being used in the build key supplied to BitBucket. It would be preferable to mark an aborted build as failed, and to overwrite the build status when another project build job starts for the same commit. |
New:
If another build of the same project is started for the same commit, a new build is started in BitBucket, but the status remains as 'In Progress. This appears to be caused by the unique Jenkins build ID being used in the build key supplied to BitBucket. It would be preferable to mark an aborted build as failed, and to overwrite the build status when another project build job starts for the same commit. |
Summary | Original: Aborted builds should be reported to BitBucket as STOPPED | New: Aborted builds should be reported to Bitbucket as STOPPED |
Description |
Original:
If another build of the same project is started for the same commit, a new build is started in BitBucket, but the status remains as 'In Progress. This appears to be caused by the unique Jenkins build ID being used in the build key supplied to BitBucket. It would be preferable to mark an aborted build as failed, and to overwrite the build status when another project build job starts for the same commit. |
New:
|
Description |
Original:
|
New:
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. |
Description |
Original:
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. |
New:
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: {code} post { success { bitbucketStatusNotify(buildState: 'SUCCESSFUL') } failure { bitbucketStatusNotify(buildState: 'FAILED') } unstable { bitbucketStatusNotify(buildState: 'FAILED') } aborted { bitbucketStatusNotify(buildState: 'STOPPED') } } {code} |
Hello, Is there any update on this? Bitbucket should show a greyed out "stopped" status on aborted builds instead of red "failed"