teameh / bitrise-step-bitbucket-server-post-build-status

MIT License
3 stars 8 forks source link

FIX use a more consistent 'key' value when updating Build Status #8

Closed Buju77 closed 2 years ago

Buju77 commented 2 years ago

We recently encountered a bug that resulted us not able to merge our PR in Bitbucket.

Our developer simply re-run the last build with same commit hash after receiving a failed build ❌ . This step created a 2nd build status (see screenshot with 2x LATEST tag).

Screenshot 2022-03-18 at 16 59 09

Bitbucket Server then disallowed the merge button, because there was another failed build for the same commit.

Screenshot 2022-03-18 at 16 58 43

According to the Bitbucket docu, it is storing a build result for each key and commit_hash pair.

Screenshot 2022-03-18 at 17 03 46

But the current version was always using the $build_number as the key value. Which means that using "Rebuild" button in Bitrise will always result in adding a new build result entry in Bitbucket --> PRs can't be merged.

My fix is to simply use a more constant value $triggered_workflow_id for the key value.

teameh commented 2 years ago

https://github.com/bitrise-io/bitrise-steplib/pull/3503

teameh commented 2 years ago

Merged, see https://github.com/bitrise-io/bitrise-steplib/pull/3503