Repository navigation
fix: approve git-hosted tarball builds by repository url - #12985
Conversation
|
💖 Thanks for opening this pull request! 💖 |
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:
📝 WalkthroughWalkthroughGit-hosted tarball dependencies now match ChangesGit tarball allow-build matching
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant PackageManager
participant AllowBuildPolicy
participant RepositoryKeyNormalizer
participant PolicyTests
PackageManager->>AllowBuildPolicy: check git clone or tarball depPath
AllowBuildPolicy->>RepositoryKeyNormalizer: derive canonical repository key
RepositoryKeyNormalizer-->>AllowBuildPolicy: return hashless git repository URL
AllowBuildPolicy-->>PackageManager: return allow or deny decision
PolicyTests->>AllowBuildPolicy: verify supported and rejected URL forms
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: 5/5Safe to merge. The change is purely additive — it extends the key-matching logic, not the allow/deny decision logic itself — and both stacks have been updated in parity with comprehensive tests. The URL normalisation is narrowly scoped: known hosts are matched by exact prefix and every unrecognised pattern returns undefined/None rather than a spurious key. The Rust Cow refactor is idiomatic and the as_deref() call site is correct. No correctness or security issues were identified. Files Needing Attention: No files require special attention. Reviews (7): Last reviewed commit: "fix: align git-hosted tarball repo key n..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.changeset/allow-git-tarball-builds-by-repo-url.md:
- Around line 1-4: Add "pacquet": patch to the changeset frontmatter alongside
"`@pnpm/building.policy`" and "pnpm", preserving the existing package release
entries.
In `@pnpm/crates/package-manager/src/build_modules.rs`:
- Around line 339-357: Update git_hosted_tarball_repo_url so GitHub and
Bitbucket parsing accepts exactly one non-empty repository path component before
the tarball suffix, matching the TypeScript normalization behavior. Reject
repository values containing additional slashes, while preserving the existing
owner validation and canonical git URL output.
🪄 Autofix (Beta)
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: 9dda7dff-893a-4f62-991e-3523e5dc2931
📒 Files selected for processing (6)
.changeset/allow-git-tarball-builds-by-repo-url.mdcspell.jsonpnpm/crates/package-manager/src/build_modules.rspnpm/crates/package-manager/src/build_modules/tests.rspnpm11/building/policy/src/index.tspnpm11/building/policy/test/index.ts
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12985 +/- ##
=======================================
Coverage 87.86% 87.87%
=======================================
Files 549 549
Lines 96091 96131 +40
=======================================
+ Hits 84429 84473 +44
+ Misses 11662 11658 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. 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.74280870984,
"stddev": 0.16776965332961952,
"median": 2.68812635974,
"user": 2.0901761199999997,
"system": 1.6329789999999995,
"min": 2.55004130424,
"max": 3.02003899224,
"times": [
2.55004130424,
2.98542061124,
2.67445098024,
2.70180173924,
2.5698411232400002,
2.76675365024,
2.88300252124,
3.02003899224,
2.67098697624,
2.60574920024
]
},
{
"command": "pacquet@main",
"mean": 2.74949447854,
"stddev": 0.1377443192617426,
"median": 2.80098153624,
"user": 2.1745468199999998,
"system": 1.7528808999999999,
"min": 2.48970181724,
"max": 2.93454627424,
"times": [
2.48970181724,
2.67118456724,
2.59313102224,
2.80520649724,
2.83567195524,
2.87569446524,
2.93454627424,
2.67675849324,
2.81629311824,
2.7967565752400003
]
},
{
"command": "pnpr@HEAD",
"mean": 1.68740854644,
"stddev": 0.14351699422276123,
"median": 1.6730416187400001,
"user": 1.6938131200000002,
"system": 1.7970207999999999,
"min": 1.48106495024,
"max": 1.88518890624,
"times": [
1.88518890624,
1.64463962924,
1.81794211224,
1.48106495024,
1.5433994282399999,
1.81384710524,
1.59772524124,
1.5534428662400002,
1.70144360824,
1.83539161724
]
},
{
"command": "pnpr@main",
"mean": 1.66743349704,
"stddev": 0.13726697616892367,
"median": 1.66416404824,
"user": 1.4696118200000001,
"system": 1.4964551999999998,
"min": 1.49602262724,
"max": 1.8765942982400001,
"times": [
1.8765942982400001,
1.49602262724,
1.54830443724,
1.72593199724,
1.54286117524,
1.62174576524,
1.70658233124,
1.82386705324,
1.79892204024,
1.53350324524
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.28997597750000004,
"stddev": 0.009850416440498921,
"median": 0.2897585387,
"user": 0.232966,
"system": 0.5704575399999999,
"min": 0.2738565947,
"max": 0.3084981127,
"times": [
0.2892953707,
0.2813300017,
0.2895021277,
0.2738565947,
0.2813282897,
0.2907685417,
0.2989593327,
0.2900149497,
0.2962064537,
0.3084981127
]
},
{
"command": "pacquet@main",
"mean": 0.2860349772,
"stddev": 0.009627449560701721,
"median": 0.2817759027,
"user": 0.23113529999999996,
"system": 0.57170744,
"min": 0.2774062677,
"max": 0.3049266577,
"times": [
0.28392217070000003,
0.27837237870000003,
0.3049266577,
0.2929038137,
0.27958600370000003,
0.2796296347,
0.2774062677,
0.2989151407,
0.2794529637,
0.2852347407
]
},
{
"command": "pnpr@HEAD",
"mean": 0.29555804760000004,
"stddev": 0.011969367970897635,
"median": 0.29988951220000004,
"user": 0.2461106,
"system": 0.56896494,
"min": 0.2754313157,
"max": 0.3070496267,
"times": [
0.2813906247,
0.2754313157,
0.2799425417,
0.3054046637,
0.2994384317,
0.2979469147,
0.3017074947,
0.30692826970000003,
0.3003405927,
0.3070496267
]
},
{
"command": "pnpr@main",
"mean": 0.3439955471,
"stddev": 0.04537677687322384,
"median": 0.3293916467,
"user": 0.27401810000000004,
"system": 0.6464814399999999,
"min": 0.3061361937,
"max": 0.46506157270000004,
"times": [
0.33979975970000004,
0.3238352477,
0.3541467987,
0.3061361937,
0.3297385627,
0.3179879077,
0.3181835047,
0.3290447307,
0.3560211927,
0.46506157270000004
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7616817062999997,
"stddev": 0.056436024000355314,
"median": 2.7568621121000003,
"user": 1.92517492,
"system": 1.6242518799999999,
"min": 2.6867230131,
"max": 2.8822990641,
"times": [
2.7094224681,
2.7882263471,
2.7364972931000002,
2.8822990641,
2.7203721801,
2.7340841801,
2.7917271581,
2.7902384281000003,
2.6867230131,
2.7772269311000004
]
},
{
"command": "pacquet@main",
"mean": 2.8363315964,
"stddev": 0.08381767546368434,
"median": 2.8351708786,
"user": 2.09213842,
"system": 1.6483340800000001,
"min": 2.7243926381000003,
"max": 2.9707337691,
"times": [
2.8497051651,
2.8206365921,
2.9524184461000003,
2.9707337691,
2.7943228771,
2.7243926381000003,
2.7592208701,
2.7472163991,
2.8567099461,
2.8879592611000002
]
},
{
"command": "pnpr@HEAD",
"mean": 1.7691342339000002,
"stddev": 0.14330476615222265,
"median": 1.7565393341000002,
"user": 1.4852388199999997,
"system": 1.6806078799999997,
"min": 1.5359531401000002,
"max": 2.0102840901000003,
"times": [
1.7352677221000001,
1.7850460671000001,
1.7030049281000001,
1.5359531401000002,
1.7006371881000002,
1.9950051411,
1.6662984531,
1.7778109461000002,
1.7820346631000001,
2.0102840901000003
]
},
{
"command": "pnpr@main",
"mean": 1.7333229032000002,
"stddev": 0.11537882253146985,
"median": 1.7024736811,
"user": 1.4827804199999999,
"system": 1.57197028,
"min": 1.6256046761,
"max": 1.9361298941,
"times": [
1.9330158471,
1.6983523461,
1.9361298941,
1.6348367901,
1.7093399721,
1.6581941631000001,
1.6495750961000002,
1.7815852311000002,
1.7065950161,
1.6256046761
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.6704669230400001,
"stddev": 0.056250295914207694,
"median": 0.66451237374,
"user": 0.9211086199999998,
"system": 0.9378908600000001,
"min": 0.6009143637400001,
"max": 0.7641284167400001,
"times": [
0.61490070974,
0.61956218774,
0.74302249474,
0.71319560674,
0.7641284167400001,
0.6853683167400001,
0.6009143637400001,
0.68056014474,
0.6484646027400001,
0.63455238674
]
},
{
"command": "pacquet@main",
"mean": 0.63126203424,
"stddev": 0.05955487106532331,
"median": 0.62304465574,
"user": 0.86611292,
"system": 0.88460076,
"min": 0.5490468017400001,
"max": 0.7092718117400001,
"times": [
0.5858435147400001,
0.59851889374,
0.5913602557400001,
0.56886764374,
0.5490468017400001,
0.64757041774,
0.7021344137400001,
0.66558579474,
0.6944207947400001,
0.7092718117400001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.41334578084,
"stddev": 0.03111109546761106,
"median": 0.41532262974,
"user": 0.30948152,
"system": 0.6902481600000001,
"min": 0.36135963574,
"max": 0.44905176774000005,
"times": [
0.44899085474000006,
0.44442120874,
0.44905176774000005,
0.43046530874000005,
0.40256641474000004,
0.42807884474,
0.38994756174,
0.38017723874000003,
0.36135963574,
0.39839897274
]
},
{
"command": "pnpr@main",
"mean": 0.40677709024,
"stddev": 0.04513866297758024,
"median": 0.40204716524000006,
"user": 0.29502772,
"system": 0.6615758599999999,
"min": 0.35216198974,
"max": 0.51440816374,
"times": [
0.40209431874,
0.40200001174000005,
0.51440816374,
0.43694492374000005,
0.41017193974000005,
0.37645480074000004,
0.39768282074000005,
0.36457019474,
0.35216198974,
0.41128173874
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.9188338120999997,
"stddev": 0.03831983522852821,
"median": 1.9090978013,
"user": 1.0685812199999998,
"system": 0.9335015200000001,
"min": 1.8761623803,
"max": 2.0068297413000002,
"times": [
1.9494580683,
1.9360580443,
1.9210889093,
1.8961251333,
2.0068297413000002,
1.9028661473,
1.9146629163,
1.8815540943,
1.8761623803,
1.9035326863
]
},
{
"command": "pacquet@main",
"mean": 2.0019900621,
"stddev": 0.12030528837617324,
"median": 1.9752509723,
"user": 1.2329960199999999,
"system": 0.97761852,
"min": 1.8652583833,
"max": 2.2889928413000002,
"times": [
1.9734120813,
1.8652583833,
1.9001912843000002,
1.9225932393,
1.9507983693,
1.9770898633,
2.0779862303,
2.0532200643,
2.0103582643,
2.2889928413000002
]
},
{
"command": "pnpr@HEAD",
"mean": 0.5692462781,
"stddev": 0.1207751362327473,
"median": 0.5357505328000001,
"user": 0.44344901999999997,
"system": 0.85297302,
"min": 0.4756290253,
"max": 0.8904543743000001,
"times": [
0.4756290253,
0.5644073303,
0.8904543743000001,
0.5213620163,
0.6309472163000001,
0.49302729230000003,
0.5399817633,
0.5315193023,
0.5421964133,
0.5029380473
]
},
{
"command": "pnpr@main",
"mean": 0.5645472954999999,
"stddev": 0.0622185504339968,
"median": 0.5904935203,
"user": 0.42683302,
"system": 0.8592138199999999,
"min": 0.45973141030000003,
"max": 0.6445154063,
"times": [
0.5559290413,
0.6445154063,
0.5972858503,
0.6021346573,
0.6159289293,
0.6019143133,
0.5837011903,
0.4952358813,
0.45973141030000003,
0.4890962753
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.44723522226000006,
"stddev": 0.08731766097159434,
"median": 0.42227891986,
"user": 0.44791554,
"system": 0.12479016000000001,
"min": 0.33203908136,
"max": 0.58326822536,
"times": [
0.33203908136,
0.35691701636,
0.39153913436,
0.38146223836,
0.43634182136,
0.58326822536,
0.53913235736,
0.52792514236,
0.51551118736,
0.40821601836
]
},
{
"command": "pacquet@main",
"mean": 0.44910719016000006,
"stddev": 0.0519134931553953,
"median": 0.45514226036,
"user": 0.45088394000000004,
"system": 0.12776936,
"min": 0.36615702336,
"max": 0.54297784336,
"times": [
0.38372380636,
0.54297784336,
0.47199780636,
0.45601236636,
0.47404955036,
0.44211032236,
0.45427215436,
0.41104576236,
0.36615702336,
0.48872526636
]
},
{
"command": "pnpr@HEAD",
"mean": 0.12664755636000002,
"stddev": 0.012716883499431116,
"median": 0.12535703086,
"user": 0.03954145818181818,
"system": 0.02218145090909091,
"min": 0.10758383536,
"max": 0.15227516336000002,
"times": [
0.12429953336,
0.11004074036000001,
0.11568212336000001,
0.13381893436,
0.15082097936000002,
0.14399042736,
0.12921441436,
0.12515040836000002,
0.13635009936,
0.12732328136,
0.12473981936,
0.11296058236,
0.12798167436000002,
0.15227516336000002,
0.13624639436000002,
0.12262425336,
0.13770318336,
0.11108206136000001,
0.11808796136000001,
0.12556365336,
0.11270671636000001,
0.10758383536
]
},
{
"command": "pnpr@main",
"mean": 0.11133768355047621,
"stddev": 0.00959861148427977,
"median": 0.10723596436,
"user": 0.030816949523809523,
"system": 0.019324193333333337,
"min": 0.10108433436000001,
"max": 0.13977276236,
"times": [
0.12995612536,
0.10491274036,
0.11956245536000001,
0.13977276236,
0.10487750436000001,
0.10108433436000001,
0.10407900736,
0.10434449436000001,
0.11787388036,
0.10499305036,
0.11363575836,
0.11417056036,
0.10952821036,
0.10723596436,
0.11707029436000001,
0.10466474536,
0.10345333436000001,
0.10448417636000001,
0.10700598336,
0.11115363636,
0.11423233636
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 5.532584566300001,
"stddev": 0.3986439444696944,
"median": 5.381717528799999,
"user": 4.129966519999999,
"system": 2.91849242,
"min": 5.0834603343,
"max": 6.2447315413,
"times": [
5.7263745453,
6.1822678162999996,
5.3912177123,
5.2978097713,
5.5251915993,
6.2447315413,
5.0834603343,
5.2874261583,
5.3722173453,
5.2151488393
]
},
{
"command": "pacquet@main",
"mean": 5.098975363699999,
"stddev": 0.3002463426821468,
"median": 5.0367929238,
"user": 3.2024504199999995,
"system": 2.39515142,
"min": 4.7774043683,
"max": 5.7353225543,
"times": [
4.9717905052999996,
4.8552879873,
4.9940922493,
4.7967259053,
4.7774043683,
5.3227160483,
5.3718100133,
5.0794935983,
5.0851104073,
5.7353225543
]
},
{
"command": "pnpr@HEAD",
"mean": 3.8680518943999993,
"stddev": 0.11847749700424309,
"median": 3.8567499613,
"user": 2.1230016199999997,
"system": 2.20795292,
"min": 3.7459054082999996,
"max": 4.1425539733,
"times": [
3.8604810303,
3.9340691903,
3.8564944973,
3.7739133293,
4.1425539733,
3.9506137933,
3.8570054252999997,
3.7721983142999997,
3.7872839823,
3.7459054082999996
]
},
{
"command": "pnpr@main",
"mean": 3.8500028795999994,
"stddev": 0.12923497243853088,
"median": 3.8433167008,
"user": 1.9665950199999997,
"system": 2.06022822,
"min": 3.6341936663,
"max": 4.0244540453,
"times": [
4.0244540453,
3.9969096143,
3.7900650252999997,
4.0020980393,
3.8231774652999997,
3.7102661733,
3.8700117833,
3.7853970473,
3.8634559363,
3.6341936663
]
}
]
} |
|
| Branch | pr/12985 |
| 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) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 2,246.57 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 703.93 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 712.82 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 109.65 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 2,161.79 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 4,963.46 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 740.55 ms |
e5048df to
a6fd249
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm11/building/policy/src/index.ts (1)
171-179: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse a verb for the function name.
As per coding guidelines, functions should use verb names. Consider renaming
gitHostedTarballRepoKeytogetGitHostedTarballRepoKeyto maintain consistent naming conventions across the repository.— CodeRabbit (state-of-the-art model)
♻️ Proposed refactor
-function gitHostedTarballRepoKey (pkgIdWithPatchHash: string): string | undefined { +function getGitHostedTarballRepoKey (pkgIdWithPatchHash: string): string | undefined {If applied, also update the call site at line 136:
- return gitHostedTarballRepoKey(depPath) + return getGitHostedTarballRepoKey(depPath)🤖 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/building/policy/src/index.ts` around lines 171 - 179, Rename the function gitHostedTarballRepoKey to getGitHostedTarballRepoKey to use the verb-based naming convention, and update its call site in the surrounding policy logic so all references use the new name.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.
Nitpick comments:
In `@pnpm11/building/policy/src/index.ts`:
- Around line 171-179: Rename the function gitHostedTarballRepoKey to
getGitHostedTarballRepoKey to use the verb-based naming convention, and update
its call site in the surrounding policy logic so all references use the new
name.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 298e0d87-9598-4f94-a5ab-06cab15bc426
📒 Files selected for processing (6)
.changeset/allow-git-tarball-builds-by-repo-url.mdcspell.jsonpnpm/crates/package-manager/src/build_modules.rspnpm/crates/package-manager/src/build_modules/tests.rspnpm11/building/policy/src/index.tspnpm11/building/policy/test/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- cspell.json
- pnpm/crates/package-manager/src/build_modules/tests.rs
- pnpm11/building/policy/test/index.ts
- pnpm/crates/package-manager/src/build_modules.rs
a6fd249 to
d4ab582
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/building/policy/src/index.ts`:
- Around line 171-180: Update gitHostedTarballRepoKey to parse the tarball URL
and reject any path containing dot segments before applying
GIT_HOSTED_TARBALL_REPO_URL_MATCHERS, or match only its normalized path. Apply
the same dot-segment guard or normalization in the Rust build-policy matcher so
pnpm and pacquet derive identical repository keys.
🪄 Autofix (Beta)
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: 5baf3562-f9af-40ac-b10c-9131d884aa22
📒 Files selected for processing (6)
.changeset/allow-git-tarball-builds-by-repo-url.mdcspell.jsonpnpm/crates/package-manager/src/build_modules.rspnpm/crates/package-manager/src/build_modules/tests.rspnpm11/building/policy/src/index.tspnpm11/building/policy/test/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- cspell.json
- pnpm/crates/package-manager/src/build_modules/tests.rs
- pnpm11/building/policy/test/index.ts
- pnpm/crates/package-manager/src/build_modules.rs
d4ab582 to
121a0fa
Compare
|
| Project | pnpm's project |
| Branch | pr/12985 |
| Testbed | pacquet |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 2,686.72 ms(-4.64%)Baseline: 2,817.60 ms | 3,381.11 ms (79.46%) |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot 🚷 view threshold | 1,876.16 ms(-4.24%)Baseline: 1,959.31 ms | 2,351.17 ms (79.80%) |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 600.91 ms(-5.82%)Baseline: 638.02 ms | 765.62 ms (78.49%) |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot 🚷 view threshold | 332.04 ms(-13.32%)Baseline: 383.05 ms | 459.66 ms (72.24%) |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot 🚷 view threshold | 2,550.04 ms(+5.03%)Baseline: 2,427.85 ms | 2,913.42 ms (87.53%) |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot 🚷 view threshold | 5,083.46 ms(+12.46%)Baseline: 4,520.18 ms | 5,424.22 ms (93.72%) |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot 🚷 view threshold | 273.86 ms(-2.42%)Baseline: 280.64 ms | 336.76 ms (81.32%) |
|
| Project | pnpm's project |
| Branch | pr/12985 |
| 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) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 1,535.95 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 475.63 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 361.36 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 107.58 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,481.06 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,745.91 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 275.43 ms |
|
@zkochan Sorry, I know you're busy, but any chance I could get your eyeballs on this PR please? |
pnpm 11.11 (pnpm#12856) let an `allowBuilds` entry approve a git dependency's build scripts by its repository URL without the resolved commit hash, but only for dependencies pnpm clones, whose dep path looks like `name@git+https://host/org/repo.git#<commit>`. The common `github:` case is not cloned: pnpm downloads it as a tarball from codeload.github.com, giving a dep path of the form `name@https://codeload.github.com/org/repo/tar.gz/<commit>`. That form has neither the `git+` prefix nor the `#` separator the hashless matcher keys on, so the entry was ignored and the build stayed unapproved unless it pinned the exact commit hash. Normalize a git-hosted tarball dep path back to the canonical `name@git+https://host/org/repo.git` key that a clone of the same repository produces, so one hashless entry approves the package whether pnpm clones it or downloads a tarball. GitHub (codeload), GitLab archive, and Bitbucket download URLs are covered, and the download host of each is anchored so a look-alike host cannot be rewritten into an unrelated repository key. Approving or denying a specific resolved commit by its full tarball dep path continues to work. The change is mirrored in both stacks, `@pnpm/building.policy` and `pacquet-package-manager`, with unit tests on each side.
The TypeScript matcher tried its three host patterns in sequence, so a malformed URL on a claimed download host could fall through to the generic GitLab archive pattern and still derive that host's trusted repo key (e.g. a bitbucket.org URL with a /-/archive/ path). The Rust matcher claims codeload.github.com and bitbucket.org exclusively, which is the stricter and safer behavior, so the TypeScript side now does the same via per-host early returns. Conversely, the Rust GitLab branch accepted any URL containing /-/archive/ regardless of what follows, while the TypeScript regex requires a non-empty ref segment followed by a slash. The Rust branch now enforces the same anchor, iterating the archive markers to mirror the regex's lazy project capture exactly. Both suites pin the newly aligned behavior, including the Bitbucket fall-through case that previously approved a build in TypeScript only. Co-Authored-By: Claude Fable 5 <[email protected]>
121a0fa to
5930e1f
Compare
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Unconditional tarball normalization
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
Summary
Fixes #13429
pnpm 11.11 (#12856) let an
allowBuildsentry approve a git dependency's build scripts by its repository URL without the resolved commit hash, but only for dependencies pnpm clones, whose dep path looks likename@git+https://host/org/repo.git#<commit>.The common
github:case isn't cloned, pnpm downloads it as a tarball from codeload.github.com, giving a dep path of the formname@https://codeload.github.com/org/repo/tar.gz/<commit>. That form has neither thegit+prefix nor the#separator the hashless matcher keys on, so the entry was ignored and the build stayed unapproved unless it pinned the exact commit hash.This PR normalizes a git-hosted tarball dep path back to the canonical
name@git+https://host/org/repo.gitkey that a clone of the same repository produces, so one hashless entry approves the package whether pnpm clones it or downloads a tarball.GitHub (codeload), GitLab archive, and Bitbucket download URLs are covered. The host is part of each derived key, and the GitHub and Bitbucket download hosts are matched against a literal value (GitLab's is captured generically to allow self-hosted instances), so a look-alike host cannot be rewritten into an unrelated repository key. Approving or denying a specific resolved commit by its full tarball dep path continues to work.
The change is mirrored in both stacks,
@pnpm/building.policyandpacquet-package-manager, with unit tests on each side.Manually validated against this minimal reproduction: https://github.com/n3dst4/pnpm-allowbuilds-repro
Validation:
pnpm --filter @pnpm/building.policy test— TS policy suite, 17/17 pass, including the newshould allow git-hosted tarball builds by hashless repository keypnpm exec eslint pnpm11/building/policy/src/index.ts pnpm11/building/policy/test/index.ts— cleancargo test -p pacquet-package-manager --lib build_modules— 58 pass, including the newexplicit_allow_by_git_hosted_tarball_repo_urlcargo fmt -p pacquet-package-manager -- --check— cleancargo clippy -p pacquet-package-manager --all-targets --locked -- -D warnings— cleanRUSTDOCFLAGS='-D warnings' cargo doc --no-deps -p pacquet-package-manager --all-features— cleantypos pnpm11/building/policy pnpm/crates/package-manager/src/build_modules.rs pnpm/crates/package-manager/src/build_modules/tests.rs .changeset/allow-git-tarball-builds-by-repo-url.md— cleanallowBuildskey from the minimal repro through the compiledcreateAllowBuildFunction, which returnstrue(stock pnpm returnsundefinedfor the same input, so the build is ignored)ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWEDand never runs the build, confirming the gap this PR closesSquash Commit Body
Checklist
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
/codesmithwith what you need. Autofix is disabled.Summary by CodeRabbit
git+...allow lists.