Repository navigation
fix: pnpm publish --otp and pnpm publish --batch --otp to send the configured OTP to the registry - #12957
Conversation
|
💖 Thanks for opening this pull request! 💖 |
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis change preserves configured OTP values in regular and batch publish flows, verifies registry header propagation and first-attempt handling, and adds patch-release metadata. ChangesPublish OTP propagation
Estimated code review effort: 2 (Simple) | ~10 minutes 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 |
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? |
Confidence Score: 5/5Safe to merge — the change is a targeted one-line fix in two files, backed by new test coverage in both TypeScript and Rust. The fix correctly uses ?? so the user-supplied OTP is forwarded on the first attempt while a challenge-obtained OTP still takes precedence on retry. The ?? operator (not ||) means even an empty-string OTP from the challenge round-trip is correctly preserved. New tests in both the TS and Rust layers confirm the first-request OTP header is present, and the existing OTP-challenge flow tests still pass unchanged. No files require special attention. Reviews (4): Last reviewed commit: "test(publish): cover configured OTP on t..." | Re-trigger Greptile |
pnpm publish --otp and pnpm publish --batch --otp to send the configured OTP to the registrypnpm publish --otp and pnpm publish --batch --otp to send the configured OTP to the registry
…he configured OTP to the registry
Code Review by Qodo
Context used✅ Compliance rules (platform):
18 rules 1. Redundant test doc comment
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
…ndling
The comment still described the pre-fix `{ ...publishOptions, otp }` behavior
and claimed the spread adds `otp: undefined`. Describe the current contract:
the first call falls back to the configured `--otp`, a retry OTP takes
precedence, and the undefined-is-absent note applies only when both are unset.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 9418f88 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
pacquet's `publish_with_otp_handling` already forwards a statically configured `--otp` on the first PUT (the operation closure falls back to it when no challenge OTP is present), but no test guarded that: every existing case passed `otp = None`. Add a regression test that mocks a single PUT matching `npm-otp` with no challenge, mirroring the TypeScript CLI's "preserves OTP from publish options on the first publish attempt" test so the two stacks keep matching coverage. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Code review by qodo was updated up to the latest commit 12acbb8 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR.
|
Summary
I found this when testing if Changesets correctly handle pnpm 11.
Squash 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
pnpm publish --otpandpnpm publish --batch --otpto send the configured OTP on the first registry request.otp: undefinedduring initial attempts when an OTP is already available.npm-otpheader is correctly included for batch publishing and that OTP is forwarded unchanged for OTP handling.