Skip to content

fix: gate release metadata before publish - #1163

Merged
kang-heewon merged 1 commit into
trunkfrom
fix/1138-release-metadata-gate
Jul 1, 2026
Merged

fix: gate release metadata before publish#1163
kang-heewon merged 1 commit into
trunkfrom
fix/1138-release-metadata-gate

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Jul 1, 2026

Copy link
Copy Markdown
Member

Fixes #1138.

Summary

  • Splits release workflow routing so raw .changeset updates can update the Changesets release PR without running publish-only gates.
  • Adds a strict release metadata check before dry-run publish that blocks non-private packages with 0.0.0 versions or missing CHANGELOG.md, with explicit Changesets recovery guidance.
  • Keeps release-gate maintenance changes self-checkable on current trunk by allowing placeholder metadata only when a pending changeset covers the package.
  • Updates package-bin smoke consumers to place temporary tarball overrides in 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 --check and git diff --cached --check - passed.

Self-review gates

  • Correctness/regression: PASS. Raw changesets no longer trigger strict publish gates, publish candidates run the strict metadata gate before dry-run publish, and tests cover routing, ordering, maintenance self-checks, strict failures, pending changeset allowance, and invalid-manifest failures.
  • API/security/compatibility/release: PASS. Runtime package APIs and dependencies are unchanged; no credentials are introduced; release metadata failures preserve explicit package/file diagnostics and recovery guidance.
  • Maintainability/minimality: PASS. The gate reuses existing package-manifest discovery and Changesets frontmatter, avoids a new dependency, and keeps the workflow split local to release routing.

Review and QA

  • Independent code review: APPROVE with no actionable findings.
  • Verifier review: initial PARTIAL due untracked new files and actionlint SC2129 style warnings; both were fixed before commit.
  • UltraQA: PASS. Strict mode was exercised against the current repository and blocked existing placeholders; maintenance mode was exercised against pending changesets and passed; pnpm 11 smoke failure was reproduced manually and fixed by moving temporary overrides to pnpm-workspace.yaml.

Notes

  • Local commit and push used LEFTHOOK=0 after Lefthook invoked direct pnpm paths that prompted interactively to remove/reinstall workspace node_modules in 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

  • 새 기능

    • 릴리즈 상태를 더 세분화해, 릴리즈 PR 업데이트와 게시 게이트 점검을 각각 처리하도록 개선했습니다.
    • 릴리즈 메타데이터 검사 단계가 추가되어 배포 전 필요한 정보 누락을 더 쉽게 확인할 수 있습니다.
  • 버그 수정

    • 변경 감지와 수동 실행 시 릴리즈 작업 판단이 더 일관되게 동작하도록 정리했습니다.
    • 게시 후보와 유지보수 변경이 서로 다른 경로로 정확히 분기되도록 개선했습니다.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@kang-heewon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2479b3e6-7b88-4d46-bad3-772ca08e11e3

📥 Commits

Reviewing files that changed from the base of the PR and between ff8054a and 02ed04d.

📒 Files selected for processing (7)
  • .github/workflows/release.yml
  • packages/migration-runner/src/tests/PublishedCli.spec.ts
  • packages/rpc-codegen/src/tests/PublishedCli.spec.ts
  • scripts/package-bin-smoke.mts
  • scripts/release-metadata-check.mts
  • scripts/tests/release-metadata-check.spec.ts
  • scripts/tests/release-workflow.spec.ts
📝 Walkthrough

Walkthrough

release.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

릴리스 퍼블리시 게이팅

Layer / File(s) Summary
워크플로우 라우팅 플래그 분리
.github/workflows/release.yml
should_publish 단일 조건을 should_update_release_pr, should_run_publish_gates, should_verify_release_gate_maintenance로 분리하고, 각 단계 조건 및 self-check 단계(release-metadata-check.mts 실행 추가)를 재구성했습니다.
release-metadata-check 스크립트 구현
scripts/release-metadata-check.mts
packages/ 하위 package.json의 name/version(0.0.0 금지)/CHANGELOG.md 존재를 검사하고, .changeset 메타데이터 기반 pending 예외를 처리해 blockedDiagnostics 존재 시 exit(1)로 종료하는 CLI를 추가했습니다.
release-metadata-check 테스트
scripts/tests/release-metadata-check.spec.ts
임시 디렉터리와 spawnSync를 이용해 publishable/private 스킵, placeholder 버전/누락 changelog 리포트, --allow-pending-changesets 동작, pending changesets가 잘못된 메타데이터를 가리지 못함을 검증했습니다.
워크플로우 라우팅 테스트
scripts/tests/release-workflow.spec.ts
release PR 업데이트/퍼블리시 후보 패턴과 라우팅 예측자를 도입해 changesets/퍼블리시 후보/혼합/workflow_dispatch 케이스, Release metadata check 단계 마커, 유지보수 전용 변경의 라우팅 결과를 검증했습니다.

패키지 스모크 테스트 소비자 구성

