Repository navigation
fix(bootstrap): compare repo origins transport-agnostically - #11034
Conversation
[bootstrap.repos] treated an existing checkout as a conflict when its origin used a different transport than the configured url, even when both identify the same repository — e.g. an ssh origin git@github.com:jdx/mise.git against a configured https://github.com/jdx/mise.git. Updates fetch and pull through the checkout's own origin, so the configured url acts as a repository identity check, not a fetch source. Normalize common network forms (git@host:path, ssh://git@host/path, scheme://host/path) to a host/path identity for the comparison. Different hosts, ssh aliases, explicit ports, and paths still conflict. Only the conventional git ssh user is treated as transport metadata; other ssh users can identify different repositories on generic ssh servers and stay part of the identity. Local paths, file:// urls, and unrecognized syntax keep exact matching. Fixes the false conflict discussed in jdx#10997.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesRepository origin matching
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant RepositoryStatus
participant origin_matches_config
participant CanonicalRepoIdentity
RepositoryStatus->>origin_matches_config: compare stored and configured origins
origin_matches_config->>CanonicalRepoIdentity: parse recognized remote URLs
CanonicalRepoIdentity-->>origin_matches_config: return canonical repository identity
origin_matches_config-->>RepositoryStatus: return Current or Conflict
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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.
Pull request overview
This PR improves [bootstrap.repos] handling by treating a repo’s configured url as an identity check rather than requiring an exact transport match to the checkout’s origin (e.g., allowing git@github.com:owner/repo.git to match https://github.com/owner/repo.git). This aligns bootstrap repo status/update behavior with real-world git remote URL variations while keeping stricter matching for non-network or unrecognized forms.
Changes:
- Added transport-agnostic repository identity comparison for common network URL forms (scp-like SSH,
ssh://,git://,http(s)://) while preserving exact matching for local paths,file://, Windows paths, and unknown schemes. - Introduced focused unit tests covering both positive (same repo across transports) and negative (host/user/port/path conflicts) cases, plus a real-git fixture test via
status_one. - Updated documentation to describe the new comparison rules and the cases that still conflict.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/system/repos.rs |
Adds repo_identity parsing/normalization for network remotes and expands tests to validate cross-transport matching and conflict scenarios. |
docs/bootstrap/repos.md |
Documents the transport-agnostic matching behavior and explicitly lists conflict / exact-match cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR fixes a false conflict in
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to URL comparison logic with no effect on clone/fetch/pull mechanics, and every edge case in the agreed spec has a corresponding test. The new repo_identity path only runs when both exact and normalized matching have already failed, so existing behaviour is fully preserved. The identity reduction is deterministic: .git suffix and the git user are stripped before comparison, host case is normalized, and explicit ports remain in the identity string. All three accepted forms and every documented exact-match-only case have a unit test; status_recognizes_origin_across_transports exercises the full status_one path with a real git fixture. No data is mutated by this change. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "Keep https userinfo out of the identity ..." | Re-trigger Greptile |
There was a problem hiding this comment.
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 `@src/system/repos.rs`:
- Around line 451-453: Update repo_identity() to account for URL query
parameters when constructing the repository identity: either return None
whenever url.query() is present or pass the query through repo_identity_parts so
distinct remotes remain distinct. Preserve the existing handling for URLs
without queries.
🪄 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: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 8a3bd964-cb2f-4689-b759-e2fdeb859e14
📒 Files selected for processing (2)
docs/bootstrap/repos.mdsrc/system/repos.rs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54767a6dd6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ies and userless ssh Review round: tighten repo_identity to exactly the jdx#10997 contract. - Only scp-like git@host:path, ssh:// with an explicit user, and https:// participate in cross-transport identity. http:// and git:// keep exact matching — updates pull through the checkout's existing origin, so equating them with a configured https url would silently preserve an insecure transport. - ssh forms without a user keep exact matching: git resolves an omitted ssh user to the current login user, not git, so a userless origin can be a different remote view than git@. - URLs carrying a query or fragment keep exact matching — url.path() comparison would collapse distinct ?tenant= remotes. Negative tests added for each; docs restated as an exact three-form list.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6bb1bffd92
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
https userinfo is credential material, not repository identity: an origin ssh://alice@example.com/team/repo must not match a configured https://alice@example.com/team/repo just because the strings share a user. userinfo-bearing https URLs now stay on the exact-match path. Negative tests added.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdcb6c4e38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Bumps this repo's vendored floor pair — min_version in .mise.toml and mise_min_version in bin/setup — in lockstep with the fleet-wide raise to a mise containing jdx/mise#11034 (transport-agnostic repo-origin comparison), which the docker-dev-origin v2 setup block relies on. Why 2026.7.10: upstream tagged but never published v2026.7.8–v2026.7.10 (release-pipeline failure; v2026.7.11 is the first published release since 7.7). GitHub releases and brew now carry 2026.7.14, but Arch's extra/mise — the Omarchy suite's only channel — was built from the unpublished v2026.7.10 tag, so 2026.7.10 is the highest floor every channel satisfies today (ancestry: compare v2026.7.10...95ca0a7b = behind). Setup upgrades mise in place, so un-upgraded machines converge on their next bin/setup run; until then a raised .mise.toml floor errors on every mise invocation in this checkout (announce before landing).
Bumps this repo's vendored floor pair — min_version in .mise.toml and mise_min_version in bin/setup — in lockstep with the fleet-wide raise to a mise containing jdx/mise#11034 (transport-agnostic repo-origin comparison), which the docker-dev-origin v2 setup block relies on. Why 2026.7.10: upstream tagged but never published v2026.7.8–v2026.7.10 (release-pipeline failure; v2026.7.11 is the first published release since 7.7). GitHub releases and brew now carry 2026.7.14, but Arch's extra/mise — the Omarchy suite's only channel — was built from the unpublished v2026.7.10 tag, so 2026.7.10 is the highest floor every channel satisfies today (ancestry: compare v2026.7.10...95ca0a7b = behind). Setup upgrades mise in place, so un-upgraded machines converge on their next bin/setup run; until then a raised .mise.toml floor errors on every mise invocation in this checkout (announce before landing).
…https origins (#2998) Byte-identical swap to shipyard's canonical v2 block (verified with the audit parser, not by eye). mise ≥ the raised fleet floor compares repo origins transport-agnostically (jdx/mise#11034), so v1's ssh-rewrite arm is gone — canonical ssh origins keep updating through ssh untouched. In its place, the narrow gap #144 deferred: an existing clean checkout whose origin already names the canonical repo over https gets a noninteractive auth probe of its actual origin before mise pulls through it, stopping with guidance that names the failing origin and both remedies. Dirty, foreign, and malformed checkouts still fall through to mise's own diagnostics. Requires the fleet floor raise to land first (this block only runs after bin/setup's floor check passes).
Bumps this repo's vendored floor pair — min_version in .mise.toml and mise_min_version in bin/setup — in lockstep with the fleet-wide raise to a mise containing jdx/mise#11034 (transport-agnostic repo-origin comparison), which the docker-dev-origin v2 setup block relies on. Why 2026.7.10: upstream tagged but never published v2026.7.8–v2026.7.10 (release-pipeline failure; v2026.7.11 is the first published release since 7.7). GitHub releases and brew now carry 2026.7.14, but Arch's extra/mise — the Omarchy suite's only channel — was built from the unpublished v2026.7.10 tag, so 2026.7.10 is the highest floor every channel satisfies today (ancestry: compare v2026.7.10...95ca0a7b = behind). Setup upgrades mise in place, so un-upgraded machines converge on their next bin/setup run; until then a raised .mise.toml floor errors on every mise invocation in this checkout (announce before landing).
…https origins (basecamp#2998) Byte-identical swap to shipyard's canonical v2 block (verified with the audit parser, not by eye). mise ≥ the raised fleet floor compares repo origins transport-agnostically (jdx/mise#11034), so v1's ssh-rewrite arm is gone — canonical ssh origins keep updating through ssh untouched. In its place, the narrow gap basecamp#144 deferred: an existing clean checkout whose origin already names the canonical repo over https gets a noninteractive auth probe of its actual origin before mise pulls through it, stopping with guidance that names the failing origin and both remedies. Dirty, foreign, and malformed checkouts still fall through to mise's own diagnostics. Requires the fleet floor raise to land first (this block only runs after bin/setup's floor check passes).
Implements the direction agreed in #10997:
[bootstrap.repos]rejected an existing checkout whoseoriginuses a different transport than the configuredurl, even when both identify the same repository (e.g.git@github.com:jdx/mise.gitvshttps://github.com/jdx/mise.git). Updates fetch and pull through the checkout's ownorigin, so the configuredurlacts as a repository identity check, not a fetch source.What changed
origin_matches_confignow falls back to comparing arepo_identityfor common network URL forms —git@host:path,ssh://user@host[:port]/path, andhttps://host/path— exactly the three forms from the discussion — reduced to[user@]host[:port]/pathwith the.gitsuffix stripped.Per the contract in the discussion:
gitssh users stay part of the identity — they can identify different repositories on generic ssh servers. Only the conventionalgituser is treated as transport metadata.file://URLs, Windows paths, and unrecognized syntax (unknown schemes, remote-helper forms).Docs updated to state the comparison rules.
Tests
origin_urls_match_the_same_repo_across_transports: positive ssh↔https coverage across scp,ssh://, suffixless, host-case, same-non-git-user, leading-slash scp paths, and agreeing explicit ports — both directions.origin_urls_conflict_across_hosts_users_ports_and_paths: negative coverage for different host, ssh alias, explicit port, different path/owner, non-git ssh user (scp and url forms), userless ssh (git resolves an omitted user to the login user, notgit), query-carrying URLs,http://andgit://(an insecure transport is never treated as the https config), unrecognized scheme, local vsfile://, and Windows paths.status_recognizes_origin_across_transports: real-git fixture throughstatus_one— ssh origin against an https config reportscurrent, a foreign owner reports the unchangedorigin does not match configured urlconflict.Also verified against a locally built binary with real fixture repos: all six spellings of the declared repo report
current; foreign owner / different host / ssh alias / explicit port / non-git user reportconflict; dirty checkouts still hard-stop withhas local changes; linked worktrees (.gitfile) are recognized;repos update(#11022) flows through the same comparison. The released 2026.7.5 binary reportsconflictfor the ssh-origin case as a control.Summary by CodeRabbit
.git, host casing normalization, and explicit port handling).