From 191aa03eb307e84c557d78e8d40b4d3d452489c1 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 11 Nov 2025 15:28:08 -0800 Subject: [PATCH 1/2] short circuit --- .github/workflows/backend.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 9b37a135a373ba..e08afe8389e508 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_IN_TEST_ENVIRONMENT: 1 + run: make test-cli - name: Inspect failure if: failure() From 55fdd33d5c8cff91b9fc2ccf7506c802484f1a18 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 11 Nov 2025 15:54:04 -0800 Subject: [PATCH 2/2] fix: introduce SENTRY_NO_CREATE_DEFAULT_PROJECT --- .github/workflows/backend.yml | 2 +- src/sentry/receivers/core.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index e08afe8389e508..d60ede485eb585 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -199,7 +199,7 @@ jobs: # 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_IN_TEST_ENVIRONMENT: 1 + SENTRY_NO_CREATE_DEFAULT_PROJECT: 1 run: make test-cli - name: Inspect 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.