How to Re-Run PR Build When Base Changes

Hello! First off thanks to anyone that helps me figure this out.

I have the following flow:

  1. Developer creates a PR (A).
  2. Their PR build runs to validate the PR (A).
  3. Another PR (B) is built, validated, and merged, but it breaks PR A.
  4. PR a should rebuild since the base changed, but it doesn’t.

Anyone have any ideas on how to re-run PR builds based on changes to the base? I’ve tried the following settings, including Push commits and Pull request synchronized.

In this scenario since the there is two PRs dependent there will be specific event for each PR that cannot tell the other PR to retry their pipeline. I would suggest using the PR Comment so you can tell Codefresh when to run you PR again after changes to another PR. Or perhaps you merge the other PR into yours which would trigger commit/pr sync events.

Adding… I see you merged PR B, if that is the case you can merge master to your PR and the sync event should pick up that change to the PR.

You can also use branch protection to require the branch be up-to-date with target branch.

Hey Dustin,

Thanks for replying.

The problem we want to solve is breaking the build and then having to go spend time investigating that, since right now we have some infrastructure and feature changes in flux in the same repository. If we can, we would like to solve this via technology and not process.

I understand that manually merging into the branch would show that your PR breaks the build, but then we are solving the problem with process and not technology.

I’ve done this in the past with Jenkins.

I’ll see about protected branches.

Devon,

Thank you for explaining the scenario in more detail.

The branch protection is likely the ticket in this scenario.

It would prevent anyone from merging in their branches that are not up-to-date or tested against master requiring them to merge master into their branch thus re-triggering the PR build using the PR Sync event.

This would prevent breaks from being introduced to master branch.