Skip to content

ci(dispatch): skip retro for scaffold PRs - #8057

Closed
shairevivo wants to merge 1 commit into
fullsend-ai:mainfrom
shairevivo:fix/8043-skip-retro-scaffold
Closed

shairevivo wants to merge 1 commit into
fullsend-ai:mainfrom
shairevivo:fix/8043-skip-retro-scaffold

Conversation

@shairevivo

Copy link
Copy Markdown
Contributor

Summary

Skips automatic retro dispatch for fullsend scaffold PRs, whose shim-only changes have no substantive work for a retro agent. Ordinary closed PRs and manual /fs-retro dispatches are unchanged.

Related Issue

Fixes #8043

Changes

  • Pass the PR head ref into the per-repo reusable dispatcher route step.
  • Do not select the retro stage for exact scaffold refs: fullsend/onboard, fullsend/offboard, and fullsend/scaffold-install.
  • Add a runtime regression test that executes the embedded route script for all three scaffold refs and an ordinary ref.

Testing

  • make lint (after staging)
  • go test ./internal/scaffold/
  • Regression test was red before the guard and green after it.

Dispatch and cross-forge evidence

  • GitHub: a closed pull_request_target event from one of the three exact scaffold branches emits no stage; any other closed PR emits retro; issue-comment /fs-retro remains on its separate route.
  • GitLab: not applicable to this change; its CI dispatcher is a separate template and was not modified.
  • Forgejo: not applicable to this GitHub Actions reusable-workflow path; no Forgejo dispatch code or contract changed.
  • Instruction surfaces: verified the route rule and its executable regression test. No workflow_call inputs, secrets, event payload fields, agent prompts, examples, or user documentation changed.
  • Adversarial re-review scenario: not applicable; this change does not alter review/re-review dispatch.
  • Historical constraint: Short-circuit retro dispatch for scaffolding PRs #8043 establishes the wasted-compute case; this preserves the intentionally ungated retro route for all non-scaffold PR closures.
  • Behavioral validation: verified locally by executing the route shell embedded in reusable-dispatch.yml. Live validation is blocked until a scaffold PR is merged after this PR lands.

Checklist

  • PR title follows Conventional Commits
  • Commit is DCO signed off and includes the Codex co-author trailer
  • I can explain all changes in this PR

Co-authored-by: Codex <noreply@openai.com>
Signed-off-by: Shai Revivo <srevivo@redhat.com>
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Skip automatic retro for scaffold PRs

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Skip automatic retro when a closed PR uses one of three exact fullsend scaffold branches.
• Preserve retro dispatch for other closed PRs and manual commands.
• Test the workflow’s route script against scaffold and ordinary branches.
Diagram

graph TD
  A["Closed PR"] --> B["Route step"] --> C{"Scaffold ref?"} -->|Yes| D["No stage"]
  C -->|No| E["Retro stage"]
  F["Manual retro"] --> E
Loading
High-Level Assessment

Keep the exact head-ref check in the existing route step: it targets the three known scaffold branches without adding API calls or changing manual dispatch. Inspecting PR files was considered but would add complexity for this fixed branch convention.

Files changed (2) +88 / -1

Bug fix (1) +9 / -1
reusable-dispatch.ymlExclude scaffold refs from automatic retro routing +9/-1

Exclude scaffold refs from automatic retro routing

• Passes the PR head ref to the route script and leaves the stage empty when a closed PR uses one of three exact scaffold refs. Other closed PRs continue to select retro.

.github/workflows/reusable-dispatch.yml

Tests (1) +79 / -0
dispatch_retro_scaffold_test.goExercise closed-PR routing with the workflow script +79/-0

Exercise closed-PR routing with the workflow script

• Extracts and runs the reusable workflow’s Determine stage script. Verifies that each scaffold ref emits no stage while an ordinary ref emits retro.

internal/scaffold/dispatch_retro_scaffold_test.go

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (2) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Per-org scaffold PRs still run retros 📘 Rule violation ⚙ Maintainability
Description
The new scaffold-branch guard in reusable-dispatch.yml is absent from the per-org dispatch.yml,
whose closed-PR route still sets STAGE="retro". Closing a PR on any of the three scaffold branches
through the per-org route therefore continues to dispatch a retro, and the new regression test
exercises only the per-repo route.
Code

.github/workflows/reusable-dispatch.yml[R288-289]

+                  case "${PR_HEAD_REF}" in
+                    fullsend/onboard|fullsend/offboard|fullsend/scaffold-install)
Relevance

●●● Strong

Accepted precedent requires duplicated dispatch workflows to remain behaviorally synchronized,
including matching routing logic.

