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
+6 -7
View File
@@ -44,18 +44,17 @@ def temp_repo() -> Any:
yield repo_path
def test_clone_raises_not_implemented_error(local_git: LocalGitOperations) -> None:
with pytest.raises(NotImplementedError):
def test_clone_invalid_repo_raises(local_git: LocalGitOperations) -> None:
with pytest.raises(RuntimeError, match="Git clone failed"):
local_git.clone("https://example.com/repo.git", Path("/tmp/dest"), "cred-id")
def test_fetch_raises_not_implemented_error(local_git: LocalGitOperations, temp_repo: Path) -> None:
with pytest.raises(NotImplementedError):
local_git.fetch(temp_repo, "cred-id")
def test_fetch_no_remote_succeeds(local_git: LocalGitOperations, temp_repo: Path) -> None:
local_git.fetch(temp_repo, "cred-id")
def test_push_raises_not_implemented_error(local_git: LocalGitOperations, temp_repo: Path) -> None:
with pytest.raises(NotImplementedError):
def test_push_no_remote_raises(local_git: LocalGitOperations, temp_repo: Path) -> None:
with pytest.raises(RuntimeError, match="Git push failed"):
local_git.push(temp_repo, "cred-id")