Skip to content

verify: opt-in PgBot migration verification; fix public-repo guard - #8

Merged
alexshapalov merged 6 commits into
mainfrom
feat/pgbot-verify
Nov 16, 2026
Merged

alexshapalov merged 6 commits into
mainfrom
feat/pgbot-verify

Conversation

@alexshapalov

Copy link
Copy Markdown
Contributor

Draft for review — do not merge or tag.

  • New opt-in verify step (verify: false by default) running pgrun bot verify: categories, policy-controlled blocking, job summary table, outputs.
  • Fix: the production-like public-repository guard never refused (jq // treats false as empty); regression test added.
  • Branch also carries the 2026-11 sprint commits (engine + request_id on create, 429 capacity_busy wait). Some earlier commits appear twice because main has equivalents with different hashes; the net diff is 11 files.
  • README/docs changes here are not published until a release is approved.

🤖 Generated with Claude Code

alexshapalov and others added 4 commits November 15, 2026 09:20
The server picks the engine before provisioning; the run-unique branch name doubles as the
idempotency key, and a replayed create (200, replayed: true) counts as created. 19/19 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With server-side admission control on, a busy host answers 429 capacity_busy + Retry-After and
creates nothing. The action now treats it like a quota wait: give back a partial hold, wait what
the server asks (clamped 5-60 s) within capacity-wait, retry under a new name. 503
capacity_unavailable stays fatal. Without this, enabling admission would fail CI runs under load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
verify: true runs `pgrun bot verify --json` (pgrun-verify 1.x) before the
mode's run and reports its verdict: job summary sections per category
(success, informational warnings, dangerous operations with advice,
confirmed failure, unsupported on PGX, incomplete, infrastructure error),
annotations, and verify-verdict/-blocking/-categories/-report outputs.
Blocking follows the report's `blocking` field under the explicit
verify-fail-on / verify-block-on policy; a missing CLI or unreadable report
is an `error` category, blocking only when block-on lists it.

The token reaches pgrun by env only; the migration runs under
env -u PGRUN_API_TOKEN, its output redacted and fenced by stop-commands.
Each run writes into its own mktemp directory and never touches the run
step's state. No unpinned CLI download: no verify-capable release is
pinned yet. Off by default; existing steps unchanged.

Tests: tests/test_verify.sh with a fake pgrun (52 checks, incl. 8
concurrent runs on one runner temp dir).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/ treats false as empty)

Found while integrating verify. A public repository's run went ahead in production-like mode,
printing the sanitized copy's data into readable Actions logs was possible. Test added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexshapalov and others added 2 commits November 15, 2026 12:06
…t file

On GitHub the runner's GITHUB_EVENT_PATH describes THIS (public) repository, so since the
public-repository guard works (622cf34) it refused 43 of 52 verify tests in CI; locally the
variable is unset and they passed. run_verify now defaults to a private-repository event; the
guard tests pass their own. Reproduced locally with a public event: 9/52 before, 52/52 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t file)

c95784c fixed test_verify.sh; test_lifecycle.sh (the unit job) and test_rails_local.sh had the same
leak: on GitHub the runner's GITHUB_EVENT_PATH describes this public repository, so the working
public-repository guard refused 25 of 33 lifecycle tests. Reproduced locally with a public event:
8/33 before, 33/33 after; verify 52/52, guard 3/3, profile 30/30, node 20/20 under the same event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexshapalov
alexshapalov marked this pull request as ready for review November 16, 2026 03:21
@alexshapalov
alexshapalov merged commit 2921ed1 into main Nov 16, 2026
2 checks passed
@alexshapalov
alexshapalov deleted the feat/pgbot-verify branch November 16, 2026 03:22
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.

1 participant