Skip to content

fix: make generated workspace installs reproducible - #1742

Merged
kang-heewon merged 4 commits into
trunkfrom
fix/1689-reproducible-scaffolds
Aug 7, 2026
Merged

fix: make generated workspace installs reproducible#1742
kang-heewon merged 4 commits into
trunkfrom
fix/1689-reproducible-scaffolds

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Aug 4, 2026

Copy link
Copy Markdown
Member

Outcome

Fresh generated workspaces now pin Turbo to the root-supported 2.10.2 release. Default dependency installation explicitly creates a lockfile before validating that the same lockfile is accepted in frozen mode, and generated-app smoke coverage repeats the CI install contract.

Fixes #1689

Verification

  • Two clean blank generations produced byte-identical lockfiles (c0dfc1b0a8323c94a7d91844913d6c1dd5b76dc75c6bab893be2dfdd480c71b0) and both passed pnpm install --frozen-lockfile.
  • pnpm --filter create-croco-app test — 137 passed.
  • pnpm exec vitest run scripts/tests/create-croco-app-generated-smoke.spec.ts --config vitest.config.ts — 35 passed.
  • Affected package typecheck and lint passed.
  • pnpm check — 24/25 passed, 1 not applicable, 0 failed.
  • Pre-push workspace gates — 234/234 test tasks and 233/233 typecheck tasks passed.
  • Generated-app smoke install and frozen-install steps passed for blank, SaaS, production app, admin console, and AI SaaS.

Review gates

  • Correctness and regression — PASS. Default installation creates and immediately validates the frozen lockfile; --no-install remains covered; clean generation produced identical dependency graphs.
  • API, security, compatibility, and release — PASS. Public exports are unchanged, every Turbo-bearing template is checked against the root version, and a patch changeset covers create-croco-app.
  • Maintainability and minimality — PASS after fix. The policy test recursively discovers template manifests instead of maintaining a manual template list; the diff stays within dependency bootstrap and its verification.

Residual risk

The admin-console smoke proceeds through install and frozen-install, then hits the existing time-dependent ExpiredGrantProblem tracked by #1735. The identical five failures reproduce on exact base SHA 31636bb5528ff23120bddbe111260c2f7f994b96; this PR does not alter the affected credit fixture.

Summary by CodeRabbit

  • 개선 사항
    • 생성 앱의 의존성 설치 과정과 lockfile 검증을 강화했습니다.
    • 모든 생성 템플릿의 Turbo 버전을 2.10.2로 고정해 일관된 개발 환경을 제공합니다.
  • 버그 수정
    • pnpm 미설치, 의존성 설치 실패, lockfile 검증 실패 시 단계별 복구 안내를 제공합니다.
    • 생성된 프로젝트가 frozen lockfile 설치에서도 정상적으로 검증되도록 개선했습니다.
  • 테스트
    • 템플릿의 Turbo 버전과 생성 앱의 lockfile 설치 상태를 자동으로 확인합니다.

@coderabbitai

coderabbitai Bot commented Aug 4, 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: 48 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 @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 Plus

Run ID: 3117e5ee-d933-432c-a836-bc749def9f49

📥 Commits

Reviewing files that changed from the base of the PR and between 9f70aa2 and b574575.

📒 Files selected for processing (2)
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/create-croco-app/test-fixtures/templates/container-fullstack/package.json.hbs
📝 Walkthrough

Walkthrough

create-croco-app 템플릿의 Turbo 버전을 2.10.2로 고정했습니다. 생성기 설치를 pnpm 가용성 확인, lockfile 갱신, frozen lockfile 검증의 단계로 변경했습니다. 오류 유형과 생성 앱 스모크 검증도 추가했습니다.

Changes

생성 워크스페이스 재현성

