Skip to content

feat(integrations): Genericise repository syncing task#112519

Merged
wedamija merged 2 commits intomasterfrom
danf/sync-repos-task-generalize
Apr 9, 2026
Merged

feat(integrations): Genericise repository syncing task#112519
wedamija merged 2 commits intomasterfrom
danf/sync-repos-task-generalize

Conversation

@wedamija
Copy link
Copy Markdown
Member

@wedamija wedamija commented Apr 8, 2026

This uses more generic functions in the syncing task. It turns out there's more work to do for each provider to make them generic, so not enabling everything yet.

@wedamija wedamija requested a review from a team April 8, 2026 20:25
@wedamija wedamija requested review from a team as code owners April 8, 2026 20:25
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 8, 2026
Comment thread src/sentry/integrations/source_code_management/sync_repos.py
Comment thread src/sentry/integrations/source_code_management/sync_repos.py
@wedamija wedamija force-pushed the danf/move-sync-repos-task branch from 987d043 to c11d6af Compare April 8, 2026 20:35
@wedamija wedamija requested a review from a team as a code owner April 8, 2026 20:35
@wedamija wedamija force-pushed the danf/sync-repos-task-generalize branch from 4fd70b5 to 95097c5 Compare April 8, 2026 20:35
@wedamija wedamija changed the title Danf/sync repos task generalize feat(integrations): Genericise repository syncing task Apr 8, 2026
wedamija added a commit that referenced this pull request Apr 8, 2026
Required to get #112519 working for all scms. integration_id and installation are the same, but different scms use them. I don't want to refactor how the scms work, so just providing both.
Base automatically changed from danf/move-sync-repos-task to master April 9, 2026 17:54
wedamija added 2 commits April 9, 2026 10:55
This switches over the repository syncing task to be able to run for most SCM providers.
@wedamija wedamija force-pushed the danf/sync-repos-task-generalize branch from 95097c5 to 6749a24 Compare April 9, 2026 17:55
@wedamija wedamija enabled auto-merge (squash) April 9, 2026 17:59
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6749a24. Configure here.

restored_ids = sentry_disabled_ids & provider_external_ids

metric_tags = {
"provider": integration.provider,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GHE sync crashes on ApiError due to missing method

High Severity

GitHubEnterpriseIntegration does not override is_rate_limited_error; it inherits the base IntegrationInstallation implementation which raises NotImplementedError. Before this PR, GHE integrations always exited early because the feature flag was GitHub-specific. Now that dedicated github_enterprise-repo-auto-sync flags are registered and checked, GHE can reach the except ApiError handler. When any ApiError occurs, installation.is_rate_limited_error(e) raises NotImplementedError, masking the original error and preventing the raise from re-raising the ApiError for proper task retry.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6749a24. Configure here.

@wedamija wedamija merged commit d20aa17 into master Apr 9, 2026
77 checks passed
@wedamija wedamija deleted the danf/sync-repos-task-generalize branch April 9, 2026 18:12
wedamija added a commit that referenced this pull request Apr 9, 2026
Required to get #112519 working for all scms. integration_id and installation are the same, but different scms use them. I don't want to refactor how the scms work, so just providing both.
george-sentry pushed a commit that referenced this pull request Apr 9, 2026
This uses more generic functions in the syncing task. It turns out there's more work to do for each provider to make them generic, so not enabling everything yet.
wedamija added a commit that referenced this pull request Apr 10, 2026
Required to get #112519 working for all scms. integration_id and installation are the same, but different scms use them. I don't want to refactor how the scms work, so just providing both.
wedamija added a commit that referenced this pull request Apr 10, 2026
…12545)

Required to get #112519 working
for all scms.

Expand the periodic repo sync from GitHub-only to provider-agnostic. The
task now uses each provider's get_repositories() and external_id instead
of GitHub-specific API calls, with per-provider feature flags to control
rollout.

Currently enabled for GitHub, GitHub Enterprise, and VSTS. GitLab and
Bitbucket are blocked on a pre-existing issue where create_repositories
eagerly creates webhooks for all repos before checking if they already
exist. Perforce lacks external_id support.

<!-- Describe your PR here. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants