Expand description
Which configured profile answers questions about a repository.
With several profiles (two self-managed GitLab hosts, or two accounts
on one host) a repository’s remote does not identify a profile by
host alone. resolve_for_repo applies one deterministic rule set so
the TUI, CLI and MCP all pick the same profile:
- an explicit per-repo override (
RepoState::hosting_integration) wins, if it still names an enabled hosting profile; - otherwise remotes are tried in the order
upstream,origin, then the rest as given, and the first one a profile owns is used. Each family says what owning means (FamilySpec::owns_remote): the same hostname by default (ports are ignored: SSH and HTTPS remotes of one instance differ in them), the same organization for Azure DevOps; - several profiles on that host: the one whose user owns the
namespace (
login == first path segment) wins, else the first configured – and the result is flaggedambiguousso a frontend can offer to pin a choice.
Structs§
- Resolution
- Resolve
Remote - A remote as the resolver sees it.
- Suggestion
- One proposal for linking a repository: a remote whose host an enabled hosting profile serves, with the project path read from it. Only ever a suggestion - nothing links a repository on its own.
Functions§
- resolve_
for_ repo - suggest_
for_ repo - The profiles that match the repository’s remotes,
originfirst (thenupstream, then the rest as given); every enabled hosting profile on a remote’s host is proposed, once per(profile, project).