Layer / File(s) Summary
Turbo 버전 계약과 템플릿 검증
packages/create-croco-app/templates/*, packages/create-croco-app/test-fixtures/templates/*, packages/create-croco-app/src/tests/templates-build.spec.ts
관련 템플릿의 turbo 버전을 2.10.2로 고정했습니다. 테스트는 각 템플릿 버전이 루트 devDependencies.turbo와 일치하고 "latest"가 아닌지 확인합니다.
단계별 pnpm 설치와 오류 계약
packages/create-croco-app/src/libs/problems/PnpmCommandProblem.ts, packages/create-croco-app/src/generator.ts, packages/create-croco-app/src/tests/generator-install.spec.ts, scripts/static-misuse-raw-error-allowlist.json, tsconfig/contract-strict.baseline.json
생성기는 pnpm 가용성을 확인한 뒤 pnpm install --no-frozen-lockfilepnpm install --lockfile-only --frozen-lockfile을 실행합니다. 각 실패 단계는 코드, 단계, 명령, 복구 정보를 포함한 PnpmCommandProblem으로 처리합니다. 관련 테스트와 정적 검사 기준을 갱신했습니다.
생성 앱 frozen 검증과 릴리스 기록
scripts/create-croco-app-generated-smoke.mts, .changeset/fresh-scaffolds-lock-dependencies.md
생성 앱 스모크 테스트가 일반 설치 후 pnpm install --frozen-lockfile을 실행합니다. 변경 사항에 create-croco-app patch changeset을 추가했습니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Generator as create-croco-app generator
  participant Pnpm as pnpm
  participant Workspace as 생성 워크스페이스
  participant Smoke as 생성 앱 스모크 테스트
  Generator->>Pnpm: pnpm --version
  Pnpm-->>Generator: pnpm 가용성 결과
  Generator->>Pnpm: pnpm install --no-frozen-lockfile
  Pnpm->>Workspace: 의존성 설치 및 lockfile 갱신
  Generator->>Pnpm: pnpm install --lockfile-only --frozen-lockfile
  Pnpm->>Workspace: lockfile 검증
  Smoke->>Pnpm: pnpm install --frozen-lockfile
  Pnpm->>Workspace: 생성 앱 CI 설치 계약 검증
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 생성된 워크스페이스 설치의 재현성 개선이라는 핵심 변경을 간결하고 정확하게 설명합니다.
Linked Issues check ✅ Passed Turbo 고정, lockfile 생성 및 검증, 재현성 테스트, CI 설치 검증이 이슈 #1689의 요구사항을 충족합니다.
Out of Scope Changes check ✅ Passed 변경 사항은 의존성 부트스트랩과 검증 범위에 포함되며 애플리케이션 템플릿 동작 변경은 없습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1689-reproducible-scaffolds

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 Aug 4, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 37.0μs 30.0ms 8.2μs +352.5% -
CrocoApp lambdaHandler (10 controllers) 2.2ms 50.0ms 258.4μs +751.9% -
Lambda cold-start simulation 1.8ms 80.0ms 418.1μs +326.7% -
Lambda cold-start with headers 1.4ms 80.0ms 369.7μs +291.3% -
Lambda cold-start with binary body 1.4ms 80.0ms 339.1μs +324.4% -
Lambda cold-start with query params 1.4ms 80.0ms 301.3μs +374.0% -
Lambda cold-start with authorizer context 1.4ms 80.0ms 299.8μs +368.5% -
Lambda cold-start realistic scenario 1.4ms 80.0ms 299.2μs +360.3% -
EventBusConfig.start (10 handlers) 1.9μs 10.0ms 1.4μs +30.0% -
EventPublisher.publishNow single event 2.1μs 2.0ms 1.7μs +24.4% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs +0.0% -
Container.get singleton (cold) 64.3μs 5.0ms 70.3μs -8.5% -
Container.register × 50 components 3.1ms 10.0ms 3.2ms -3.4% -
Container.validate (50 components) 3.6ms 20.0ms 3.4ms +6.8% -
Container.get singleton (warm) 1.6μs 500.0μs 1.6μs +0.6% -
TelemetryRuntime.init (lambda preset) 2.3μs 200.0ms 1.1ms -99.8% -
lambdaPreset config creation 1.4μs 2.0ms 1.4μs +0.0% -

Updated: 2026-08-05T05:35:06.749Z · Commit: 5c32796

@kang-heewon
kang-heewon force-pushed the fix/1689-reproducible-scaffolds branch 5 times, most recently from 689fd75 to b531110 Compare August 4, 2026 14:25

@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: 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 `@packages/create-croco-app/src/tests/generator-install.spec.ts`:
- Around line 45-49: Update the generator install test assertions around
execSyncMock to verify call order and total invocation count, using
toHaveBeenNthCalledWith or mock.calls: assert the --no-frozen-lockfile command
is first and the --lockfile-only --frozen-lockfile command is second, while
preserving the existing cwd and stdio options.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0608a721-394e-420b-8522-09b7524986b6

📥 Commits

Reviewing files that changed from the base of the PR and between 1d5ed40 and b531110.

📒 Files selected for processing (11)
  • .changeset/fresh-scaffolds-lock-dependencies.md
  • packages/create-croco-app/src/generator.ts
  • packages/create-croco-app/src/tests/generator-install.spec.ts
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/create-croco-app/templates/admin-console/package.json.hbs
  • packages/create-croco-app/templates/ai-saas/package.json.hbs
  • packages/create-croco-app/templates/blank/package.json.hbs
  • packages/create-croco-app/templates/saas/package.json.hbs
  • packages/create-croco-app/templates/spa-be-split/package.json.hbs
  • packages/create-croco-app/test-fixtures/templates/ssr-lambda/package.json.hbs
  • scripts/create-croco-app-generated-smoke.mts

Comment thread packages/create-croco-app/src/tests/generator-install.spec.ts Outdated
@kang-heewon
kang-heewon force-pushed the fix/1689-reproducible-scaffolds branch from b531110 to d862d1f Compare August 4, 2026 14:47
@kang-heewon

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@kang-heewon
kang-heewon force-pushed the fix/1689-reproducible-scaffolds branch 5 times, most recently from e9a8b45 to 9ded80b Compare August 5, 2026 04:07
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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: 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 `@packages/create-croco-app/src/generator.ts`:
- Around line 512-516: Update installPnpmDependencies() so each failing pnpm
install is caught and converted into the established RFC 7807 Problem contract,
including a diagnostic code and recovery guidance instead of allowing
ExecSyncError/Error to reach the CLI catch-all. Apply this to both install
commands while preserving their existing working-directory and stdio behavior.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ec6a155f-70cc-46c4-9e2d-20a990a2fceb

📥 Commits

Reviewing files that changed from the base of the PR and between 28d9461 and 9ded80b.

📒 Files selected for processing (11)
  • .changeset/fresh-scaffolds-lock-dependencies.md
  • packages/create-croco-app/src/generator.ts
  • packages/create-croco-app/src/tests/generator-install.spec.ts
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/create-croco-app/templates/admin-console/package.json.hbs
  • packages/create-croco-app/templates/ai-saas/package.json.hbs
  • packages/create-croco-app/templates/blank/package.json.hbs
  • packages/create-croco-app/templates/saas/package.json.hbs
  • packages/create-croco-app/templates/spa-be-split/package.json.hbs
  • packages/create-croco-app/test-fixtures/templates/ssr-lambda/package.json.hbs
  • scripts/create-croco-app-generated-smoke.mts

Comment thread packages/create-croco-app/src/generator.ts Outdated
@kang-heewon

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@kang-heewon
kang-heewon force-pushed the fix/1689-reproducible-scaffolds branch from ba07054 to 9f70aa2 Compare August 5, 2026 05:18
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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: 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 `@packages/create-croco-app/src/tests/templates-build.spec.ts`:
- Around line 1324-1326: Update the template manifest validation around
templateManifests so manifests are not discarded merely because
devDependencies.turbo is absent. Explicitly identify workspace roots whose
scripts use Turbo, then assert those roots declare turbo and match the expected
root version, while retaining validation that manifests without Turbo remain
supported.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7c1a6ed0-ffa4-416e-b0c9-502840e5127d

📥 Commits

Reviewing files that changed from the base of the PR and between c0c9679 and 9f70aa2.

📒 Files selected for processing (14)
  • .changeset/fresh-scaffolds-lock-dependencies.md
  • packages/create-croco-app/src/generator.ts
  • packages/create-croco-app/src/libs/problems/PnpmCommandProblem.ts
  • packages/create-croco-app/src/tests/generator-install.spec.ts
  • packages/create-croco-app/src/tests/templates-build.spec.ts
  • packages/create-croco-app/templates/admin-console/package.json.hbs
  • packages/create-croco-app/templates/ai-saas/package.json.hbs
  • packages/create-croco-app/templates/blank/package.json.hbs
  • packages/create-croco-app/templates/saas/package.json.hbs
  • packages/create-croco-app/templates/spa-be-split/package.json.hbs
  • packages/create-croco-app/test-fixtures/templates/ssr-lambda/package.json.hbs
  • scripts/create-croco-app-generated-smoke.mts
  • scripts/static-misuse-raw-error-allowlist.json
  • tsconfig/contract-strict.baseline.json

Comment thread packages/create-croco-app/src/tests/templates-build.spec.ts Outdated
@kang-heewon

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@kang-heewon
kang-heewon merged commit 5e8f35d into trunk Aug 7, 2026
11 of 12 checks passed
@kang-heewon
kang-heewon deleted the fix/1689-reproducible-scaffolds branch August 7, 2026 14:49
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.

[create-croco-app] Make fresh generated workspaces reproducible and CI-ready

1 participant