refactor(dispatch): require PR context for review triggers#2473
refactor(dispatch): require PR context for review triggers#2473ifireball wants to merge 8 commits into
Conversation
Review and fix agents need PR context. Drop the issues labeled ready-for-review route and gate /fs-review to PR comments only, leaving pull_request_target and pull_request_review auto-triggers unchanged. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
PR Summary by QodoRequire PR context for review dispatch triggers Description
Diagram
High-Level Assessment
Files changed (9)
|
Site previewPreview: https://a0df40c9-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 3:26 PM UTC · Completed 3:39 PM UTC |
Code Review by Qodo
1.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsHigh
Medium
Low
Previous runReviewFindingsHigh
Low
Previous run (2)ReviewFindingsHigh
Low
Previous run (3)ReviewFindingsHigh
Low
Previous run (4)ReviewFindingsHigh
Medium
Low
Previous run (5)ReviewFindingsHigh
Medium
Low
Previous run (6)ReviewFindingsHigh
Low
Previous run (7)ReviewFindingsHigh
Medium
Low
Previous run (8)ReviewFindingsHigh
Medium
Low
Labels: PR modifies dispatch workflow routing and updates multiple documentation files. |
Restore the ready-for-review label dispatch route gated on ISSUE_HAS_PR, matching the /fs-review PR-context guard. Standalone issues no longer enqueue review; PR label application still can. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Finished Review · ✅ Success · Started 5:52 AM UTC · Completed 6:04 AM UTC |
…drop-issue-review-fix-triggers Signed-off-by: Barak Korren <bkorren@redhat.com>
Tighten review agent doc wording per review, clarify ADR notes that fix dispatch was already PR-only, and annotate ADR 0002. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Finished Review · ✅ Success · Started 6:51 AM UTC · Completed 7:04 AM UTC |
Clearer env var name for the issue_comment/ issues guard that checks github.event.issue.pull_request is set. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Finished Review · ✅ Success · Started 7:55 AM UTC · Completed 8:07 AM UTC |
Use the clearer ISSUE_IS_PR name suggested in review instead of the shorter IS_PR alias. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
🤖 Finished Review · ✅ Success · Started 12:16 PM UTC · Completed 12:28 PM UTC |
waynesun09
left a comment
There was a problem hiding this comment.
Review — 2 findings (Medium)
M1 — PR description references old variable name ISSUE_HAS_PR
The summary bullets say "Gate /fs-review on ISSUE_HAS_PR" and "Gate ready-for-review label on ISSUE_HAS_PR", but the code renames to ISSUE_IS_PR. The description is the permanent record post-merge — should match the actual variable name.
M3 — Shim repos need coordinated update
fullsend-ai/.fullsend dispatch.yml still uses the old ISSUE_HAS_PR name, /fs-review dispatches unconditionally (L96-97), and ready-for-review triggers review unconditionally (L144-145). The behavioral change only takes effect in per-repo mode and newly scaffolded repos — existing per-org deployments will continue dispatching review on standalone issues until the shim repos are updated separately.
Consider noting this in the PR description or filing a follow-up to update fullsend-ai/.fullsend (and nonflux/.fullsend) after this lands.
Signed-off-by: Barak Korren <bkorren@redhat.com>
Apply ISSUE_IS_PR gating in reusable-dispatch.yml only; leave per-org dispatch.yml unchanged for now. Add reusable-dispatch routing test and update docs/ADRs to document the per-repo scope. Signed-off-by: Barak Korren <bkorren@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Scoped to per-repo only per M3: routing changes are in |
|
🤖 Finished Review · ✅ Success · Started 3:06 PM UTC · Completed 3:18 PM UTC |
| STAGE="code" | ||
| fi | ||
| ;; | ||
| /fs-review) |
There was a problem hiding this comment.
[medium] architectural-coherence
The PR introduces intentional behavioral divergence between per-repo and per-org installation modes for review triggers. ADR 0033 and ADR 0034 both state routing logic should be 'identical' between modes. The PR documents this as temporary ('pending follow-up') but provides no timeline or tracking for convergence.
| STAGE="code" | ||
| fi | ||
| ;; | ||
| /fs-review) |
There was a problem hiding this comment.
[low] silent-skip
When /fs-review is issued on an issue without a linked PR, STAGE remains empty and the workflow silently skips dispatch. The user receives no feedback explaining why the command was ignored. This is consistent with existing patterns (/fs-code silently skips when ISSUE_IS_PR is true), so this is not a regression.
waynesun09
left a comment
There was a problem hiding this comment.
[medium] test-regex-fragility
The (?s)/fs-review\).*?ISSUE_IS_PR and (?s)ready-for-review.*?ISSUE_IS_PR regexes assert that ISSUE_IS_PR appears somewhere after the trigger string in the file — not that it gates the specific case block. If the /fs-review case block lost its gate but ISSUE_IS_PR still appeared later (e.g., in the /fs-fix block), the test would false-pass. Consider tightening to match within the case block structure, e.g.:
assert.Regexp(t, `(?s)/fs-review\)\s*\n\s+if \[\[ "\$\{ISSUE_IS_PR\}"`, s)
assert.Regexp(t, `(?s)ready-for-review"\s*\]\];\s*then\s*\n\s+if \[\[ "\$\{ISSUE_IS_PR\}"`, s)Routing logic and docs LGTM otherwise.
Assisted-by: Claude (review), Gemini (review)
Summary
Require PR context for review dispatch in per-repo installs only (
reusable-dispatch.yml). Per-orgdispatch.ymlis unchanged pending follow-up./fs-reviewonISSUE_IS_PR(PR comments only; preserves stale-head re-dispatch inpost-review.sh)ready-for-reviewlabel onISSUE_IS_PR(PR label application only; standalone issues skipped)pull_request_reviewand PR-gated/fs-fix/fs-revieworready-for-reviewlabelpull_request_target;ready-for-reviewon a PR;/fs-reviewon PR commentspull_request_review;/fs-fixon PR commentsPer-org installs (
.fullsend/dispatch.yml) retain legacy issue-side review triggers until a follow-up PR.ADR annotations
Test plan
go test ./internal/scaffold/...make lintready-for-reviewis applied to a standalone issueready-for-reviewon a PR dispatches review/fs-reviewon a PR comment still dispatches reviewpull_request_targeton PR open/push