diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 9b37a135a373ba..d60ede485eb585 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -195,8 +195,12 @@ jobs: mode: migrations - name: Run test - run: | - make test-cli + env: + # This short circuits the create_default_projects post_upgrade hook + # which spawns taskworkers which will spin for 5 minutes on kafka + # not being up. We don't need the default project here as this is not local dev. + SENTRY_NO_CREATE_DEFAULT_PROJECT: 1 + run: make test-cli - name: Inspect failure if: failure() diff --git a/src/sentry/receivers/core.py b/src/sentry/receivers/core.py index c3a6a2d55dcb1c..95a70944c95835 100644 --- a/src/sentry/receivers/core.py +++ b/src/sentry/receivers/core.py @@ -1,3 +1,5 @@ +import os + from click import echo from django.conf import settings from django.contrib.auth.models import AnonymousUser @@ -32,6 +34,14 @@ def create_default_projects(**kwds): # No op in production SaaS environments. return + # Temporary patch to stop getsentry migrations-drift ci from timing out + # because something in create_default_project triggers taskworkers which + # spin for 5m waiting for kafka which isn't up. + # (Only postgres+redis is needed for running migrations.) + # We still want post_save hooks to run, just not in this specific case. + if os.environ.get("SENTRY_NO_CREATE_DEFAULT_PROJECT") == "1": + return + create_default_project( # This guards against sentry installs that have SENTRY_PROJECT set to None, so # that they don't error after every migration. Specifically for single tenant.