fix(ci): tolerate upstream uv audit OSV parse failure#1423
Merged
sscargal merged 1 commit intoMay 20, 2026
Conversation
Temporarily skip the workflow when `uv audit` exits non-zero due to the upstream OSV/uv deserialization bug (astral-sh/uv#19492). The bad OSV record (PYSEC-2026-89 and similar) contains an empty `{}` in `affected.ranges.events`, which uv's strict Rust deserializer rejects, aborting the entire audit before vulnerabilities can be reported. The workflow now: - Captures uv audit's stderr separately and forwards it to the run log. - Detects the specific `error decoding response body` failure mode. - Emits a GitHub Actions ::warning:: annotation plus a Step Summary explaining what was skipped, why, and how to remove the shim. - Exits successfully so unrelated PRs aren't blocked while we wait for the upstream fix (astral-sh/uv#19496 or equivalent). All other uv audit error exit codes (>1) still fail loudly. Once the `setup-uv` version is bumped past 0.11.15 to a release containing the upstream fix, the workaround branch should be removed so future audit regressions surface immediately. Signed-off-by: Steve Scargall <37674041+sscargal@users.noreply.github.com>
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.
Summary
Stops the
Security Auditworkflow from blocking unrelated PRs while we wait for the upstream uv/OSV bug fix. When (and only when)uv auditexits non-zero with the specificerror decoding response bodyfailure, the workflow now:::warning::annotation plus a Step Summary explaining what was skipped, why, and how to remove the shim.has_vulnerabilities=falseso the downstream upgrade and PR-creation steps no-op cleanly.All other
uv auditexit codes >1 still fail loudly.Root cause (not in this repo)
Upstream: astral-sh/uv#19492. An OSV record (
PYSEC-2026-89and similar) contains an empty{}inaffected.ranges.events— invalid per OSV's schema. uv's strict Rust deserializer rejects the record, aborting the entire audit before any vulnerabilities can be reported. uv maintainers (@woodruffw) are deliberately holding back the lenient-parser fix (astral-sh/uv#19496) so OSV fixes the bad records upstream first.Locally reproducible against this repo's
uv.lock: 5/5 attempts fail with the same error, so this is not transient.Why a shim (and not pip-audit / waiting)
Considered alternatives:
pip-audit— robust, but requires re-implementing the JSON parse + upgrade loop around its different schema. Held in reserve if upstream takes weeks.uv audit --ignore <id>— does not help; uv's--ignorefilters after deserialization, and the parse aborts before filtering.--service-url— no maintained mirror exists.The shim is the smallest reversible change that keeps PRs unblocked. It is gated on a very specific error string so it does not silently swallow other failure modes.
Verification
Dispatched on this branch via
workflow_dispatch:Run security audit: emits##[warning]uv audit could not decode the OSV response (known upstream bug astral-sh/uv#19492)….Upgrade vulnerable packagesandCreate security fix pull request: both skipped (correct, becausehas_vulnerabilities=false).Run: https://github.com/sscargal/MemMachine/actions/runs/26188026375
How to remove this shim (resolution criteria)
When both of the following are true, delete the
grep -qF 'error decoding response body'branch in.github/workflows/security-audit.yml:uvrelease containingastral-sh/uv#19496(or an equivalent fix) is available.astral-sh/setup-uvversion:input is bumped to that release.The in-repo tracking issue (to be filed alongside this PR) lists the full analysis, root cause, ruled-out theories, possible workarounds, and the decision to wait for upstream.
Test plan
uv.lock(which triggers the OSV parse failure) — exits success with the warning annotationUpgrade vulnerable packages,Create security fix pull request) are skipped cleanly whenhas_vulnerabilities=falsesetup-uvversion:inputSigned-off-by: Steve Scargall 37674041+sscargal@users.noreply.github.com