fix(installer): ignore generated BMAD configuration#2542
Conversation
📝 WalkthroughWalkthroughAdds an ChangesRoot .gitignore management
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Installer
participant ManifestGenerator
participant FileSystem
Installer->>ManifestGenerator: generateManifests()
ManifestGenerator->>ManifestGenerator: ensureCustomConfigStubs(bmadDir)
ManifestGenerator->>ManifestGenerator: ensureRootGitignore(bmadDir)
ManifestGenerator->>FileSystem: read .gitignore (if exists)
alt markers found
ManifestGenerator->>FileSystem: replace managed block
else file empty
ManifestGenerator->>FileSystem: write managed block
else file has user content
ManifestGenerator->>FileSystem: append managed block
end
FileSystem-->>ManifestGenerator: write skipped if unchanged
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tools/installer/core/manifest-generator.js (1)
680-717: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueSolid, well-tested implementation. Create/replace/append logic correctly preserves user content and is idempotent (verified by Test Suite 36b).
Two minor notes:
- The ast-grep
detect-non-literal-fs-filenamehints on lines 697/714 are false positives here —gitignorePathis derived frombmadDir, an internal installer parameter, not untrusted/request-derived input.- No try/catch wraps the
fs.readFile/fs.writeFilecalls, so a permission or I/O error will propagate uncaught out ofgenerateManifests. This is consistent with the siblingensureCustomConfigStubsmethod above, so likely an accepted pattern relying on a top-level installer catch, but worth confirming that upstream handling surfaces a clean error/exit code rather than a raw stack trace.As per path instructions,
tools/**build scripts should be checked for proper error handling and exit codes.🤖 Prompt for 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. In `@tools/installer/core/manifest-generator.js` around lines 680 - 717, The file I/O in ensureRootGitignore currently lets read/write failures bubble out of generateManifests, so confirm the installer’s upstream error handling surfaces a clean failure path and exit code instead of an uncaught stack trace. If there is no top-level catch, wrap the fs.pathExists, fs.readFile, and fs.writeFile flow in a consistent installer error handler (matching ensureCustomConfigStubs and the surrounding manifest-generator logic) and report a clear fatal message via the existing installer entrypoint.Source: Path instructions
🤖 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.
Nitpick comments:
In `@tools/installer/core/manifest-generator.js`:
- Around line 680-717: The file I/O in ensureRootGitignore currently lets
read/write failures bubble out of generateManifests, so confirm the installer’s
upstream error handling surfaces a clean failure path and exit code instead of
an uncaught stack trace. If there is no top-level catch, wrap the fs.pathExists,
fs.readFile, and fs.writeFile flow in a consistent installer error handler
(matching ensureCustomConfigStubs and the surrounding manifest-generator logic)
and report a clear fatal message via the existing installer entrypoint.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 45c2c27c-acf9-4551-8444-c6fa32bd4205
📒 Files selected for processing (2)
test/test-installation-components.jstools/installer/core/manifest-generator.js
What
Added an installer-managed _bmad/.gitignore block that excludes generated configuration and personal override files while keeping team configuration commit-able. #2533
Why
Generated configuration contains personal values and changing timestamps that create unnecessary diffs and merge conflicts in shared repositories.
How
Testing
Ran node test/test-installation-components.js; all 388 tests passed.