PR-#1688
PR-#2373

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 1062045 requires matching stage routing across the two dispatch workflows unless an inline
comment explains a workflow-specific difference. The changed route skips these branches, while the
scaffold workflow's closed-PR route unconditionally selects retro.

Rule 1062045: Keep jq payload, stage routing, and secret threading logic in dispatch workflows in sync
.github/workflows/reusable-dispatch.yml[285-296]
internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml[215-220]
internal/scaffold/dispatch_retro_scaffold_test.go[20-20]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The per-repo route now skips retro for three scaffold branches, but the per-org route still dispatches retro for them.

## Fix Focus Areas
- .github/workflows/reusable-dispatch.yml[288-295]
- internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml[215-219]

## Recommended Fix
Apply the same branch guard to the per-org route and test both routes. If the difference is intentional, add an inline comment explaining why it is specific to the per-repo workflow.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


2. Unrelated pull requests skip retros 🐞 Bug ≡ Correctness
Description
The closed route decides whether to suppress retro using only PR_HEAD_REF, without verifying
that the pull request is a scaffold PR. If a contributor closes a substantive PR from a fork branch
named fullsend/onboard or fullsend/offboard, the caller forwards the event but the route emits
no stage, so the automatic retro never runs.
Code

.github/workflows/reusable-dispatch.yml[R288-290]

+                  case "${PR_HEAD_REF}" in
+                    fullsend/onboard|fullsend/offboard|fullsend/scaffold-install)
+                      echo "::notice::Skipping retro for fullsend scaffold PR on ${PR_HEAD_REF}"
Relevance

●●● Strong

The guard uses branch names as ownership signals; accepted dispatch precedents favor explicit
authorization and event validation.

PR-#1688
PR-#2106

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The route receives the PR's head ref and uses it as its sole skip condition. The per-repo caller
filters out fullsend/scaffold-install but forwards closed PRs from the other two names; the
route's empty stage then prevents the retro job from running. Repository guidance also identifies
these branch names as predictable and cautions against treating them as ownership signals.

.github/workflows/reusable-dispatch.yml[119-123]
.github/workflows/reusable-dispatch.yml[284-295]
internal/scaffold/fullsend-repo/templates/shim-per-repo.yaml[23-46]
.github/workflows/reusable-dispatch.yml[1184-1205]
docs/contributing/forge-abstraction.md[23-31]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The closed-PR route treats predictable branch names as proof that a PR is a scaffold PR, allowing unrelated PRs to bypass automatic retro.
## Fix Focus Areas
- .github/workflows/reusable-dispatch.yml[119-123]
- .github/workflows/reusable-dispatch.yml[284-295]
## Recommended Fix
Require a trustworthy scaffold ownership signal in addition to the exact branch name before suppressing retro; route PRs with missing or mismatched ownership data to retro. Add a regression case for an unrelated PR using a scaffold-named branch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Informational

3. Workflow edits lack guide sign-off 📘 Rule violation § Compliance
Description
The new PR_HEAD_REF mapping and closed-PR route guard modify a pull_request_target workflow
without an explicit statement that docs/contributing/ci-workflows.md was consulted. Neither the PR
description nor an inline comment names the guide, leaving the required review acknowledgment absent
for this workflow change.
Code

.github/workflows/reusable-dispatch.yml[122]

+          PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
Relevance

● Weak

Recent precedent rejected requiring explicit guide acknowledgment for pull_request_target workflow
edits.

PR-#7845

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3201588 requires an explicit PR-description or inline-comment reference to the guide for this
kind of workflow change. The diff changes the pull-request-target routing job, and the supplied PR
description contains no such reference.

Rule 3201588: Consult CI workflow guide when modifying GitHub Actions workflows or secrets
.github/workflows/reusable-dispatch.yml[102-125]
.github/workflows/reusable-dispatch.yml[285-296]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR changes a pull-request-target workflow but does not explicitly record consultation of the CI workflow guide.

## Fix Focus Areas
- .github/workflows/reusable-dispatch.yml[122-122]
- .github/workflows/reusable-dispatch.yml[288-295]

## Recommended Fix
Review docs/contributing/ci-workflows.md against the changed event mapping and route, then explicitly state in the PR description that the guide was consulted.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 74 rules
✅ Skills: 4 invoked
  writing-user-docs
  writing-adrs
  check-patch-coverage
  cutting-releases
✅ Cross-repo context — repo relationships
  Explored: repo: fullsend-ai/experiments (sha: 3f1614fa) — View relationship
  Explored: repo: fullsend-ai/.fullsend (sha: 7c163cad) — View relationship
  Explored: repo: fullsend-ai/pi-xai-vertex (sha: 8f50bdda) — View relationship
  Explored: repo: fullsend-ai/scribe (sha: 0f3eb528) — View relationship
  Explored: repo: fullsend-ai/mlflow-assessments (sha: 46f42987) — View relationship
  Explored: repo: fullsend-ai/pi-anthropic-vertex (sha: 960eff35) — View relationship
  Explored: repo: fullsend-ai/metrics (sha: 48e25b2e) — View relationship
  Explored: repo: fullsend-ai/agents (sha: 8f8dce20) — View relationship
