Skip to content

Fix incorrect repo path on Windows for mlc add repo command - #332

Draft
arjunsuresh with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-wrong-repo-path-windows
Draft

arjunsuresh with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-wrong-repo-path-windows

Conversation

Copilot AI commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

mlc add repo <path> silently registered the wrong path when the given path did not exist or was inaccessible. On Windows this reliably hits a mounted/network drive that is not visible to the running process (per-session mapped-drive / UAC quirk): mlc add repo Z:\pa\aocc-scripts registered C:\Users\amd\MLC\repos\aocc-scripts with no error.

Root cause — In RepoAction.add, when os.path.exists(input) is False the code assumed the input was a bare repo name and created/registered <repos_path>/<basename>. An explicit but temporarily-unreachable path fell into this branch.

Changes

  • mlc/repo_action.py
    • Added _looks_like_filesystem_path() — flags absolute paths, anything containing a separator, Windows drive letters (Z:\… / Z:/…), and UNC paths. Recognized on any OS so behavior is testable off-Windows.
    • add now fails loudly with a clear error when an explicit path is missing/inaccessible, instead of creating the wrong folder. Bare names, URLs, and existing external paths are unchanged.
  • tests/test_repo_action_add_path.py — covers the helper plus add behavior (missing explicit path errors without creating a stray folder; Windows-style path errors on any platform; existing external path registers as-is).
  • .github/workflows/test-unit.yml — new windows-basic-commands job (windows-latest) running the repo-path tests, a basic mlc command smoke test (add/find/list/rm repo), and a regression check. Kept separate from the full unittest discover matrix because several existing tests drive the Unix bash installer and are not Windows-compatible.

Behavior

$ mlc add repo Z:\pa\aocc-scripts   # drive not visible to this process
ERROR - The repo path 'Z:\pa\aocc-scripts' does not exist or is not accessible.
        Please ensure the path is correct and that any mounted/network drive is
        available to this process before adding it as a repo.

✅ PR Checklist

✅ Testing & CI

  • Have tested the changes in my local environment, else have properly conveyed in the PR description
  • The change includes a GitHub Action to test the script(if it is possible to be added).
  • No existing GitHub Actions are failing because of this change.

📚 Documentation

  • README or help docs are updated for new features or changes.
  • CLI help messages are meaningful and complete.

📁 File Hygiene & Output Handling

  • No unintended files (e.g., logs, cache, temp files, pycache, output folders) are committed.

🛡️ Safety & Security

  • No secrets or credentials are committed.
  • Paths, shell commands, and environment handling are safe and portable.

🙌 Contribution Hygiene

  • PR title and description are concise and clearly state the purpose of the change.
  • Related issues (if any) are properly referenced using Fixes # or Closes #.
  • All reviewer feedback has been addressed.

Copilot AI and others added 2 commits October 23, 2026 15:30
…tem paths

Co-authored-by: arjunsuresh <4791823+arjunsuresh@users.noreply.github.com>
Co-authored-by: arjunsuresh <4791823+arjunsuresh@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect repo path on Windows for mlc add repo command Fix incorrect repo path on Windows for mlc add repo command Oct 23, 2026
Copilot AI requested a review from arjunsuresh October 23, 2026 15:35

This branch has not been deployed

No deployments
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.

Added new repo path but it is still adding the wrong path on windows

2 participants