Repository navigation
Closed
Labels
complexity-lowComplexity: low (board points 1-3)priority-p2Importanttheme-reliabilityTheme: Reliabilitytype-featureNew functionality
Description
Summary
Add environment variable overrides for git base URL to support GHES, Gitea, and local reproduction of git sync issues.
Context
Currently Trinity hardcodes `https://github.com\` and `https://api.github.com\`. This blocks:
- Self-hosted Git (GHES, Gitea, GitLab)
- Local reproduction of git sync bugs (essential for testing S1-S7)
Acceptance Criteria
New environment variables
- `TRINITY_GIT_BASE_URL` (default `https://github.com\`) — scheme+host for clone/push URLs
- `TRINITY_GIT_API_BASE` (default `https://api.github.com\`) — API endpoint for repo validation
Backend changes
- `src/backend/services/github_service.py` — use `TRINITY_GIT_API_BASE`
- `src/backend/services/git_service.py` — new `_git_remote_url()` helper using `TRINITY_GIT_BASE_URL`
- `src/backend/services/agent_service/crud.py` — propagate env var to agent container
Agent container changes
- `docker/base-image/startup.sh` — compose `CLONE_URL` from env var
Backward compatibility
- When env vars unset, behavior unchanged (defaults to github.com)
- Test that defaults still work
Technical Notes
~30 lines of code, zero schema change. Gitea's API returns the same shape as GitHub's for repo operations, so the single base-URL swap works end-to-end.
This enables local reproduction of all other git sync issues via `docker-compose.gitea.yml` overlay.
Part of Epic #381
Metadata
Metadata
Assignees
Labels
complexity-lowComplexity: low (board points 1-3)priority-p2Importanttheme-reliabilityTheme: Reliabilitytype-featureNew functionality
Activity
feat(git): self-hosted git URL support via env overrides (Abilityai#387)
chore: park exploratory WIP (research, superpowers, template prototypes)
feat(git): self-hosted git URL support via env overrides (Abilityai#387)
test(git): cover TRINITY_GIT_BASE_URL / TRINITY_GIT_API_BASE overrides (
feat(git): self-hosted git URL support (#387) (#393)