Review mode: Auto: ⚖️ Balanced: This changes CI dispatch behavior and adds workflow-executing regression coverage, so a careful review is warranted despite the localized two-file scope.

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +288 to +289
case "${PR_HEAD_REF}" in
fullsend/onboard|fullsend/offboard|fullsend/scaffold-install)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

1. Per-org scaffold prs still run retros 📘 Rule violation ⚙ Maintainability

The new scaffold-branch guard in reusable-dispatch.yml is absent from the per-org dispatch.yml,
whose closed-PR route still sets STAGE="retro". Closing a PR on any of the three scaffold branches
through the per-org route therefore continues to dispatch a retro, and the new regression test
exercises only the per-repo route.
Agent Prompt
## Issue description
The per-repo route now skips retro for three scaffold branches, but the per-org route still dispatches retro for them.

## Fix Focus Areas
- .github/workflows/reusable-dispatch.yml[288-295]
- internal/scaffold/fullsend-repo/.github/workflows/dispatch.yml[215-219]

## Recommended Fix
Apply the same branch guard to the per-org route and test both routes. If the difference is intentional, add an inline comment explaining why it is specific to the per-repo workflow.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

Comment on lines +288 to +290
case "${PR_HEAD_REF}" in
fullsend/onboard|fullsend/offboard|fullsend/scaffold-install)
echo "::notice::Skipping retro for fullsend scaffold PR on ${PR_HEAD_REF}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

2. Unrelated pull requests skip retros 🐞 Bug ≡ Correctness

The closed route decides whether to suppress retro using only PR_HEAD_REF, without verifying
that the pull request is a scaffold PR. If a contributor closes a substantive PR from a fork branch
named fullsend/onboard or fullsend/offboard, the caller forwards the event but the route emits
no stage, so the automatic retro never runs.
Agent Prompt
## Issue description
The closed-PR route treats predictable branch names as proof that a PR is a scaffold PR, allowing unrelated PRs to bypass automatic retro.
## Fix Focus Areas
- .github/workflows/reusable-dispatch.yml[119-123]
- .github/workflows/reusable-dispatch.yml[284-295]
## Recommended Fix
Require a trustworthy scaffold ownership signal in addition to the exact branch name before suppressing retro; route PRs with missing or mismatched ownership data to retro. Add a regression case for an unrelated PR using a scaffold-named branch.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 7:58 AM UTC · Completed 8:09 AM UTC

Commit: 5549e65 · View workflow run →

Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $1.68

@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Oct 4, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Small 2-file change closely matching linked issue scope with test coverage, but assigned moderate risk due to modifying high-churn protected CI workflow reusable-dispatch.yml without a feature toggle.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [protected-path] .github/workflows/reusable-dispatch.yml:289 — This PR modifies a protected infrastructure file: .github/workflows/reusable-dispatch.yml. Issue Short-circuit retro dispatch for scaffolding PRs #8043 and the PR description explain the scaffold-retro suppression, but protected-path changes always require human approval, regardless of context.
    Remediation: Obtain a human maintainer's approval of the workflow routing change.

Labels: The PR changes GitHub Actions routing for automatic retro dispatch, matching the repository's CI and dispatch component labels.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

# (lifecycle accounting). See ADR 0054 #5223 note.
STAGE="retro"
case "${PR_HEAD_REF}" in
fullsend/onboard|fullsend/offboard|fullsend/scaffold-install)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[medium] protected-path

This PR modifies a protected infrastructure file: .github/workflows/reusable-dispatch.yml. Issue #8043 and the PR description explain the scaffold-retro suppression, but protected-path changes always require human approval, regardless of context.

Suggested fix: Obtain a human maintainer's approval of the workflow routing change.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment component/ci CI pipelines and checks component/dispatch Workflow dispatch and triggers labels Oct 4, 2026
@shairevivo

Copy link
Copy Markdown
Contributor Author

Closing this PR as it seems like the issue is trying to fix legacy per org behaviour.

@shairevivo shairevivo closed this Oct 4, 2026

This branch had an error being deployed

1 failed deployment
dev — 5549e650 Deployed Oct 4, 2026 by shairevivo via behaviour #15271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ci CI pipelines and checks component/dispatch Workflow dispatch and triggers requires-manual-review Review requires human judgment risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Short-circuit retro dispatch for scaffolding PRs

1 participant