Browse Source

chore(hybridcloud) Merge customer-domains feature into multi-region (#72902)

To reduce the number of features flags and the combinations of feature
flags, I am merging the `customer-domains` feature into
`system:multi-region`.

I've started to cleanup some of the logic around customer-domains
behavior as we'll no longer have ways to go in and out of customer
domains for specific organizations. There is more to do here and I'll do
the remaining cleanup once customer-domains feature can be removed.

These changes also include moving away from `window.__initialData` being
used across the application. Instead we can use `ConfigStore` to read
application configuration.

Refs #72537
Mark Story 8 months ago
parent
commit
93d6593ce2

+ 1 - 1
src/sentry/api/serializers/models/auth_provider.py

@@ -29,7 +29,7 @@ class AuthProviderSerializer(Serializer):
         login_url = Organization.get_url(organization.slug)
 
         absolute_login_url = OrganizationAbsoluteUrlMixin.organization_absolute_url(
-            features.has("organizations:customer-domains", organization),
+            features.has("system:multi-region"),
             slug=organization.slug,
             path=login_url,
         )

+ 1 - 0
src/sentry/api/serializers/models/organization.py

@@ -303,6 +303,7 @@ class OrganizationSerializer(Serializer):
         request = env.request
         if request and is_using_customer_domain(request):
             # If the current request is using a customer domain, then we activate the feature for this organization.
+            # TODO(hybridcloud) This needs to be removed alongside the customer-domain feature
             feature_set.add("customer-domains")
 
         if "dynamic-sampling" not in feature_set and "mep-rollout-flag" in feature_set:

+ 0 - 1
src/sentry/apidocs/examples/project_examples.py

@@ -283,7 +283,6 @@ DETAILED_PROJECT = {
             "performance-large-http-payload-ingest",
             "crons-issue-platform",
             "profile-file-io-main-thread-ingest",
-            "customer-domains",
             "performance-file-io-main-thread-post-process-group",
             "performance-render-blocking-asset-span-visible",
             "ds-sliding-window-org",

+ 1 - 1
src/sentry/auth/helper.py

@@ -211,7 +211,7 @@ class AuthIdentityHandler:
         subdomain = None
         if data:
             subdomain = data.get("subdomain") or None
-        if features.has("organizations:customer-domains", self.organization, actor=user):
+        if features.has("system:multi-region"):
             subdomain = self.organization.slug
 
         try:

+ 1 - 0
src/sentry/conf/server.py

@@ -2186,6 +2186,7 @@ SENTRY_USE_ISSUE_OCCURRENCE = False
 SENTRY_USE_GROUP_ATTRIBUTES = True
 
 # This flag activates code paths that are specific for customer domains
+# Deprecated: This setting will be replaced with feature checks for system:multi-region
 SENTRY_USE_CUSTOMER_DOMAINS = False
 
 # This flag activates replay analyzer service in the development environment

+ 1 - 1
src/sentry/integrations/github/integration.py

@@ -147,7 +147,7 @@ def error(
 
 
 def get_document_origin(org) -> str:
-    if org and features.has("organizations:customer-domains", org.organization):
+    if org and features.has("system:multi-region"):
         return f'"{generate_organization_url(org.organization.slug)}"'
     return "document.origin"
 

+ 1 - 1
src/sentry/integrations/pipeline.py

@@ -238,7 +238,7 @@ class IntegrationPipeline(Pipeline):
 
     def _dialog_response(self, data, success):
         document_origin = "document.origin"
-        if features.has("organizations:customer-domains", self.organization):
+        if features.has("system:multi-region"):
             document_origin = f'"{generate_organization_url(self.organization.slug)}"'
         context = {
             "payload": {"success": success, "data": data},

+ 1 - 1
src/sentry/types/organization.py

@@ -22,7 +22,7 @@ class OrganizationAbsoluteUrlMixin:
         if request and is_using_customer_domain(request):
             return True
 
-        return features.has("organizations:customer-domains", self)
+        return features.has("system:multi-region")
 
     def _has_customer_domain(self) -> bool:
         # For getsentry compatibility

+ 1 - 1
src/sentry/utils/linksign.py

@@ -68,7 +68,7 @@ def generate_signed_unsubscribe_link(
     html_viewname = f"sentry-organization-unsubscribe-{resource}"
     api_endpointname = f"sentry-api-0-organization-unsubscribe-{resource}"
     url_args = [organization.slug, resource_id]
-    if features.has("organizations:customer-domains", organization):
+    if features.has("system:multi-region"):
         url_args = [resource_id]
         html_viewname = f"sentry-customer-domain-unsubscribe-{resource}"
 

+ 1 - 1
src/sentry/web/client_config.py

@@ -221,7 +221,7 @@ class _ClientConfig:
             yield "auth:register"
         if features.has("relocation:enabled", actor=self.user):
             yield "relocation:enabled"
-        if features.has("system:multi-region", actor=self.user):
+        if features.has("system:multi-region"):
             yield "system:multi-region"
         if self.customer_domain or (
             self.last_org and features.has("organizations:customer-domains", self.last_org)

Some files were not shown because too many files changed in this diff