feat(perforce): Add UI for adding depot repos
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 23m
- Merged PRs (30d)
- 607
Description
The Perforce integration has no UI for adding depot repositories. Automatic repo sync is intentionally excluded (SCM_SYNC_PROVIDERS in sync_repos.py) because Perforce cannot derive external_id from its API. The only way to add a Perforce depot today is to manually POST to /api/0/organizations/{org}/repos/.
Current behavior
- The Repositories page (
/settings/org/repos/) renders Perforce installations (it has thecommitsfeature gate) but shows no way to add depots. - The "Sync now" button is wired to
/integrations/{id}/repo-sync/which returns400for Perforce, so clicking it silently fails. - Users must curl the repos API directly to add a depot.
Gap
The backend is fully ready: PerforceIntegration.get_repositories() returns available depots from the P4 server, and PerforceRepositoryProvider.get_repository_data() / build_repository_config() handle validation and persistence. There is no frontend depot-picker dialog that calls these.
Suggested approach
- Add an "Add depot" button/dialog on the Repositories page for Perforce installations (similar to how other integrations surface an add-repo flow).
- The dialog should call
get_repositories()to list available depots and POST to/api/0/organizations/{org}/repos/on selection. - Hide or disable the "Sync now" button for Perforce (backend already blocks it; frontend should too).
Relevant code:
src/sentry/integrations/perforce/integration.py—get_repositories(),SCM_SYNC_PROVIDERScommentsrc/sentry/integrations/perforce/repository.py—get_repository_data(),build_repository_config()src/sentry/integrations/api/endpoints/organization_integration_repo_sync.py— 400 guard for non-sync providersstatic/app/views/settings/organizationRepositories/index.tsx—SCM_PROVIDER_ORDER(Perforce absent),ConnectedInstallation
Action taken on behalf of Sergiy Dybskiy.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in static/app/views/settings/organizationRepositories/index.tsx, reviewing SCM_PROVIDER_ORDER and ConnectedInstallation, then read the Perforce methods in src/sentry/integrations/perforce/integration.py and repository.py. Check the repo-sync endpoint's Perforce guard before implementing the UI flow. Done means users can select and add a depot from the Repositories page and cannot trigger Sync now for Perforce.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- api, backend, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100