fix(dispatch): per-role two-layer concurrency for per-repo (#981)#2465
fix(dispatch): per-role two-layer concurrency for per-repo (#981)#2465ifireball wants to merge 6 commits into
Conversation
…ai#981) Remove the monolithic per-repo shim concurrency group and add matching cancel-in-progress groups on reusable-dispatch stage jobs plus all reusable-{stage}.yml workflows so roles dedupe independently. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
PR Summary by QodoPer-role concurrency for per-repo dispatch workflows Description
Diagram
High-Level Assessment
Files changed (10)
|
Site previewPreview: https://c0c69ed0-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 8:39 AM UTC · Completed 8:53 AM UTC |
Code Review by Qodo
Context used✅ Tickets:
🎫 Deduplicate review dispatches for the same HEAD SHA 🎫 Follow-up: document concurrency/cancel-in-progress & fan-out semantics under synchronous dispatch (post ADR 0041) 🎫 Concurrency group cancels code dispatch when triage applies multiple labels✅ Compliance rules (platform):
58 rules✅ Skills:
writing-user-docs, writing-adrs 1.
|
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Previous run (2)ReviewFindingsMedium
Low
Labels: PR fixes dispatch concurrency groups across workflow files and scaffold templates. Previous run (3)ReviewFindingsMedium
Low
Previous run (4)ReviewFindingsMedium
Low
Labels: PR fixes dispatch concurrency groups across workflow files and scaffold templates. |
Signed-off-by: Barak Korren <bkorren@redhat.com>
Align ADR 0034/0041 consequences with per-role cancel-in-progress groups introduced for per-repo dispatch (fullsend-ai#981). Fixes gofmt CI failure. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Review · ❌ Terminated · Started 9:56 AM UTC · Ended 10:11 AM UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Babysit update
|
|
🤖 Finished Review · ✅ Success · Started 9:56 AM UTC · Completed 10:11 AM UTC |
ci: retrigger e2e after babysit fixes Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Review · |
…ncel Per-role groups on workflow_call parents (thin callers and reusable-dispatch stage jobs) share keys with reusable stage workflows. Duplicate groups with cancel-in-progress cancel the parent immediately, breaking e2e triage (fullsend-ai#981). Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Finished Review · ✅ Success · Started 10:25 AM UTC · Completed 10:40 AM UTC |
| independently: a new dispatch now cancels any in-progress run for the | ||
| same issue/PR. In practice, only one agent should run per issue/PR at a | ||
| time, and the latest event takes priority. | ||
| - Enrolled repos gain per-role concurrency groups with `cancel-in-progress: true` |
There was a problem hiding this comment.
[medium] scope-authorization
The PR replaces 6 lines of ADR 0034's Consequences section (describing a single concurrency group) with 9 lines describing per-role concurrency groups. Per AGENTS.md, accepted ADRs are point-in-time records; substantial rewrites to Consequences sections are prohibited. Consider writing a new ADR that supersedes ADR 0034's concurrency model.
Suggested fix: Write a new ADR documenting the per-role concurrency model and add a short cross-reference annotation to ADR 0034 instead of rewriting it.
| @@ -398,6 +410,9 @@ jobs: | |||
| name: Review | |||
| needs: route | |||
| if: needs.route.outputs.stage == 'review' | |||
There was a problem hiding this comment.
[low] edge-case
The review stage concurrency group uses github.event.pull_request.number || github.event.issue.number. When triggered by issues/labeled vs pull_request_target, different concurrency keys are produced for linked issue/PR pairs with different numbers. Two concurrent review runs are possible for the same logical work item.
| `dispatch.yml` directly; the single-file marker pattern from ADR 0026 is gone. | ||
| - Per-org and per-repo dispatch shapes converge; enrolled-repo shims may need | ||
| `needs:` / concurrency review ([#504](https://github.com/fullsend-ai/fullsend/issues/504)). | ||
| - Per-org and per-repo dispatch shapes converge; per-role concurrency is |
There was a problem hiding this comment.
[low] scope-authorization
The PR replaces a forward-looking consequence with a resolution statement. While close to the annotation exception AGENTS.md permits, it rewrites the original text rather than appending a note.
Restore workflow-level cancel-in-progress on reusable-{stage}.yml using
distinct fullsend-{stage}-agent- group keys so workflow_call parents keep
their own dispatch groups. Revert ADR body edits; add short implementation
notes only (fullsend-ai#981).
Signed-off-by: Barak Korren <bkorren@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Finished Review · ✅ Success · Started 10:53 AM UTC · Completed 11:06 AM UTC |
| name: Review | ||
| needs: route | ||
| if: needs.route.outputs.stage == 'review' | ||
| concurrency: |
There was a problem hiding this comment.
[low] edge-case
The review stage concurrency group uses github.event.pull_request.number || github.event.issue.number. When review is triggered by issues/labeled (ready-for-review), the key uses the issue number; when triggered by pull_request_target, it uses the PR number. For a linked issue/PR pair where the numbers differ, the two triggers produce different concurrency keys and will not cancel each other. Two concurrent review runs are possible for the same logical work item. The same concern applies to fix and retro stages.
Summary
fullsend-dispatch-{issue|pr}concurrency group from the per-repo shim template — it serialized unrelated roles and could drop the wrong pending run when multiple label events arrived in quick succession (Concurrency group cancels code dispatch when triage applies multiple labels #2452).cancel-in-progress: trueconcurrency on all six stage jobs inreusable-dispatch.yml(triage, code, review, fix, retro, prioritize).reusable-{stage}.ymlworkflows (defense-in-depth for overlappingworkflow_callinvocations and manual re-triggers).Roles operate independently: a review dispatch does not cancel triage, code, fix, etc.
History (why this is messy)
dispatch-triage,dispatch-fix, etc., butdispatch-reviewanddispatch-codedid not → PR refactor: unify mint provisioning and harden URL validation #930 saw 23 review dispatches, only 8 useful.dispatchjob with a shared queue group; per-stage cancellation moved to per-org thin callers (review.yml, etc.).reusable-dispatch.ymlwas documented to get per-stage concurrency (PR feat: add per-repo installation mode (ADR 0033) #799) but never did.This PR implements the two-layer, per-role policy ADR 0033 intended for per-repo installs.
Issues
Closes #981
Closes #982
Closes #1357
Also addresses:
Not solved here (follow-ups):
Test plan
mise exec -- go test ./internal/scaffold/ -vMade with Cursor