Skip to content

Add Git Repos management tools (list, clone, sync, delete)#419

Open
jralfonsog wants to merge 5 commits intodatabricks-solutions:mainfrom
jralfonsog:feat/git-repos
Open

Add Git Repos management tools (list, clone, sync, delete)#419
jralfonsog wants to merge 5 commits intodatabricks-solutions:mainfrom
jralfonsog:feat/git-repos

Conversation

@jralfonsog
Copy link
Copy Markdown

Summary

  • List repos: List all Git repos in the workspace, with optional path prefix filter
  • Get repo: Retrieve repo details by ID (path, URL, branch, head commit)
  • Create repo: Clone a remote Git repository into the workspace (supports 8 providers)
  • Update repo: Switch branch or tag — pulls latest from remote and checks out the ref
  • Delete repo: Remove a repo from the workspace (remote unaffected)

Architecture

Layer File Description
Core library databricks_tools_core/repos/repos.py 5 CRUD functions with typed exception handling
MCP tools databricks_mcp_server/tools/repos.py Wrappers with manifest tracking for create/delete
Unit tests tests/unit/test_repos.py 19 tests covering CRUD, error handling, validation

Create and delete operations integrate with the manifest system for resource tracking.

Test plan

  • 19 unit tests pass (pytest tests/unit/test_repos.py -v)
  • Ruff lint and format pass
  • Integration tested against live workspace:
    • list_repos with path prefix filter returns 4 repos
    • Full lifecycle: create → get → update (switch branch) → delete verified
    • Not-found returns structured error dict (not exception)
    • Invalid provider validation returns clear error message
    • Deleted repo confirmed unreachable after deletion

This pull request was AI-assisted by Isaac.

Add 5 functions for Databricks Repos CRUD operations:
- list_repos: list repos with optional path prefix filter
- get_repo: get repo details by ID
- create_repo: clone a Git repository into the workspace
- update_repo: switch branch or tag (pulls latest from remote)
- delete_repo: remove a repo from the workspace

Co-authored-by: Isaac
Wrap the 5 core repos functions as MCP tools with manifest tracking:
- list_repos (timeout=30)
- get_repo (timeout=30)
- create_repo (timeout=120, tracks resource in manifest)
- update_repo (timeout=60)
- delete_repo (timeout=30, removes from manifest)

Co-authored-by: Isaac
Cover all 5 functions: list_repos, get_repo, create_repo, update_repo,
delete_repo. Tests include happy paths, error handling, provider validation,
and branch/tag mutual exclusivity.

Co-authored-by: Isaac
Remove extraneous f-string prefix, fix line length, remove unused variable.

Co-authored-by: Isaac
- Docstrings: opening """ on its own line
- MCP module header: add tool listing
- Serialization: use getattr() for defensive SDK object access
- Returns sections: bullet list format for dict keys
- Manifest imports: late imports in try blocks
- Idempotent create: rename to create_or_update_repo with _find_repo_by_url helper

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant