Rerun Pull Request pipelines when the destination branch changes

Issue #17949 resolved
Brandon Patterson
created an issue

Recently, I had a pull request that was initially targeted at the wrong destination branch. The PR pipeline ran and failed, at which point I noticed and corrected the destination branch.

Expected behavior: the pull request reruns against the new target branch.

Observed behavior: the pipeline didn't rerun against the new branch, and the failed test status continued to display on the retargeted PR.

Rerunning the pipeline seemed to trigger a build against the old destination branch, which continued to fail. Rejecting and reopening the PR also failed to trigger a new pipeline (the stale result was used on the new PR).

Comments (5)

  1. Aneita Yang staff
    • changed status to open

    Hey @Brandon Patterson,

    Thanks for reaching out and raising this. I've raised a ticket in the team's backlog to investigate this bug - when the destination branch is changed completely, the pull request pipeline should run. I'll keep you updated on our progress via this issue.

    What we don't currently support, and what is unlikely for us to support, is building the pull request pipeline on every update of the destination branch (e.g. when someone pushes new changes to the destination branch) as we this will likely become quite noisy, especially for larger teams. If you are interested in that functionality as well, I'd love to better understand why and what you're trying to accomplish.

  2. Brandon Patterson reporter

    I'm referring here to the case where the destination branch has been changed to a different branch. The behavior you've described is what I expected. (Switching the destination branch is a pretty rare occurrence for my team, so this is a pretty small issue, but caused some confusion when we came across it.)

    I think that rerunning a pipeline when the destination branch changes would give some added stability to the eventual merge, but I agree that that could cause a lot of excess builds for large teams. A happy medium might be allowing for users to configure pipelines such that when they hit the merge button, the pipeline is rerun (if the destination has changed), and the merge is performed only if the pipeline passes. Supported or not though, I'd consider that extra functionality beyond what I'm concerned with here!

  3. Log in to comment