feat(git): resolve a single app installation by id on the credential broker - #128
Merged
Conversation
…broker
Add ResolveAppInstallationByIdAsync to IGitCredentialBroker: an O(1) point
lookup of a single platform-app installation by its provider-side id.
The Nexus setup-complete verifier currently confirms an installation by
listing every installation of the app and filtering client-side — O(N) per
connect. This gives it a direct by-id lookup instead.
- GitHub adapter: GET /app/installations/{id} with the App JWT; a 404 maps
to the new Git.InstallationNotFound error (Error.NotFound), routed via a
GitRestErrorContext.ForInstallation so other statuses still propagate.
- InMemoryGitServer + NullGitServer implement the new method.
- New GitErrors.InstallationNotFound(installationId) factory.
Claude-Session: https://claude.ai/code/session_01VFDn7gCH7vdvT4eoNhsMLr
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
ResolveAppInstallationByIdAsync(installationId, appKey?, ct)toIGitCredentialBroker— an O(1) point lookup of a single platform-app installation by its provider-side id, alongside the existing account-probe (ResolveAppInstallationAsync) and full-list (ListAppInstallationsAsync) methods.Why
The Nexus setup-complete verifier confirms an app installation by listing every installation of the platform app and filtering client-side — O(N) per connect, and it grows with every customer that installs the app. When the caller already holds an installation id and only needs to confirm it still belongs to the app, a by-id lookup is the right primitive.
How
GET /app/installations/{installation_id}with the App JWT (same style asResolveAppInstallationAsync/ListAppInstallationsAsync). A 404 maps to a newGit.InstallationNotFounderror; other statuses (401/429/5xx) propagate unchanged. The 404→InstallationNotFoundrouting goes through a newGitRestErrorContext.ForInstallation(id), mirroring howForRepository/ForNamespacealready tell the error mapper what a 404 means.GitErrors.InstallationNotFound(string installationId)→Error.NotFound, codeGit.InstallationNotFound(sibling ofRepositoryNotFound/NamespaceNotFound).InMemoryGitServer(lookup seeded installations by id; miss →InstallationNotFound) andNullGitServer(Git.NotConfigured, like every other method) implement the new method.Tests
Git.InstallationNotFound, unknown app key →Git.NotConfigured.GitErrorsfactory test +NullGitServernot-configured assertion.Compendium.Abstractions.Git100% line,Compendium.Adapters.GitHub93.3% line (both ≥90%).Claude-Session: https://claude.ai/code/session_01VFDn7gCH7vdvT4eoNhsMLr