diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py index 127c03cce2ca24..c4442a3b0bbc1a 100644 --- a/src/sentry/features/temporary.py +++ b/src/sentry/features/temporary.py @@ -448,8 +448,6 @@ def register_temporary_features(manager: FeatureManager) -> None: manager.add("organizations:sentry-app-webhook-circuit-breaker", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) # Override dry-run to enable real blocking per app-owner org during rollout manager.add("organizations:sentry-app-webhook-circuit-breaker-live-run", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) - # Create organiations via control-scoped domains in saas. - manager.add("organizations:create-org-control", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enables organization access to the new notification platform manager.add("organizations:notification-platform.internal-testing", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) diff --git a/src/sentry/web/client_config.py b/src/sentry/web/client_config.py index 2265a3374b89fe..87e73d28c768aa 100644 --- a/src/sentry/web/client_config.py +++ b/src/sentry/web/client_config.py @@ -225,10 +225,6 @@ def enabled_features(self) -> Iterable[str]: yield "relocation:enabled" if features.has("system:multi-region"): yield "system:multi-region" - if self.last_org and features.has( - "organizations:create-org-control", self.last_org, actor=self.user - ): - yield "organizations:create-org-control" @property def needs_upgrade(self) -> bool: diff --git a/static/app/utils/regions/index.tsx b/static/app/utils/regions/index.tsx index e97690e4daf843..dad2dabdc6bbd2 100644 --- a/static/app/utils/regions/index.tsx +++ b/static/app/utils/regions/index.tsx @@ -85,15 +85,6 @@ export function getRegionNameChoices(): Array<[string, string]> { }); } -export function getRegionUrl(name: string): string | null { - const regions = getRegions(); - const found = regions.find(item => item.name === name); - if (found) { - return found.url; - } - return null; -} - export function shouldDisplayRegions(): boolean { return getRegions().length > 1; } diff --git a/static/app/views/organizationCreate/index.spec.tsx b/static/app/views/organizationCreate/index.spec.tsx index 3425493b51769b..96cecb00669f53 100644 --- a/static/app/views/organizationCreate/index.spec.tsx +++ b/static/app/views/organizationCreate/index.spec.tsx @@ -53,6 +53,7 @@ describe('OrganizationCreate', () => { it('creates a new org', async () => { const orgCreateMock = MockApiClient.addMockResponse({ url: '/organizations/', + host: ConfigStore.get('links').sentryUrl, method: 'POST', body: OrganizationFixture(), }); @@ -84,7 +85,7 @@ describe('OrganizationCreate', () => { error: expect.any(Function), method: 'POST', data: {agreeTerms: true, defaultTeam: true, name: 'Good Burger'}, - host: undefined, + host: ConfigStore.get('links').sentryUrl, }); }); expect(testableWindowLocation.assign).toHaveBeenCalledTimes(1); @@ -95,6 +96,7 @@ describe('OrganizationCreate', () => { it('creates a new org with customer domain feature', async () => { const orgCreateMock = MockApiClient.addMockResponse({ + host: ConfigStore.get('links').sentryUrl, url: '/organizations/', method: 'POST', body: OrganizationFixture(), @@ -119,7 +121,7 @@ describe('OrganizationCreate', () => { method: 'POST', success: expect.any(Function), error: expect.any(Function), - host: undefined, + host: ConfigStore.get('links').sentryUrl, }); }); @@ -131,6 +133,7 @@ describe('OrganizationCreate', () => { function multiRegionSetup() { const orgCreateMock = MockApiClient.addMockResponse({ + host: ConfigStore.get('links').sentryUrl, url: '/organizations/', method: 'POST', body: OrganizationFixture(), @@ -163,7 +166,7 @@ describe('OrganizationCreate', () => { success: expect.any(Function), error: expect.any(Function), method: 'POST', - host: undefined, + host: ConfigStore.get('links').sentryUrl, data: {defaultTeam: true, name: 'Good Burger'}, }); }); @@ -195,14 +198,13 @@ describe('OrganizationCreate', () => { ); await userEvent.click(screen.getByText('Create Organization')); - const expectedHost = 'https://us.example.com'; await waitFor(() => { expect(orgCreateMock).toHaveBeenCalledWith('/organizations/', { success: expect.any(Function), error: expect.any(Function), method: 'POST', - host: expectedHost, - data: {defaultTeam: true, name: 'Good Burger'}, + host: ConfigStore.get('links').sentryUrl, + data: {defaultTeam: true, name: 'Good Burger', dataStorageLocation: 'us'}, }); }); @@ -228,14 +230,13 @@ describe('OrganizationCreate', () => { ); await userEvent.click(screen.getByText('Create Organization')); - const expectedHost = 'https://de.example.com'; await waitFor(() => { expect(orgCreateMock).toHaveBeenCalledWith('/organizations/', { success: expect.any(Function), error: expect.any(Function), method: 'POST', - host: expectedHost, - data: {defaultTeam: true, name: 'Good Burger'}, + host: ConfigStore.get('links').sentryUrl, + data: {defaultTeam: true, name: 'Good Burger', dataStorageLocation: 'de'}, }); }); @@ -245,11 +246,8 @@ describe('OrganizationCreate', () => { ); }); - it('submits to the control URL when create-org-control is active', async () => { - ConfigStore.set( - 'features', - new Set(['system:multi-region', 'organizations:create-org-control']) - ); + it('submits to the control URL when multi-region is active', async () => { + ConfigStore.set('features', new Set(['system:multi-region'])); ConfigStore.set('urlPrefix', 'https://sentry.io'); ConfigStore.set('regions', [ {url: 'https://us.example.com', name: 'us'}, @@ -259,6 +257,7 @@ describe('OrganizationCreate', () => { }, ]); const orgCreateMock = MockApiClient.addMockResponse({ + host: ConfigStore.get('links').sentryUrl, url: '/organizations/', method: 'POST', body: OrganizationFixture(), diff --git a/static/app/views/organizationCreate/index.tsx b/static/app/views/organizationCreate/index.tsx index f6ac1fae5caace..f46520447dd8f1 100644 --- a/static/app/views/organizationCreate/index.tsx +++ b/static/app/views/organizationCreate/index.tsx @@ -16,11 +16,7 @@ import {t, tct} from 'sentry/locale'; import {getOverride} from 'sentry/overrideRegistry'; import {ConfigStore} from 'sentry/stores/configStore'; import type {OrganizationSummary} from 'sentry/types/organization'; -import { - getRegionUrl, - getRegionNameChoices, - shouldDisplayRegions, -} from 'sentry/utils/regions'; +import {getRegionNameChoices, shouldDisplayRegions} from 'sentry/utils/regions'; import {testableWindowLocation} from 'sentry/utils/testableWindowLocation'; import {normalizeUrl} from 'sentry/utils/url/normalizeUrl'; import {useApi} from 'sentry/utils/useApi'; @@ -28,14 +24,6 @@ import {useApi} from 'sentry/utils/useApi'; export const DATA_STORAGE_DOCS_LINK = 'https://docs.sentry.io/product/accounts/choose-your-data-center'; -function removeDataStorageLocationFromFormData( - formData: Record -): Record { - const shallowFormDataClone = {...formData}; - delete shallowFormDataClone.dataStorageLocation; - return shallowFormDataClone; -} - const DataConsentCheck = OverrideOrDefault({ overrideName: 'component:data-consent-org-creation-checkbox', defaultComponent: null, @@ -48,7 +36,6 @@ function OrganizationCreate() { const relocationUrl = normalizeUrl('/relocation/'); const regionChoices = getRegionNameChoices(); const client = useApi(); - const useControl = ConfigStore.get('features').has('organizations:create-org-control'); const hasDataConsent = getOverride('component:data-consent-org-creation-checkbox') !== undefined; @@ -61,17 +48,7 @@ function OrganizationCreate() { if (!formModel.validateForm()) { return; } - - let host: string | undefined; - if (data.dataStorageLocation) { - if (useControl) { - host = ConfigStore.get('links').sentryUrl; - } else { - const storageLocation = data.dataStorageLocation; - host = getRegionUrl(storageLocation) ?? host; - data = removeDataStorageLocationFromFormData(data); - } - } + const host = ConfigStore.get('links').sentryUrl; addLoadingMessage(t('Creating Organization\u2026')); formModel.setFormSaving(); @@ -84,7 +61,7 @@ function OrganizationCreate() { error: onSubmitError, }); }, - [client, useControl] + [client] ); return ( diff --git a/tests/acceptance/test_create_organization.py b/tests/acceptance/test_create_organization.py index 2846a414e00b10..533e60b731fe47 100644 --- a/tests/acceptance/test_create_organization.py +++ b/tests/acceptance/test_create_organization.py @@ -15,13 +15,14 @@ def setUp(self) -> None: PRIVACY_URL="https://sentry.io/privacy/", TERMS_URL="https://sentry.io/terms/" ) def test_simple(self) -> None: - self.browser.get("/organizations/new/") - assert self.browser.wait_until('input[name="name"]') - assert self.browser.element_exists('input[name="name"]') - assert self.browser.element_exists('input[name="agreeTerms"]') - self.browser.element('input[name="name"]').send_keys("new org") - self.browser.element('input[name="agreeTerms"]').click() - self.browser.click('button[type="submit"]') - # After creating an org should end up on create project - self.browser.wait_until_test_id("platform-javascript-react") - assert self.browser.element_exists_by_test_id("create-project") + with self.options({"system.url-prefix": self.browser.live_server_url}): + self.browser.get("/organizations/new/") + assert self.browser.wait_until('input[name="name"]') + assert self.browser.element_exists('input[name="name"]') + assert self.browser.element_exists('input[name="agreeTerms"]') + self.browser.element('input[name="name"]').send_keys("new org") + self.browser.element('input[name="agreeTerms"]').click() + self.browser.click('button[type="submit"]') + # After creating an org should end up on create project + self.browser.wait_until_test_id("platform-javascript-react") + assert self.browser.element_exists_by_test_id("create-project") diff --git a/tests/acceptance/test_quick_start.py b/tests/acceptance/test_quick_start.py index 922b41a205f796..8ec77f342e4f21 100644 --- a/tests/acceptance/test_quick_start.py +++ b/tests/acceptance/test_quick_start.py @@ -25,19 +25,20 @@ def setUp(self) -> None: PRIVACY_URL="https://sentry.io/privacy/", TERMS_URL="https://sentry.io/terms/" ) def test_quick_start_sidebar_is_not_automatically_opened_after_project_creation(self) -> None: - self.browser.get("/organizations/new/") + with self.options({"system.url-prefix": self.browser.live_server_url}): + self.browser.get("/organizations/new/") - self.browser.element('input[name="name"]').send_keys("new org") - self.browser.element('input[name="agreeTerms"]').click() - self.browser.click('button[type="submit"]') + self.browser.element('input[name="name"]').send_keys("new org") + self.browser.element('input[name="agreeTerms"]').click() + self.browser.click('button[type="submit"]') - self.browser.wait_until_test_id("platform-javascript-react") - self.browser.click('[data-test-id="platform-javascript-react"') - self.browser.click('button[aria-label="Create Project"]') + self.browser.wait_until_test_id("platform-javascript-react") + self.browser.click('[data-test-id="platform-javascript-react"') + self.browser.click('button[aria-label="Create Project"]') - self.browser.wait_until(xpath='//h2[text()="Configure React SDK"]') + self.browser.wait_until(xpath='//h2[text()="Configure React SDK"]') - assert not self.browser.element_exists_by_test_id("quick-start-content") + assert not self.browser.element_exists_by_test_id("quick-start-content") @pytest.mark.skip(reason="Temporarily skipped") @with_feature("organizations:onboarding") diff --git a/tests/sentry/web/test_client_config.py b/tests/sentry/web/test_client_config.py index 6089fe596e01bc..a1fee3a2127dfd 100644 --- a/tests/sentry/web/test_client_config.py +++ b/tests/sentry/web/test_client_config.py @@ -145,7 +145,6 @@ def test_client_config_features() -> None: { "auth:register": True, "system:multi-region": True, - "organizations:create-org-control": True, } ), ): @@ -154,7 +153,6 @@ def test_client_config_features() -> None: assert "features" in result assert "system:multi-region" in result["features"] assert "auth:register" in result["features"] - assert "organizations:create-org-control" in result["features"] @no_silo_test