Skip to content

refactor(cli): keep the gitpick pin in one constant and test reinit and sync - #864

Merged
nrjdalal merged 2 commits into
canaryfrom
refactor/cli-gitpick-pin
Oct 4, 2026
Merged

nrjdalal merged 2 commits into
canaryfrom
refactor/cli-gitpick-pin

Conversation

@nrjdalal

@nrjdalal nrjdalal commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Two findings from the CLI plan (plans/cli-dx.md), both about keeping the CLI maintainable.

Changes

  • The gitpick pin is one constant (finding 10). The fetch and overlay helpers each spelled out gitpick@6.0.0, so a version bump had to touch two call sites and could miss one. It now lives in a single GITPICK constant in packages/cli/src/git.ts, the same shape PGLAUNCH has in src/db.ts. The CLI still runs an exact gitpick version.
  • reinit and sync have 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.
  • Their pure branching moved into exported units so it can be covered. nextSteps in reinit asks for a database URL only while .env has none. reportReconcile in sync names 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.
  • Docs. The plan counts both findings as closed and its index line drops them. The runtime-apis skill'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-types with every turbo task forced uncached, and bun run test pass locally: 353 pass, 67 skipped end-to-end tests with no stack, 0 fail.
  • Breaking the singular/plural choice and the URL-step condition fails three of the new tests, so they catch real regressions.
  • The built CLI, run under Node as npx runs it, prints reinit --help, and refuses both reinit -y and sync on a dirty repo with exit code 1, leaving the file in place.
  • fetchZerostarter run 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

  • Tests
    • Expanded checks for CLI reinitialization and synchronization, including safety conditions and the guidance shown in different repository states.
  • Chores
    • Updated the CLI development backlog to reflect completed audit items. No user-facing behavior changes are noted.

@vercel

vercel Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api.zerostarter.dev Ready Ready Preview Oct 4, 2026 3:05pm UTC
zerostarter.dev Ready Ready Preview Oct 4, 2026 3:05pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: nrjdalal/zerostarter/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5fda0403-c796-4f91-9011-74398b7d4def
📥 Commits

Reviewing files that changed from the base of the PR and between 322e53e and 87bb85f.

⛔ Files ignored due to path filters (1)
  • .agents/skills/runtime-apis/index.md is excluded by !**/.agents/**
📒 Files selected for processing (7)
  • .github/notes/plans/README.md
  • .github/notes/plans/cli-dx.md
  • packages/cli/bin/commands/reinit.ts
  • packages/cli/bin/commands/sync.ts
  • packages/cli/src/git.ts
  • tests/packages/cli/bin/commands/reinit.test.ts
  • tests/packages/cli/bin/commands/sync.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: nrjdalal/zerostarter/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1a5cc013-5010-4055-bff8-93536f73e8ed
📥 Commits

Reviewing files that changed from the base of the PR and between d9afa35 and 322e53e.

⛔ Files ignored due to path filters (1)
  • .agents/skills/runtime-apis/index.md is excluded by !**/.agents/**
📒 Files selected for processing (7)
  • .github/notes/plans/README.md
  • .github/notes/plans/cli-dx.md
  • packages/cli/bin/commands/reinit.ts
  • packages/cli/bin/commands/sync.ts
  • packages/cli/src/git.ts
  • tests/packages/cli/bin/commands/reinit.test.ts
  • tests/packages/cli/bin/commands/sync.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

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

Changes

CLI developer experience

Layer / File(s) Summary
Reinit follow-up steps and checks
packages/cli/bin/commands/reinit.ts, tests/packages/cli/bin/commands/reinit.test.ts
nextSteps returns follow-up commands and includes the .env URL instruction only when no PostgreSQL URL exists. Reinit tests cover help, repository-state refusals, and helper output.
Sync reconciliation reporting and checks
packages/cli/bin/commands/sync.ts, tests/packages/cli/bin/commands/sync.test.ts
reportReconcile contains the existing reconciliation messages and conditions, and sync calls it after regenerating skill tables. Tests cover help, repository-state refusals, and reporting output.
Gitpick version and audit notes
packages/cli/src/git.ts, .github/notes/plans/README.md, .github/notes/plans/cli-dx.md
Git commands use a shared GITPICK version constant; fetchZerostarter passes the URL and destination as separate arguments. The audit notes mark five findings closed and remove resolved items from the open list.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to 322e5

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)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the two main changes: centralizing the gitpick version pin and testing reinit and sync.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Reinit prints the steps in line
Sync reports each changed sign
Gitpick shares one pinned tag
Tests check guards and every flag
Audit notes close the loop, no lag

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

@github-actions github-actions Bot added @workflows Auto-created label for @workflows @zerostarter Auto-created label for @zerostarter 0/1 PR has 0 of 1 required approvals labels Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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.

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.
@nrjdalal
nrjdalal force-pushed the refactor/cli-gitpick-pin branch from 322e53e to 87bb85f Compare October 4, 2026 15:04
@nrjdalal
nrjdalal merged commit 1b3067a into canary Oct 4, 2026
7 checks passed
@nrjdalal
nrjdalal deleted the refactor/cli-gitpick-pin branch October 4, 2026 15:06

This branch was successfully deployed

2 active deployments
Preview – api.zerostarter.dev — 87bb85f6 Deployed Oct 4, 2026 by vercel[bot]
Preview – zerostarter.dev — 87bb85f6 Deployed Oct 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0/1 PR has 0 of 1 required approvals @.agents Auto-created label for @.agents @tests Auto-created label for @tests @workflows Auto-created label for @workflows @zerostarter Auto-created label for @zerostarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant