refactor(cli): keep the gitpick pin in one constant and test reinit and sync - #864
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 48 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe CLI changes extract reinit follow-up steps and sync reconciliation reporting into exported helpers, add tests for command guards and output, and use one constant for the pinned gitpick version. The CLI audit notes reflect the closed findings. ChangesCLI developer experience
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to This change moves CLI reporting logic into testable helpers, centralizes the gitpick version pin, and adds tests. User-visible behavior is reported as unchanged, and no merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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. Reinit prints the steps in line Comment |
|
Important Merge with a squash commit (not merge), so canary stays one commit per PR and shared-history merges stay reserved for release PRs. Delete the branch after merging to keep the remote clean. |
c56cf1c to
322e53e
Compare
The fetch and overlay helpers each repeated the pinned gitpick version, so a bump had to touch two places. Hoist it to one constant, as the db helper already does for pglaunch. Closes finding 10 of the CLI plan and drops it from the backlog index.
reinit and sync were the two CLI commands with no test. Both refuse a directory with no repo or a dirty tree before they delete or fetch anything; the new tests pin that, and that nothing is printed or removed on a refusal. Their pure branching moves into exported units so it can be covered: reinit's next steps, which ask for a database URL only while .env has none, and sync's reconcile report, which names the skills and guide it kept, left alone or updated with no sync record. Closes finding 7 of the CLI plan and indexes the two test files in the runtime-apis skill.
322e53e to
87bb85f
Compare
Two findings from the CLI plan (
plans/cli-dx.md), both about keeping the CLI maintainable.Changes
gitpick@6.0.0, so a version bump had to touch two call sites and could miss one. It now lives in a singleGITPICKconstant inpackages/cli/src/git.ts, the same shapePGLAUNCHhas insrc/db.ts. The CLI still runs an exact gitpick version.reinitandsynchave tests (finding 7). They were the two commands with none. Both refuse a directory with no repo or a dirty tree before they delete or fetch anything. The new tests pin that refusal, and that nothing is printed or removed when it happens.nextStepsinreinitasks for a database URL only while.envhas none.reportReconcileinsyncnames the skills and guide the sync kept, left alone, or updated with no sync record. Both blocks moved as they were, so the printed output is unchanged.runtime-apisskill's file index lists the two new test files, which follow the CLI tests'node:style.Verification
bun run format,bun run lint,bun run check-typeswith every turbo task forced uncached, andbun run testpass locally: 353 pass, 67 skipped end-to-end tests with no stack, 0 fail.reinit --help, and refuses bothreinit -yandsyncon a dirty repo with exit code 1, leaving the file in place.fetchZerostarterrun from source into a scratch directory still fetches the starter through the constant.No UI change, so there is nothing to screenshot. Rebased onto canary after #862, which removed the neighbouring line of the plans index; the rebase changed only that index line.
🤖 Generated with Claude Code
Summary by CodeRabbit