Uh oh!
There was an error while loading. Please reload this page.
chore: exclude ZenStack-generated files from prettier formatting - #2786
Conversation
PR #2779 ran prettier over tracked generated files (schema.ts, schema-lite.ts, models.ts, input.ts). During the release workflow, sample/test builds run `zen generate` which rewrites these files with the generator's own formatting, leaving the working tree dirty and causing `pnpm publish` to fail with ERR_PNPM_GIT_UNCLEAN (v3.9.0 release run). - extend .prettierignore to cover all generated file names, including schema-lite.ts and tests/runtimes/**, which were previously missed - restore the affected generated files to pristine generator output Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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 (8)
📝 WalkthroughWalkthroughThe PR expands ChangesRepository formatting alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Uh oh!
There was an error while loading. Please reload this page.
Summary
The v3.9.0 release run (failed job) died in the
Publish packagesstep withERR_PNPM_GIT_UNCLEAN.Root cause: #2779 ran prettier over tracked generated files (
schema.ts,schema-lite.ts,models.ts,input.tsundersamples/,tests/, and package test dirs). In the release workflow, sample/test builds runzen generate, which rewrites those files with the generator's own formatting (double quotes, no trailing commas), leaving modified tracked files in the working tree — sopnpm -r publishfails its git-clean check.Changes
.prettierignoreto cover all ZenStack-generated file names. The previous list missedschema-lite.tsentirely and didn't covertests/runtimes/**. Patterns stay scoped tosamples/,tests/, and**/test/**because a few hand-written source files share these names (packages/orm/src/schema.ts,packages/schema/src/schema.ts,packages/testtools/src/schema.ts).pnpm builddirties back to pristine generator output, so builds no longer touch the tree.This also prevents recurrence via the pre-commit hook:
lint-stagedrunsprettier --writeon staged*.ts, which would otherwise re-format regenerated files on every commit.Verification
prettier --list-differentnow reports none of them (the restored files use generator formatting, so they would be flagged if the ignore rules didn't match).pnpm build(minusbun-e2e, no bun installed locally) leaves the working tree clean.After this merges to
main, the failed release can be re-triggered via workflow dispatch.🤖 Generated with Claude Code
Summary by CodeRabbit
Style
Documentation
Chores