docs(batches): add recipe for re-running only previously failed jobs#12117
Conversation
Merge Protections🔴 2 of 6 protections blocking · waiting on 👀 reviews
🔴 👀 Review RequirementsWaiting for
This rule is failing.
🔴 🔎 ReviewsWaiting for
This rule is failing.
Show 4 satisfied protections🟢 🤖 Continuous Integration
🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 📕 PR description
🟢 🚦 Auto-queueWhen all merge protections are satisfied, this pull request will be queued automatically. |
There was a problem hiding this comment.
Pull request overview
This PR updates the merge queue batches documentation to extend the existing “re-run only previously failed tests” recipe to the CI job level, and to document additional metadata (draft_pr_head_sha) that enables this workflow.
Changes:
- Adds
draft_pr_head_shato theprevious_failed_batchesmetadata example and explains what it represents. - Introduces a new “Re-running Only the Previously Failed Jobs” recipe describing job-level self-skipping on batch splits.
- Provides a GitHub Actions example that queries parent-batch check runs and conditionally skips work.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
79893ac to
18ffa39
Compare
Revision history
|
| "previous_failed_batches": [ | ||
| { | ||
| "draft_pr_number": 980, | ||
| "draft_pr_head_sha": "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678", |
There was a problem hiding this comment.
Agreed the naming is worth changing, but it can't happen in this PR: draft_pr_head_sha is the engine's field name (MergeQueueInfoFailedBatch in batch.py), sitting next to the already-documented draft_pr_number. mergify ci queue-info prints the git-note payload verbatim, so these docs just mirror what the engine emits today, renaming here would make them wrong.
It's also a breaking change: the keys are published in the draft PR body YAML and the refs/notes/mergify/<branch> note, and users' CI scripts jq them directly, so it needs both-key back-compat for a deprecation window.
Tracked separately in MRGFY-8075, which also flags the open question: batch_number/batch_head_sha vs batch_pr_number/batch_pr_head_sha. Your call there. Docs get updated once the engine ships the rename.
Leaving this thread open for you.
Mirror the "re-running only the previously failed tests" recipe one level up, at the CI job. When Mergify splits a failed batch, each job self-skips if it already passed on the parent draft: it reads previous_failed_batches[-1].draft_pr_head_sha from `mergify ci queue-info` and queries the GitHub check-runs API on that commit as the source of truth for which jobs passed. Everything falls back to the full run. Also surface draft_pr_head_sha in the shared metadata example, which was missing it though the CLI already emits it. Docs only, no engine or CLI change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Change-Id: If18f8ac57eb9abfe8072f37b66f1a1f5565aab04
18ffa39 to
7887164
Compare
Mirror the "re-running only the previously failed tests" recipe one level
up, at the CI job. When Mergify splits a failed batch, each job self-skips
if it already passed on the parent draft: it reads
previous_failed_batches[-1].draft_pr_head_sha from
mergify ci queue-infoand queries the GitHub check-runs API on that commit as the source of
truth for which jobs passed. Everything falls back to the full run.
Also surface draft_pr_head_sha in the shared metadata example, which was
missing it though the CLI already emits it.
Docs only, no engine or CLI change.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com