Skip to content

fix(installer): accept windows custom module paths#2511

Open
dracic wants to merge 3 commits into
bmad-code-org:mainfrom
dracic:fix/custom-module-path
Open

fix(installer): accept windows custom module paths#2511
dracic wants to merge 3 commits into
bmad-code-org:mainfrom
dracic:fix/custom-module-path

Conversation

@dracic

@dracic dracic commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Custom module source parsing now accepts Windows local paths such as C:\modules\foo, C:/modules/foo, and .\foo.

Why

Windows-style local paths such as C:\projects\ai\BMAD-METHOD fell through to the Git URL parser and were rejected as invalid, even though slash-style paths like /projects/ai/BMAD-METHOD already worked.

How

  • Added shared local-source detection for POSIX, Windows absolute, Windows relative, and home-relative paths.
  • Routed the existing custom source parser through that detector before URL handling.
  • Added parser regression coverage for Windows-shaped local paths.

Testing

Ran npm run lint, npm run test:urls, and node test/test-installation-components.js; all passed.

@augmentcode

augmentcode Bot commented Jun 25, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR fixes custom-module source parsing so Windows-shaped local paths are recognized as local sources instead of being misrouted to Git URL parsing.

Changes:

  • Introduced a shared isLocalSourcePath helper covering POSIX, Windows absolute/relative, and home-relative inputs
  • Updated CustomModuleManager.parseSource() to route local detection through this helper before URL parsing
  • Added regression tests validating Windows drive paths, forward-slash drive paths, and .\-relative paths are treated as type: 'local'

Technical Notes: Uses path.win32.isAbsolute() to detect drive/UNC-style absolute paths consistently.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread tools/installer/modules/custom-module-manager.js
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds a shared local-path detector in CustomModuleManager.parseSource so Windows-style paths are treated as local sources, and extends the parser tests with Windows drive-letter and relative path cases.

Changes

Installer source parsing

Layer / File(s) Summary
Local path classification
tools/installer/modules/custom-module-manager.js
Adds isLocalSourcePath(input) and uses it in parseSource to classify POSIX, Windows, and home-relative inputs as local paths.
Windows path tests
test/test-parse-source-urls.js
Adds cases for Windows drive-letter, slash-separated, and relative path inputs that assert local parsing and missing-path errors.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: installer parsing now accepts Windows custom module paths.
Description check ✅ Passed The description matches the changeset and explains the parsing update, rationale, and added tests.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

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

Inline comments:
In `@tools/installer/modules/custom-module-manager.js`:
- Around line 112-113: The `@version` parser in custom-module-manager still uses
the older beforeLooksLikeRepo check, so Windows and relative local paths can
bypass the local-path suffix error. Update the parser to reuse the shared
isLocalSourcePath predicate in the same way the local branch does, and ensure
parseSource rejects any local path with an `@version` suffix by returning the
existing “Local paths do not support `@version` suffixes” error instead of
treating it as a literal path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8c51cf2c-3d77-472f-a69b-e1a69aa0628c

📥 Commits

Reviewing files that changed from the base of the PR and between 7b2d90a and 0aa45ba.

📒 Files selected for processing (2)
  • test/test-parse-source-urls.js
  • tools/installer/modules/custom-module-manager.js

Comment thread tools/installer/modules/custom-module-manager.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant