Merge Queues: Preventing Early Merges Before Triggering Build

Overview

This article addresses an issue where a Pull Request (PR) gets merged prematurely while CircleCI triggers another workflow. This situation often arises when using dynamic configuration, which initiates a "setup" job to determine the changed files and triggers code tests based on those changes. The problem occurs when the "setup" job completion is interpreted as a "passed" status check, causing the merge queue to merge the PR even before the actual tests are triggered.

Prerequisites

  • Enabled merge queues in GitHub. 
  • Dynamic configuration usage CircleCI

Solution

To resolve this issue, you can configure the timeout of the Status Check on Github. This adjustment allows CircleCI to allocate some time for the next workflow to run. The Status Check timeout determines how long the queue should wait for a response from CI before assuming that checks have failed. 

As mentioned in the Github documentation:

"Status check timeout: Choose how long the queue should wait for a response from CI before assuming that checks have failed." - Managing Merges on GitHub

Please note that this feature is not provided by CircleCI, so we recommend checking GitHub for more details on setting it up. 

Additional Resource

For more information on dynamic configuration in CircleCI, please refer to our Dynamic Configuration documentation. To learn more about Github's merge queues, you can visit this Github article.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.