Fail closed on npm publication state (v1.2.3) - #66
Conversation
|
Warning Review limit reached
Next review available in: 52 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe release updates version ChangesNPM publication verification
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant publishJob
participant resolveNpmPublicationState
participant npmRegistry
publishJob->>resolveNpmPublicationState: Check publication-state
resolveNpmPublicationState->>npmRegistry: Validate expected version and integrity
npmRegistry-->>resolveNpmPublicationState: Return publication metadata
resolveNpmPublicationState-->>publishJob: Return absent, present, or error
publishJob->>npmRegistry: Publish when state is absent
publishJob->>resolveNpmPublicationState: Require present package and latest selector
resolveNpmPublicationState->>npmRegistry: Verify published metadata
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
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 `@scripts/resolve-npm-publication.mjs`:
- Around line 14-19: Update requireIntegrity in
scripts/resolve-npm-publication.mjs at lines 14-19 to decode the SRI payload
after the existing syntax check and reject it unless the decoded digest is
exactly 64 bytes. In tests/npm-publication-state.test.ts at lines 4-8, replace
the short integrity fixture with a valid 64-byte SHA-512 SRI value and add a
test asserting that a short digest is rejected.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f29ac10e-7f86-4f7b-a256-44840095b11d
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.github/workflows/publish.ymlCHANGELOG.mdpackage.jsonscripts/resolve-npm-publication.mjssrc/version.tstests/npm-publication-state.test.tstests/release-readiness.test.ts
Summary
npm view --json | jq ... || truepublication detection with a built-in-fetch resolverlatestagainst the checksummed tarball before completing releaseRed-green evidence
31508966331: unprivileged verify green, publisher failed because npm E404 JSON was coerced into non-empty integrity; public registry independently returned E404npm view/|| true, and version contract was 1.2.2latest, name/version/integrity mismatch, malformed metadata/JSON, 503, and network errorsabsentfor oilpriceapi@1.2.3The v1.2.2 GitHub release is marked prerelease/non-latest with an explicit halted notice. The orphan v1.4.1 tag remains untouched.
Summary by CodeRabbit
New Features
latesttag.Bug Fixes
Chores