fix(pacquet/cli): patch --version literal during release build#11812
Conversation
The `pacquet --version` string is a hardcoded clap attribute in `cli_args.rs`. It didn't get bumped for the 0.2.2 release, so the published binary still reports 0.2.1. Bump the literal to 0.2.2 and add a release-workflow step that rewrites the attribute from `inputs.version` before `cross build`, so future releases stay correct automatically. A trailing `grep -F` fails the job loudly if the regex stops matching after a future refactor of the attribute.
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? |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
🧰 Additional context used📓 Path-based instructions (1)pacquet/**/*.rs📄 CodeRabbit inference engine (pacquet/AGENTS.md)
Files:
🧠 Learnings (2)📚 Learning: 2026-05-20T19:40:55.051ZApplied to files:
📚 Learning: 2026-05-20T23:07:58.444ZApplied to files:
🔇 Additional comments (2)
📝 WalkthroughWalkthroughThis PR automates version injection for pacquet CLI releases. The workflow now validates a manually provided semver version and patches the CLI clap version attribute during the build step, ensuring the compiled binary reports the intended release version without manual source edits. ChangesRelease Version Management
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11812 +/- ##
=======================================
Coverage 87.47% 87.47%
=======================================
Files 202 202
Lines 23704 23704
=======================================
Hits 20735 20735
Misses 2969 2969 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Scenario: Frozen Lockfile
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.4623472442999996,
"stddev": 0.05693212216118505,
"median": 2.4612821928999997,
"user": 2.74035124,
"system": 3.7955662400000003,
"min": 2.3781981049,
"max": 2.5312554489,
"times": [
2.5121219809,
2.5312554489,
2.4125988039,
2.3898779539,
2.4645570868999997,
2.3781981049,
2.4580072989,
2.5296735739,
2.5077110979,
2.4394710929
]
},
{
"command": "pacquet@main",
"mean": 2.4156959388,
"stddev": 0.060074574006443,
"median": 2.4028696254,
"user": 2.7709589399999994,
"system": 3.7745668399999994,
"min": 2.3528810319,
"max": 2.5545166389,
"times": [
2.3936644939,
2.4121327009,
2.3528810319,
2.3823691089,
2.5545166389,
2.4093833409,
2.4830053479,
2.4010319849,
2.3632674739,
2.4047072659
]
},
{
"command": "pnpm",
"mean": 4.927063482300001,
"stddev": 0.03887862590865631,
"median": 4.9278037359,
"user": 8.338695140000002,
"system": 4.322487539999999,
"min": 4.8630045689,
"max": 4.996393059900001,
"times": [
4.9501187709000005,
4.8630045689,
4.933007459900001,
4.960582677900001,
4.9241397539000005,
4.9314677179,
4.914547805900001,
4.996393059900001,
4.8741071819,
4.923265825900001
]
}
]
}Scenario: Frozen Lockfile (Hot Cache)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.69531208356,
"stddev": 0.04760048689515899,
"median": 0.67857499126,
"user": 0.3881392,
"system": 1.55811656,
"min": 0.66638772426,
"max": 0.82290018026,
"times": [
0.82290018026,
0.67094635626,
0.67798582826,
0.6676102592600001,
0.71935072126,
0.69154352826,
0.68874787226,
0.66848421126,
0.67916415426,
0.66638772426
]
},
{
"command": "pacquet@main",
"mean": 0.6926755337599999,
"stddev": 0.04072978448966641,
"median": 0.6778802242599999,
"user": 0.38956329999999995,
"system": 1.5656124599999999,
"min": 0.65426460526,
"max": 0.7846380322600001,
"times": [
0.72335206726,
0.7846380322600001,
0.66431414826,
0.65426460526,
0.67283151326,
0.66243394126,
0.70823527526,
0.71462427026,
0.68292893526,
0.65913254926
]
},
{
"command": "pnpm",
"mean": 2.6218551658600004,
"stddev": 0.12312314229710096,
"median": 2.5902588047600004,
"user": 3.2771828,
"system": 2.2619941599999995,
"min": 2.4878528062600003,
"max": 2.90180992426,
"times": [
2.6628088452600003,
2.53251104826,
2.4878528062600003,
2.67428121926,
2.5205748952600002,
2.5437069342600003,
2.7144883762600003,
2.6096494862600004,
2.5708681232600004,
2.90180992426
]
}
]
} |
Summary
pacquet --versionreports a hardcoded clap attribute literal inpacquet/crates/cli/src/cli_args.rs. It wasn't bumped for the 0.2.2 release, so the published 0.2.2 binary still reports 0.2.1. Bump the literal to0.2.2..github/workflows/pacquet-release-to-npm.yml) that rewrites the attribute frominputs.versionbeforecross build, so future releases stay correct without anyone having to remember.The substitution is a portable
perl -i -pe(matching macOS / Linux / Windows-bash matrix legs); a trailinggrep -Ffails the job loudly if the regex stops matching after a future refactor of the attribute. The sameinputs.versionsemver check that already gates the publish job now also runs at the top of the matched build step, so an invalid version fails early instead of after six parallel builds.Test plan
cli_args.rswith a0.2.3-rc.1-style value (done; substitution lands andgrep -Fsucceeds).pacquet --versionmatchesinputs.version.Written by an agent (Claude Code, claude-opus-4-7).
Summary by CodeRabbit