Skip to content

Commit 8969845

Browse files
joshuarliJesse-Box
authored andcommitted
ref: short circuit create_default_projects post_upgrade hook for test-cli (#103196)
1 parent f70bbdf commit 8969845

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/backend.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,12 @@ jobs:
195195
mode: migrations
196196

197197
- name: Run test
198-
run: |
199-
make test-cli
198+
env:
199+
# This short circuits the create_default_projects post_upgrade hook
200+
# which spawns taskworkers which will spin for 5 minutes on kafka
201+
# not being up. We don't need the default project here as this is not local dev.
202+
SENTRY_NO_CREATE_DEFAULT_PROJECT: 1
203+
run: make test-cli
200204

201205
- name: Inspect failure
202206
if: failure()

src/sentry/receivers/core.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from click import echo
24
from django.conf import settings
35
from django.contrib.auth.models import AnonymousUser
@@ -32,6 +34,14 @@ def create_default_projects(**kwds):
3234
# No op in production SaaS environments.
3335
return
3436

37+
# Temporary patch to stop getsentry migrations-drift ci from timing out
38+
# because something in create_default_project triggers taskworkers which
39+
# spin for 5m waiting for kafka which isn't up.
40+
# (Only postgres+redis is needed for running migrations.)
41+
# We still want post_save hooks to run, just not in this specific case.
42+
if os.environ.get("SENTRY_NO_CREATE_DEFAULT_PROJECT") == "1":
43+
return
44+
3545
create_default_project(
3646
# This guards against sentry installs that have SENTRY_PROJECT set to None, so
3747
# that they don't error after every migration. Specifically for single tenant.

0 commit comments

Comments
 (0)