feat(pr-review): review by reconciliation from one cron, without per-repo stubs #1252

Closed
claude-bot wants to merge 1 commits from feat/pr-review-reconcile into feat/pr-review-listed-agent
Member

Stacked on #1251; retarget to master after it merges.

The per-repo stubs were the fragile part: four files in four repos, each with its own secret bindings and its own event. A lost event, a missing binding or a forgotten stub meant no review and nobody noticed. Now one cron pipeline in homelab reconciles.

Every 10 minutes ci/agents/pr-review/run.sh walks the repositories in ci/agents/pr-review/repos.txt, picks one open PR that has no review by review-bot at its current head commit, has the Mistral agent review it and posts the result. The state is the pr-review:sha marker in the bot's own review, so a missed run or a failed review is retried by the next run.

  • pr-eligible.sh decides which PRs qualify (open, not draft, not WIP, no review at this head); covered by the offline tests, including a title that only starts with 'wip'.
  • One review per run, random pick: a PR whose review keeps failing cannot block the others, and a run stays inside the cron interval. mistral-review.sh makes one attempt with a 540 s limit; the next run is the retry.
  • A pull_request run from an old per-repo stub now exits without doing anything, so existing stubs stay harmless until deleted.
  • The pipeline image is pinned (ci-claude:2.1.296) instead of :latest; the Claude CLI is not used any more.
  • PR_REVIEW_DRY_RUN=1 lists what would be reviewed; PR_REVIEW_WORK moves the scratch directory.
  • To review another repository: add it to repos.txt and give review-bot read access.

Tried: dry run against the four configured repos listed the open PRs, skipped #1251 and shelly-manager #105 (already reviewed at their head) and picked one of the four that still need a review.

Latency is up to 10 minutes after a push instead of seconds.

After merge:

  1. Create the cron: woodpecker-cli repo cron add --repo k.renner/homelab --name pr-review --branch master --schedule '*/10 * * * *'
  2. Delete the stub from homeassistant, authentik-samba-bridge (instead of #5) and shelly-manager (instead of #107).
  3. mistral_api_key only needs the cron and manual events.

🤖 Generated with Claude Code

Stacked on #1251; retarget to master after it merges. The per-repo stubs were the fragile part: four files in four repos, each with its own secret bindings and its own event. A lost event, a missing binding or a forgotten stub meant no review and nobody noticed. Now one cron pipeline in homelab reconciles. Every 10 minutes ci/agents/pr-review/run.sh walks the repositories in ci/agents/pr-review/repos.txt, picks one open PR that has no review by review-bot at its current head commit, has the Mistral agent review it and posts the result. The state is the pr-review:sha marker in the bot's own review, so a missed run or a failed review is retried by the next run. - pr-eligible.sh decides which PRs qualify (open, not draft, not WIP, no review at this head); covered by the offline tests, including a title that only starts with 'wip'. - One review per run, random pick: a PR whose review keeps failing cannot block the others, and a run stays inside the cron interval. mistral-review.sh makes one attempt with a 540 s limit; the next run is the retry. - A pull_request run from an old per-repo stub now exits without doing anything, so existing stubs stay harmless until deleted. - The pipeline image is pinned (ci-claude:2.1.296) instead of :latest; the Claude CLI is not used any more. - PR_REVIEW_DRY_RUN=1 lists what would be reviewed; PR_REVIEW_WORK moves the scratch directory. - To review another repository: add it to repos.txt and give review-bot read access. Tried: dry run against the four configured repos listed the open PRs, skipped #1251 and shelly-manager #105 (already reviewed at their head) and picked one of the four that still need a review. Latency is up to 10 minutes after a push instead of seconds. After merge: 1. Create the cron: woodpecker-cli repo cron add --repo k.renner/homelab --name pr-review --branch master --schedule '*/10 * * * *' 2. Delete the stub from homeassistant, authentik-samba-bridge (instead of #5) and shelly-manager (instead of #107). 3. mistral_api_key only needs the cron and manual events. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude-bot added 1 commit 2026-10-11 16:39:53 +00:00
feat(pr-review): review by reconciliation from one cron, without per-repo stubs
ci/woodpecker/pr/ci-manifests-test Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
563284bd51
A single cron pipeline in homelab walks the repositories in ci/agents/pr-review/repos.txt, picks one open PR without a review at its current head commit and reviews it with the Mistral agent. The state is the pr-review:sha marker in the bot's own review, so a missed run or failed review is retried by the next run and no pipeline file is needed in the reviewed repositories. pr-eligible.sh decides which PRs qualify; the pick is random so a PR that keeps failing cannot block the rest; one attempt per run keeps a run inside the cron interval. A pull_request run from an old per-repo stub exits without doing anything. The pipeline image is pinned instead of :latest. PR_REVIEW_DRY_RUN=1 lists what would be reviewed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Member

Superseded by #1254 (Go service).

Superseded by #1254 (Go service).
claude-bot closed this pull request 2026-10-11 18:57:45 +00:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.