Skip to content

feat: add git workspace source contract - #144

Merged
delete-cloud merged 1 commit into
mainfrom
feat/git-workspace-source-contract
May 13, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
feat/git-workspace-source-contract

Conversation

@delete-cloud

@delete-cloud delete-cloud commented May 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add workspace_source.kind = git request schema with remote URL, base ref, base SHA, and optional runtime profile
  • fail closed with HTTP 501 until Git-backed workspace provisioning is implemented
  • ensure Git source requests do not fall through to Docker provider provisioning

Validation

  • uv run pytest tests/ui/test_http_server.py -k "git_workspace_source_until_supported" -q
  • uv run pytest tests/ui/test_http_server.py -k "git_workspace_source_until_supported or provisions_docker_cloud_workspace or rejects_workspace_provisioning_when_disabled or rejects_conflicting_workspace_binding_inputs or RemoteResultPublicationContract" -q
  • uv run pytest tests/ui/test_http_server.py tests/ui/test_http_server_workspace_transfer.py -k "workspace_source or git_workspace or docker_cloud_workspace or workspace_transfer or RemoteResultPublicationContract" -q
  • uv run basedpyright --level error src/coding_agent/ui/schemas.py src/coding_agent/ui/http_server.py tests/ui/test_http_server.py
  • uv run ruff format --check src/coding_agent/ui/schemas.py src/coding_agent/ui/http_server.py tests/ui/test_http_server.py
  • git diff --check

@coderabbitai

coderabbitai Bot commented May 13, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR adds a GitWorkspaceSourceRequest schema to the API contract, implements early rejection of Git workspace sources during provisioning with HTTP 501 status, improves error handling to preserve HTTP exception details, and adds test coverage validating the rejection behavior.

Changes

Git workspace source request schema and validation

Layer / File(s) Summary
Git workspace source schema definition
coding-agent/src/coding_agent/ui/schemas.py
Introduces GitWorkspaceSourceRequest Pydantic model with kind="git" literal, required Git-specific fields (remote_url, base_ref, base_sha), and optional runtime_profile. Updates WorkspaceSourceRequest union type to accept both Docker and Git sources.
Git workspace rejection and error handling
coding-agent/src/coding_agent/ui/http_server.py
Adds explicit check in _provisioned_execution_binding_from_request to detect Git workspace sources and raise HTTP 501 "git workspace source is not implemented yet". Improves create_session error handling to re-raise HTTPException instances, preserving their original status codes and details instead of remapping them.
Git workspace rejection test
coding-agent/tests/ui/test_http_server.py
Adds test test_create_session_rejects_git_workspace_source_until_supported that verifies session creation with Git workspace source fails with HTTP 501 and the expected error message when cloud workspace provisioning is configured.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through Git-shaped dreams,
But workspace sources aren't what they seem,
With 501, "not yet!" it declares,
While schemas and tests show utmost care. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add git workspace source contract' clearly and concisely describes the main change—adding a Git workspace source schema and related contract implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/git-workspace-source-contract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@delete-cloud
delete-cloud merged commit 04673f6 into main May 13, 2026
1 check passed
@delete-cloud
delete-cloud deleted the feat/git-workspace-source-contract branch May 13, 2026 06:05
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