fix(installer): descriptive error when module definition missing after clone#2377
Conversation
…g after clone When a stable tag predates a module restructure (e.g. baut v1.14.0 had payload/source dirs, but the registry pointed to skills/module.yaml which only exists on main), findExternalModuleSource silently returned the configured but non-existent path. This caused a confusing ENOENT inside getFileList/copyModuleWithFiltering rather than a clear error. Now throws with the version that was cloned and a --next hint when the install channel was stable, so users know exactly how to recover. Closes #2372
🤖 Augment PR SummarySummary: Improves the installer’s external module source detection by throwing a clear error when the cloned repo/ref doesn’t contain the expected module definition file, instead of returning a non-existent path. 🤖 Was this summary useful? React with 👍 or 👎 |
📝 WalkthroughWalkthroughThe PR improves error handling in external module installation by converting a silent fallback return into a descriptive error. When a cloned external module repository lacks the expected module structure, ChangesExternal Module Source Discovery Error Messaging
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tools/installer/modules/external-manager.js (1)
1-1:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winFix Prettier formatting to unblock CI.
The pipeline reports code style issues that need to be resolved before merge.
Run the following command to fix:
prettier --write tools/installer/modules/external-manager.jsAs per coding guidelines, tools/** should maintain proper code quality standards including formatting.
🤖 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/modules/external-manager.js` at line 1, Run Prettier on tools/installer/modules/external-manager.js to fix formatting so CI passes: execute the suggested formatter (prettier --write tools/installer/modules/external-manager.js) or apply your editor’s Prettier fix, save the file, and commit the updated formatting; ensure the change touches the existing module import (const fs = require('../fs-native');) and nothing else functionally changes before pushing.
🤖 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.
Outside diff comments:
In `@tools/installer/modules/external-manager.js`:
- Line 1: Run Prettier on tools/installer/modules/external-manager.js to fix
formatting so CI passes: execute the suggested formatter (prettier --write
tools/installer/modules/external-manager.js) or apply your editor’s Prettier
fix, save the file, and commit the updated formatting; ensure the change touches
the existing module import (const fs = require('../fs-native');) and nothing
else functionally changes before pushing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f1a9c4fa-40e9-4100-b093-308c6474efea
📒 Files selected for processing (1)
tools/installer/modules/external-manager.js
What
findExternalModuleSourcenow throws a clear, actionable error when a cloned module's repo doesn't contain the expected module definition path, instead of silently returning that non-existent path.Why
When a stable tag predates a module restructure, the installer cloned the tagged version, couldn't find
module_definition(e.g.skills/module.yaml) anywhere in the repo, then silently returned the configured (but non-existent) path assourcePath. This caused a confusing ENOENT buried insidegetFileList/copyModuleWithFiltering:Users had no idea which module failed or why. Reported in #2372.
How
Replaced the silent
return path.dirname(configuredPath)fallback with a thrown error that:stable, appends a--next=<code>hint so the user can recover immediatelyExample new error
Related
v1.14.2git tag onbmad-code-org/bmad-automatorbmad-code-org/bmad-plugins-marketplacePR settingdefault_channel: nextforbaut