Browse Source

ref(controlsilo) Move another task into integrations.github (#75450)

This github task was hiding in the root integrations directory.

Split out from #74925
Mark Story 7 months ago
parent
commit
77c048abab

+ 7 - 1
src/sentry/integrations/github/tasks/__init__.py

@@ -1,4 +1,10 @@
+from .link_all_repos import link_all_repos
 from .open_pr_comment import open_pr_comment_workflow
 from .pr_comment import github_comment_reactions, github_comment_workflow
 
-__all__ = ("open_pr_comment_workflow", "github_comment_reactions", "github_comment_workflow")
+__all__ = (
+    "open_pr_comment_workflow",
+    "github_comment_reactions",
+    "github_comment_workflow",
+    "link_all_repos",
+)

+ 23 - 0
src/sentry/integrations/github/tasks/link_all_repos.py

@@ -0,0 +1,23 @@
+from sentry.plugins.providers.integration_repository import RepoExistsError
+from sentry.silo.base import SiloMode
+from sentry.tasks.base import instrumented_task, retry
+from sentry.tasks.integrations.link_all_repos import link_all_repos as link_all_repos_old
+
+
+@instrumented_task(
+    name="sentry.integrations.github.tasks.link_all_repos",
+    queue="integrations.control",
+    max_retries=3,
+    silo_mode=SiloMode.CONTROL,
+)
+@retry(exclude=(RepoExistsError, KeyError))
+def link_all_repos(
+    integration_key: str,
+    integration_id: int,
+    organization_id: int,
+):
+    link_all_repos_old(
+        integration_key=integration_key,
+        integration_id=integration_id,
+        organization_id=organization_id,
+    )