Layer / File(s) Summary
소비자 pnpm 워크스페이스 오버라이드 이동
scripts/package-bin-smoke.mts
consumerRoot/package.json에서 pnpm.overrides 구성을 제거하고 packages: [] 및 overrides를 포함한 pnpm-workspace.yaml을 새로 작성하도록 변경했습니다.

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 생성/퍼블리시
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning scripts/package-bin-smoke.mts의 pnpm-workspace.yaml 변경은 #1138의 릴리스 메타데이터 게이트 요구와 직접 관련이 없습니다. 이 pnpm 소비자 설정 변경은 별도 PR로 분리하거나, 릴리스 게이트 구현에 필수임을 설명할 근거를 추가하세요.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 릴리스 메타데이터 게이트를 publish 전에 추가한다는 핵심 변경을 간결하게 설명합니다.
Linked Issues check ✅ Passed 릴리스 메타데이터 검사와 워크플로우 선행 실행이 #1138의 publishable 0.0.0 및 누락 changelog 차단 요구를 충족합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1138-release-metadata-gate

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

📊 Benchmark Results

❌ Some benchmarks failed

Gate failures

  • CrocoApp constructor: p75 8.8μs exceeds baseline 3.4μs by more than 20%
  • CrocoApp lambdaHandler (10 controllers): p75 260.4μs exceeds baseline 33.3μs by more than 20%
  • Lambda cold-start simulation: p75 412.5μs exceeds baseline 70.2μs by more than 20%
  • Lambda cold-start with headers: p75 362.5μs exceeds baseline 66.7μs by more than 20%
  • Lambda cold-start with binary body: p75 322.8μs exceeds baseline 63.2μs by more than 20%
  • Lambda cold-start with query params: p75 276.3μs exceeds baseline 63.9μs by more than 20%
  • Lambda cold-start with authorizer context: p75 276.6μs exceeds baseline 59.8μs by more than 20%
  • Lambda cold-start realistic scenario: p75 275.4μs exceeds baseline 60.2μs by more than 20%
  • EventBusConfig.start (10 handlers): p75 1.6μs exceeds baseline 0.9μs by more than 20%
  • EventPublisher.publishNow single event: p75 1.8μs exceeds baseline 1.1μs by more than 20%
  • DefaultHandlerResolver.resolve × 10: p75 0.1μs exceeds baseline 0.0μs by more than 20%
  • Container.get singleton (cold): p75 58.9μs exceeds baseline 0.6μs by more than 20%
  • Container.register × 50 components: p75 3.1ms exceeds baseline 12.1μs by more than 20%
  • Container.validate (50 components): p75 3.0ms exceeds baseline 29.7μs by more than 20%
  • Container.get singleton (warm): p75 1.6μs exceeds baseline 0.3μs by more than 20%
  • lambdaPreset config creation: p75 1.4μs exceeds baseline 1.0μs by more than 20%
Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 8.8μs 30.0ms 3.4μs +161.5% -
CrocoApp lambdaHandler (10 controllers) 260.4μs 50.0ms 33.3μs +682.2% -
Lambda cold-start simulation 412.5μs 80.0ms 70.2μs +487.9% -
Lambda cold-start with headers 362.5μs 80.0ms 66.7μs +443.0% -
Lambda cold-start with binary body 322.8μs 80.0ms 63.2μs +411.0% -
Lambda cold-start with query params 276.3μs 80.0ms 63.9μs +332.5% -
Lambda cold-start with authorizer context 276.6μs 80.0ms 59.8μs +362.6% -
Lambda cold-start realistic scenario 275.4μs 80.0ms 60.2μs +357.7% -
EventBusConfig.start (10 handlers) 1.6μs 10.0ms 0.9μs +79.7% -
EventPublisher.publishNow single event 1.8μs 2.0ms 1.1μs +68.3% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.0μs +90.5% -
Container.get singleton (cold) 58.9μs 5.0ms 0.6μs +9319.0% -
Container.register × 50 components 3.1ms 10.0ms 12.1μs +25788.6% -
Container.validate (50 components) 3.0ms 20.0ms 29.7μs +9958.8% -
Container.get singleton (warm) 1.6μs 500.0μs 0.3μs +431.8% -
TelemetryRuntime.init (lambda preset) 1.1ms 200.0ms 69.3ms -98.5% -
lambdaPreset config creation 1.4μs 2.0ms 1.0μs +37.2% -

Updated: 2026-07-01T10:51:56.444Z · Commit: 52decad

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between dc5e4e9 and ff8054a.

📒 Files selected for processing (5)
  • .github/workflows/release.yml
  • scripts/package-bin-smoke.mts
  • scripts/release-metadata-check.mts
  • scripts/tests/release-metadata-check.spec.ts
  • scripts/tests/release-workflow.spec.ts

Comment thread .github/workflows/release.yml
Comment thread scripts/release-metadata-check.mts
Comment thread scripts/tests/release-metadata-check.spec.ts
@kang-heewon
kang-heewon force-pushed the fix/1138-release-metadata-gate branch from ff8054a to 4b80d82 Compare July 1, 2026 09:58
@kang-heewon
kang-heewon force-pushed the fix/1138-release-metadata-gate branch from 4b80d82 to c760a71 Compare July 1, 2026 10:32
@kang-heewon
kang-heewon force-pushed the fix/1138-release-metadata-gate branch from c760a71 to 02ed04d Compare July 1, 2026 10:44
@kang-heewon
kang-heewon merged commit 0b78820 into trunk Jul 1, 2026
8 of 9 checks passed
@kang-heewon
kang-heewon deleted the fix/1138-release-metadata-gate branch July 1, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[release] Gate publishable 0.0.0 packages and missing changelogs

1 participant