fix: gate release metadata before publish - #1163
Conversation
|
Warning Review limit reached
Next review available in: 47 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: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughrelease.yml의 릴리스 라우팅 로직이 should_publish 단일 플래그에서 should_update_release_pr, should_run_publish_gates, should_verify_release_gate_maintenance 세 플래그로 분리되었습니다. 퍼블리시 가능한 패키지의 버전/CHANGELOG 메타데이터를 검사하는 release-metadata-check.mts 스크립트가 신규 추가되어 워크플로우와 pnpm check 흐름에 연동되었고, 관련 테스트가 함께 추가/갱신되었습니다. 별도로 package-bin-smoke.mts의 pnpm overrides 설정 위치가 pnpm-workspace.yaml로 이동했습니다. Changes릴리스 퍼블리시 게이팅
패키지 스모크 테스트 소비자 구성
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow as Release Workflow
participant Detector as Change Detector
participant MetadataCheck as release-metadata-check.mts
participant PublishSteps as Publish Gate Steps
Workflow->>Detector: 변경된 파일 목록 전달
Detector->>Detector: release PR/퍼블리시 후보/유지보수 패턴 매칭
Detector->>Workflow: should_update_release_pr, should_run_publish_gates, should_verify_release_gate_maintenance 출력
Workflow->>MetadataCheck: should_run_publish_gates=true 시 실행
MetadataCheck->>MetadataCheck: 패키지 name/version/CHANGELOG 검사
MetadataCheck-->>Workflow: blockedDiagnostics 있으면 exit(1)
Workflow->>PublishSteps: should_run_publish_gates=true 시 audit/build/typecheck/test 실행
Workflow->>Workflow: should_update_release_pr 또는 should_run_publish_gates 시 Release PR 생성/퍼블리시
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
📊 Benchmark Results❌ Some benchmarks failed Gate failures
Updated: 2026-07-01T10:51:56.444Z · Commit: 52decad |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 50-52: The release workflow pattern for release PR updates is too
broad because `release_pr_update_pattern` in the release workflow matches
`.changeset/README.md`, which conflicts with the `readChangesetFiles` logic that
explicitly excludes `README.md`. Tighten the regex in the release workflow so
README changes are ignored while valid changeset files still match, and add a
regression test in `scripts/tests/release-workflow.spec.ts` covering a
`.changeset/README.md` change to ensure `should_update_release_pr` stays false.
In `@scripts/release-metadata-check.mts`:
- Around line 144-152: The pending classification in release-metadata-check.mts
is tied to exact message text, so updates or localization can break
--allow-pending-changesets detection. Add stable diagnostic codes (for example
via the manifest/version and changelog checks) when pushing entries in the
validation logic, then update the pending filter to test those codes instead of
comparing message strings. Keep the existing messages for display, but make the
classification path use the new code-based values in the pending-checking flow.
In `@scripts/tests/release-metadata-check.spec.ts`:
- Around line 181-195: The runScript helper currently calls spawnSync without
any timeout, which can let a hung child process block the test suite; update
runScript to pass a timeout option to spawnSync so it fails fast. Use the
existing runScript and spawnSync call in release-metadata-check.spec.ts to
locate the change, and keep the returned ScriptResult behavior unchanged while
ensuring timeout-related failures surface clearly.
🪄 Autofix (Beta)
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: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 73132c93-0a6c-406f-a915-cf591f18cddd
📒 Files selected for processing (5)
.github/workflows/release.ymlscripts/package-bin-smoke.mtsscripts/release-metadata-check.mtsscripts/tests/release-metadata-check.spec.tsscripts/tests/release-workflow.spec.ts
ff8054a to
4b80d82
Compare
4b80d82 to
c760a71
Compare
c760a71 to
02ed04d
Compare
Fixes #1138.
Summary
.changesetupdates can update the Changesets release PR without running publish-only gates.0.0.0versions or missingCHANGELOG.md, with explicit Changesets recovery guidance.pnpm-workspace.yaml, matching pnpm 11 settings behavior.Verification
CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm exec vitest run scripts/tests/release-workflow.spec.ts scripts/tests/release-metadata-check.spec.ts scripts/tests/package-bin-smoke.spec.ts --config vitest.config.ts- passed, 19 tests.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm exec vitest run scripts/tests/release-workflow.spec.ts scripts/tests/package-entrypoint-smoke.spec.ts scripts/tests/package-bin-smoke.spec.ts scripts/tests/release-docs-check.spec.ts scripts/tests/release-metadata-check.spec.ts scripts/tests/changeset-required-check.spec.ts scripts/tests/normalize-packages.spec.ts --config vitest.config.ts- passed, 62 tests.if command -v actionlint >/dev/null 2>&1; then actionlint .github/workflows/release.yml; elif [ -x node_modules/.bin/actionlint ]; then node_modules/.bin/actionlint .github/workflows/release.yml; else echo 'actionlint not installed'; fi- passed.node --experimental-strip-types scripts/release-metadata-check.mts --allow-pending-changesets- passed, 14 pending changeset recoveries reported.node --experimental-strip-types scripts/release-metadata-check.mts- failed as expected with 14 release metadata violations and recovery guidance.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm build- passed, 113 Turbo tasks successful.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm package-manifests:check- passed.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm release-docs:check- passed.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm package-entrypoints:smoke- passed, 109 packages checked and 1 exempt.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm package-bins:smoke- passed, 5 packages and 5 bins checked.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm check- passed.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm typecheck- passed, 224 Turbo tasks successful.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm test- passed, 225 Turbo tasks successful.CI=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack pnpm changeset-required:check -- --base origin/trunk --head HEAD- passed, no publishable package behavior changes detected.git diff --checkandgit diff --cached --check- passed.Self-review gates
Review and QA
pnpm-workspace.yaml.Notes
LEFTHOOK=0after Lefthook invoked directpnpmpaths that prompted interactively to remove/reinstall workspacenode_modulesin this non-interactive worktree. The equivalent formatter, lint, workflow lint, release-maintenance tests, build, check, typecheck, test, changeset, metadata, and diff gates above passed explicitly through Corepack/manual commands before PR creation.Summary by CodeRabbit
새 기능
버그 수정