fix(ci): treat retired pnpm audit endpoint as skip, not a dependency issue#6466
Merged
Conversation
…issue npm retired the legacy pnpm audit endpoints (/-/npm/v1/security/audits and .../audits/quick); they now return HTTP 410 with a body directing callers to the bulk advisory endpoint. pnpm v10 still calls the legacy path, so `pnpm audit` exits non-zero even when no advisory exists. `xtask deps --web` only inspected the exit code, so it counted each of the three frontend dirs (web / dashboard / docs) as a dependency issue and failed the Security job with "3 dependency issue(s) found". Because the job runs on any Rust/CI change, main went red on every push regardless of the diff under test (#6455, #6456, #6457 all inherited it). run_pnpm_audit now captures the combined stdout+stderr and classifies the outcome: a genuine advisory still fails the build, but the retired-endpoint signature (ERR_PNPM_AUDIT_BAD_RESPONSE / "endpoint is being retired" / an audit-context 410) is warned and skipped rather than counted. An audit-infrastructure outage no longer reads as a vulnerability. Restoring real frontend advisory coverage requires a pnpm version that speaks the bulk advisory endpoint and is out of scope here. Closes #6462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mainis red. TheSecurityCI job fails atRun security auditon every push that touches Rust or CI, unrelated to the diff under test — #6455, #6456, and #6457 all inherited it (tracked by the auto-filed #6462).Root cause is not a dependency vulnerability. npm retired the legacy
pnpm auditendpoints:pnpm v10 (pinned in CI) still calls the legacy path, so
pnpm auditexits non-zero even when there is no advisory.xtask deps --webonly inspected the exit code, so it counted each of the three frontend dirs (web/dashboard/docs) as a dependency issue →Error: 3 dependency issue(s) found→ exit 1.cargo auditon the Rust side passes cleanly ("no vulnerabilities found"); the failure is entirely the retired audit API.Fix
run_pnpm_audit(xtask/src/deps.rs) now captures the combined stdout+stderr instead of only the exit code and returns a three-wayPnpmAuditOutcome:Clean— pnpm reported no advisories (or no manifest present).Vulnerable— a genuine advisory; still incrementsissuesand fails the build, unchanged.Skipped— the retired-endpoint signature (ERR_PNPM_AUDIT_BAD_RESPONSE,endpoint is being retired, or an audit-contextresponded with 410); warned and not counted against the build.An audit-infrastructure outage no longer reads as a vulnerability, while real advisories fail exactly as before. This also removes the broader "audit service down ⇒ CI red" fragility class, not just today's instance.
Verification
cargo check -p xtask— cleancargo clippy -p xtask --all-targets -- -D warnings— zero warningscargo test -p xtask deps::— 6/6 passcargo fmt -p xtask -- --check— cleanSix unit tests cover the classifier against the verbatim CI 410 body (both the two-endpoint
web/dashboardvariant and the single-endpointdocsvariant), case-insensitivity, a real advisory table (must still fail), clean output, and an unrelated non-audit 410 (must not be swallowed).Out-of-scope follow-up
This restores CI to green; it does not restore real frontend advisory coverage — with pnpm v10 hitting the retired endpoint, all three dirs currently land on
Skipped. Regaining live coverage needs a pnpm version that speaks the bulk advisory endpoint (orpnpm audit --jsonagainst the new API), which is a frontend-toolchain change in a different domain. Flagging for a maintainer rather than bundling it here.Closes #6462