3728c245d3
- 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
36 lines
799 B
Python
36 lines
799 B
Python
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
|