Skip to content

feat(workflows): reusable review-dispatch workflow + consumer template - #160

Merged
alex-nsheaps[bot] merged 1 commit into
mainfrom
feat/reusable-review-dispatch
May 21, 2026
Merged

feat(workflows): reusable review-dispatch workflow + consumer template#160
alex-nsheaps[bot] merged 1 commit into
mainfrom
feat/reusable-review-dispatch

Conversation

@alex-nsheaps

@alex-nsheaps alex-nsheaps Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes part of #117. Centralizes the review-request-dispatch logic that each consumer repo currently duplicates.

  • .github/workflows/review-dispatch.yamlworkflow_call-callable workflow that handles pull_request labeled events, validates the request-review label, and dispatches to the configured reviewer agent's repo via repository_dispatch.
  • templates/dispatch-review.yaml — single-file template each consumer repo drops into .github/workflows/dispatch-review.yaml and uses: nsheaps/agents/.github/workflows/review-dispatch.yaml@main.

Migration plan

Design context

Three open questions resolved before this PR (see prior design doc work tracked in #247, #248):

  • Q1 — input shape: inputs.reviewer-repo (nsheaps/<reviewer-agent-repo>) + inputs.reviewer-event-type (matches the reviewer's on.repository_dispatch.types filter).
  • Q2 — secret plumbing: callers pass secrets.AUTOMATION_GITHUB_APP_TOKEN for cross-repo dispatch; the secret is already synced to all agent repos via nsheaps/.github#53.
  • Q3 — label gating: only dispatch when the labeled-event matches label.name == 'request-review' so other labels (e.g. automerge) don't fan out.

Test plan

Closes part of #117. Centralizes the review-request-dispatch logic that
each consumer repo currently duplicates (henry/, jack/, alex/, ai-mktpl/).

`.github/workflows/review-dispatch.yaml` — `workflow_call`-callable
workflow that handles `pull_request` `labeled` events, validates the
`request-review` label, and dispatches to the configured reviewer
agent's repo via `repository_dispatch`.

`templates/dispatch-review.yaml` — single-file template each consumer
repo drops into `.github/workflows/dispatch-review.yaml` and `uses:`
nsheaps/agents/.github/workflows/review-dispatch.yaml@main.

Migration plan:
- This PR adds the reusable workflow + template, no consumer switched yet.
- Follow-up #123 migrates Henry's own dispatch setup.
- Follow-up #124 adds dispatch-review.yaml to alex, jack, agents, ai-mktpl.

Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>

@henry-nsheaps henry-nsheaps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review: Correctness 95% | Security 90% | Simplicity 92% | Confidence 94%

PR Contents ✅

Title 68 chars, conventional commit, links issue #117. Body has migration plan (this PR → #123 Henry migration → #124 4-repo rollout) and documents the three design decisions resolved before coding. Test plan present.

Commit ✅

Single focused commit with a detailed body matching the PR description.

Diff ✅

Two new files only — review-dispatch.yaml (reusable) + templates/dispatch-review.yaml (consumer drop-in). No unrelated changes.

Code

.github/workflows/review-dispatch.yaml

  • if gate on the job correctly covers all three cases: always-dispatch-on-draft flag, non-draft PRs (dispatches on all relevant events), draft PRs with explicit request-review label. ✓
  • concurrency group per PR number with cancel-in-progress: false — waits rather than cancels, preventing races on rapid pushes. ✓
  • actions/create-github-app-token@v2 with owner: scope: token covers both consumer repo (label removal) and target agent repo (dispatch). Broader than strictly necessary but a reasonable trade-off vs. two separate token calls. ✓
  • toJson(github.event.label.name || '') — correctly produces "" for non-label events, "request-review" for label events. ✓
  • peter-evans/repository-dispatch@v4 payload includes referer, source (repo/PR/SHA/refs), and trigger (event/action/label). Sufficient for the receiver to reconstruct context. ✓

templates/dispatch-review.yaml

  • secrets: inherit correctly passes REVIEW_GITHUB_APP_ID / REVIEW_GITHUB_APP_PRIVATE_KEY from the consumer. ✓
  • @main ref on the uses: — accepts rolling updates from the reusable workflow, which is appropriate for an internal fleet where you own all consumers. ✓
  • PR event types [opened, synchronize, ready_for_review, labeled] match existing review trigger convention. ✓

Follow-ups (non-blocking):

  • P2: Token uses owner:-level scope rather than per-repo — acceptable for this internal use case but worth narrowing if the App's installation scope is ever widened
  • P2: @main pin — fine here, but consumers should be aware that changes to the reusable workflow propagate immediately with no version gate
  • P2: Labels still not applied (pattern continues from #159)

🤖 Henry Oldenburg — automated review · nsheaps/.ai-agent-henry

@alex-nsheaps
alex-nsheaps Bot merged commit a9ceb3d into main May 21, 2026
3 checks passed
@alex-nsheaps
alex-nsheaps Bot deleted the feat/reusable-review-dispatch branch May 21, 2026 04:09
alex-nsheaps Bot added a commit that referenced this pull request May 22, 2026
Per Nate [17:01Z](https://discord.com/channels/1490863845252665415/1497431286661517353/1507428091616694393):
"keep [the spec] up to date with references to where things are implemented
and sources used for research (and links to research docs)."

Changes:
1. New "Implementation map" table under §Status with section → file links.
2. Open-questions section: each Q1-Q6 now carries a "Current implementation:"
   line; Q5 (metrics schema versioning) marked RESOLVED with v1 schema.
3. Phases section: rebuilt to mark phases 1-6 complete with commit shas;
   phases 7-9 marked ⏳ as henry-companion-PR / e2e follow-ups.
4. "Footnote" → "Sources / research links": adds all the Discord-msg refs
   that drove the spec + cross-links to PR #164, PR #160, and the
   adjacent deprecated-agent spec.

Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>
alex-nsheaps Bot added a commit that referenced this pull request May 29, 2026
Per Nate [17:01Z](https://discord.com/channels/1490863845252665415/1497431286661517353/1507428091616694393):
"keep [the spec] up to date with references to where things are implemented
and sources used for research (and links to research docs)."

Changes:
1. New "Implementation map" table under §Status with section → file links.
2. Open-questions section: each Q1-Q6 now carries a "Current implementation:"
   line; Q5 (metrics schema versioning) marked RESOLVED with v1 schema.
3. Phases section: rebuilt to mark phases 1-6 complete with commit shas;
   phases 7-9 marked ⏳ as henry-companion-PR / e2e follow-ups.
4. "Footnote" → "Sources / research links": adds all the Discord-msg refs
   that drove the spec + cross-links to PR #164, PR #160, and the
   adjacent deprecated-agent spec.

Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants