Repository navigation
fix(audit): correct patched version ranges against actually published versions - #13832
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Important Approval pendingCodeRabbit has no unresolved comments, but it has not reviewed the latest commit. Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.
📝 WalkthroughWalkthroughAudit now validates inferred patched versions against published registry versions. Unpublished versions are removed from audit results and do not create overrides or ChangesPublished patched-version validation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant AuditCommand
participant PublishTimeValidator
participant Registry
participant AuditFix
AuditCommand->>PublishTimeValidator: pass audit advisories
PublishTimeValidator->>Registry: fetch package publish-time metadata
Registry-->>PublishTimeValidator: published version map
PublishTimeValidator->>PublishTimeValidator: match patched ranges
PublishTimeValidator-->>AuditCommand: filtered advisories
AuditCommand->>AuditFix: pass shared publish-time data
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Confidence Score: 3/5The PR is not yet safe to merge because exact-version age exclusions can miss the version selected by a caret override, and Rust update remediation can still advertise a fix outside the dependency's selectable range. The current TypeScript fix path exempts only one published version even though its override may resolve to another fresh version, while the Rust update path does not constrain resolution to the published version advertised by the corrected report; both previously reported installation failures remain reachable. Files Needing Attention: pnpm11/deps/compliance/commands/src/audit/fix.ts; pnpm/crates/cli/src/cli_args/audit/fix.rs Reviews (12): Last reviewed commit: "fix(audit): match deprecations on the pa..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13832 +/- ##
========================================
Coverage 88.15% 88.15%
========================================
Files 644 644
Lines 106710 106818 +108
========================================
+ Hits 94074 94170 +96
- Misses 12636 12648 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Caution CodeRabbit couldn't update its existing comment. The review summary may be out of date. Error details |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
pnpm/crates/cli/src/cli_args/audit.rs (1)
247-251: 🚀 Performance & Scalability | 🔵 Trivial | 🏗️ Heavy liftReuse publish-time maps across audit fix processing.
The validator fetches each packument and discards the result. The minimum-release-age flow then fetches the same packument again. This doubles registry traffic and serial request latency for
audit --fixwithminimumReleaseAge.
pnpm/crates/cli/src/cli_args/audit.rs#L247-L251: return the fetchedOption<HashMap<String, String>>values with the normalization result.pnpm/crates/cli/src/cli_args/audit/fix.rs#L198-L208: consume the pre-fetched map while preserving theNonefail-open distinction.pnpm/crates/cli/tests/suite/audit.rs#L731-L741: change the old-patch fixture to expect one packument request.pnpm/crates/cli/tests/suite/audit.rs#L839-L847: change the multi-advisory fixture to expect one packument request.As per path instructions, “Avoid unnecessary registry requests.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/cli_args/audit.rs` around lines 247 - 251, Reuse fetched publish-time packument maps through audit fix processing instead of refetching them: update drop_unsatisfiable_patched_versions in pnpm/crates/cli/src/cli_args/audit.rs:247-251 to return the fetched Option<HashMap<String, String>> values with the normalization result, and update the audit fix flow in pnpm/crates/cli/src/cli_args/audit/fix.rs:198-208 to consume those maps while preserving None as the fail-open case. Update the old-patch and multi-advisory fixtures in pnpm/crates/cli/tests/suite/audit.rs:731-741 and pnpm/crates/cli/tests/suite/audit.rs:839-847 to expect one packument request.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm/crates/cli/src/cli_args/audit.rs`:
- Around line 516-523: The `fix_published` logic in the audit version-time
handling must fail open for invalid non-metadata keys: parse every key as a
`Result`, retain `advisory.patched_versions` if any parse fails, and set it to
`None` only when all keys parse successfully and none satisfies `range`. Apply
the same behavior in `publishTimes.ts` and add corresponding regression tests.
In `@pnpm/crates/cli/src/cli_args/audit/render.rs`:
- Line 81: Add a regression test alongside the existing text-report rendering
test, configuring the advisory’s patched_versions field to None and asserting
that the rendered table displays “Patched versions” with the value “None.”
In `@pnpm11/deps/compliance/commands/src/audit/audit.ts`:
- Around line 248-250: Update the audit flow around
dropUnsatisfiablePatchedVersions so advisories are first filtered according to
the selected operation’s auditLevel, ignoreGhsas, and fix eligibility, then
validate patched versions only for that selected set. Preserve report and fix
behavior while avoiding registry requests for advisories that cannot affect the
operation.
In `@pnpm11/deps/compliance/commands/src/audit/publishTimes.ts`:
- Around line 76-85: In publishTimes.ts, update the version-key evaluation
around getPublishTimes so unparsable non-created/modified keys are treated as
unknown metadata: retain patched_versions rather than clearing it, while
preserving the existing satisfiesSafe behavior for valid versions. Apply the
corresponding retention behavior in fix.ts, and add regression coverage in
commands/test/audit/fix.ts for both the TypeScript report flow and Rust
age-exclusion flow; changes are required at
pnpm11/deps/compliance/commands/src/audit/publishTimes.ts:76-85,
pnpm11/deps/compliance/commands/src/audit/fix.ts:99-102, and
pnpm11/deps/compliance/commands/test/audit/fix.ts:367-383.
---
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/audit.rs`:
- Around line 247-251: Reuse fetched publish-time packument maps through audit
fix processing instead of refetching them: update
drop_unsatisfiable_patched_versions in
pnpm/crates/cli/src/cli_args/audit.rs:247-251 to return the fetched
Option<HashMap<String, String>> values with the normalization result, and update
the audit fix flow in pnpm/crates/cli/src/cli_args/audit/fix.rs:198-208 to
consume those maps while preserving None as the fail-open case. Update the
old-patch and multi-advisory fixtures in
pnpm/crates/cli/tests/suite/audit.rs:731-741 and
pnpm/crates/cli/tests/suite/audit.rs:839-847 to expect one packument request.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: bae18e81-e7cb-44ca-b5e7-cf4de818c269
📒 Files selected for processing (11)
.changeset/audit-fix-age-excludes-unpublished-versions.mdpnpm/crates/cli/src/cli_args/audit.rspnpm/crates/cli/src/cli_args/audit/fix.rspnpm/crates/cli/src/cli_args/audit/render.rspnpm/crates/cli/src/cli_args/audit/tests.rspnpm/crates/cli/tests/suite/audit.rspnpm11/deps/compliance/audit/src/index.tspnpm11/deps/compliance/commands/src/audit/audit.tspnpm11/deps/compliance/commands/src/audit/fix.tspnpm11/deps/compliance/commands/src/audit/publishTimes.tspnpm11/deps/compliance/commands/test/audit/fix.ts
There was a problem hiding this comment.
Pull request overview
Ensures pnpm audit and pnpm audit --fix don’t claim or act on “patched versions” that were never published by verifying the inferred patched range against the registry packument, and aligning this behavior across the TypeScript CLI and the Rust (pacquet) port.
Changes:
- Verify inferred
patched_versionsagainst published versions and drop the range when no published version satisfies it (so the report can show no available fix). - Skip writing
minimumReleaseAgeExclude(and related fix artifacts) when the minimum patched version is absent from a successfully fetched packument (i.e. unpublished). - Add/adjust TS + Rust test coverage and ship a changeset for the user-facing behavior change.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm11/deps/compliance/commands/test/audit/fix.ts | Adds tests to ensure --fix doesn’t write overrides/age-excludes for unpublished patched versions. |
| pnpm11/deps/compliance/commands/src/audit/publishTimes.ts | Adds dropUnsatisfiablePatchedVersions and publish-time fetching support used for patched-range validation. |
| pnpm11/deps/compliance/commands/src/audit/fix.ts | Updates minimumReleaseAgeExclude generation to treat missing versions in fetched packuments as “unpublished”. |
| pnpm11/deps/compliance/commands/src/audit/audit.ts | Runs the new patched-range validation before reporting/fixing; updates patched version rendering. |
| pnpm11/deps/compliance/audit/src/index.ts | Exports satisfiesSafe for reuse in patched-range validation. |
| pnpm/crates/cli/tests/suite/audit.rs | Adds/updates pacquet e2e tests for unpublished patch behavior and packument-fetch expectations. |
| pnpm/crates/cli/src/cli_args/audit/tests.rs | Adjusts unit tests for minimum-release-age exclusion logic and adds coverage for unpublished versions. |
| pnpm/crates/cli/src/cli_args/audit/render.rs | Updates patched version rendering in Rust output. |
| pnpm/crates/cli/src/cli_args/audit/fix.rs | Updates Rust age-exclude logic to skip unpublished versions; exposes packument time fetcher for reuse. |
| pnpm/crates/cli/src/cli_args/audit.rs | Adds Rust-side patched-range validation (drop_unsatisfiable_patched_versions) before rendering/fixing. |
| .changeset/audit-fix-age-excludes-unpublished-versions.md | Release note + version bumps for TS CLI + pacquet parity. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
cf9302c to
41d30f4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (2)
pnpm11/deps/compliance/commands/src/audit/audit.ts:369
- Rendering
patched_versionsasNonewhen the field isundefinedconflates two different cases. In@pnpm/deps.compliance.auditthe inference can returnundefinedwhen the patched range cannot be inferred fromvulnerable_versions(seeinferPatchedVersionscomment inpnpm11/deps/compliance/audit/src/index.ts), which is closer to “unknown” than “no fix”. With this change, advisories with non-inferable fixes will now be reported as having no patched versions.
Consider keeping (unknown) (or similar) for the “could not infer” case, while still showing None specifically when an inferred range was dropped by dropUnsatisfiablePatchedVersions. That likely requires carrying an explicit marker for “dropped as unpublished” rather than overloading undefined.
['Package', advisory.module_name],
['Vulnerable versions', advisory.vulnerable_versions],
['Patched versions', advisory.patched_versions ?? 'None'],
[
pnpm/crates/cli/src/cli_args/audit/render.rs:82
- This renders missing
patched_versionsasNone, butpatched_versions == Nonecan also mean the patched range could not be inferred (not necessarily that there is no fix). That makes the report potentially misleading for advisories where inference fails.
Consider rendering an “unknown” label for the “cannot infer” case, while still rendering None specifically when an inferred range was dropped because no published version satisfies it. This likely needs an explicit marker for “dropped as unpublished” rather than overloading None.
.push_record(vec!["Vulnerable versions".to_string(), advisory.vulnerable_versions.clone()]);
builder.push_record(vec![
"Patched versions".to_string(),
advisory.patched_versions.clone().unwrap_or_else(|| "None".to_string()),
]);
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. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.6000861640000004,
"stddev": 0.19077370919718883,
"median": 2.5528686449,
"user": 1.6296920799999999,
"system": 1.62718248,
"min": 2.3854455099000003,
"max": 2.8493317199000003
},
{
"command": "pacquet@main",
"mean": 2.6316150901000004,
"stddev": 0.1615231760671021,
"median": 2.6881056054,
"user": 1.4517761799999997,
"system": 1.49082318,
"min": 2.3134736589,
"max": 2.7787123819
},
{
"command": "pnpr@HEAD",
"mean": 1.6476524287999996,
"stddev": 0.05190495170403015,
"median": 1.6511596029,
"user": 1.17768308,
"system": 1.23998658,
"min": 1.5775958289,
"max": 1.7444472308999999
},
{
"command": "pnpr@main",
"mean": 1.5269871590999997,
"stddev": 0.1215766989629595,
"median": 1.5509793124,
"user": 1.0732794799999996,
"system": 1.21739308,
"min": 1.2915898779,
"max": 1.6734814979
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2619818318600001,
"stddev": 0.008030345063135633,
"median": 0.26027869346,
"user": 0.20016946,
"system": 0.48121973999999995,
"min": 0.24790313396000002,
"max": 0.27967044896000004
},
{
"command": "pacquet@main",
"mean": 0.2637805490600001,
"stddev": 0.010618809851295354,
"median": 0.25940454046000005,
"user": 0.20715096000000002,
"system": 0.46550193999999995,
"min": 0.25543151796,
"max": 0.28828449296
},
{
"command": "pnpr@HEAD",
"mean": 0.26559189156000007,
"stddev": 0.009691919158122066,
"median": 0.26376822246000003,
"user": 0.21042435999999998,
"system": 0.47427063999999997,
"min": 0.25462914996,
"max": 0.28713059196
},
{
"command": "pnpr@main",
"mean": 0.26136023246000006,
"stddev": 0.007430713562492839,
"median": 0.26145048846,
"user": 0.19796966000000002,
"system": 0.47626694,
"min": 0.25036184496,
"max": 0.27663859996000006
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.006178230741642513,
"stddev": 0.0003228035178612183,
"median": 0.00613672386,
"user": 0.004189119613526572,
"system": 0.00203488768115942,
"min": 0.00560252036,
"max": 0.00831568236
},
{
"command": "pacquet@main",
"mean": 0.006272905398095234,
"stddev": 0.0004336526633670376,
"median": 0.00621851886,
"user": 0.004182365714285718,
"system": 0.0021343083333333324,
"min": 0.00547833536,
"max": 0.00928336136
},
{
"command": "pnpr@HEAD",
"mean": 0.006047380416701031,
"stddev": 0.00028325751412564085,
"median": 0.00602320086,
"user": 0.003929834639175258,
"system": 0.00216327706185567,
"min": 0.00547922836,
"max": 0.0072460903600000005
},
{
"command": "pnpr@main",
"mean": 0.006212831029014082,
"stddev": 0.0002686351423676198,
"median": 0.0062135433600000005,
"user": 0.0042186400938967125,
"system": 0.002039556338028169,
"min": 0.00557128036,
"max": 0.00732023936
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.006127301031428573,
"stddev": 0.00025193518884967115,
"median": 0.00608318094,
"user": 0.004490074285714285,
"system": 0.0016772017142857147,
"min": 0.00566858194,
"max": 0.007575227940000001
},
{
"command": "pacquet@main",
"mean": 0.006340766643488372,
"stddev": 0.0004356914901133136,
"median": 0.006288417940000001,
"user": 0.004402096279069771,
"system": 0.0019715824418604644,
"min": 0.00548842294,
"max": 0.00904298794
},
{
"command": "pnpr@HEAD",
"mean": 0.006716145530659341,
"stddev": 0.0012450879530310132,
"median": 0.006210074440000001,
"user": 0.004418032197802197,
"system": 0.0023147038461538445,
"min": 0.005402851940000001,
"max": 0.01223471994
},
{
"command": "pnpr@main",
"mean": 0.007256466653804722,
"stddev": 0.0009480339335948192,
"median": 0.00712190394,
"user": 0.004829416026936026,
"system": 0.002445885656565658,
"min": 0.005849390940000001,
"max": 0.01380180594
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.9054411604799997,
"stddev": 0.10066266335826383,
"median": 2.90030709188,
"user": 1.92269522,
"system": 1.51840996,
"min": 2.7768657338800002,
"max": 3.02558547388
},
{
"command": "pacquet@main",
"mean": 2.77698752298,
"stddev": 0.022951162176844866,
"median": 2.77380969738,
"user": 1.56990182,
"system": 1.2715200599999998,
"min": 2.73717874088,
"max": 2.8215413588800002
},
{
"command": "pnpr@HEAD",
"mean": 1.5259074300799997,
"stddev": 0.12593560694706413,
"median": 1.4930253383799998,
"user": 1.09624372,
"system": 1.32053376,
"min": 1.4032186868799998,
"max": 1.80385319188
},
{
"command": "pnpr@main",
"mean": 1.66528764618,
"stddev": 0.17249916976386565,
"median": 1.67845876438,
"user": 1.33370042,
"system": 1.56691126,
"min": 1.4728009498799999,
"max": 1.87996133788
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.58334242072,
"stddev": 0.0945163713705823,
"median": 0.54629531202,
"user": 0.72726088,
"system": 0.7690127199999999,
"min": 0.48301050652000005,
"max": 0.7953648455200001
},
{
"command": "pacquet@main",
"mean": 0.5747583537200001,
"stddev": 0.06996123598239305,
"median": 0.57997215652,
"user": 0.74239228,
"system": 0.76306432,
"min": 0.45919770052000003,
"max": 0.71367060352
},
{
"command": "pnpr@HEAD",
"mean": 0.3926389572200001,
"stddev": 0.013701387172720259,
"median": 0.39120912001999997,
"user": 0.29791838,
"system": 0.54670602,
"min": 0.37277924452,
"max": 0.41166284952000004
},
{
"command": "pnpr@main",
"mean": 0.36757299572,
"stddev": 0.027216845726023522,
"median": 0.36172438852,
"user": 0.24255178000000002,
"system": 0.55123092,
"min": 0.33547252652000004,
"max": 0.41748361452000005
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.24380452668,
"stddev": 0.0380480946830769,
"median": 2.2355131465799998,
"user": 1.20674532,
"system": 0.9750617999999998,
"min": 2.19785830408,
"max": 2.3432005450799998
},
{
"command": "pacquet@main",
"mean": 2.36491533478,
"stddev": 0.07945495306461006,
"median": 2.3531977880799997,
"user": 1.3064305199999997,
"system": 1.0850114000000002,
"min": 2.24985945208,
"max": 2.4958820570799998
},
{
"command": "pnpr@HEAD",
"mean": 0.42827304008,
"stddev": 0.025826026922872922,
"median": 0.42502780908000004,
"user": 0.33126372,
"system": 0.5870687,
"min": 0.38813705708,
"max": 0.48754847308000004
},
{
"command": "pnpr@main",
"mean": 0.40654580058,
"stddev": 0.0316562185516684,
"median": 0.40712097608000003,
"user": 0.27782452,
"system": 0.5901973999999999,
"min": 0.36518755908000006,
"max": 0.45571214108
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.21633654165538463,
"stddev": 0.020596871877895204,
"median": 0.21946038504,
"user": 0.16804062769230768,
"system": 0.05119428307692308,
"min": 0.17690821404,
"max": 0.25035357403999997
},
{
"command": "pacquet@main",
"mean": 0.2066261425015385,
"stddev": 0.01874372306189702,
"median": 0.20208330204000002,
"user": 0.1528777815384615,
"system": 0.05775174461538461,
"min": 0.18170649704000003,
"max": 0.24592101904000002
},
{
"command": "pnpr@HEAD",
"mean": 0.09310399636258063,
"stddev": 0.001778124701522972,
"median": 0.09291746804,
"user": 0.027624320000000004,
"system": 0.008253055483870966,
"min": 0.08939855104000001,
"max": 0.09707515604000001
},
{
"command": "pnpr@main",
"mean": 0.09274164097750003,
"stddev": 0.00226611787551307,
"median": 0.09223872704000001,
"user": 0.02586232,
"system": 0.009241056249999999,
"min": 0.08857127704000001,
"max": 0.09703867704000001
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.4920743306022222,
"stddev": 0.0780316100491552,
"median": 0.47152479538000003,
"user": 0.46079260666666666,
"system": 0.09764613777777778,
"min": 0.42220334638,
"max": 0.66693527238
},
{
"command": "pacquet@main",
"mean": 0.4960540579355555,
"stddev": 0.053959646952385115,
"median": 0.50834786338,
"user": 0.47013949555555556,
"system": 0.10031736,
"min": 0.39233653838,
"max": 0.56422749238
},
{
"command": "pnpm@HEAD",
"mean": 2.9925777208244444,
"stddev": 0.10651718978674374,
"median": 2.96750530838,
"user": 4.5853629399999996,
"system": 0.2518249155555556,
"min": 2.8882634413800004,
"max": 3.18928268338
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.454129032359999,
"stddev": 0.15176744973286738,
"median": 4.402916236259999,
"user": 1.2739849199999997,
"system": 1.3950809999999998,
"min": 4.293801526259999,
"max": 4.68728006126
},
{
"command": "pacquet@main",
"mean": 4.337924575859999,
"stddev": 0.04664651122961663,
"median": 4.31877772276,
"user": 1.24558422,
"system": 1.4069514,
"min": 4.30146815126,
"max": 4.4320999282599995
},
{
"command": "pnpr@HEAD",
"mean": 3.376630331359999,
"stddev": 0.04240210756877795,
"median": 3.35907364326,
"user": 1.2309433200000002,
"system": 1.2994544,
"min": 3.34068259226,
"max": 3.45573170826
},
{
"command": "pnpr@main",
"mean": 3.403956126460001,
"stddev": 0.05639416541659109,
"median": 3.3842619962600002,
"user": 1.19250752,
"system": 1.2887875999999998,
"min": 3.33823017126,
"max": 3.52923258726
}
]
}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. Comparable to that scenario head-to-head.
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.15304219490235293,
"stddev": 0.0048878366102864616,
"median": 0.15337583702,
"user": 0.17387205411764708,
"system": 0.16936111411764707,
"min": 0.14507356602,
"max": 0.16228139102
},
{
"command": "pacquet@main",
"mean": 0.1556157883325,
"stddev": 0.005688967091397181,
"median": 0.15568446802,
"user": 0.1797624475,
"system": 0.1744922575,
"min": 0.14873353702,
"max": 0.16835458102
},
{
"command": "pnpr@HEAD",
"mean": 0.16414239389500002,
"stddev": 0.007877027845511851,
"median": 0.16470422802,
"user": 0.17785901,
"system": 0.18884781999999994,
"min": 0.15201243302,
"max": 0.18167664202
},
{
"command": "pnpr@main",
"mean": 0.16618368889500001,
"stddev": 0.005591001726430327,
"median": 0.16636416902,
"user": 0.18696926000000003,
"system": 0.17381607,
"min": 0.15857356002,
"max": 0.18060023702
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13832 |
| Testbed | pnpr |
⚠️ WARNING: No Threshold found!Without a Threshold, no Alerts will ever be generated.
Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| gvs-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 152.01 ms |
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,403.22 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 388.14 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 372.78 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 89.40 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,577.60 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,340.68 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 254.63 ms |
| isolated-linker.repeat-install.cold-cache.hot-store | 📈 view plot | 5.40 ms |
| isolated-linker.repeat-install.hot-cache.hot-store | 📈 view plot | 5.48 ms |
41d30f4 to
15f092a
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pnpm/crates/cli/src/cli_args/audit/fix.rs (1)
141-166: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the historical porting notes.
Ports ...describes implementation history. It does not document a current contract. Remove those clauses and retain the behavior and fail-open invariants.As per coding guidelines, comments must document contracts or non-obvious constraints and “describe current behavior rather than historical implementation details.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm/crates/cli/src/cli_args/audit/fix.rs` around lines 141 - 166, Remove the historical porting notes from the comments above resolve_minimum_release_age_excludes and minimum_release_age_excludes, including references to pnpm and createMinimumReleaseAgeExcludes. Retain comments describing the current overflow fail-open behavior and the minimum-release-age exclusion rules.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/deps/compliance/commands/src/audit/fix.ts`:
- Around line 99-102: Select the lowest published version satisfying
patchedVersions instead of requiring the theoretical range minimum, then use it
for timestamp lookup and the exclusion spec in the TypeScript fix flow around
getPublishTimes. Apply equivalent semver selection in
pnpm/crates/cli/src/cli_args/audit/fix.rs:175-188, and add regression coverage
in pnpm/crates/cli/src/cli_args/audit/tests.rs:1343-1360 for both audit fix
modes where the lower bound is unpublished but a later satisfying version is
recent and requires exclusion.
---
Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/audit/fix.rs`:
- Around line 141-166: Remove the historical porting notes from the comments
above resolve_minimum_release_age_excludes and minimum_release_age_excludes,
including references to pnpm and createMinimumReleaseAgeExcludes. Retain
comments describing the current overflow fail-open behavior and the
minimum-release-age exclusion rules.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c824e008-7151-4445-9950-e102302db100
📒 Files selected for processing (12)
pnpm/crates/cli/src/cli_args/audit.rspnpm/crates/cli/src/cli_args/audit/fix.rspnpm/crates/cli/src/cli_args/audit/render.rspnpm/crates/cli/src/cli_args/audit/report.rspnpm/crates/cli/src/cli_args/audit/tests.rspnpm/crates/cli/tests/suite/audit.rspnpm11/deps/compliance/audit/src/types.tspnpm11/deps/compliance/commands/src/audit/audit.tspnpm11/deps/compliance/commands/src/audit/fix.tspnpm11/deps/compliance/commands/src/audit/fixWithUpdate.tspnpm11/deps/compliance/commands/src/audit/publishTimes.tspnpm11/deps/compliance/commands/test/audit/fix.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- pnpm11/deps/compliance/commands/test/audit/fix.ts
- pnpm/crates/cli/tests/suite/audit.rs
- pnpm11/deps/compliance/commands/src/audit/publishTimes.ts
- pnpm/crates/cli/src/cli_args/audit/render.rs
- pnpm/crates/cli/src/cli_args/audit.rs
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (1)
pnpm11/deps/compliance/commands/src/audit/audit.ts:261
AuditOptionsnow supports an injectedgetPublishTimes, buthandler()always creates a new fetcher and ignoresopts.getPublishTimes. This makes the new option ineffective and can reintroduce extra network calls in programmatic uses/tests that want to share a memoized fetcher.
const getPublishTimes = createPublishTimesFetcher(opts)
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pnpm11/deps/compliance/commands/src/audit/fix.ts (1)
68-69: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winDescribe metadata absence without making a historical claim.
A version can be published and later removed from the registry. The fetched map proves only that the version is absent from the successful metadata response. Replace “was never published” and “no fix has shipped” with wording such as “is not available in the fetched metadata.” This matches the skipped and yanked release cases. (docs.npmjs.com)
As per path instructions, comments must describe current behavior rather than historical implementation details.
Also applies to: 82-89
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm11/deps/compliance/commands/src/audit/fix.ts` around lines 68 - 69, Update the documentation around the resolved publish-time map to describe only current metadata absence: replace claims that a missing version was never published or that no fix shipped with wording that the version is not available in the fetched metadata, including the related comments around the skipped and yanked release handling.Sources: Path instructions, MCP tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pnpm11/deps/compliance/commands/src/audit/fix.ts`:
- Around line 117-121: Update the publish-time validation around publishedAt to
use a strict ISO timestamp parser rather than Date’s permissive constructor,
treating non-conforming values—including "0" and malformed calendar dates—as
unknown and returning lowestSpec. Add regression coverage for "0" and another
malformed timestamp.
- Around line 102-116: Update the published-version selection in the audit fix
flow to retain each original registry key alongside its parsed semver value
through filtering and sorting, then use that original key when reading the
publish timestamp instead of lowest.version. Preserve the existing
lowest-version resolution and add a regression test covering a normalized key
such as v1.2.3.
---
Outside diff comments:
In `@pnpm11/deps/compliance/commands/src/audit/fix.ts`:
- Around line 68-69: Update the documentation around the resolved publish-time
map to describe only current metadata absence: replace claims that a missing
version was never published or that no fix shipped with wording that the version
is not available in the fetched metadata, including the related comments around
the skipped and yanked release handling.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1e414215-db85-4894-859e-cfb3b974fb88
📒 Files selected for processing (4)
pnpm/crates/cli/src/cli_args/audit/fix.rspnpm/crates/cli/src/cli_args/audit/tests.rspnpm11/deps/compliance/commands/src/audit/fix.tspnpm11/deps/compliance/commands/test/audit/fix.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- pnpm/crates/cli/src/cli_args/audit/tests.rs
- pnpm11/deps/compliance/commands/test/audit/fix.ts
- pnpm/crates/cli/src/cli_args/audit/fix.rs
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (1)
pnpm11/deps/compliance/commands/src/audit/audit.ts:261
AuditOptionsnow allows injecting a memoizedgetPublishTimesfetcher, but the handler always creates a new fetcher and ignoresopts.getPublishTimes. This makes the option ineffective for callers (e.g. tests or higher-level orchestration) and contradicts the option’s doc comment about consumers reusing the shared fetcher when provided.
const getPublishTimes = createPublishTimesFetcher(opts)
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
…e fixes The deprecation set is built from the packument's `versions` keys but was consulted with the raw `time` key. Both maps normally spell a release the same way, but nothing guarantees it — the surrounding code already documents that a `time` key may carry a leading `v` — and when they differ the deprecated release passes the filter and gets advertised as the fix. Parse both sides and compare the parsed versions. Selecting the lowest satisfying version by semver order alone picks a prerelease over the stable release that follows it: for an inferred `>=1.9.10` with `2.0.0-beta.1` and `2.0.0` published, `2.0.0-beta.1` sorts lower and won. A beta is not a remediation to point users at, and `--fix update` cannot select one through the dependent's original range anyway. Rank stable releases above prereleases, falling back to a prerelease only when nothing else satisfies the range, so a prerelease-only line still reports a fix instead of `None`.
|
Code review by qodo was updated up to the latest commit 369f0bb |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
[email protected] (GHSA-w5p7-h5w8-2hfq) no longer has a non-deprecated patched version, so pnpm/pnpm#13832 makes `pnpm audit` report patched_versions: null and propose no fix for it, breaking the test-fixable-advisory-updates-lockfile job. That pnpm change shipped on main (both the 11.x and 12.x release lines), so it affects any pnpm release cut after 2026-08-20, not just v12. Switch the fixture to [email protected] (GHSA-xvch-5gv4-984h), whose patched versions (>=1.2.6) are not deprecated.
Summary
close #13824 #13678 (comment)
Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
Nonewhen no valid patched version is available.