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