Repository navigation
ci: skip heavy jobs for learnings and toolkit PRs (jflowers/ship pr-scope.yml) - #217
Conversation
…cope.yml) Replace ci.yml's inline learnings-only `changes` detector with a `scope` job that calls jflowers/ship's shared pr-scope.yml. Its code output is 'false' for Dewey learnings PRs and for gh-hud toolkit rollouts. Move the Standardized CI call from ci_checks.yml into ci.yml, keeping its job name, so CI OK can need it and become the only required check. Build and Test and Standardized CI now run only on code == 'true'. Chore PRs get a Gitleaks job that scans their commits, which replaces the secret scan they no longer get from Standardized CI. CI OK now checks each job ended as scope chose, instead of accepting any mix of success and skipped. ci_gating_test.go drops the tests of the deleted detector. It now pins the new job graph and runs the new verdict against a truth table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uf-divisor
left a comment
There was a problem hiding this comment.
Council verdict: APPROVE WITH ADVISORIES — 7/7 reviewer runs succeeded; 10 findings (2 MEDIUM, 8 LOW), none blocking.
Replaces the inline learnings-only changes detector with jflowers/ship's pr-scope.yml scope job, moves Standardized CI into ci.yml so CI OK can be the only required check, and adds a chore-only Gitleaks job replacing the secret scan chore PRs lose. The workflow graph, the fail-closed verdict logic, and the 18-case truth-table test are correct as written.
The two MEDIUM advisories are forward-looking operational risks rather than defects in this diff:
- The new
Gitleaksjob never executes on this PR (code == 'true'), so its pinned URL, checksum, andHEAD^1..HEAD^2scan range stay unvalidated until the first chore PR triggers it — andCI OKrequires gitleaks success for chores. A scratch-branch smoke test before the first real chore PR closes the gap. - The CLS-FR-001 push guarantee now rests entirely on ship's external push path: the in-repo push short-circuit and its executed regression case are deleted, while
release.ymlpreflight andCI OKboth depend on that path returningcode=trueon push.
Lower-severity advisories are inline. One item sits outside this PR's diff hunks, so it belongs here:
- LOW (documentation) — AGENTS.md's "Recent Changes" list still describes the deleted architecture: the
ci-skip-build-for-learningsentry says learnings-only PRs skipBuild and Test"via achangesdetection job" and thatStandardized CI / Run lintersstill runs on every PR (AGENTS.md:629), and the list has no entry for this migration. Updating it alongside the CI Parity Gate section keeps the doc internally consistent.
Findings via the Divisor review council (adversary, architect, curator, gaze-testing, guard, sre, testing).
This review was generated by /uf.review-pr (AI-assisted).
|
|
||
| # Chore PRs skip Standardized CI, and with it the secret scan: scan | ||
| # their commits here instead, since learnings can carry leaked secrets. | ||
| gitleaks: |
There was a problem hiding this comment.
[MEDIUM | release-pipeline-integrity | divisor-sre] The new Gitleaks job never runs on this PR — if: needs.scope.outputs.code == 'false' is false for a code PR — so the pinned artifact URL, the hardcoded GITLEAKS_SHA256, and the HEAD^1..HEAD^2 scan range unique to this repo's merge-commit checkout are unvalidated at merge time. The first chore/learnings PR is the first execution, and CI OK requires gitleaks == success for chores, so a wrong checksum, asset name, or range blocks every chore PR until a fix-up lands. Exercising the job out-of-band (a scratch chore branch or a temporary unconditional run) before the first real chore PR closes the gap.
| # code == 'false' only for pull requests whose files are all Dewey | ||
| # learnings, or a gh-hud toolkit rollout; 'true' for everything else. | ||
| scope: | ||
| uses: jflowers/ship/.github/workflows/pr-scope.yml@3b0ce8bf47183be402df9eaec16644c213eee5f7 # main, after v0.11.0 |
There was a problem hiding this comment.
[MEDIUM | release-pipeline-integrity | divisor-sre] Deleting the in-repo changes job moves the CLS-FR-001 push guarantee (pushes to main always run everything) entirely onto ship's pr-scope.yml push path, and the PR also removes the executed push event regression case that asserted code=true. TestCIGatingWorkflows_StructureEnforcesChoreSkip pins the SHA but not push behavior. release.yml's preflight gates on Build and Test and Standardized CI / Run linters, which exist on main HEAD only if call-reusable-ci runs on push; CI OK passes a push only when scope returns code=true. A ship push-path regression reddens main CI and blocks releases with no in-repo signal.
| // when both a failure and a cancellation occur) fails this test. | ||
| // script against needed-job results, so weakening it (say, accepting a | ||
| // skipped Build and Test on a code PR) fails this test. | ||
| func TestCIGatingWorkflows_AggregateVerdictBehavior(t *testing.T) { |
There was a problem hiding this comment.
[LOW | test-quality | divisor-gaze-testing] TestCIGatingWorkflows_AggregateVerdictBehavior spawns a bash subprocess for each of the 18 truth-table cases without a testing.Short() guard, diverging from TC-011 (SHOULD) and AGENTS.md's workflow-test guidance that subprocess-spawning tests be skippable in short mode. The pre-change version carried the same gap.
| assertMatches(t, yamlSection(t, workflow, "call-reusable-ci", 2), `(?m)^\s+uses:\s*complytime/org-infra/\.github/workflows/reusable_ci\.yml@`, "org-infra reusable CI call") | ||
| gitleaks := yamlSection(t, workflow, "gitleaks", 2) | ||
| assertContains(t, gitleaks, `sha256sum -c -`, "gitleaks download checksum") | ||
| assertContains(t, gitleaks, `--log-opts='HEAD^1..HEAD^2'`, "gitleaks scans the PR's commits") |
There was a problem hiding this comment.
[LOW | coverage-gap | divisor-testing] The structure test pins the gitleaks scan range and the checksum-verified download but not the checkout's fetch-depth: 0 that makes HEAD^1..HEAD^2 resolvable — the same invariant the deleted detector test pinned (fetch-depth: 2). A regression that shrinks the fetch depth passes make check and surfaces only as a runtime gitleaks failure on the next chore PR.
| assertContains(t, gitleaks, `--log-opts='HEAD^1..HEAD^2'`, "gitleaks scans the PR's commits") | |
| assertContains(t, gitleaks, `--log-opts='HEAD^1..HEAD^2'`, "gitleaks scans the PR's commits") | |
| assertContains(t, gitleaks, "fetch-depth: 0", "gitleaks fetches full history for the commit scan") |
| # (repos/replicator.yml: "CI OK" and "Standardized CI / Run linters", | ||
| # not strict; the org code-repos ruleset requires the code owner's | ||
| # approval). protection: null has the Settings app remove the classic | ||
| # (repos/replicator.yml: "CI OK", not strict; the org code-repos |
There was a problem hiding this comment.
[LOW | operational-documentation | divisor-sre] The required-check transition is not atomic with this merge — the live safe-settings required set still includes Standardized CI / Run linters while this comment asserts repos/replicator.yml: "CI OK" as if live. After merge, a chore PR skips call-reusable-ci, so the still-required check never reports and the PR blocks until the safe-settings change lands. Spelling out the merge → safe-settings sequencing in this comment or the PR body makes the blocking window discoverable.
| - ignore: true | ||
| conditions: | ||
| - expr: | | ||
| ActionName == "jflowers/ship/.github/workflows/pr-scope.yml" && ActionVersion == "3b0ce8bf47183be402df9eaec16644c213eee5f7" |
There was a problem hiding this comment.
[LOW | coverage-gap | divisor-gaze-testing + divisor-testing] No test in internal/workflowtest/ reads .pinact.yaml, so the two-file invariant this rule creates — ci.yml's scope pin must match this rule's ActionVersion exactly — has no local pinning. A ship-pin bump that forgets the rule, widens it, or leaves a stale dead rule behind after moving to a released tag passes make check and fails only in Standardized CI's "Verify action versions" after push. Extending TestCIGatingWorkflows_StructureEnforcesChoreSkip to assert the rule's ActionVersion equals the SHA captured by shipScopeRE moves that failure to make check time.
| @@ -0,0 +1,17 @@ | |||
| # pinact configuration, read by Standardized CI's "Verify action versions" | |||
There was a problem hiding this comment.
[LOW | dependency-health | divisor-sre] The scope job pins an untagged commit on ship's main (# main, after v0.11.0), so the pin has no released tag to audit against and no version-comment provenance — an auditability gap rather than a reproducibility break (the SHA is immutable). Bumping to a ship release tag once one is cut, which lets this ignore rule stop matching, closes the gap.
Summary
Replaces
ci.yml's inline learnings-onlychangesdetector with jflowers/ship's sharedpr-scope.yml. It runs as ascopejob, pinned to3b0ce8bf(main, after v0.11.0). Itscodeoutput is'false'for two kinds of PR:.uf/dewey/learnings/*.mdfile.jflowers, branchchore/toolkit-*, every file under.opencode/.Pushes and everything else get
'true'.Changes:
ci.yml.ci_checks.ymlis deleted and itscall-reusable-cijob now lives inci.yml. The job name staysStandardized CI, so the check names (Standardized CI / Run lintersand the rest) don't change and release preflight still finds them onmain. With the job in the same workflow,CI OKcan need it. That letsCI OKcover it and be the only required check. A skipped reusable-workflow caller reports none of its inner check names, soStandardized CI / Run linterscan't stay required once that job can skip.Build and TestandStandardized CIrun only whenneeds.scope.outputs.code == 'true'.Gitleaksjob. It runs only on chore PRs (code == 'false') and scans the PR's commits (HEAD^1..HEAD^2). The gitleaks version is SHA-256 pinned and matches dewey and gaze. This replaces the secret scan chore PRs no longer get from MegaLinter's betterleaks.CI OK. It keeps itsalways()condition, which still exempts only a cancelled push run. It now fails unlessscopesucceeded and each job ended as scope chose:Build and TestandStandardized CIsucceed withGitleaksskipped for code, and the reverse for chores. Before, it accepted any mix of success and skipped.internal/workflowtest/ci_gating_test.go. Removes the tests of the deleted detector script, since ship owns and tests that classifier now. It now pins the new job graph and runs the verdict script against a truth table.AGENTS.mdCI Parity Gate and the.github/settings.ymlcomment are updated.This reverses CLS-FR-002 of
ci-skip-build-for-learnings, which said Standardized CI is never skipped. Chore PRs now skip MegaLinter, KICS and PR title validation. The newGitleaksjob keeps the secret scan for them.ci_dependencies.yml(dependency review) is left ungated. It is cheap, not required, and relevant to toolkit rollouts, which can change.opencode/package manifests.After merge, the org's safe-settings will make
CI OKthe only required check, droppingStandardized CI / Run linters.Related Issues
ci-skip-build-for-learningsReview Hints
go test ./internal/workflowtest/andactionlint .github/workflows/*.ymlpass locally.Standardized CI / Run lintersfrom the required checks, chore PRs will wait on it. Code PRs are unaffected.🤖 Generated with Claude Code