Skip to content

feat: add direct repository and branch lookup - #5080

Open
bestmaa wants to merge 2 commits into
Dokploy:canaryfrom
bestmaa:agent/direct-repository-lookup
Open

feat: add direct repository and branch lookup#5080
bestmaa wants to merge 2 commits into
Dokploy:canaryfrom
bestmaa:agent/direct-repository-lookup

Conversation

@bestmaa

@bestmaa bestmaa commented Aug 14, 2026

Copy link
Copy Markdown

What is this PR about?

In organizations with a large number of repositories and branches, selecting a known repository or branch currently requires loading and paginating the complete list first. This can make provider setup slow and generate unnecessary API traffic.

This PR adds an optional direct lookup path while preserving the existing pickers:

  • enter owner/repository, a nested GitLab namespace, or a repository URL to fetch exactly one repository;
  • enter an exact branch name, including names with /, to fetch exactly one branch;
  • use provider-native single-resource endpoints for GitHub, GitLab, Bitbucket, and Gitea;
  • defer full repository and branch list requests until the corresponding dropdown is opened;
  • support both application and Compose provider forms;
  • keep existing provider permission checks and picker behavior as a fallback.

The change is intentionally contained in shared lookup components plus small provider-specific server adapters. It does not add a database migration or change existing saved provider configuration.

Why?

This was motivated by a real company setup where provider accounts contained many repositories and individual repositories contained many branches. Users usually already knew the exact repository and branch they wanted, but still had to wait for complete lists to load. Exact lookup makes that common path proportional to one API request instead of the size of the account or repository.

Testing

  • pnpm exec biome check on all changed TypeScript/TSX files
  • pnpm --filter=server run typecheck
  • pnpm --filter=dokploy run typecheck
  • 13 focused Vitest cases covering repository parsing and exact repository/branch lookup across all four providers
  • Production image built with the repository Dockerfile and Node 24.4.0
  • Fresh Docker stack health check returned HTTP 200
  • Browser E2E against an isolated Gitea-compatible service selected acme/payments and branch main
  • Request trace confirmed only /api/v1/repos/acme/payments and /api/v1/repos/acme/payments/branches/main were called; no full-list endpoint was used

Checklist

  • Dedicated branch based on canary
  • Read the contribution guidelines
  • Tested in a local Docker instance

Screenshots

Direct repository and branch lookup

Greptile Summary

This PR adds direct repository and branch lookup across GitHub, GitLab, Bitbucket, and Gitea while retaining the existing list-based pickers.

  • Adds shared direct-lookup components and stale-request invalidation.
  • Adds provider-specific single-resource API adapters.
  • Integrates deferred list loading into application and Compose provider forms.
  • Adds focused parsing, request-guard, and provider lookup tests.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported stale-response failure is addressed by invalidating requests when lookup context changes, when a newer request begins, and when the component unmounts; no blocking failure remains.

Reviews (2): Last reviewed commit: "fix: ignore stale git lookup responses" | Re-trigger Greptile

Context used:

@bestmaa
bestmaa marked this pull request as ready for review August 14, 2026 09:06
@bestmaa
bestmaa requested a review from Siumauricio as a code owner August 14, 2026 09:06
@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant