After a failed CI build, if the user clicks the '+' button to trigger a new build of the same CI job and the job passes, the Bitbucket PR should show the build as passing.
Actual Behavior
After a failed CI build, if the user clicks the '+' button to trigger a new build of the same CI job and the job passes, the Bitbucket PR shows two builds on the PR--one passing build and one failing build. If the user has the merge check Check the last commit for N successful build and no failed builds enabled, the user will be unable to merge the PR until a new commit is pushed.
Steps to Reproduce
Create a repository in Bitbucket Cloud.
Create a branch permission on the default branch and set the merge check for Check the last commit for 1 successful build and no failed builds.
Create a CI job in Concourse with the concourse-git-bitbucket-pr-resource configured to post back to the PR on_failure (see sample config above).
Configure the CI job to fail by default.
Create a new branch from the default branch.
Commit a change to the new branch.
Submit a PR to the default branch.
Observe the failed build result.
Fix the CI job to succeed.
Re-run the CI job via the build trigger in the Concourse CI web console (or via CLI).
Observe that two builds are posted back to the PR and that the user is unable to merge the PR.
Important Factoids
The current behavior when re-running a failed build on a PR in Bitbucket Pipelines is to set the key on the build status to the same key as the previous build thereby updating the same build status. This PR updates this resource to behave in a similar manner as the Bitbucket Pipelines product.
Concourse CI Version
v3.14.1
Configuration
Debug Output
Expected Behavior
After a failed CI build, if the user clicks the '+' button to trigger a new build of the same CI job and the job passes, the Bitbucket PR should show the build as passing.
Actual Behavior
After a failed CI build, if the user clicks the '+' button to trigger a new build of the same CI job and the job passes, the Bitbucket PR shows two builds on the PR--one passing build and one failing build. If the user has the merge check
Check the last commit for N successful build and no failed builds
enabled, the user will be unable to merge the PR until a new commit is pushed.Steps to Reproduce
Check the last commit for 1 successful build and no failed builds
.concourse-git-bitbucket-pr-resource
configured to post back to the PRon_failure
(see sample config above).Important Factoids
The current behavior when re-running a failed build on a PR in Bitbucket Pipelines is to set the key on the build status to the same key as the previous build thereby updating the same build status. This PR updates this resource to behave in a similar manner as the Bitbucket Pipelines product.
References