Pipelines for a single branch should pull a specific commit and queue

Issue #13340 duplicate
Justin Rittenhouse
created an issue

If I issue a 3 pull requests to master for 3 different branches, and each is merged in short sequence, it triggers three pipelines from the master branch, with no real order to which one runs first. This can cause them to execute out of order, resulting in an incorrect state at the end of the final pipeline completing, whichever that ends up being.

Comments (4)

  1. Justin Rittenhouse reporter

    I have a pipeline script that rebases the pre-production branch off of master. I have a webhook that auto-merges pull requests to master with two approvals, triggered by the approvals. If there are two or more pull requests outstanding against master, with one approval each, and someone goes in and reviews and approves them, they will merge with master in the order they were approved, and then each merge triggers a pipeline. The pipeline checks out master, pulls in the pre-production branch, checks it out, and rebases against master. If it is successful, it then force pushes the rebase back up. This allows us to maintain a synchronization between production and pre-production, where pre-production could be multiple commits ahead of production for testing purposes. The issue we see is that if we have the multi-approval state, the three webhooks operate independently, and pre-production is left in a state based on the last webhook to finish, rather than the last webhook to execute in order. This has led to times when pre-production is rebased against the first of three commits to master, and is then out of sync, with a number of commits to its own branch ahead of master, but also two commits behind.

  2. Samuel Tannous staff

    Hi Justin, I don't fully understand the workflow you described. It sounds similar to gitfow but I don't understand the requirement to force push back to the preproduction branch. Perhaps a diagram will help? Have you considered modifying your workflow to avoid the force push as a workaround to this issue? This page compares some different workflows which might help https://www.atlassian.com/git/tutorials/comparing-workflows/

    I'll leave this ticket open as a feature request as it's a useful suggestion either way. Thanks for the feedback.

  3. Log in to comment