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,35 @@
|
||||
from uuid import UUID
|
||||
|
||||
from app.schemas.base import OrmBase
|
||||
|
||||
|
||||
class RepositoryConnectionBase(OrmBase):
|
||||
project_id: UUID
|
||||
repository_id: UUID | None = None
|
||||
provider_kind: str = "generic"
|
||||
credential_id: UUID | None = None
|
||||
connection_status: str = "pending"
|
||||
default_branch: str | None = None
|
||||
|
||||
|
||||
class RepositoryConnectionCreate(OrmBase):
|
||||
repository_id: UUID
|
||||
provider_kind: str
|
||||
credential_kind: str
|
||||
credential_payload: str
|
||||
|
||||
|
||||
class RepositoryConnectionRead(OrmBase):
|
||||
id: UUID
|
||||
project_id: UUID
|
||||
repository_id: UUID | None = None
|
||||
provider_kind: str
|
||||
credential_id: UUID | None = None
|
||||
connection_status: str
|
||||
default_branch: str | None = None
|
||||
|
||||
|
||||
class SshKeyResponse(OrmBase):
|
||||
connection_id: UUID
|
||||
public_key: str
|
||||
credential_id: UUID
|
||||
Reference in New Issue
Block a user