Skip to content

feat(perforce): Add UI for adding depot repos #116291

@sentry-junior

Description

@sentry-junior

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.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions