Repository navigation
Conversation
Keep staged publishing above direct OIDC publishing in the trust-policy ranking. Use the stronger release path instead of lowering the rank. Stage the TypeScript `@pnpm/exe` and `pnpm` packages in dependency order. Stage Rust native packages, wrappers, and the `pnpm` gate as separate layers. Each layer waits for interactive 2FA approval before the next one is created. Closes #13693.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR adds a Bash utility for staged npm publication. Release workflows use staged OIDC publication for TypeScript and Rust packages. CI tests the utility, and ChangesStaged npm publication
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseWorkflow
participant PublicationScript
participant NpmRegistry
ReleaseWorkflow->>PublicationScript: Stage package dependency layer
PublicationScript->>NpmRegistry: Check publication state
PublicationScript->>NpmRegistry: Submit unpublished package stage
PublicationScript-->>ReleaseWorkflow: Return stage ID or failure
Assessment against linked issues
Out-of-scope changes
Possibly related PRs
Suggested reviewers: ✨ 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 |
PR Summary by QodoCI(release): stage npm publishes and wait for 2FA approval between dependency layers
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previous shared-deadline issue is eliminated because the workflow no longer waits for approval, and the previously withdrawn dependency-layer concern reflects the documented stage-only release model. Reviews (4): Last reviewed commit: "fix(release): silence staged publication..." | 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 @.github/scripts/npm-staged-publication.sh:
- Around line 94-100: Update the poll_seconds validation in the publication
script to require a positive integer, rejecting zero while preserving the
existing error and return behavior for invalid values. Leave timeout_seconds
validation unchanged.
In @.github/scripts/npm-staged-publication.test.sh:
- Around line 97-107: Extend the missing-stage-ID test around
npm-staged-publication.sh to make the fake pnpm response emit
::warning::forged-stage-output, then assert the captured output logs it only
with the controlled “stage output:” prefix and contains no line beginning with
the forged workflow command. Preserve the existing failure and missing-stage-ID
assertions.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 44a2e97e-fd33-4fe0-9309-dd006fc166ea
📒 Files selected for processing (5)
.github/scripts/npm-staged-publication.sh.github/scripts/npm-staged-publication.test.sh.github/workflows/ci.yml.github/workflows/release.ymlRELEASING.md
Code Review by Qodo
1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Pin publication checks and staging to the npm registry. Ignore ambient auth configuration during staged publishing. Retry transient publication lookups while bounding persistent failures. Reject zero-second polling and test sanitized registry output. Cap each approval layer at 90 minutes so all Rust layers fit within the job deadline.
|
Addressed the wait-loop reliability finding in a4f1d15. A transient The same commit also pins publication traffic to npm, rejects zero-second polling, adds the forged workflow-command regression, and gives every approval layer its own 90-minute window. Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit a4f1d15 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/scripts/npm-package-publication-state.sh (1)
6-8: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low valueKeep the npm registry probe configuration-safe.
npm viewis pinned toregistry.npmjs.org/, but npm can still apply local/global npmrc or environment variable configuration during the lookup. Add regression coverage in.github/scripts/npm-package-publication-state.test.shfor npm behavior under npmrc/config and auth-related configuration, so future changes cannot introduce unprivileged credential leaks.🤖 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 @.github/scripts/npm-package-publication-state.sh around lines 6 - 8, Update the npm view probe in the publication-state script to prevent local/global npmrc and environment configuration from affecting the registry lookup, while preserving the explicit npmjs registry. Add regression cases in npm-package-publication-state.test.sh covering npmrc/config and auth-related settings, verifying credentials are not exposed without privileged access.
🤖 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 @.github/scripts/npm-package-publication-state.sh:
- Around line 6-8: Update the npm view probe in the publication-state script to
prevent local/global npmrc and environment configuration from affecting the
registry lookup, while preserving the explicit npmjs registry. Add regression
cases in npm-package-publication-state.test.sh covering npmrc/config and
auth-related settings, verifying credentials are not exposed without privileged
access.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 85b52c32-52ce-4732-98cf-e120409bd274
📒 Files selected for processing (6)
.github/scripts/npm-package-publication-state.sh.github/scripts/npm-package-publication-state.test.sh.github/scripts/npm-staged-publication.sh.github/scripts/npm-staged-publication.test.sh.github/workflows/release.ymlRELEASING.md
🚧 Files skipped from review as they are similar to previous changes (3)
- RELEASING.md
- .github/scripts/npm-staged-publication.sh
- .github/workflows/release.yml
Remove approval polling from CI. Stage native packages, wrappers, and pnpm in one workflow run. Maintainers approve the completed stages later in dependency order.
|
Follow-up d9ecd3c simplifies the handoff: CI now stages every dependency layer and finishes without polling for approval. The completed job summary contains all stage IDs; a maintainer can approve them later with interactive 2FA, in dependency order and with This supersedes the earlier 90-minute wait design and removes the polling code entirely. The npm registry pinning, isolated auth configuration, already-published rerun guard, and forged workflow-command regression remain. Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit d9ecd3c |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/scripts/npm-staged-publication.sh (1)
62-72: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick winReject multi-line
stage_idvalues before logging them.Line 63 accepts any non-empty JSON string.
jq -rconverts escaped line breaks into real line breaks. A stage ID such asok\n::warning::forgedreaches line 70, where GitHub Actions reads the second line as a workflow command.Reject
\rand\ninstage_idbefore writing it to stdout orGITHUB_STEP_SUMMARY. Add a success-path regression case with a forged command in the stage ID.Proposed fix
if ! stage_id=$(jq -er --arg name "$name" \ '.[$name].stageId | strings | select(length > 0)' <<< "$stage_output"); then # existing error handling return 1 fi + if [[ $stage_id == *$'\r'* || $stage_id == *$'\n'* ]]; then + echo "::error::pnpm stage publish returned an unsafe stage ID for $package_spec" >&2 + return 1 + fi echo "Staged $package_spec with ID $stage_id"Based on learnings: external responses must be sanitized before they are logged by GitHub Actions.
🤖 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 @.github/scripts/npm-staged-publication.sh around lines 62 - 72, Validate the extracted stage_id in the staging flow before the success message or GITHUB_STEP_SUMMARY write, rejecting any value containing carriage-return or newline characters and returning failure through the existing error path. Add a success-path regression case using a stage ID containing a forged GitHub Actions command, asserting it is rejected and never emitted as workflow output.Source: Learnings
🤖 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 @.github/workflows/release.yml:
- Around line 944-970: Stage each release dependency layer only after its own
approval: persist the stage IDs and poll with a bounded timeout after native
packages before the Rust wrappers, after wrappers before the Rust pnpm package,
and at the TypeScript pnpm flow before staging the package, covering release.yml
ranges 944-970 and 451-460. Update npm-staged-publication.sh lines 83-88 to emit
the stage IDs and per-layer approval information needed by this workflow instead
of instructing approval only after the workflow completes.
---
Outside diff comments:
In @.github/scripts/npm-staged-publication.sh:
- Around line 62-72: Validate the extracted stage_id in the staging flow before
the success message or GITHUB_STEP_SUMMARY write, rejecting any value containing
carriage-return or newline characters and returning failure through the existing
error path. Add a success-path regression case using a stage ID containing a
forged GitHub Actions command, asserting it is rejected and never emitted as
workflow output.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 98dec113-db98-4229-8995-0f49a8aca8e9
📒 Files selected for processing (4)
.github/scripts/npm-staged-publication.sh.github/scripts/npm-staged-publication.test.sh.github/workflows/release.ymlRELEASING.md
🚧 Files skipped from review as they are similar to previous changes (1)
- RELEASING.md
|
Local pnpr verification found and fixed an output-parsing issue in e39f46d. I then exercised the staged release shape against a live local pnpr registry:
The local run used pnpr bearer authentication and omitted npm provenance, since GitHub OIDC issuance and npm trusted-publisher policy cannot be reproduced locally. The production-only OIDC/provenance portion remains covered by the release configuration and existing publish implementation; the stage protocol, CLI output contract, dependency ordering, and post-approval installation were exercised end to end. The helper test, Written by an agent (Codex, GPT-5). |
|
Code review by qodo was updated up to the latest commit e39f46d |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Summary
@pnpm/exeandpnpmpackages through OIDC without giving CI approval or direct-publish permission.@pnpm/napiand@pnpm/exewrappers, andpnpmgate in one workflow run.pnpmuntil last.trustPolicy=no-downgrade, fixing Exclude pnpm from global trustPolicy by default, otherwise causes self-update command not work #13693 without weakening the policy.Before this workflow is used, the npm trusted publishers for
pnpm,@pnpm/exe,@pnpm/napi, and their platform packages need to be configured for staged publishing only. That lets CI create stages but reserves approval and publication for a maintainer using interactive 2FA.Squash Commit Body
Checklist
already linked to it solves it.
pnpm/port, or the description notes what still needs porting.Written by an agent (Codex, GPT-5).
Summary by CodeRabbit
Release Process
Documentation
Tests