Skip to main content

Module resolve

Module resolve 

Source
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:

  1. an explicit per-repo override (RepoState::hosting_integration) wins, if it still names an enabled hosting profile;
  2. 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;
  3. 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 flagged ambiguous so a frontend can offer to pin a choice.

Structs§

Resolution
ResolveRemote
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, origin first (then upstream, then the rest as given); every enabled hosting profile on a remote’s host is proposed, once per (profile, project).