Browse Source

feat(onprem) Enable discover2 for on-prem (#19023)

Enable discover2 for on-prem usage as it has been mainlined in Saas for
a while now. Remove the old events-v2 feature flag as it is unused and
superseded by the discover-query and discover-basic feature flags.

* Fix tests that were relying on features being off.
* Dismiss sidebar guide on snapshots where they show up.
* Hide the assistant on another page.
Mark Story 4 years ago
parent
commit
4f5f25dd4d

+ 2 - 4
src/sentry/conf/server.py

@@ -819,12 +819,10 @@ SENTRY_FEATURES = {
     "organizations:custom-symbol-sources": True,
     # Enable the events stream interface.
     "organizations:events": False,
-    # Enable events v2 instead of the events stream
-    "organizations:events-v2": False,
     # Enable discover 2 basic functions
-    "organizations:discover-basic": False,
+    "organizations:discover-basic": True,
     # Enable discover 2 custom queries and saved queries
-    "organizations:discover-query": False,
+    "organizations:discover-query": True,
     # Enable Performance view
     "organizations:performance-view": False,
     # Enable multi project selection

+ 0 - 2
src/sentry/features/__init__.py

@@ -61,7 +61,6 @@ default_manager.add("organizations:data-export", OrganizationFeature)  # NOQA
 default_manager.add("organizations:discover", OrganizationFeature)  # NOQA
 default_manager.add("organizations:enterprise-perf", OrganizationFeature)  # NOQA
 default_manager.add("organizations:events", OrganizationFeature)  # NOQA
-default_manager.add("organizations:events-v2", OrganizationFeature)  # NOQA
 default_manager.add("organizations:transaction-events", OrganizationFeature)  # NOQA
 default_manager.add("organizations:performance-view", OrganizationFeature)  # NOQA
 default_manager.add("organizations:discover-basic", OrganizationFeature)  # NOQA
@@ -117,7 +116,6 @@ default_manager.add("projects:plugins", ProjectPluginFeature)  # NOQA
 requires_snuba = (
     "organizations:discover",
     "organizations:events",
-    "organizations:events-v2",
     "organizations:transaction-events",
     "organizations:performance-view",
     "organizations:global-views",

+ 13 - 21
src/sentry/testutils/cases.py

@@ -715,27 +715,19 @@ class AcceptanceTestCase(TransactionTestCase):
         # Forward session cookie to django client.
         self.client.cookies[settings.SESSION_COOKIE_NAME] = self.session.session_key
 
-    def dismiss_assistant(self):
-        res = self.client.put(
-            "/api/0/assistant/?v2",
-            content_type="application/json",
-            data=json.dumps({"guide": "discover_sidebar", "status": "viewed", "useful": True}),
-        )
-        assert res.status_code == 201
-
-        res = self.client.put(
-            "/api/0/assistant/?v2",
-            content_type="application/json",
-            data=json.dumps({"guide": "issue", "status": "viewed", "useful": True}),
-        )
-        assert res.status_code == 201
-
-        res = self.client.put(
-            "/api/0/assistant/?v2",
-            content_type="application/json",
-            data=json.dumps({"guide": "issue_stream", "status": "viewed", "useful": True}),
-        )
-        assert res.status_code == 201
+    def dismiss_assistant(self, which=None):
+        if which is None:
+            which = ("discover_sidebar", "issue", "issue_stream")
+        if isinstance(which, six.string_types):
+            which = [which]
+
+        for item in which:
+            res = self.client.put(
+                "/api/0/assistant/?v2",
+                content_type="application/json",
+                data=json.dumps({"guide": item, "status": "viewed", "useful": True}),
+            )
+            assert res.status_code == 201, res.content
 
 
 class IntegrationTestCase(TestCase):

+ 2 - 0
tests/acceptance/test_dashboard.py

@@ -41,6 +41,7 @@ class DashboardTest(AcceptanceTestCase, SnubaTestCase):
         )
 
         self.login_as(self.user)
+        self.dismiss_assistant("discover_sidebar")
         self.path = u"/organizations/{}/projects/".format(self.organization.slug)
 
     def create_sample_event(self):
@@ -103,6 +104,7 @@ class EmptyDashboardTest(AcceptanceTestCase):
     def setUp(self):
         super(EmptyDashboardTest, self).setUp()
         self.login_as(self.user)
+        self.dismiss_assistant("discover_sidebar")
         self.path = u"/organizations/{}/projects/".format(self.organization.slug)
 
     def test_new_dashboard_empty(self):

+ 1 - 0
tests/acceptance/test_organization_activity.py

@@ -16,6 +16,7 @@ class OrganizationActivityTest(AcceptanceTestCase):
         self.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal")
         self.group = self.create_group(project=self.project)
         self.login_as(self.user)
+        self.dismiss_assistant("discover_sidebar")
         self.path = u"/organizations/{}/activity/".format(self.org.slug)
         self.project.update(first_event=timezone.now())
 

+ 1 - 0
tests/acceptance/test_organization_discover.py

@@ -51,6 +51,7 @@ class OrganizationDiscoverTest(AcceptanceTestCase, SnubaTestCase):
             project_id=self.project.id,
         )
         self.path = u"/organizations/{}/discover/".format(self.org.slug)
+        self.dismiss_assistant("discover_sidebar")
 
     def test_no_access(self):
         self.browser.get(self.path)

+ 1 - 0
tests/acceptance/test_organization_document_integration_detailed_view.py

@@ -13,6 +13,7 @@ class OrganizationDocumentIntegrationDetailView(AcceptanceTestCase):
         self.login_as(self.user)
 
     def load_page(self, slug):
+        self.dismiss_assistant("discover_sidebar")
         url = u"/settings/{}/document-integrations/{}/".format(self.organization.slug, slug)
         self.browser.get(url)
         self.browser.wait_until_not(".loading-indicator")

+ 1 - 1
tests/acceptance/test_organization_events_v2.py

@@ -150,7 +150,7 @@ class OrganizationEventsV2Test(AcceptanceTestCase, SnubaTestCase):
         self.landing_path = u"/organizations/{}/discover/queries/".format(self.org.slug)
         self.result_path = u"/organizations/{}/discover/results/".format(self.org.slug)
 
-        self.dismiss_assistant()
+        self.dismiss_assistant("discover_sidebar")
 
     def wait_until_loaded(self):
         self.browser.wait_until_not(".loading-indicator")

+ 1 - 0
tests/acceptance/test_organization_integration_detail_view.py

@@ -20,6 +20,7 @@ class OrganizationIntegrationDetailView(AcceptanceTestCase):
         self.login_as(self.user)
 
     def load_page(self, slug, configuration_tab=False):
+        self.dismiss_assistant("discover_sidebar")
         url = u"/settings/{}/integrations/{}/".format(self.organization.slug, slug)
         if configuration_tab:
             url += "?tab=configurations"

+ 1 - 0
tests/acceptance/test_organization_integration_directory.py

@@ -7,6 +7,7 @@ class OrganizationIntegrationDirectoryTest(AcceptanceTestCase):
     def setUp(self):
         super(OrganizationIntegrationDirectoryTest, self).setUp()
         self.login_as(self.user)
+        self.dismiss_assistant("discover_sidebar")
 
     def test_all_integrations_list(self):
         path = u"/settings/{}/integrations/".format(self.organization.slug)

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