Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(core): Protect saas from creating default projects #56688

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/sentry/receivers/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from sentry.services.hybrid_cloud.util import region_silo_function
from sentry.signals import post_upgrade, project_created
from sentry.silo import SiloMode
from sentry.utils.env import in_test_environment
from sentry.utils.settings import is_self_hosted

PROJECT_SEQUENCE_FIX = """
SELECT setval('sentry_project_id_seq', (
Expand All @@ -39,6 +41,10 @@ def wrapped(*args, **kwargs):


def create_default_projects(**kwds):
if not in_test_environment() and not is_self_hosted():
# No op in production SaaS environments.
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.
Expand Down
Loading