Repository navigation
fix(audit): exit non-zero when vulnerabilities remain after ignoring - #17342
Conversation
`pnpm audit --ignore` and `pnpm audit --ignore-unfixable` returned exit code 0 right after writing the ignore list, so CI passed even when vulnerabilities that were not ignored remained. Both CLIs now remove every GHSA in the merged ignore list from the report and apply the same audit-level check a plain `pnpm audit` uses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Rust CLI audit outcome pnpm/crates/cli/src/cli_args/audit/advisories.rs, pnpm/crates/cli/src/cli_args/audit/fix.rs, pnpm/crates/cli/src/cli_args/audit.rs, pnpm/crates/cli/tests/suite/audit/fixes.rs, pnpm/docs/cli/audit.md |
The Rust CLI removes ignored GHSA advisories before determining the audit outcome. The ignore operation returns its summary and persisted ignore IDs. Tests cover --ignore, --ignore-unfixable, and audit-level behavior. |
pnpm 11 audit outcome pnpm11/deps/compliance/commands/src/audit/audit.ts, pnpm11/deps/compliance/commands/test/audit/ignore.ts, pnpm11/docs/cli/audit.md, .changeset/audit-ignore-exit-code.md |
The audit command uses a shared audit-level filter to determine its exit code after removing ignored advisories. Tests and documentation cover the updated exit behavior, and the changeset declares patch releases. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested labels: product: pacquet, product: pnpm@11
Merge Risk: 
Minimal · up to 00eae
-
Ignored advisories are removed before the audit-level check, so remaining vulnerabilities correctly produce a non-zero exit code.
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
🔧 ESLint
-
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Execution Profiles recorded for 1 job, triggered by
+3 −1 ·
|
Micro-Benchmark ResultsLinux |
Same-run regression checkHEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval. Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.
Integrated-Benchmark Report (Linux)Commit: Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs. Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.41584390898,
"stddev": 0.10495070739137353,
"median": 2.3731436934800003,
"user": 2.2032104599999998,
"system": 1.9668928599999997,
"min": 2.30075448348,
"max": 2.64311427848
},
{
"command": "pacquet@main",
"mean": 2.5626592605800003,
"stddev": 0.11923234256838658,
"median": 2.58298008448,
"user": 2.3689805599999993,
"system": 2.07833766,
"min": 2.34519927948,
"max": 2.71648283348
},
{
"command": "pnpr@HEAD",
"mean": 1.6604342569799997,
"stddev": 0.143305386052531,
"median": 1.63026797698,
"user": 2.32241516,
"system": 2.1671997600000004,
"min": 1.48914495648,
"max": 1.9508206094799998
},
{
"command": "pnpr@main",
"mean": 1.59948770378,
"stddev": 0.12403581004515515,
"median": 1.56270803198,
"user": 2.2942212599999996,
"system": 2.11120616,
"min": 1.44724740848,
"max": 1.78909530448
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.35372534978000003,
"stddev": 0.034420681493631075,
"median": 0.34303309618000005,
"user": 0.42122393999999996,
"system": 0.8093272199999999,
"min": 0.30786991518000006,
"max": 0.41282117318000006
},
{
"command": "pacquet@main",
"mean": 0.39876920148,
"stddev": 0.035683953628151036,
"median": 0.38976803618000005,
"user": 0.44961754000000004,
"system": 0.91116732,
"min": 0.35801518218000006,
"max": 0.46176075218000007
},
{
"command": "pnpr@HEAD",
"mean": 0.38761792608000006,
"stddev": 0.020730518483954716,
"median": 0.38962940668,
"user": 0.43215994,
"system": 0.8510778200000001,
"min": 0.35595178918000003,
"max": 0.41220860218000005
},
{
"command": "pnpr@main",
"mean": 0.41715898728,
"stddev": 0.033411527617918914,
"median": 0.41409535368000006,
"user": 0.45593074,
"system": 0.8922314199999999,
"min": 0.37612418518000007,
"max": 0.47188649718000003
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009018638062524922,
"stddev": 0.0007390893180809596,
"median": 0.008765308820000001,
"user": 0.004631872026578073,
"system": 0.005316190631229238,
"min": 0.008227333820000002,
"max": 0.013245807820000002
},
{
"command": "pacquet@main",
"mean": 0.008727254830489509,
"stddev": 0.000693306296364563,
"median": 0.008526118820000001,
"user": 0.004733500979020979,
"system": 0.004868771538461538,
"min": 0.008055616820000002,
"max": 0.012382431820000001
},
{
"command": "pnpr@HEAD",
"mean": 0.009042973916463025,
"stddev": 0.0011432491501913633,
"median": 0.00869331182,
"user": 0.004324414147909971,
"system": 0.005639580643086817,
"min": 0.008229288820000001,
"max": 0.02125677082
},
{
"command": "pnpr@main",
"mean": 0.009120311981403515,
"stddev": 0.0010608530507055256,
"median": 0.008679129820000001,
"user": 0.004594374736842105,
"system": 0.00546612554385965,
"min": 0.00819403282,
"max": 0.014129415820000001
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.01855737074634145,
"stddev": 0.006511955429818792,
"median": 0.0166877012,
"user": 0.009812807317073178,
"system": 0.010290187317073167,
"min": 0.0106552982,
"max": 0.0418224922
},
{
"command": "pacquet@main",
"mean": 0.01263972472760736,
"stddev": 0.0018406337932977883,
"median": 0.012195545200000001,
"user": 0.006953565030674843,
"system": 0.00687744662576687,
"min": 0.010076751200000001,
"max": 0.021862080199999998
},
{
"command": "pnpr@HEAD",
"mean": 0.012207758627350431,
"stddev": 0.0020882646002862056,
"median": 0.011615573200000001,
"user": 0.0069921444444444435,
"system": 0.0064598666666666645,
"min": 0.009689833200000001,
"max": 0.0219597842
},
{
"command": "pnpr@main",
"mean": 0.013361846583886257,
"stddev": 0.0016998236741110834,
"median": 0.0131251022,
"user": 0.007542903791469191,
"system": 0.0071414654028436,
"min": 0.0104776942,
"max": 0.022531580199999998
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.48479704896,
"stddev": 0.017902666772172438,
"median": 2.48845359086,
"user": 2.09793098,
"system": 1.6839514999999998,
"min": 2.45587422036,
"max": 2.50662254536
},
{
"command": "pacquet@main",
"mean": 2.4760702364599996,
"stddev": 0.029429496947227764,
"median": 2.47609800736,
"user": 2.07216588,
"system": 1.6209211999999997,
"min": 2.43594166236,
"max": 2.51884234636
},
{
"command": "pnpr@HEAD",
"mean": 1.5103813571599995,
"stddev": 0.1451316070242318,
"median": 1.46568301836,
"user": 1.5762841799999998,
"system": 1.4021927,
"min": 1.33506338736,
"max": 1.73169305936
},
{
"command": "pnpr@main",
"mean": 1.4820231157600001,
"stddev": 0.08981302338579515,
"median": 1.49192185836,
"user": 1.63762038,
"system": 1.3691935000000002,
"min": 1.3570753953599999,
"max": 1.66547294936
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.55900801926,
"stddev": 0.07107028665724177,
"median": 0.53590078046,
"user": 0.76292466,
"system": 1.31520796,
"min": 0.48166562296000004,
"max": 0.68842428596
},
{
"command": "pacquet@main",
"mean": 0.56168297196,
"stddev": 0.06360822543220618,
"median": 0.5288701529600001,
"user": 0.7424641599999998,
"system": 1.4146752599999999,
"min": 0.48822810096,
"max": 0.66434372296
},
{
"command": "pnpr@HEAD",
"mean": 0.33451595556,
"stddev": 0.005027615109279069,
"median": 0.33401424146,
"user": 0.27951086,
"system": 0.7588957599999999,
"min": 0.32648954196,
"max": 0.34139057096000003
},
{
"command": "pnpr@main",
"mean": 0.33071828776,
"stddev": 0.008867418331609629,
"median": 0.33027517196,
"user": 0.27586296,
"system": 0.76578246,
"min": 0.31909281296,
"max": 0.35313332896
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.57972966552,
"stddev": 0.018770376106662667,
"median": 1.5761505630200001,
"user": 0.7235292400000001,
"system": 0.9502165799999999,
"min": 1.5456359445199999,
"max": 1.61535796052
},
{
"command": "pacquet@main",
"mean": 1.5738227869199999,
"stddev": 0.01405252073418863,
"median": 1.5756552360199998,
"user": 0.71877124,
"system": 0.93783408,
"min": 1.54909282652,
"max": 1.5941581715200002
},
{
"command": "pnpr@HEAD",
"mean": 0.26397881302,
"stddev": 0.00792661943408409,
"median": 0.26305749952,
"user": 0.19725324000000002,
"system": 0.53307608,
"min": 0.25477370352000006,
"max": 0.27861779252
},
{
"command": "pnpr@main",
"mean": 0.26179790482000004,
"stddev": 0.003423552634921611,
"median": 0.26141873302000007,
"user": 0.20679683999999998,
"system": 0.5191582799999999,
"min": 0.25595027552000005,
"max": 0.26884458352000007
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.24786614991999997,
"stddev": 0.01644244186289335,
"median": 0.24489334312000002,
"user": 0.20548171999999995,
"system": 0.28230108,
"min": 0.22117146362000004,
"max": 0.27343762062000004
},
{
"command": "pacquet@main",
"mean": 0.24364728470333338,
"stddev": 0.016500231353598568,
"median": 0.24977105162000002,
"user": 0.19754083666666666,
"system": 0.28247338,
"min": 0.21381323162000002,
"max": 0.27169371962000005
},
{
"command": "pnpr@HEAD",
"mean": 0.08969699065030304,
"stddev": 0.002889029644293991,
"median": 0.08964648662000001,
"user": 0.029800056363636366,
"system": 0.023163773939393943,
"min": 0.08575409662,
"max": 0.09671082562
},
{
"command": "pnpr@main",
"mean": 0.08926267939419355,
"stddev": 0.003303122087729936,
"median": 0.08777008762,
"user": 0.031119129677419352,
"system": 0.021887819354838706,
"min": 0.08560990562,
"max": 0.09866405762
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.19732358552444448,
"stddev": 0.007516639021879331,
"median": 0.19467719308000003,
"user": 0.20757590444444443,
"system": 0.048279851111111105,
"min": 0.19048419308000003,
"max": 0.21438946908000003
},
{
"command": "pacquet@main",
"mean": 0.1968224498577778,
"stddev": 0.010653137553265015,
"median": 0.20127307108000003,
"user": 0.21136190444444444,
"system": 0.04088796222222221,
"min": 0.18199303408000003,
"max": 0.21390042908
},
{
"command": "pnpm@HEAD",
"mean": 3.940969169524444,
"stddev": 0.13306962033864334,
"median": 3.94025892908,
"user": 6.211814015555556,
"system": 0.3719848511111111,
"min": 3.76536944908,
"max": 4.13168503408
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.10136553647333334,
"stddev": 0.015793589160443235,
"median": 0.09590156034,
"user": 0.09396368666666666,
"system": 0.06625151333333332,
"min": 0.08629804184,
"max": 0.16027821684000002
},
{
"command": "pacquet@main",
"mean": 0.12303975106727273,
"stddev": 0.02369687052977657,
"median": 0.11338459334,
"user": 0.11232092909090909,
"system": 0.08585073454545454,
"min": 0.09979922884,
"max": 0.20196406784
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.09406035230000002,
"stddev": 0.004819928103386242,
"median": 0.09288390030000002,
"user": 0.031017313333333327,
"system": 0.07099076,
"min": 0.0862813483,
"max": 0.10746846730000001
},
{
"command": "pacquet@main",
"mean": 0.09267982755000002,
"stddev": 0.0036049739696407544,
"median": 0.0924217403,
"user": 0.03503358625,
"system": 0.06536472874999999,
"min": 0.08792176430000001,
"max": 0.10245823230000001
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.5069028512800005,
"stddev": 0.17796420084703773,
"median": 4.4568452797800004,
"user": 1.8134050799999997,
"system": 1.57984434,
"min": 4.32716927178,
"max": 4.75706801878
},
{
"command": "pacquet@main",
"mean": 4.43585681778,
"stddev": 0.12264626525165674,
"median": 4.36947996628,
"user": 1.8957307799999998,
"system": 1.5124032399999998,
"min": 4.30962179678,
"max": 4.60734110878
},
{
"command": "pnpr@HEAD",
"mean": 3.50591125528,
"stddev": 0.09565425993773424,
"median": 3.48086071178,
"user": 1.79255128,
"system": 1.48358414,
"min": 3.40741811178,
"max": 3.65866558678
},
{
"command": "pnpr@main",
"mean": 3.53037481828,
"stddev": 0.09818398044642351,
"median": 3.50905745478,
"user": 1.83475938,
"system": 1.5344139399999999,
"min": 3.41134492778,
"max": 3.6788032747800004
}
]
}Scenario: GVS linker: fresh restore, hot cache + hot storeSame install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.19969920643000003,
"stddev": 0.013811566904401582,
"median": 0.19632185168000002,
"user": 0.25632465333333326,
"system": 0.21728361,
"min": 0.18314428418,
"max": 0.23565907718
},
{
"command": "pacquet@main",
"mean": 0.19557482139428567,
"stddev": 0.022188634641648396,
"median": 0.19394018468000002,
"user": 0.24272053428571422,
"system": 0.21370778857142855,
"min": 0.16801680018,
"max": 0.26277782818
},
{
"command": "pnpr@HEAD",
"mean": 0.2230811763466667,
"stddev": 0.011797043387274293,
"median": 0.22181540168000002,
"user": 0.2779709033333333,
"system": 0.20314077666666663,
"min": 0.20557078318000002,
"max": 0.24972644718
},
{
"command": "pnpr@main",
"mean": 0.23386585545272728,
"stddev": 0.0222251401566607,
"median": 0.23381115518,
"user": 0.2733005472727273,
"system": 0.24353635999999998,
"min": 0.17734233018,
"max": 0.25758643317999996
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.1462451970999998,
"stddev": 0.012355587801821898,
"median": 1.1468406059,
"user": 0.4412437799999999,
"system": 0.21896776000000004,
"min": 1.1180170954,
"max": 1.1651825294
},
{
"command": "pacquet@main",
"mean": 1.1447705287999999,
"stddev": 0.016482631922507422,
"median": 1.1393329499,
"user": 0.44154547999999993,
"system": 0.21467676,
"min": 1.1251112944,
"max": 1.1777681434
}
]
}Scenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.0276363709659406,
"stddev": 0.0008299771905652247,
"median": 0.02747173956,
"user": 0.01868054673267326,
"system": 0.01699261386138613,
"min": 0.02675566456,
"max": 0.03340527056
},
{
"command": "pacquet@main",
"mean": 0.027516981017142866,
"stddev": 0.0012726592787759648,
"median": 0.02715226956,
"user": 0.020276858095238097,
"system": 0.014945166476190477,
"min": 0.026444899560000002,
"max": 0.03499710056
}
]
} |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #17342 +/- ##
========================================
Coverage 92.62% 92.62%
========================================
Files 1882 1884 +2
Lines 242997 243227 +230
========================================
+ Hits 225065 225296 +231
+ Misses 17932 17931 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review Written by an agent (Claude Code, claude-opus-5-5). |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoFix audit exit codes after ignoring vulnerabilities
AI Description
Diagram
High-Level Assessment
Files changed (9)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Qodo summary findings:
Written by an agent (Claude Code, claude-opus-5-5). |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Code review by qodo was updated up to the latest commit 00eae87 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
pnpm audit --ignore <id>andpnpm audit --ignore-unfixablereturned exit code 0 right after writing the ignore list, so CI passed even when vulnerabilities that were not ignored remained. Both CLIs now exit with code 1 when, after ignoring, an advisory at or above the audit level remains. This is the same rule a plainpnpm auditapplies.Part of pnpm/tasks#191
--ignore-unfixableis every advisory with no patched version.--jsonstill prints the ignore message, not a report, in both CLIs. Only the exit code changes.--fixis unchanged. It takes precedence over--ignorein both CLIs.Squash Commit Body
Checklist
are implemented in every affected version.
exitCode: 0/AuditOutcome::Clean. Each exit-0 test fails if theignored advisories are not removed before the threshold check.
Written by an agent (Claude Code, claude-opus-5-5).
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit
pnpm auditnow exits with a non-zero status when vulnerabilities at or above the configured audit level remain after using--ignoreor--ignore-unfixable. Vulnerabilities below the configured level do not cause a failure, and the command succeeds when no qualifying vulnerabilities remain.