Skip to content

fix(origin): a drive letter is only a drive on Windows - #6

Merged
HuiJun merged 3 commits into
developfrom
fix/windows-review
Oct 30, 2026
Merged

HuiJun merged 3 commits into
developfrom
fix/windows-review

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5 for the three Devin Review findings on it.

  • Bug (Linux/macOS): fileURIPath stripped the leading slash from file:///C:/tools.kpar on every system, so a directory named C: (legal on POSIX) resolved relative to the project instead of /C:/tools.kpar. The drive check is now isDrivePath = windowsPaths && drive.MatchString(...), with windowsPaths = runtime.GOOS == "windows" as a package variable so TestDriveLetterFileURIs exercises both machines from one test file:
    windows=true:  git+file:///C:/srv/widgets → Path "C:/srv/widgets", Source C:\srv\widgets (svn: file:///C:/srv/widgets)
    windows=false: git+file:///C:/srv/widgets → Path "/C:/srv/widgets"; file://C:/x refused (C: is a host)
  • Rollback coverage on Windows: TestPublishRollsBackWhenTheLockCannotBeWritten no longer skips there. Windows ignores a read-only directory but refuses to replace a read-only file, so on Windows the test makes .project.lock.json itself 0444 and lock.Write's final os.Rename fails after lib/ was published — the same rollback path, asserted with "Access is denied" instead of "permission denied".
  • Docs: docs/packages.md and the README name the Windows spellings (<vcs>+file:///C:/path canonical, <vcs>+file://C:/path accepted as input, same for a local .kpar/project directory) and state that /C:/path is an ordinary directory elsewhere.

Verified: full gate on Linux with SYSPI_REQUIRE_VCS=1; the Windows branch of the rollback test is proven by this PR's Windows gate.

devin-ai-integration Bot and others added 2 commits October 30, 2026 01:58
fileURIPath stripped the leading slash from file:///C:/tools.kpar on every system,
so on Linux and macOS a directory named C: resolved relative to the project.
The drive check is now Windows-only (windowsPaths), the Windows file:// spellings
are documented, and the lock-rollback test runs on Windows by making the lock
file read-only instead of skipping.

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…rator

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

… host's separators

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 30, 2026 02:22

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun merged commit 9dba80a into develop Oct 30, 2026
4 checks passed
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