ci: add pr-review-cycle workflow#49084
Conversation
Adds .github/workflows/pr-review-cycle.yml — an event-driven workflow that runs one round of the post-PR-open review cycle per invocation. The cycle: 1. Requests Copilot review on the PR (with fallback handling for `Copilot` vs `copilot-pull-request-reviewer[bot]` reviewer naming). 2. Tags @claude in a PR comment so the GitHub Claude app can pick it up. 3. Polls for new inline comments + check-run status; addresses actionable comments by editing and pushing follow-up commits. 4. Rebases the PR on fresh trunk every round (not only on conflict) to keep CI signal current. 5. Caps at 10 rounds with 10-minute sleeps between rounds (hard rules in the skill body it dispatches to). Activation: triggered by `workflow_dispatch` and by `pull_request` events (opened, ready_for_review, synchronize). Skips draft PRs and cross-repository (fork) PRs per the gating in the job conditions. Required repo secrets: * ANTHROPIC_API_KEY — for the dispatched Claude Code session. The workflow no-ops gracefully if the secret is absent. This PR is one of a parallel batch upstreaming the dognose24/jetpack fork's accumulated harness work. See "Related PRs" in PR body. Note: a corresponding CODEOWNERS update on fork (`/tools/ai-sandbox/ @dognose24`) is fork-specific and intentionally not included here. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 |
anomiex
left a comment
There was a problem hiding this comment.
It seems like the whole point of this is to try to have AI code on a PR, but done inefficiently through GitHub Actions instead of running in a local Claude Code instance or the like. Why not just do that if you're wanting AI to write code for you?
Even if you really need Copilot to do reviews and you can't get that in any way other than by pushing to a PR, the local Claude Code instance could still wait for that and do things locally instead of running inside Actions.
| - Branch: ${{ steps.ctx.outputs.branch }} | ||
| - Trigger: ${{ github.event_name }} | ||
|
|
||
| Follow the instructions in .claude/commands/jetpack-pr-review-cycle.md with these |
| 2. NEVER sleep. Complete one round and stop. | ||
| 3. For all triggers: run one follow-up round — | ||
| snapshot → filter → address → CI → rebase → push → re-request review — then stop. | ||
| 4. Read .claude/pr-review-state.json at the start of the round and write it at the end |
There was a problem hiding this comment.
This is going to clutter the PR, and will be particularly annoying if the PR gets merged without deleting this garbage file.
Proposed changes
Adds
.github/workflows/pr-review-cycle.yml— an event-driven workflow that runs one round of the post-PR-open review cycle per invocation.What the workflow does (per round)
Copilotandcopilot-pull-request-reviewer[bot]reviewer naming).@claudein a PR comment so the GitHub Claude app can pick it up if installed.trunkevery round (not only on conflict) so CI signal stays current.Activation
workflow_dispatch(manual)pull_requestevents:opened,ready_for_review,synchronizeRequired secrets
ANTHROPIC_API_KEY— for the dispatched Claude Code session. The workflow no-ops gracefully if the secret is absent (so this PR is mergeable even before any secret is configured).What this PR is / isn't
A corresponding
CODEOWNERSupdate on the fork (/tools/ai-sandbox/ @dognose24) is fork-specific and intentionally not included here.Why parallel batch
This is one of 4 PRs upstreaming accumulated work from
dognose24/jetpack:tools/ai-sandbox/subsystem (Docker + wp-verify).agents/skills/+.claude/commands/agent skills + governance.github/workflows/pr-review-cycle.ymlauto-triggered review workflowThe workflow dispatches to a skill defined in PR #C (
/jetpack-pr-review-cycle). The workflow remains a no-op if that skill isn't present (the dispatch step exits with the missing-skill diagnostic), so this PR can ship before or after PR #C without breaking anything else.Does this pull request change what data or activity we track or use?
No data collection. The workflow's actions are scoped to the PR it fires on: it reads PR / review state via the GitHub API, posts comments, and pushes branch commits. The
ANTHROPIC_API_KEYsecret (when configured) is used to call Anthropic's API from within the Claude Code session the workflow dispatches.Testing instructions
yamllint .github/workflows/pr-review-cycle.yml.ANTHROPIC_API_KEYunset, the workflow's first step should fail gracefully (no-op, no API calls).ANTHROPIC_API_KEYset in a fresh PR, the workflow should run one round, post the Copilot review request + @claude tag, then sleep 10 min before the next round.🤖 Generated with Claude Code