Repository navigation
fix(dispatch)!: cut stage checks per event from six to two and stop skipped ones hiding reviews - #9977
Draft
MichaelYochpaz wants to merge 1 commit into
Draft
fix(dispatch)!: cut stage checks per event from six to two and stop skipped ones hiding reviews#9977MichaelYochpaz wants to merge 1 commit into
MichaelYochpaz wants to merge 1 commit into
Conversation
Every event created six static stage jobs (Triage, Code, Review, Fix, Retro, Prioritize), at most one of which did any work. GitHub shows the newest check per name on a pull request, so a no-op event's skipped "Review" check replaced a review that was still running, and GitHub counts a skipped check as passing. Run the built-in stages in two stage-matrix jobs instead: agent (triage, review, retro, prioritize) and coder (code and fix, which need contents: write and packages: read per ADR 0114). Like harness-run, each job builds its matrix from one expression over route's stage output, so the routed stage becomes a one-entry matrix and the check is named after it, for example "Agent (review)". A run that routes no stage skips both jobs under their unexpanded placeholder names, which never match a running check. Each event now shows two stage checks instead of six. Stage steps are unchanged and gated on matrix.stage. Concurrency groups keep their values. The agent job keeps the permissions triage, retro and prioritize had, so the review stage's job token no longer has pull-requests: write. Review writes to pull requests with its minted App token, and failure comments are issue comments, which retro already posts without that scope. The behaviour drivers match the new job names and still accept the old ones, so tests against workflows pinned to older versions keep finding agent jobs. The GitHub driver treats a run as unresolved until the stage-matrix job for a built-in agent is listed. BREAKING CHANGE: The built-in stage checks are renamed from "dispatch / Review" (and Triage, Code, Fix, Retro, Prioritize) to "dispatch / Agent (review)" or "dispatch / Coder (fix)" style names. Update scripts that match the old names. Do not make the new per-stage checks required: no check is created for a stage that intentionally does not run, such as a rebase that leaves the reviewed diff unchanged, reviews triggered only by /fs-review, or fork pull requests. Requiring the old names never guaranteed that a review ran, because a skipped check counted as passing. A stable review status is planned separately. Signed-off-by: Michael Yochpaz <myochpaz@redhat.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Every Fullsend event adds six stage checks to a PR (Triage, Code, Review, Fix, Retro, Prioritize), but at most one of them does any work. This PR runs the built-in stages in two matrix jobs named after the routed stage, for example
dispatch / Agent (review). That fixes two problems:dispatch / Reviewwith a skipped one. GitHub counts a skipped check as passing, so the PR can be merged before the review finishes. Now a run with nothing to do skips both jobs under their placeholder names, which never match a running check.Related Issue
Related to #7677. It's closed, but the extra checks it describes are still there.
Changes
reusable-dispatch.yml: the six static stage jobs become two:agentruns triage, review, retro and prioritize;coderruns code and fix.It's two jobs, not one, so that only code and fix get
contents: writeandpackages: read(ADR 0114). The matrix is built from Route's output in a single expression, the same way asharness-run. A literal list doesn't work, because the GitHub emulator expands it too early.Steps and concurrency groups: unchanged. Each stage's steps are now gated on
matrix.stage.Review permissions: the review stage's job token no longer has
pull-requests: write. Review writes with its minted App token, and the failure reporter only uses the issue-comment endpoints.Behaviour drivers (GitHub and Forgejo): they match the new job names and still accept the old ones, so tests against workflows pinned to older versions keep working.
Docs and scaffold tests: updated. A new test checks that every built-in stage runs in exactly one job, with the expected permissions.
The check names change from
dispatch / Reviewtodispatch / Agent (review), and the same for the other stages (for exampledispatch / Coder (fix)). Scripts that match the old names need updating.Please don't make the new checks required. No check is created for a stage that intentionally doesn't run: fork PRs, reviews started only by
/fs-review, and rebases that leave the diff unchanged. Requiring the old names never guaranteed that a review ran either, because a skipped check counted as passing. A stable review status is planned as a follow-up.Testing
make lintpasses (stage changes first, then run)Passed locally:
internal/scaffold,pkg/behaviourtest/...,internal/forge/...,internal/harnessdispatch/...,internal/repos,internal/clipass;go vetand the workflow-trigger tests;Needs a maintainer's help: this repo's Fullsend workflow calls
reusable-dispatch.yml@main, so Fullsend runs on this fork PR still use the old workflow, and the PR can't demonstrate the fix on itself. Could someone:/ok-to-test <sha> live;Agent (review)running, and that review posts normally withoutpull-requests: write.Heads-up: this overlaps with #7007, which pins the current stage jobs in a test. I'm happy to coordinate on which one lands first.
Checklist
!for breaking changes)