Repository navigation
refactor(ci): move four repeated pre-model leg steps into scripts - #16002
Conversation
Each of these step bodies repeated across legs now lives once: - "Assert the gate and the resolver agree" (7 copies in pr-verify.yml, pr-verify-capture.yml and pr-rate-merge-risk.yml): .github/scripts/pr-verify/assert-gate-agrees.sh - "Read the checker's model" (3 merge-risk legs): .github/scripts/pr-merge-risk/read-checker-model.sh - "Prepare the working tree" (3 tidy legs, 3 changelog legs): .github/scripts/maintenance-tidy-code-upkeep/prepare-working-tree.sh and .github/scripts/upstream-apply-changelog/prepare-working-tree.sh Each of the 16 steps keeps its name, id, if: and env: and calls its script from main's checkout. The scripts set -eo pipefail, as the workflows' `shell: bash` step shell did, and hold their bodies verbatim but for shellcheck's [ ] to [[ ]] and shfmt's layout. Drop the three dead `rm -rf` lines before the key's credit-stop marker in the merge-risk, tidy and changelog key legs: no earlier step writes the directory, and each job starts with an empty runner.temp. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 050a1110ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-security-review reviewed Security review (incremental): no findingsI reviewed only what changed since What changed. Six "Prepare the working tree" steps used to run What I checked.
No manifest or critical-findings: 0 |
|
claude-review reviewed Incremental code review:
|
…ckout In the tidy and changelog model legs, "Check out main with history" checks main out at the workspace root just before "Prepare the working tree", which replaces the earlier .base checkout. Calling `bash .base/.github/scripts/<lane>/prepare-working-tree.sh` there found no file (exit 127), so prepare failed and the model step skipped. Call the script from the root checkout instead: it is the same needs.gate.outputs.base-sha main commit, still read before any model step. The other ten calls run in jobs with no root checkout before them, where .base is still present. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Post-merge mutation testingKilled 0, survived 7, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
Closes #15964
session: Simplify E2 B
Summary
Four repeated pre-model leg steps now each live in one script under
.github/scripts/, and the three dead credit-markerrm -rflines are gone. This is part of restructuring pass #15695. Behavior is unchanged.Fix
pr-verify.yml,pr-verify-capture.ymlandpr-rate-merge-risk.yml. It now lives in.github/scripts/pr-verify/assert-gate-agrees.sh..github/scripts/pr-merge-risk/read-checker-model.sh.prepare-working-tree.shunder.github/scripts/maintenance-tidy-code-upkeep/and.github/scripts/upstream-apply-changelog/.id,if:andenv:, and itsrun:is now onebashline.bash .base/.github/scripts/<dir>/<script>.sh: the 7 gate assertions and the 3 checker-model reads.bash .github/scripts/<lane>/prepare-working-tree.shinstead. The issue's.base/form fails there, because "Check out main with history" replaces.basewith a root checkout just before the step. That checkout is the sameneeds.gate.outputs.base-shamain commit, and it still comes before the model step.rm -rflines: droppedrm -rf "${RUNNER_TEMP:?}/key-credit-stop"from the key legs of merge-risk, tidy and changelog. No earlier step writes that directory, andrunner.tempstarts empty in each job.#!/usr/bin/env bashline and holds its step body verbatim.set -eo pipefail, without-u. All five workflows setdefaults.run.shell: bash, which runs steps asbash -eo pipefail, and a script called withbashinherits neither flag.# shellcheck disable=SC2154with its reason, aspr-verify/chunk-diff.shdoes.[ ]tests became[[ ]](SC2292). Every operand is quoted, so the comparisons stay literal.{ …; exit 1; }groups.Verification
HEADand on the branch and compared them as JSON with the 16 targetedrun:values and the 3rmlines taken out. All five are equal. Every targeted step'srun:is its one-line script call.bash -eo pipefail -cand each new script ran against an identical scratch repo with a trackedCLAUDE.md,AGENTS.md,.mcp.json,.claude/**, nested copies and a staged plugin. The harness compared stdout, stderr, exit code,GITHUB_OUTPUT, the commit identity, the exclude file,git ls-files -v(skip-worktree flags), the file list,.lanemodes and the changelog prompt. All 12 cases were identical:.baseabsent, the.base/path exits 127 and the root path exits 0.shellcheck --rcfile .shellcheckrcandshfmt -d(the repo's.editorconfig) are clean on all four scripts.scripts/check-affected.shpassed 11 and skipped 5 over the 9 changed files.scripts/run-test-file.sh. Among them, the leg-equality and step-order tests inpr-verify/workflow.test.mjs,pr-merge-risk/workflow.test.mjs, thecredential-legstests andcallers.test.mjs.cache-modeandconcurrency.queuekeys it does not know.check-artifact-retention.mjsmatches 152 upload steps..githubsuite, under the one-suite-per-machine rule.Related
Follow-ups
🤖 Generated with Claude Code