Skip to content

Commit a3bbc22

Browse files
fix(workflows): add PR fallback to triage/code/prioritize concurrency
Defense-in-depth: dispatch and agent groups for triage, code, and prioritize now chain issue.number || pull_request.number like review/fix/retro. Tighten shim template test to match indented concurrency keys only (#981). Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4b08f2a commit a3bbc22

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

.github/workflows/reusable-code.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ on:
4343
required: true
4444

4545
concurrency:
46-
group: fullsend-code-agent-${{ inputs.source_repo }}-${{ fromJSON(inputs.event_payload).issue.number }}
46+
group: fullsend-code-agent-${{ inputs.source_repo }}-${{ fromJSON(inputs.event_payload).issue.number || fromJSON(inputs.event_payload).pull_request.number }}
4747
cancel-in-progress: true
4848

4949
jobs:

.github/workflows/reusable-dispatch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ jobs:
370370
needs: route
371371
if: needs.route.outputs.stage == 'triage'
372372
concurrency:
373-
group: fullsend-triage-${{ github.repository }}-${{ github.event.issue.number }}
373+
group: fullsend-triage-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }}
374374
cancel-in-progress: true
375375
# @v0 is hardcoded — GHA does not support expressions in uses:.
376376
# fullsend_ai_ref controls the ref for composite actions inside stage workflows.
@@ -393,7 +393,7 @@ jobs:
393393
needs: route
394394
if: needs.route.outputs.stage == 'code'
395395
concurrency:
396-
group: fullsend-code-${{ github.repository }}-${{ github.event.issue.number }}
396+
group: fullsend-code-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }}
397397
cancel-in-progress: true
398398
uses: fullsend-ai/fullsend/.github/workflows/reusable-code.yml@v0
399399
with:
@@ -478,7 +478,7 @@ jobs:
478478
needs: route
479479
if: needs.route.outputs.stage == 'prioritize'
480480
concurrency:
481-
group: fullsend-prioritize-${{ github.repository }}-${{ github.event.issue.number }}
481+
group: fullsend-prioritize-${{ github.repository }}-${{ github.event.issue.number || github.event.pull_request.number }}
482482
cancel-in-progress: true
483483
uses: fullsend-ai/fullsend/.github/workflows/reusable-prioritize.yml@v0
484484
with:

.github/workflows/reusable-prioritize.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ on:
4747
required: true
4848

4949
concurrency:
50-
group: fullsend-prioritize-agent-${{ inputs.source_repo }}-${{ fromJSON(inputs.event_payload).issue.number }}
50+
group: fullsend-prioritize-agent-${{ inputs.source_repo }}-${{ fromJSON(inputs.event_payload).issue.number || fromJSON(inputs.event_payload).pull_request.number }}
5151
cancel-in-progress: true
5252

5353
jobs:

.github/workflows/reusable-triage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ on:
4444
required: true
4545

4646
concurrency:
47-
group: fullsend-triage-agent-${{ inputs.source_repo }}-${{ fromJSON(inputs.event_payload).issue.number }}
47+
group: fullsend-triage-agent-${{ inputs.source_repo }}-${{ fromJSON(inputs.event_payload).issue.number || fromJSON(inputs.event_payload).pull_request.number }}
4848
cancel-in-progress: true
4949

5050
jobs:

internal/scaffold/scaffold_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func TestShimPerRepoTemplateContent(t *testing.T) {
156156
assert.Contains(t, s, "install_mode: per-repo")
157157
// Per-role concurrency lives in reusable-dispatch.yml, not a monolithic shim group (#2452).
158158
assert.NotContains(t, s, "fullsend-dispatch-${{")
159-
assert.NotContains(t, s, "concurrency:")
159+
assert.NotRegexp(t, `(?m)^\s+concurrency:`, s)
160160
assert.Contains(t, s, "per-role cancel-in-progress groups live in reusable-dispatch.yml")
161161
}
162162

internal/scaffold/workflow_call_alignment_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ var thinCallerConcurrencyExpectations = map[string]stageConcurrencyExpectation{
9191
var reusableAgentConcurrencyExpectations = map[string]stageConcurrencyExpectation{
9292
"triage": {
9393
groupPrefix: "fullsend-triage-agent-",
94-
groupMust: []string{"inputs.source_repo", "issue.number"},
94+
groupMust: []string{"inputs.source_repo", "issue.number", "pull_request.number"},
9595
},
9696
"code": {
9797
groupPrefix: "fullsend-code-agent-",
98-
groupMust: []string{"inputs.source_repo", "issue.number"},
98+
groupMust: []string{"inputs.source_repo", "issue.number", "pull_request.number"},
9999
},
100100
"review": {
101101
groupPrefix: "fullsend-review-agent-",
@@ -111,18 +111,18 @@ var reusableAgentConcurrencyExpectations = map[string]stageConcurrencyExpectatio
111111
},
112112
"prioritize": {
113113
groupPrefix: "fullsend-prioritize-agent-",
114-
groupMust: []string{"inputs.source_repo", "issue.number"},
114+
groupMust: []string{"inputs.source_repo", "issue.number", "pull_request.number"},
115115
},
116116
}
117117

118118
var dispatchStageConcurrencyExpectations = map[string]stageConcurrencyExpectation{
119119
"triage": {
120120
groupPrefix: "fullsend-triage-",
121-
groupMust: []string{"github.repository", "github.event.issue.number"},
121+
groupMust: []string{"github.repository", "github.event.issue.number", "github.event.pull_request.number"},
122122
},
123123
"code": {
124124
groupPrefix: "fullsend-code-",
125-
groupMust: []string{"github.repository", "github.event.issue.number"},
125+
groupMust: []string{"github.repository", "github.event.issue.number", "github.event.pull_request.number"},
126126
},
127127
"review": {
128128
groupPrefix: "fullsend-review-",
@@ -138,7 +138,7 @@ var dispatchStageConcurrencyExpectations = map[string]stageConcurrencyExpectatio
138138
},
139139
"prioritize": {
140140
groupPrefix: "fullsend-prioritize-",
141-
groupMust: []string{"github.repository", "github.event.issue.number"},
141+
groupMust: []string{"github.repository", "github.event.issue.number", "github.event.pull_request.number"},
142142
},
143143
}
144144

0 commit comments

Comments
 (0)