getsentry / getsentry/sentry

feat(perforce): Add UI for adding depot repos

Open
#116,291 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Integrations
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 the commits feature gate) but shows no way to add depots.
  • The "Sync now" button is wired to /integrations/{id}/repo-sync/ which returns 400 for 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.pyget_repositories(), SCM_SYNC_PROVIDERS comment
  • src/sentry/integrations/perforce/repository.pyget_repository_data(), build_repository_config()
  • src/sentry/integrations/api/endpoints/organization_integration_repo_sync.py — 400 guard for non-sync providers
  • static/app/views/settings/organizationRepositories/index.tsxSCM_PROVIDER_ORDER (Perforce absent), ConnectedInstallation

Action taken on behalf of Sergiy Dybskiy.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.