Skip to content

feat(ci): make check-pr runs what a change needs; the affected selection is guarded - #139

Merged
jayleaton merged 1 commit into
mainfrom
feat/affected-guard
Oct 31, 2026
Merged

jayleaton merged 1 commit into
mainfrom
feat/affected-guard

Conversation

@jayleaton

@jayleaton jayleaton commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Rules. Before merge, run what this change needs on its exact head (docs/CI.md, "What to run"): for Go, make lint test scoped with LINT_DIRS/TEST_PKGS (scripts/affected.sh prints them) or make check-fast, plus the checks of what you touched. Then make ci-local RAN="<what you ran>" posts local-ci and fills "Local verification" with that statement and the head SHA. Never edit that section by hand. The Local verification check, make pr-merge and the staging gate refuse the PR while it is missing, names another head, or differs from what local-ci attested. A new push or rebase needs a new attestation. A reported failure (FAILED=) is final for that head: fix it in a new commit (docs/CI.md, "Local verification").

Problem

Agents put together "what to run" by hand from scripts/affected.sh and the table in docs/CI.md. Nothing failed when the selection did not match the diff. A sqlc query change was tested only through its importers, although it reaches the database tests through the schema.

Fix

  • make check-pr (scripts/check-pr.sh) runs what the changes need, stops at the first failure, and prints the make ci-local RAN="…" line. It runs lint and -race tests on the affected packages, or make ci when a shared input changed, plus check-generated, deploy-check, actionlint, release-smoke and secret-scan as they apply. ARGS=--dry-run only lists the commands.
  • docs/CI.md "What to run", AGENTS.md and the github-prs skill (both copies) name it as the default.
  • scripts/affected.sh runs everything for sqlc's queries and generated code.
  • scripts/affected.sh exits 3 when the selection does not match the diff: a changed Go file outside deploy/ in no package, a changed package not selected, or Go changes with nothing selected. A deleted package with no importers left needs nothing. check-fast and check-pr fail with it.
  • On sample diffs: one service file selects 11 packages plus check-generated; a sqlc query, a workflow or deploy/ adds what it needs; a Go file in no package fails with exit 3.

Part of the CI speed stack (numbers: docs/ci-speed.md at the top of the stack).

Local verification

Filled by make ci-local, 2026-10-31T16:42:03Z. Never edit this section by hand.

Head 256e22bec0dac553d35fe0ccd52ed4230ddae1d2 · tree 59f498280c3f · passed
Attested by JJ Eaton on MacBook-Pro-3.local

Ran: make ci on this exact tree (59f4982) in a 4 vCPU Davit box after the rebase onto main with #143 (passed; an earlier run failed only the test-time budget on a cached slow packages/auth run under host load, and make test then passed twice in fresh boxes on main and on this stack); make secret-scan (local). Conflicts with #143 resolved keeping both sides.

🤖 Generated with Claude Code

@jayleaton
jayleaton force-pushed the perf/generate-parallel branch from 5aa16e2 to 9e0cdf4 Compare October 31, 2026 16:41
…ion is guarded

make check-pr (scripts/check-pr.sh) is the default answer to docs/CI.md
"What to run": from the branch's changes it runs make lint and make test on
the affected packages (or make ci when a shared input changed),
check-generated, deploy-check, actionlint, release-smoke and secret-scan as
they apply, stops at the first failure, and prints the make ci-local RAN
line naming exactly what ran.

scripts/affected.sh now runs everything when sqlc's queries or generated
code change (they reach the database tests through the schema, not only
through imports), and fails (exit 3) when its selection does not match the
diff: a changed Go file outside deploy/ in no package, a changed package not
selected, or Go changes with nothing selected. A deleted package with no
importers left needs nothing. check-fast and check-pr fail with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayleaton
jayleaton changed the base branch from perf/generate-parallel to main October 31, 2026 16:41
@jayleaton
jayleaton force-pushed the feat/affected-guard branch from 8918737 to 256e22b Compare October 31, 2026 16:42
@jayleaton
jayleaton merged commit aa81f38 into main Oct 31, 2026
1 check passed
@jayleaton

Copy link
Copy Markdown
Owner Author

Authorized by JJ, merged by Claude (Opus 5.5, CI speed agent) with --admin after make ci-local attested 256e22b

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