fix: show PRD-specific instructions after JSON tracker setup#96
Conversation
When users complete setup with the JSON File Tracker, they now see clear instructions about how to use the --prd flag, instead of discovering the requirement through an error message. Fixes #57
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (4)
WalkthroughA comprehensive test suite for the setup wizard is introduced, alongside enhancements to post-configuration messaging that provide tracker-specific instructions. The tests validate configuration creation, persistence, and overwrite handling, whilst the wizard now outputs PRD-related guidance for JSON tracker selections instead of generic run instructions. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
==========================================
+ Coverage 23.72% 26.35% +2.62%
==========================================
Files 74 69 -5
Lines 17263 16516 -747
==========================================
+ Hits 4095 4352 +257
+ Misses 13168 12164 -1004
🚀 New features to boost your workflow:
|
Tests cover: - projectConfigExists function - runSetupWizard with different tracker selections - JSON tracker shows PRD-specific instructions (verifies #57 fix) - Beads/Beads-BV trackers show standard instructions - Force flag behavior for overwriting existing config - checkAndRunSetup conditional logic - Welcome banner and config show command output Uses mock.module() to mock interactive prompts for deterministic testing.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/setup/wizard.test.ts`:
- Around line 276-283: The console.log spy created in the beforeEach should be
restored in afterEach to avoid leaking the mock into other tests: keep the spy
returned from spyOn(console, 'log') in a variable (e.g., consoleLogSpy) when
setting it up and then restore the original console.log in afterEach (before
removing tempDir) by calling the spy's restore/callThrough method so the
"runSetupWizard" and "wizard output messages" suites behave consistently.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/setup/wizard.test.tssrc/setup/wizard.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Start all code files with a file-level JSDoc comment section explaining the file's purpose, prefixed with 'ABOUTME: '
Files:
src/setup/wizard.tssrc/setup/wizard.test.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Start all code files with a file-level JSDoc comment section explaining the file's purpose, prefixed with "ABOUTME: "
Files:
src/setup/wizard.tssrc/setup/wizard.test.ts
🧬 Code graph analysis (1)
src/setup/wizard.ts (2)
src/setup/index.ts (1)
printInfo(31-31)src/setup/prompts.ts (1)
printInfo(374-376)
🔇 Additional comments (6)
src/setup/wizard.ts (1)
383-394: LGTM! Tracker-specific instructions address the linked issue.The conditional logic correctly distinguishes the JSON tracker from others and provides clear, actionable instructions for users. This directly resolves issue
#57by making the PRD path requirement explicit.One consideration: if additional trackers are added in the future that also require PRD paths, this hardcoded string comparison may need to be extended. Consider whether the tracker plugin itself could expose a property indicating whether PRD-specific instructions are needed, but this is fine for now given the current scope.
src/setup/wizard.test.ts (5)
1-5: LGTM! Proper ABOUTME header present.The file-level JSDoc comment correctly explains the file's purpose and follows the required format with the 'ABOUTME:' prefix.
25-56: Well-structured mock setup.The pattern of defining mutable mock implementations before mocking the modules, then importing the system under test afterwards, is correct and allows flexible per-test customisation.
69-101: Good coverage for projectConfigExists.The test cases properly cover the three relevant scenarios: no config, config exists, and directory exists without the config file. Temp directory cleanup ensures test isolation.
171-214: Excellent coverage of the core PR functionality.These tests directly validate the tracker-specific instruction behaviour introduced in this PR. The use of both positive assertions (
toContain) and negative assertions (not.toContain) ensures the conditional logic works correctly for the JSON tracker versus other tracker types.
103-126: Good test setup pattern with proper cleanup.The
runSetupWizardtest suite demonstrates the correct pattern for capturing and restoring console output, withconsoleLogSpy.mockRestore()inafterEach. The captured output approach enables verification of the tracker-specific instructions without requiring complex mocking of the prompts module's print functions.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
…hierarchy Both beads and beads-bv tracker docs now explain: - Default 'ralph' label filter (issues must have this label to appear) - Tasks must be children of epic (using --parent flag) to appear with --epic - How to add labels to existing issues - How to change/remove the label filter beads.mdx changes: - Added warning callout about default ralph label filter - Updated Basic Usage to show --label ralph on all create commands - Added step explaining parent-child relationships - Added step for dependencies (was missing) - Fixed Options Reference to show labels default is 'ralph' - Rewrote Label Filtering section with clear instructions - Updated troubleshooting to check labels first beads-bv.mdx changes: - Added warning callout about default ralph label - Completely rewrote Basic Usage to show epic creation first - Shows creating tasks as children with --parent flag - Added callout explaining --parent requirement - Fixed Options Reference to show labels default - Added link to beads docs for label filtering details
Store the spy in a variable and call mockRestore() in afterEach to prevent mock leakage between test suites.
- Set project coverage target to 35% with 1% threshold - Set patch coverage target to 50% with 5% threshold - Ignore website, tests, and dist directories - Configure PR comment layout
…tions fix: show PRD-specific instructions after JSON tracker setup
Summary
--prdflagralph-tui runChanges
The setup wizard now shows tracker-specific instructions:
For JSON tracker:
For Beads/BV trackers (unchanged):
Test plan
ralph-tui setup --forceand select JSON File Trackerralph-tui setup --forceand select Beads trackerralph-tui runinstructionFixes #57
Summary by CodeRabbit
Release Notes
Tests
New Features
✏️ Tip: You can customize this high-level summary in your review settings.