feat(FN-007): implement repository connection API and git operations

- Add GitHubAdapter and GitLabAdapter with URL parsing
- Create provider factory in apps/api/app/git/providers/
- Implement clone, fetch, push in LocalGitOperations
- Add repository_connections router with CRUD and SSH key endpoints
- Create RepositoryConnection schema with validation
- Update models and routers __init__.py for new components
- Add comprehensive tests for git operations
This commit is contained in:
2026-05-16 13:41:37 +02:00
parent 25db3f81b0
commit 3728c245d3
9 changed files with 396 additions and 30 deletions
+17
View File
@@ -0,0 +1,17 @@
from app.git.provider import GitProvider
from app.git.types import ProviderKind
from .github import GitHubAdapter
from .gitlab import GitLabAdapter
PROVIDERS: dict[ProviderKind, type[GitProvider]] = {
ProviderKind.github: GitHubAdapter,
ProviderKind.gitlab: GitLabAdapter,
}
def get_provider(kind: ProviderKind) -> GitProvider:
provider_class = PROVIDERS.get(kind)
if provider_class is None:
raise ValueError(f"Unsupported provider kind: {kind}")
return provider_class()