-
Notifications
You must be signed in to change notification settings - Fork 57
ci: queue PRs in Mergify once verify and Unfret pass #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+27
−0
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| queue_rules: | ||
| - name: default | ||
| batch_size: 1 | ||
| checks_timeout: null | ||
| queue_conditions: [] | ||
| merge_conditions: | ||
| - check-success=verify | ||
| - check-success=Unfret | ||
|
|
||
| merge_protections_settings: | ||
| auto_merge_conditions: | ||
| - base = main | ||
|
|
||
| merge_protections: | ||
| - name: Queue ready pull requests | ||
| description: Automatically queue non-draft pull requests targeting main after the required gates pass. | ||
| if: | ||
| - base = main | ||
| success_conditions: | ||
| - -draft | ||
| - check-success=verify | ||
| - check-success=Unfret | ||
|
|
||
| commands_restrictions: | ||
| requeue: | ||
| conditions: | ||
| - sender-permission >= write | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
Unfretdoes not require the independent live verdict, this rule queues any non-draft PR tomainonce the two checks pass. The PR can then merge while the live test required by the shipping flow is still in progress. Require that verdict before automatic queuing, or leave queuing to the guarded shipping flow.Knowledge Base Used: Quality assurance and review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drafts can't queue: the merge protection requires
-draft. AGENTS.md keeps a PR in draft until the installed-candidate evidence is recorded, so marking it ready is the live-verdict gate. That holds only if PRs open as drafts. The live-gate skill in #90 will enforce it by being the step that marks a PR ready. The emptymerge_conditionsfinding is fixed in 635d077.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That resolves the concern. With PRs opened as drafts and the live-gate skill being the step that marks them ready after installed-candidate evidence,
-draftmakes the merge protection a live-verdict gate. The addedmerge_conditionschecks also ensure the queued merge commit reruns bothverifyandUnfretbefore merging.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction to my reply above: the draft convention doesn't close this gap. Unfret doesn't review drafts (drafting cancels an in-flight review), so a PR has to be non-draft to get its
Unfretcheck, and once it is, this rule queues it as soon asverifyandUnfretpass, possibly before the live test. The live verdict needs to be its own required check, for example a commit status on the exact head that the #90 skill posts after the installed-harness test, listed in bothmerge_conditionsand the protection'ssuccess_conditions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right—the draft convention does not close this gap.
Unfretcancels its review for drafts, so the PR must become non-draft beforecheck-success=Unfretcan pass; at that point, this protection can queue it without any installed-harness/live verdict.The live-gate result therefore needs to be an independent status/check on the exact tested head, included in both
success_conditionsand the queue rule'smerge_conditionsso it is also rerun and required for the queued merge commit. My previous resolution was incorrect; this finding remains valid.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refinement, per the review on #104: list
live-gateinqueue_conditionsand the protection'ssuccess_conditionsonly, not inmerge_conditions. Mergify validates a temporary queue head that the installed-harness test never sees, so requiringlive-gatethere would block forever underchecks_timeout: null.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That refinement is correct.
live-gateshould be added to the queue rule’squeue_conditionsand to the protection’ssuccess_conditions, but not toqueue_rules[].merge_conditions. Mergify evaluatesmerge_conditionsagainst the temporary queued merge commit; because the installed-harness test posts its result only for the original PR head, requiringcheck-success=live-gatethere would leave the queued commit unsatisfied and prevent merging indefinitely whenchecks_timeout: null. The live-gate therefore controls entry into the queue and protection success, while the queued commit itself only reruns the checks that can report on that commit (verifyandUnfret).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second refinement, from #104's review: putting
live-gateonly at queue entry still lets a rebuilt queue head merge untested, and non-emptymerge_conditionsmake Mergify create draft batch PRs, which Unfret never reviews. The likely shape: in-place checks (emptymerge_conditions,batch_size: 1) plusqueue_conditionsrequiring-draft,verify,Unfret,live-gate, and an up-to-date branch, so the merged tree is the tested tree. Please verify against Mergify's docs before adopting it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs support the in-place direction, with two qualifications:
merge_conditionsis the merge-time/speculative-check path. A distinct non-empty set can make Mergify validate a temporary draft/batch PR, andbatch_size: 1alone does not guarantee in-place checks. An emptymerge_conditionsis appropriate for the single-step path, but in-place behavior also requires serial operation (max_parallel_checks: 1) andbatch_size: 1(along with the other documented eligibility constraints).queue_conditionscontrol admission and continued queue membership. Requiringcheck-success=live-gatethere means that if the tested SHA changes, the PR no longer satisfies the condition and should leave the queue until a fresh verdict is posted. The status must be attached to the exact commit SHA tested.Thus, the proposed shape is reasonable:
The queue must also be configured for serial checks (
max_parallel_checks: 1), andlive-gateshould be included inmerge_protections[].success_conditionsalongsideverifyandUnfret.I would not add an invented
updatedorup-to-datequeue condition. Mergify documents GitHub branch protection/rulesets’ strict required-status-checks policy (“Require branches to be up to date before merging”) as the mechanism for that. Since this repository currently has no such protection, enabling it is a separate repository configuration change, not a.mergify.ymlcondition. Strict protection is also problematic with temporary batch PRs, reinforcing the choice of in-place checks here.References: queue rules, queue lifecycle, batches and in-place eligibility, and GitHub rulesets.