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:
@@ -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()
|
||||
Reference in New Issue
Block a user