Repository navigation
Conversation
With the default pretty format, every pnpr::access line printed each field twice and user three times. emit_access_log entered the per-request span before emitting, the span records the same fields, and the compact formatter appends the current span's fields after the event's. The JSON format hid the same duplication under a span object. The access event now fires outside the request span. It carries every documented field itself, so nothing is lost in either format. The span keeps request_id, method, uri, client_ip, and user_agent for the events emitted inside a request, which the audit records inherit. Its status, latency_ms, bytes, and user slots were only filled after the handler returned, when no event inside the request could see them, so they are removed along with record_span_and_metrics. The subscriber construction moves from main.rs into pnpr::logging::log_subscriber so a test can run a request through the real pretty and JSON configurations and assert on the formatted line. Closes pnpm/tasks#195
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
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": 3.9013740840000004,
"stddev": 0.46625522951314785,
"median": 3.7667972174,
"user": 4.18742688,
"system": 2.9778615000000004,
"min": 3.4481411229,
"max": 4.7492535659
},
{
"command": "pacquet@main",
"mean": 3.4798143304,
"stddev": 0.13378725577529754,
"median": 3.4454023449,
"user": 4.08189908,
"system": 2.8306438,
"min": 3.3406726399,
"max": 3.7005556909
},
{
"command": "pnpr@HEAD",
"mean": 1.6847086541,
"stddev": 0.09442847291741782,
"median": 1.6859017499000002,
"user": 3.07168388,
"system": 2.2194476999999995,
"min": 1.5775891509000002,
"max": 1.8689727459000003
},
{
"command": "pnpr@main",
"mean": 1.7025001161000002,
"stddev": 0.14081611898825183,
"median": 1.6708141339000002,
"user": 3.0511191799999997,
"system": 2.2070087,
"min": 1.5296524249,
"max": 1.9497737799000001
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.23427755198,
"stddev": 0.005547022263075226,
"median": 0.23581599988000002,
"user": 0.27489613999999996,
"system": 0.5443411599999999,
"min": 0.22483138138000003,
"max": 0.24177290638
},
{
"command": "pacquet@main",
"mean": 0.24928836068,
"stddev": 0.02207493656182829,
"median": 0.24025392338,
"user": 0.2873828399999999,
"system": 0.60423786,
"min": 0.22153178038000002,
"max": 0.28373797238000004
},
{
"command": "pnpr@HEAD",
"mean": 0.25605253308,
"stddev": 0.01778567126665592,
"median": 0.25314332738,
"user": 0.27699873999999997,
"system": 0.57658466,
"min": 0.23979247538,
"max": 0.30027536738000005
},
{
"command": "pnpr@main",
"mean": 0.25280071388,
"stddev": 0.010025601456030965,
"median": 0.25337610438,
"user": 0.2822689399999999,
"system": 0.5512989599999999,
"min": 0.23270893238,
"max": 0.26925235638
}
]
}Scenario: Isolated linker: repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.009271896980287764,
"stddev": 0.000567004845690248,
"median": 0.009224516840000002,
"user": 0.005353349208633093,
"system": 0.004732637841726618,
"min": 0.008141405840000001,
"max": 0.012253297840000002
},
{
"command": "pacquet@main",
"mean": 0.009053270471229238,
"stddev": 0.0005790871094283833,
"median": 0.00902341484,
"user": 0.005651547707641194,
"system": 0.004239524518272421,
"min": 0.00784140084,
"max": 0.01139931184
},
{
"command": "pnpr@HEAD",
"mean": 0.009267773440671145,
"stddev": 0.0005852193685445097,
"median": 0.00919837834,
"user": 0.005645055100671137,
"system": 0.004456292348993286,
"min": 0.00792185284,
"max": 0.012601221840000001
},
{
"command": "pnpr@main",
"mean": 0.008692310354851485,
"stddev": 0.0012800184556442955,
"median": 0.008236434840000001,
"user": 0.005188203234323435,
"system": 0.004294739273927391,
"min": 0.00739367984,
"max": 0.01742293784
}
]
}Scenario: Isolated linker: repeat install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.01172609494047393,
"stddev": 0.001041330595247892,
"median": 0.011569734040000001,
"user": 0.0068650606635071105,
"system": 0.005843979905213268,
"min": 0.00956470304,
"max": 0.01413775704
},
{
"command": "pacquet@main",
"mean": 0.010941944009565214,
"stddev": 0.0010182032658395763,
"median": 0.010733412040000001,
"user": 0.006157426086956518,
"system": 0.00571244104347826,
"min": 0.00848918004,
"max": 0.014411011040000001
},
{
"command": "pnpr@HEAD",
"mean": 0.010368834346034477,
"stddev": 0.0004933643896622476,
"median": 0.010351067040000002,
"user": 0.006048166379310345,
"system": 0.005142921896551723,
"min": 0.009195148040000002,
"max": 0.012990428040000002
},
{
"command": "pnpr@main",
"mean": 0.010380065398333334,
"stddev": 0.0004973774393548559,
"median": 0.01043082704,
"user": 0.006154574999999992,
"system": 0.005065507,
"min": 0.008757094040000002,
"max": 0.01170734504
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.5254072672,
"stddev": 0.02214051255989598,
"median": 2.5235053461,
"user": 2.6329763,
"system": 1.7288759799999998,
"min": 2.4937747646,
"max": 2.5645911706
},
{
"command": "pacquet@main",
"mean": 2.6483508209,
"stddev": 0.1261007111941834,
"median": 2.6544709756,
"user": 3.0478813999999996,
"system": 1.98054278,
"min": 2.4994266836,
"max": 2.8983251886000003
},
{
"command": "pnpr@HEAD",
"mean": 1.7156340882000003,
"stddev": 0.12222631850220099,
"median": 1.6888813281000001,
"user": 2.7819313,
"system": 1.97238788,
"min": 1.6005903876,
"max": 2.0412122716
},
{
"command": "pnpr@main",
"mean": 1.8335666253,
"stddev": 0.12504662196467653,
"median": 1.7940372191,
"user": 3.1736034,
"system": 2.317801780000001,
"min": 1.6761612006000002,
"max": 2.0161553676
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.44055855420000006,
"stddev": 0.014747356270952718,
"median": 0.441837713,
"user": 0.59901762,
"system": 0.70697152,
"min": 0.4177289215,
"max": 0.46173105350000004
},
{
"command": "pacquet@main",
"mean": 0.44249966939999996,
"stddev": 0.014951752242078533,
"median": 0.43709982300000005,
"user": 0.59660992,
"system": 0.70455372,
"min": 0.42603159150000003,
"max": 0.4673354055
},
{
"command": "pnpr@HEAD",
"mean": 0.29508089140000004,
"stddev": 0.013315624519107807,
"median": 0.29744382999999996,
"user": 0.25868401999999996,
"system": 0.5463543200000001,
"min": 0.27372938950000003,
"max": 0.3157288045
},
{
"command": "pnpr@main",
"mean": 0.3153420151,
"stddev": 0.017714899088361144,
"median": 0.313799861,
"user": 0.28581932,
"system": 0.60732322,
"min": 0.2899259105,
"max": 0.3518256645
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.7547507333600003,
"stddev": 0.14568857697292692,
"median": 1.70589957156,
"user": 1.1136790799999998,
"system": 1.0489331199999998,
"min": 1.62056964706,
"max": 2.08735536606
},
{
"command": "pacquet@main",
"mean": 1.65078854126,
"stddev": 0.04755486815704739,
"median": 1.64392630656,
"user": 0.9883554799999998,
"system": 0.89825822,
"min": 1.5888446170600001,
"max": 1.7561083110600002
},
{
"command": "pnpr@HEAD",
"mean": 0.29315452896000005,
"stddev": 0.014515725951258312,
"median": 0.29015324906000006,
"user": 0.24623918000000003,
"system": 0.5452677199999999,
"min": 0.27385538506,
"max": 0.31617873506000005
},
{
"command": "pnpr@main",
"mean": 0.30826548976,
"stddev": 0.02083038352668398,
"median": 0.3110663020600001,
"user": 0.26113818,
"system": 0.5825952199999999,
"min": 0.27965165406000003,
"max": 0.33288005806000004
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.40247664636000013,
"stddev": 0.040902419957122634,
"median": 0.41068738636,
"user": 0.41897709999999994,
"system": 0.15797754000000003,
"min": 0.31494045536000004,
"max": 0.45939577436000006
},
{
"command": "pacquet@main",
"mean": 0.39754284545999996,
"stddev": 0.04176186666062408,
"median": 0.39156479036,
"user": 0.41737160000000006,
"system": 0.16445414000000003,
"min": 0.32581400936000005,
"max": 0.45572881836
},
{
"command": "pnpr@HEAD",
"mean": 0.1401595329314286,
"stddev": 0.012683277520364487,
"median": 0.13546548836000002,
"user": 0.0667462476190476,
"system": 0.030949678095238096,
"min": 0.12035603836,
"max": 0.16836743436
},
{
"command": "pnpr@main",
"mean": 0.12003689249636364,
"stddev": 0.009822364708606991,
"median": 0.11789720086,
"user": 0.050801563636363636,
"system": 0.025803985454545455,
"min": 0.10531036036,
"max": 0.13754782336000002
}
]
}Scenario: Isolated linker: peer-heavy resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.2820873590777778,
"stddev": 0.011130072724895556,
"median": 0.28634617230000003,
"user": 0.30313823111111116,
"system": 0.06704377111111111,
"min": 0.26640004530000005,
"max": 0.29494324330000005
},
{
"command": "pacquet@main",
"mean": 0.29123047885555553,
"stddev": 0.010819401520058874,
"median": 0.2941187223,
"user": 0.3207520088888889,
"system": 0.06085410444444444,
"min": 0.2727671273,
"max": 0.3071102083
},
{
"command": "pnpm@HEAD",
"mean": 4.525335872077777,
"stddev": 0.17964532497717745,
"median": 4.5482583313,
"user": 7.278118786666667,
"system": 0.4372967711111111,
"min": 4.1861699353,
"max": 4.7671106092999995
}
]
}Scenario: Isolated linker: linked-workspace resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.17891210118705883,
"stddev": 0.025239951380326604,
"median": 0.18083807254000003,
"user": 0.15733776941176475,
"system": 0.08729147647058823,
"min": 0.14245348254,
"max": 0.23197488854000003
},
{
"command": "pacquet@main",
"mean": 0.17332626837333337,
"stddev": 0.026894906437969743,
"median": 0.16933440254,
"user": 0.1560378511111111,
"system": 0.08478102222222221,
"min": 0.12850350354,
"max": 0.22825122754000002
}
]
}Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.14116469074521737,
"stddev": 0.012801351569827705,
"median": 0.14238203618,
"user": 0.05552255304347827,
"system": 0.09717941217391306,
"min": 0.12167237918,
"max": 0.16199190218
},
{
"command": "pacquet@main",
"mean": 0.14719099865368424,
"stddev": 0.01165269347447171,
"median": 0.14451906418000002,
"user": 0.060439061052631575,
"system": 0.09839660210526316,
"min": 0.12763212618000003,
"max": 0.16971051818000002
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 5.093234009439999,
"stddev": 0.2808866547936794,
"median": 5.12596406754,
"user": 3.0778381799999996,
"system": 2.3152872,
"min": 4.657253327539999,
"max": 5.57114046554
},
{
"command": "pacquet@main",
"mean": 5.242533738039999,
"stddev": 0.27658246536776226,
"median": 5.34445887604,
"user": 3.2149127799999997,
"system": 2.4294605999999996,
"min": 4.85005257754,
"max": 5.60398769554
},
{
"command": "pnpr@HEAD",
"mean": 3.7359981094399997,
"stddev": 0.16242480171842338,
"median": 3.7462481755400003,
"user": 2.4793740799999995,
"system": 1.9224285,
"min": 3.52211270454,
"max": 4.0858036665399995
},
{
"command": "pnpr@main",
"mean": 3.76957033594,
"stddev": 0.2139988614067115,
"median": 3.6898550095400005,
"user": 2.52397938,
"system": 2.0419573,
"min": 3.53630933154,
"max": 4.0515111055399995
}
]
}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.14541082674117647,
"stddev": 0.00762681962067833,
"median": 0.14364022980000002,
"user": 0.18085903411764703,
"system": 0.13328660941176468,
"min": 0.13566415180000002,
"max": 0.16240213080000002
},
{
"command": "pacquet@main",
"mean": 0.14858630968235295,
"stddev": 0.004610570752614176,
"median": 0.14735691580000002,
"user": 0.18503244588235296,
"system": 0.13840649176470587,
"min": 0.13865293080000002,
"max": 0.1562633408
},
{
"command": "pnpr@HEAD",
"mean": 0.158510995175,
"stddev": 0.006352159154441044,
"median": 0.15835236530000002,
"user": 0.19389224,
"system": 0.13285082999999998,
"min": 0.1479345698,
"max": 0.1709430408
},
{
"command": "pnpr@main",
"mean": 0.16283829633333333,
"stddev": 0.008406616494046636,
"median": 0.16119419780000002,
"user": 0.18645620666666662,
"system": 0.1426704133333333,
"min": 0.1500533178,
"max": 0.1796192318
}
]
}Scenario: Store only: unlocked direct deps, cold cache + hot storeStore-only install (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.31972108432,
"stddev": 0.05349603703439984,
"median": 1.30813068142,
"user": 0.8233516599999999,
"system": 0.32701921999999994,
"min": 1.26863096692,
"max": 1.42797634692
},
{
"command": "pacquet@main",
"mean": 1.2719439270200001,
"stddev": 0.07947594788625818,
"median": 1.25970827742,
"user": 0.70761866,
"system": 0.29506972,
"min": 1.20735734592,
"max": 1.46770004492
}
]
}Scenario: Cargo: repeat install, hot cache + hot storeFrozen repeat install of a Cargo workspace (
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.03681847823792206,
"stddev": 0.00326127712271747,
"median": 0.03604033916,
"user": 0.02795148727272728,
"system": 0.01750192805194805,
"min": 0.03197841716,
"max": 0.04792209216
},
{
"command": "pacquet@main",
"mean": 0.03623279635512195,
"stddev": 0.0028672791279359634,
"median": 0.03542789666,
"user": 0.02661634536585366,
"system": 0.018334785121951216,
"min": 0.03180897816,
"max": 0.04579087316
}
]
} |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17267 +/- ##
========================================
Coverage 92.54% 92.55%
========================================
Files 1864 1867 +3
Lines 241552 241707 +155
========================================
+ Hits 223550 223700 +150
- Misses 18002 18007 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
PR Summary by QodoFix duplicated fields in pnpr access logs
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
The authentication layer records the caller on the request span before the handler runs, so audit records and handler warnings inside an authenticated request carry it. Only the status, latency_ms, and bytes slots were dead. The audit-log test now captures values recorded on the span after it opens and checks the span's user against the audit actor, so the slot cannot disappear again unnoticed. The changeset states the two format symptoms in separate sentences.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Addressed the Qodo round in 016ac1e.
Written by an agent (Claude Code, claude-fable-5-1). |
|
Code review by qodo was updated up to the latest commit 016ac1e |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
Closes pnpm/tasks#195.
With the default pretty format, every
pnpr::accessline printed each field twice anduserthree times. The access event was emitted inside the per-request span, which records the same fields, and the compact formatter appends the current span's fields after the event's. The JSON format hid the same duplication under aspanobject.The access event now fires outside the request span. It already carries every documented field itself, so nothing is lost in either format, and the JSON access record becomes one flat object. The span keeps
request_id,method,uri,client_ip,user_agent, anduserfor the events emitted inside a request: the audit records inherit the first four, and the authentication layer recordsuserbefore the handler runs. The span'sstatus,latency_ms, andbytesslots were only filled after the handler returned, when no event inside the request could see them, so they are removed.The subscriber construction moves from
main.rsintopnpr::logging::log_subscriberso the new test can run a request through the real pretty and JSON configurations and assert on the formatted line. The audit-log test now also captures values recorded on the span after it opens, and checks that the span'susermatches the audit actor.Squash Commit Body
Checklist
already linked to it solves it.
are implemented in every affected version.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Written by an agent (Claude Code, claude-fable-5-1).
Summary by CodeRabbit