Audit dependencies on every pull request, not only those targeting master - #401
Conversation
…ster `dependency-security.yml` carried the same `pull_request: branches: [master]` filter #398 removed from `ci.yml`, so a pull request stacked on another branch got no `cargo-audit` or frontend dependency audit at all. It still reported a green mergeable state, because nothing required had failed -- the same shape of false green, in the workflow whose whole job is to tell you about an advisory. The cost of the gap is different from `ci.yml`'s, which is why it is worth fixing separately rather than living with. A missing test run delays a signal about code the PR contains. A missing dependency audit delays a signal about a published advisory that may already apply, and the delay lasts until the stack root merges -- so the advisory surfaces attached to whichever PR happens to land first, not to the one that introduced the dependency. `push` stays master-only for the reason `ci.yml` gives: a branch worth auditing has a pull request, and that is what triggers the run. `dependency-security.yml` is in the compatibility surface, so surface and matrix are resealed: one hash changed, pin set unchanged at 212 (set-compared against master, not counted), and the recorded sha256 matches the file's bytes. Verified with every exit status read directly: `reseal.sh --verify` exit 0; `check-ci-workflow-consistency.mjs` exit 0; compatibility gate passes; tools workspace 11 binaries, 53 passed, 0 failed. The workflow parses and keeps its single `audit` job, with `pull_request` now carrying only `types`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Review turned up one consequence worth recording before this merges. It is not a defect in the diff, and it does not block — but it is a real cost that this change widens, and it should be on the PR rather than only in a review transcript. Widening the trigger widens the blast radius of a failure mode that fired today.
This workflow still runs plain, non-differential So after this change, the next external advisory publication turns every open PR red rather than only master-targeting ones. Merging anyway, for two reasons:
The real fix is to wire |
Follow-up to #398, which fixed the identical filter in
ci.yml. A review of that PR flagged this file as carrying the same bug, unfixed.dependency-security.ymlfilteredpull_requesttobranches: [master], so a PR stacked on another branch got nocargo-auditand no frontend dependency audit at all — while still reporting a green mergeable state, because nothing required had failed. That is the same false green #398 describes, in the workflow whose entire job is to tell you about an advisory.Why this is worth its own change rather than living with
The cost differs from
ci.yml's. A missing test run delays a signal about code the PR contains — bounded by that PR. A missing dependency audit delays a signal about a published advisory that may already apply, and the delay runs until the stack root merges. The advisory then surfaces attached to whichever PR happens to land first, not to the one that introduced the dependency.pushstays master-only for the reasonci.ymlgives: a branch worth auditing has a pull request, and that is what triggers the run.Verification
Every exit status read directly, not through a pipe.
reseal.sh --verifycheck-ci-workflow-consistency.mjscompatibility_gate_passed:unknown_claims=11:evidenced_claims=0dependency-security.ymlis in the compatibility surface, so surface and matrix are resealed: one hash changed, pin set set-compared against master and unchanged at 212, and the recorded sha256 independently recomputed against the file's bytes. The workflow parses and keeps its singleauditjob, withpull_requestnow carrying onlytypes.Scope
Only the trigger. The audit job, its
permissions: contents: read, and its concurrency group are untouched. This workflow has nosecrets.*usage and ispull_request, notpull_request_target, so fork-PR exposure is unchanged — the same reasoning that held for #398.After this,
docs/proposed-merge-gate-ci.md:44-45is the last place the old pattern appears. It is a proposal doc rather than a live workflow, and arguably correct for a master-branch-protection gate specifically, so it is left alone here.🤖 Generated with Claude Code