hash
stringlengths
40
40
date
stringdate
2017-08-30 22:37:25
2025-03-22 03:08:47
author
stringclasses
173 values
commit_message
stringlengths
15
151
is_merge
bool
1 class
masked_commit_message
stringlengths
6
126
type
stringclasses
17 values
git_diff
stringlengths
182
1.51M
e0c2b8a98301efd389e9cb61d057690222fb30b0
2024-04-15 20:23:12
edwardgou-sentry
chore(performance): Graduate perf score calculation and fid score deprecation flags (#68894)
false
Graduate perf score calculation and fid score deprecation flags (#68894)
chore
diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index f82f100437bc6a..a24699f5ce9947 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -1711,10 +1711,6 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]: "organizations:performance-anomaly-detection-ui": False, # Enable mobile performance score calculation for transactions in relay "organizations:performance-calculate-mobile-perf-score-relay": False, - # Enable performance score calculation for transactions in relay - "organizations:performance-calculate-score-relay": False, - # Deprecate fid from performance score calculation - "organizations:deprecate-fid-from-performance-score": False, # Enable performance change explorer panel on trends page "organizations:performance-change-explorer": False, # Enable interpolation of null data points in charts instead of zerofilling in performance diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py index 2a0f44d8dc48ab..d72898a2b05a09 100644 --- a/src/sentry/features/temporary.py +++ b/src/sentry/features/temporary.py @@ -64,7 +64,6 @@ def register_temporary_features(manager: FeatureManager): manager.add("organizations:metrics-stats", OrganizationFeature, FeatureHandlerStrategy.REMOTE) manager.add("organizations:ddm-ui", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) manager.add("organizations:default-high-priority-alerts", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) - manager.add("organizations:deprecate-fid-from-performance-score", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) manager.add("organizations:derive-code-mappings", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) manager.add("organizations:derive-code-mappings-go", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) manager.add("organizations:device-class-synthesis", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) @@ -136,7 +135,6 @@ def register_temporary_features(manager: FeatureManager): manager.add("organizations:org-subdomains", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) manager.add("organizations:performance-anomaly-detection-ui", OrganizationFeature, FeatureHandlerStrategy.REMOTE) manager.add("organizations:performance-calculate-mobile-perf-score-relay", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) - manager.add("organizations:performance-calculate-score-relay", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) manager.add("organizations:performance-change-explorer", OrganizationFeature, FeatureHandlerStrategy.REMOTE) manager.add("organizations:performance-chart-interpolation", OrganizationFeature, FeatureHandlerStrategy.REMOTE) manager.add("organizations:performance-consecutive-db-issue", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) diff --git a/src/sentry/relay/config/__init__.py b/src/sentry/relay/config/__init__.py index 511f7a9ae6ac7c..52eac740564b78 100644 --- a/src/sentry/relay/config/__init__.py +++ b/src/sentry/relay/config/__init__.py @@ -410,13 +410,6 @@ def _should_extract_abnormal_mechanism(project: Project) -> bool: def _get_browser_performance_profiles(organization: Organization) -> list[dict[str, Any]]: - if not features.has("organizations:performance-calculate-score-relay", organization): - return [] - - shouldIncludeFid = not features.has( - "organizations:deprecate-fid-from-performance-score", organization - ) - return [ { "name": "Chrome", @@ -435,13 +428,6 @@ def _get_browser_performance_profiles(organization: Organization) -> list[dict[s "p50": 2400.0, "optional": False, }, - { - "measurement": "fid", - "weight": 0.30 if shouldIncludeFid else 0.0, - "p10": 100.0, - "p50": 300.0, - "optional": True, - }, { "measurement": "cls", "weight": 0.15, @@ -480,13 +466,6 @@ def _get_browser_performance_profiles(organization: Organization) -> list[dict[s "p50": 2400.0, "optional": True, }, - { - "measurement": "fid", - "weight": 0.30 if shouldIncludeFid else 0.0, - "p10": 100.0, - "p50": 300.0, - "optional": True, - }, { "measurement": "cls", "weight": 0.0, @@ -525,13 +504,6 @@ def _get_browser_performance_profiles(organization: Organization) -> list[dict[s "p50": 2400.0, "optional": False, }, - { - "measurement": "fid", - "weight": 0.0, - "p10": 100.0, - "p50": 300.0, - "optional": True, - }, { "measurement": "cls", "weight": 0.0, @@ -570,13 +542,6 @@ def _get_browser_performance_profiles(organization: Organization) -> list[dict[s "p50": 2400.0, "optional": False, }, - { - "measurement": "fid", - "weight": 0.30 if shouldIncludeFid else 0.0, - "p10": 100.0, - "p50": 300.0, - "optional": True, - }, { "measurement": "cls", "weight": 0.15, @@ -615,13 +580,6 @@ def _get_browser_performance_profiles(organization: Organization) -> list[dict[s "p50": 2400.0, "optional": False, }, - { - "measurement": "fid", - "weight": 0.30 if shouldIncludeFid else 0.0, - "p10": 100.0, - "p50": 300.0, - "optional": True, - }, { "measurement": "cls", "weight": 0.15, diff --git a/tests/sentry/relay/snapshots/test_config/test_get_project_config/full_config/REGION.pysnap b/tests/sentry/relay/snapshots/test_config/test_get_project_config/full_config/REGION.pysnap index f4bf8a92892297..438e1590a53b30 100644 --- a/tests/sentry/relay/snapshots/test_config/test_get_project_config/full_config/REGION.pysnap +++ b/tests/sentry/relay/snapshots/test_config/test_get_project_config/full_config/REGION.pysnap @@ -1,5 +1,5 @@ --- -created: '2024-02-07T10:46:28.389774Z' +created: '2024-04-15T14:23:08.500844+00:00' creator: sentry source: tests/sentry/relay/test_config.py --- @@ -101,6 +101,176 @@ config: groupingConfig: enhancements: KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ id: newstyle:2023-01-11 + performanceScore: + profiles: + - condition: + name: event.contexts.browser.name + op: eq + value: Chrome + name: Chrome + scoreComponents: + - measurement: fcp + optional: false + p10: 900.0 + p50: 1600.0 + weight: 0.15 + - measurement: lcp + optional: false + p10: 1200.0 + p50: 2400.0 + weight: 0.3 + - measurement: cls + optional: false + p10: 0.1 + p50: 0.25 + weight: 0.15 + - measurement: ttfb + optional: false + p10: 200.0 + p50: 400.0 + weight: 0.1 + - condition: + name: event.contexts.browser.name + op: eq + value: Firefox + name: Firefox + scoreComponents: + - measurement: fcp + optional: false + p10: 900.0 + p50: 1600.0 + weight: 0.15 + - measurement: lcp + optional: true + p10: 1200.0 + p50: 2400.0 + weight: 0.3 + - measurement: cls + optional: false + p10: 0.1 + p50: 0.25 + weight: 0.0 + - measurement: ttfb + optional: false + p10: 200.0 + p50: 400.0 + weight: 0.1 + - condition: + name: event.contexts.browser.name + op: eq + value: Safari + name: Safari + scoreComponents: + - measurement: fcp + optional: false + p10: 900.0 + p50: 1600.0 + weight: 0.15 + - measurement: lcp + optional: false + p10: 1200.0 + p50: 2400.0 + weight: 0.0 + - measurement: cls + optional: false + p10: 0.1 + p50: 0.25 + weight: 0.0 + - measurement: ttfb + optional: false + p10: 200.0 + p50: 400.0 + weight: 0.1 + - condition: + name: event.contexts.browser.name + op: eq + value: Edge + name: Edge + scoreComponents: + - measurement: fcp + optional: false + p10: 900.0 + p50: 1600.0 + weight: 0.15 + - measurement: lcp + optional: false + p10: 1200.0 + p50: 2400.0 + weight: 0.3 + - measurement: cls + optional: false + p10: 0.1 + p50: 0.25 + weight: 0.15 + - measurement: ttfb + optional: false + p10: 200.0 + p50: 400.0 + weight: 0.1 + - condition: + name: event.contexts.browser.name + op: eq + value: Opera + name: Opera + scoreComponents: + - measurement: fcp + optional: false + p10: 900.0 + p50: 1600.0 + weight: 0.15 + - measurement: lcp + optional: false + p10: 1200.0 + p50: 2400.0 + weight: 0.3 + - measurement: cls + optional: false + p10: 0.1 + p50: 0.25 + weight: 0.15 + - measurement: ttfb + optional: false + p10: 200.0 + p50: 400.0 + weight: 0.1 + - condition: + inner: + - name: event.contexts.browser.name + op: eq + value: Chrome + - name: event.contexts.browser.name + op: eq + value: Google Chrome + op: or + name: Chrome INP + scoreComponents: + - measurement: inp + optional: false + p10: 200.0 + p50: 500.0 + weight: 1.0 + - condition: + name: event.contexts.browser.name + op: eq + value: Edge + name: Edge INP + scoreComponents: + - measurement: inp + optional: false + p10: 200.0 + p50: 500.0 + weight: 1.0 + - condition: + name: event.contexts.browser.name + op: eq + value: Opera + name: Opera INP + scoreComponents: + - measurement: inp + optional: false + p10: 200.0 + p50: 500.0 + weight: 1.0 piiConfig: applications: $string: diff --git a/tests/sentry/relay/test_config.py b/tests/sentry/relay/test_config.py index 79a3af15954c6a..e16b488834c6f6 100644 --- a/tests/sentry/relay/test_config.py +++ b/tests/sentry/relay/test_config.py @@ -759,165 +759,125 @@ def test_alert_metric_extraction_rules(default_project, factories): @django_db_all def test_performance_calculate_score(default_project): - features = { - "organizations:performance-calculate-score-relay": True, - } + config = get_project_config(default_project, full_config=True).to_dict()["config"] - with Feature(features): - config = get_project_config(default_project, full_config=True).to_dict()["config"] - - # Set a version field that is returned even though it's optional. - for profile in config["performanceScore"]["profiles"]: - profile["version"] = "1" - - validate_project_config(json.dumps(config), strict=True) - performance_score = config["performanceScore"]["profiles"] - assert performance_score[0] == { - "name": "Chrome", - "scoreComponents": [ - {"measurement": "fcp", "weight": 0.15, "p10": 900, "p50": 1600, "optional": False}, - {"measurement": "lcp", "weight": 0.3, "p10": 1200, "p50": 2400, "optional": False}, - { - "measurement": "fid", - "weight": 0.3, - "p10": 100, - "p50": 300, - "optional": True, - }, - {"measurement": "cls", "weight": 0.15, "p10": 0.1, "p50": 0.25, "optional": False}, - {"measurement": "ttfb", "weight": 0.1, "p10": 200, "p50": 400, "optional": False}, - ], - "condition": { - "op": "eq", - "name": "event.contexts.browser.name", - "value": "Chrome", + # Set a version field that is returned even though it's optional. + for profile in config["performanceScore"]["profiles"]: + profile["version"] = "1" + + validate_project_config(json.dumps(config), strict=True) + performance_score = config["performanceScore"]["profiles"] + assert performance_score[0] == { + "name": "Chrome", + "scoreComponents": [ + {"measurement": "fcp", "weight": 0.15, "p10": 900, "p50": 1600, "optional": False}, + {"measurement": "lcp", "weight": 0.3, "p10": 1200, "p50": 2400, "optional": False}, + {"measurement": "cls", "weight": 0.15, "p10": 0.1, "p50": 0.25, "optional": False}, + {"measurement": "ttfb", "weight": 0.1, "p10": 200, "p50": 400, "optional": False}, + ], + "condition": { + "op": "eq", + "name": "event.contexts.browser.name", + "value": "Chrome", + }, + "version": "1", + } + assert performance_score[1] == { + "name": "Firefox", + "scoreComponents": [ + { + "measurement": "fcp", + "weight": 0.15, + "p10": 900.0, + "p50": 1600.0, + "optional": False, }, - "version": "1", - } - assert performance_score[1] == { - "name": "Firefox", - "scoreComponents": [ - { - "measurement": "fcp", - "weight": 0.15, - "p10": 900.0, - "p50": 1600.0, - "optional": False, - }, - { - "measurement": "lcp", - "weight": 0.3, - "p10": 1200.0, - "p50": 2400.0, - "optional": True, - }, - { - "measurement": "fid", - "weight": 0.3, - "p10": 100.0, - "p50": 300.0, - "optional": True, - }, - {"measurement": "cls", "weight": 0.0, "p10": 0.1, "p50": 0.25, "optional": False}, - { - "measurement": "ttfb", - "weight": 0.1, - "p10": 200.0, - "p50": 400.0, - "optional": False, - }, - ], - "condition": { - "op": "eq", - "name": "event.contexts.browser.name", - "value": "Firefox", + { + "measurement": "lcp", + "weight": 0.3, + "p10": 1200.0, + "p50": 2400.0, + "optional": True, }, - "version": "1", - } - assert performance_score[2] == { - "name": "Safari", - "scoreComponents": [ - { - "measurement": "fcp", - "weight": 0.15, - "p10": 900.0, - "p50": 1600.0, - "optional": False, - }, - { - "measurement": "lcp", - "weight": 0.0, - "p10": 1200.0, - "p50": 2400.0, - "optional": False, - }, - { - "measurement": "fid", - "weight": 0.0, - "p10": 100.0, - "p50": 300.0, - "optional": True, - }, - {"measurement": "cls", "weight": 0.0, "p10": 0.1, "p50": 0.25, "optional": False}, - { - "measurement": "ttfb", - "weight": 0.1, - "p10": 200.0, - "p50": 400.0, - "optional": False, - }, - ], - "condition": { - "op": "eq", - "name": "event.contexts.browser.name", - "value": "Safari", + {"measurement": "cls", "weight": 0.0, "p10": 0.1, "p50": 0.25, "optional": False}, + { + "measurement": "ttfb", + "weight": 0.1, + "p10": 200.0, + "p50": 400.0, + "optional": False, }, - "version": "1", - } - assert performance_score[3] == { - "name": "Edge", - "scoreComponents": [ - {"measurement": "fcp", "weight": 0.15, "p10": 900, "p50": 1600, "optional": False}, - {"measurement": "lcp", "weight": 0.3, "p10": 1200, "p50": 2400, "optional": False}, - { - "measurement": "fid", - "weight": 0.3, - "p10": 100, - "p50": 300, - "optional": True, - }, - {"measurement": "cls", "weight": 0.15, "p10": 0.1, "p50": 0.25, "optional": False}, - {"measurement": "ttfb", "weight": 0.1, "p10": 200, "p50": 400, "optional": False}, - ], - "condition": { - "op": "eq", - "name": "event.contexts.browser.name", - "value": "Edge", + ], + "condition": { + "op": "eq", + "name": "event.contexts.browser.name", + "value": "Firefox", + }, + "version": "1", + } + assert performance_score[2] == { + "name": "Safari", + "scoreComponents": [ + { + "measurement": "fcp", + "weight": 0.15, + "p10": 900.0, + "p50": 1600.0, + "optional": False, }, - "version": "1", - } - assert performance_score[4] == { - "name": "Opera", - "scoreComponents": [ - {"measurement": "fcp", "weight": 0.15, "p10": 900, "p50": 1600, "optional": False}, - {"measurement": "lcp", "weight": 0.3, "p10": 1200, "p50": 2400, "optional": False}, - { - "measurement": "fid", - "weight": 0.3, - "p10": 100, - "p50": 300, - "optional": True, - }, - {"measurement": "cls", "weight": 0.15, "p10": 0.1, "p50": 0.25, "optional": False}, - {"measurement": "ttfb", "weight": 0.1, "p10": 200, "p50": 400, "optional": False}, - ], - "condition": { - "op": "eq", - "name": "event.contexts.browser.name", - "value": "Opera", + { + "measurement": "lcp", + "weight": 0.0, + "p10": 1200.0, + "p50": 2400.0, + "optional": False, }, - "version": "1", - } + {"measurement": "cls", "weight": 0.0, "p10": 0.1, "p50": 0.25, "optional": False}, + { + "measurement": "ttfb", + "weight": 0.1, + "p10": 200.0, + "p50": 400.0, + "optional": False, + }, + ], + "condition": { + "op": "eq", + "name": "event.contexts.browser.name", + "value": "Safari", + }, + "version": "1", + } + assert performance_score[3] == { + "name": "Edge", + "scoreComponents": [ + {"measurement": "fcp", "weight": 0.15, "p10": 900, "p50": 1600, "optional": False}, + {"measurement": "lcp", "weight": 0.3, "p10": 1200, "p50": 2400, "optional": False}, + {"measurement": "cls", "weight": 0.15, "p10": 0.1, "p50": 0.25, "optional": False}, + {"measurement": "ttfb", "weight": 0.1, "p10": 200, "p50": 400, "optional": False}, + ], + "condition": { + "op": "eq", + "name": "event.contexts.browser.name", + "value": "Edge", + }, + "version": "1", + } + assert performance_score[4] == { + "name": "Opera", + "scoreComponents": [ + {"measurement": "fcp", "weight": 0.15, "p10": 900, "p50": 1600, "optional": False}, + {"measurement": "lcp", "weight": 0.3, "p10": 1200, "p50": 2400, "optional": False}, + {"measurement": "cls", "weight": 0.15, "p10": 0.1, "p50": 0.25, "optional": False}, + {"measurement": "ttfb", "weight": 0.1, "p10": 200, "p50": 400, "optional": False}, + ], + "condition": { + "op": "eq", + "name": "event.contexts.browser.name", + "value": "Opera", + }, + "version": "1", + } @django_db_all
e8802449cb40124e510b9ae8b2502bda1bea21f1
2021-05-05 22:31:09
Josh Ferge
fix(auth): Single tenant infinite redirects (#25881)
false
Single tenant infinite redirects (#25881)
fix
diff --git a/src/sentry/web/frontend/auth_login.py b/src/sentry/web/frontend/auth_login.py index c956c8a81be39b..1fd2de85e416e3 100644 --- a/src/sentry/web/frontend/auth_login.py +++ b/src/sentry/web/frontend/auth_login.py @@ -198,14 +198,13 @@ def handle_basic_auth(self, request, **kwargs): om = OrganizationMember.objects.get( organization=organization, email=user.email ) + # XXX(jferge): if user is removed / invited but has an acct, + # pop _next so they aren't in infinite redirect on Single Org Mode except OrganizationMember.DoesNotExist: - pass + request.session.pop("_next", None) else: - # XXX(jferge): if user is in 2fa removed state, - # dont redirect to org login page instead redirect to general login where - # they will be prompted to check their email if om.user is None: - return self.redirect(auth.get_login_url()) + request.session.pop("_next", None) return self.redirect(auth.get_login_redirect(request)) else: diff --git a/tests/sentry/web/frontend/test_auth_login.py b/tests/sentry/web/frontend/test_auth_login.py index 9ea163b681c296..4ae819fc992150 100644 --- a/tests/sentry/web/frontend/test_auth_login.py +++ b/tests/sentry/web/frontend/test_auth_login.py @@ -6,6 +6,7 @@ from exam import fixture from sentry import newsletter, options +from sentry.auth.authenticators import RecoveryCodeInterface, TotpInterface from sentry.models import OrganizationMember, User from sentry.testutils import TestCase from sentry.utils.compat import mock @@ -56,6 +57,22 @@ def test_login_valid_credentials(self): resp = self.client.post( self.path, {"username": self.user.username, "password": "admin", "op": "login"} ) + assert resp.url == "/auth/login/" + assert resp.status_code == 302 + + def test_login_valid_credentials_2fa_redirect(self): + user = self.create_user("[email protected]") + RecoveryCodeInterface().enroll(user) + TotpInterface().enroll(user) + self.create_member(organization=self.organization, user=user) + + self.client.get(self.path) + + resp = self.client.post( + self.path, + {"username": user.username, "password": "admin", "op": "login"}, + ) + assert resp.url == "/auth/2fa/" assert resp.status_code == 302 def test_registration_disabled(self): diff --git a/tests/sentry/web/frontend/test_auth_organization_login.py b/tests/sentry/web/frontend/test_auth_organization_login.py index 9639c78916a4b5..4a9b708c040f15 100644 --- a/tests/sentry/web/frontend/test_auth_organization_login.py +++ b/tests/sentry/web/frontend/test_auth_organization_login.py @@ -2,6 +2,7 @@ from django.urls import reverse from exam import fixture +from sentry.auth.authenticators import RecoveryCodeInterface, TotpInterface from sentry.models import ( AuthIdentity, AuthProvider, @@ -696,6 +697,7 @@ def test_basic_auth_flow_as_user_with_confirmed_membership(self): user = self.create_user("[email protected]") self.create_member(organization=self.organization, user=user) member = OrganizationMember.objects.get(organization=self.organization, user=user) + member.email = "[email protected]" member.save() self.session["_next"] = reverse( @@ -704,7 +706,7 @@ def test_basic_auth_flow_as_user_with_confirmed_membership(self): self.save_session() resp = self.client.post( - self.path, {"username": self.user, "password": "admin", "op": "login"}, follow=True + self.path, {"username": user, "password": "admin", "op": "login"}, follow=True ) assert resp.redirect_chain == [ (reverse("sentry-organization-settings", args=[self.organization.slug]), 302), @@ -721,3 +723,103 @@ def test_flow_as_user_without_any_membership(self): assert resp.redirect_chain == [("/auth/login/", 302)] assert resp.status_code == 403 self.assertTemplateUsed(resp, "sentry/no-organization-access.html") + + @override_settings(SENTRY_SINGLE_ORGANIZATION=True) + @with_feature({"organizations:create": False}) + def test_correct_redirect_as_2fa_user_single_org_invited(self): + user = self.create_user("[email protected]") + + RecoveryCodeInterface().enroll(user) + TotpInterface().enroll(user) + + self.create_member(organization=self.organization, user=user) + member = OrganizationMember.objects.get(organization=self.organization, user=user) + member.email = "[email protected]" + member.user = None + member.save() + + resp = self.client.post( + self.path, {"username": user, "password": "admin", "op": "login"}, follow=True + ) + + assert resp.redirect_chain == [("/auth/2fa/", 302)] + + def test_correct_redirect_as_2fa_user_invited(self): + user = self.create_user("[email protected]") + + RecoveryCodeInterface().enroll(user) + TotpInterface().enroll(user) + + self.create_member(organization=self.organization, user=user) + member = OrganizationMember.objects.get(organization=self.organization, user=user) + member.email = "[email protected]" + member.user = None + member.save() + + resp = self.client.post( + self.path, {"username": user, "password": "admin", "op": "login"}, follow=True + ) + + assert resp.redirect_chain == [("/auth/2fa/", 302)] + + @override_settings(SENTRY_SINGLE_ORGANIZATION=True) + @with_feature({"organizations:create": False}) + def test_correct_redirect_as_2fa_user_single_org_no_membership(self): + user = self.create_user("[email protected]") + + RecoveryCodeInterface().enroll(user) + TotpInterface().enroll(user) + + resp = self.client.post( + self.path, {"username": user, "password": "admin", "op": "login"}, follow=True + ) + + assert resp.redirect_chain == [("/auth/2fa/", 302)] + + def test_correct_redirect_as_2fa_user_no_membership(self): + user = self.create_user("[email protected]") + + RecoveryCodeInterface().enroll(user) + TotpInterface().enroll(user) + + resp = self.client.post( + self.path, {"username": user, "password": "admin", "op": "login"}, follow=True + ) + + assert resp.redirect_chain == [("/auth/2fa/", 302)] + + @override_settings(SENTRY_SINGLE_ORGANIZATION=True) + @with_feature({"organizations:create": False}) + def test_correct_redirect_as_2fa_user_single_org_member(self): + user = self.create_user("[email protected]") + + RecoveryCodeInterface().enroll(user) + TotpInterface().enroll(user) + + self.create_member(organization=self.organization, user=user) + member = OrganizationMember.objects.get(organization=self.organization, user=user) + member.email = "[email protected]" + member.save() + + resp = self.client.post( + self.path, {"username": user, "password": "admin", "op": "login"}, follow=True + ) + + assert resp.redirect_chain == [("/auth/2fa/", 302)] + + def test_correct_redirect_as_2fa_user_invited_member(self): + user = self.create_user("[email protected]") + + RecoveryCodeInterface().enroll(user) + TotpInterface().enroll(user) + + self.create_member(organization=self.organization, user=user) + member = OrganizationMember.objects.get(organization=self.organization, user=user) + member.email = "[email protected]" + member.save() + + resp = self.client.post( + self.path, {"username": user, "password": "admin", "op": "login"}, follow=True + ) + + assert resp.redirect_chain == [("/auth/2fa/", 302)]
59b79ebac7bbe1cb5d2f60cf0f5ee2bc66e48f17
2023-02-10 21:58:50
George Gritsouk
feat(metric-alerts): Forbid saving metric alerts that fall back to indexed events (#44370)
false
Forbid saving metric alerts that fall back to indexed events (#44370)
feat
diff --git a/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx b/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx index b79f3a70bfca97..124d46cb3fe617 100644 --- a/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx +++ b/static/app/views/alerts/rules/metric/ruleConditionsForm.tsx @@ -57,7 +57,7 @@ type Props = { dataset: Dataset; disabled: boolean; onComparisonDeltaChange: (value: number) => void; - onFilterSearch: (query: string) => void; + onFilterSearch: (query: string, isQueryValid) => void; onTimeWindowChange: (value: number) => void; organization: Organization; project: Project; @@ -431,10 +431,10 @@ class RuleConditionsForm extends PureComponent<Props, State> { <AlertContainer> <Alert type="info" showIcon> {tct( - 'Filtering by these conditions automatically switch you to indexed events. [link:Learn more].', + 'Based on your search criteria and sample rate, the events available may be limited. [link:Learn more].', { link: ( - <ExternalLink href="https://docs.sentry.io/product/sentry-basics/search/searchable-properties/#processed-event-properties" /> + <ExternalLink href="https://docs.sentry.io/product/alerts/create-alerts/metric-alert-config/#filters" /> ), } )} @@ -495,6 +495,11 @@ class RuleConditionsForm extends PureComponent<Props, State> { placeholder={this.searchPlaceholder} onChange={onChange} query={initialData.query} + // We only need strict validation for Transaction queries, everything else is fine + highlightUnsupportedTags={[ + Dataset.GENERIC_METRICS, + Dataset.TRANSACTIONS, + ].includes(dataset)} onKeyDown={e => { /** * Do not allow enter key to submit the alerts form since it is unlikely @@ -507,12 +512,12 @@ class RuleConditionsForm extends PureComponent<Props, State> { onKeyDown?.(e); }} - onClose={query => { - onFilterSearch(query); + onClose={(query, {validSearch}) => { + onFilterSearch(query, validSearch); onBlur(query); }} onSearch={query => { - onFilterSearch(query); + onFilterSearch(query, true); onChange(query, {}); }} hasRecentSearches={dataset !== Dataset.SESSIONS} diff --git a/static/app/views/alerts/rules/metric/ruleForm.tsx b/static/app/views/alerts/rules/metric/ruleForm.tsx index 16c4cf367e72b6..828f131530b4d2 100644 --- a/static/app/views/alerts/rules/metric/ruleForm.tsx +++ b/static/app/views/alerts/rules/metric/ruleForm.tsx @@ -103,6 +103,7 @@ type State = { dataset: Dataset; environment: string | null; eventTypes: EventTypes[]; + isQueryValid: boolean; project: Project; query: string; resolveThreshold: UnsavedMetricRule['resolveThreshold']; @@ -172,6 +173,7 @@ class RuleFormContainer extends AsyncComponent<Props, State> { dataset, eventTypes: eventTypes ?? rule.eventTypes ?? [], query: rule.query ?? '', + isQueryValid: true, // Assume valid until input is changed timeWindow: rule.timeWindow, environment: rule.environment || null, triggerErrors: new Map(), @@ -489,7 +491,7 @@ class RuleFormContainer extends AsyncComponent<Props, State> { // We handle the filter update outside of the fieldChange handler since we // don't want to update the filter on every input change, just on blurs and // searches. - handleFilterUpdate = (query: string) => { + handleFilterUpdate = (query: string, isQueryValid: boolean) => { const {organization, sessionId} = this.props; trackAdvancedAnalyticsEvent('alert_builder.filter', { @@ -498,7 +500,7 @@ class RuleFormContainer extends AsyncComponent<Props, State> { query, }); - this.setState({query}); + this.setState({query, isQueryValid}); }; handleSubmit = async ( @@ -864,7 +866,8 @@ class RuleFormContainer extends AsyncComponent<Props, State> { return ( <Access access={['alerts:write']}> {({hasAccess}) => { - const disabled = loading || !(isActiveSuperuser() || hasAccess); + const formDisabled = loading || !(isActiveSuperuser() || hasAccess); + const submitDisabled = formDisabled || !this.state.isQueryValid; return ( <Fragment> @@ -881,7 +884,7 @@ class RuleFormContainer extends AsyncComponent<Props, State> { apiEndpoint={`/organizations/${organization.slug}/alert-rules/${ ruleId ? `${ruleId}/` : '' }`} - submitDisabled={disabled} + submitDisabled={submitDisabled} initialData={{ name, dataset, @@ -902,7 +905,7 @@ class RuleFormContainer extends AsyncComponent<Props, State> { extraButton={ rule.id ? ( <Confirm - disabled={disabled} + disabled={formDisabled} message={t('Are you sure you want to delete this alert rule?')} header={t('Delete Alert Rule?')} priority="danger" @@ -921,7 +924,7 @@ class RuleFormContainer extends AsyncComponent<Props, State> { project={project} organization={organization} router={router} - disabled={disabled} + disabled={formDisabled} thresholdChart={wizardBuilderChart} onFilterSearch={this.handleFilterUpdate} allowChangeEventTypes={ @@ -942,9 +945,9 @@ class RuleFormContainer extends AsyncComponent<Props, State> { showMEPAlertBanner={showMEPAlertBanner} /> <AlertListItem>{t('Set thresholds')}</AlertListItem> - {thresholdTypeForm(disabled)} - {triggerForm(disabled)} - {ruleNameOwnerForm(disabled)} + {thresholdTypeForm(formDisabled)} + {triggerForm(formDisabled)} + {ruleNameOwnerForm(formDisabled)} </List> </Form> </Main>
2195a02625273e928d786974a7154d35f764b73d
2018-02-23 04:13:47
Jess MacQueen
fix(teams): Use correct settings link for create team
false
Use correct settings link for create team
fix
diff --git a/src/sentry/static/sentry/app/views/settings/team/allTeamsList.jsx b/src/sentry/static/sentry/app/views/settings/team/allTeamsList.jsx index 6fbdd91f58b979..a577f4bbbaf66a 100644 --- a/src/sentry/static/sentry/app/views/settings/team/allTeamsList.jsx +++ b/src/sentry/static/sentry/app/views/settings/team/allTeamsList.jsx @@ -36,11 +36,13 @@ class AllTeamsList extends React.Component { return <Panel>{teamNodes}</Panel>; } + // TODO(jess): update this link to use url prefix when create team + // has been moved to new settings return tct( "You don't have any teams for this organization yet. Get started by [link:creating your first team].", { root: <p />, - link: <Link to={`${urlPrefix}teams/new/`} />, + link: <Link to={`/organizations/${organization.slug}/teams/new/`} />, } ); }
3077911c8008883f6dbfaa89c6e00ca7848a5ac7
2023-12-06 04:33:59
Hubert Deng
chore(relocation): 23.11.2 release tests (#60900)
false
23.11.2 release tests (#60900)
chore
diff --git a/tests/sentry/backup/snapshots/ReleaseTests/test_at_23_11_2.pysnap b/tests/sentry/backup/snapshots/ReleaseTests/test_at_23_11_2.pysnap new file mode 100644 index 00000000000000..11dd0904cf1706 --- /dev/null +++ b/tests/sentry/backup/snapshots/ReleaseTests/test_at_23_11_2.pysnap @@ -0,0 +1,1347 @@ +--- +created: '2023-11-22T17:03:21.909589Z' +creator: sentry +source: tests/sentry/backup/test_releases.py +--- +- fields: + key: bar + last_updated: '2023-11-22T17:03:21.584Z' + last_updated_by: unknown + value: '"b"' + model: sentry.controloption + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.099Z' + date_updated: '2023-11-22T17:03:21.099Z' + external_id: slack:test-org + metadata: {} + name: Slack for test-org + provider: slack + status: 0 + model: sentry.integration + pk: 1 +- fields: + key: foo + last_updated: '2023-11-22T17:03:21.584Z' + last_updated_by: unknown + value: '"a"' + model: sentry.option + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.842Z' + default_role: member + flags: '1' + is_test: false + name: test-org + slug: test-org + status: 0 + model: sentry.organization + pk: 4553018634141712 +- fields: + date_added: '2023-11-22T17:03:21.254Z' + default_role: member + flags: '1' + is_test: false + name: Present Kingfish + slug: present-kingfish + status: 0 + model: sentry.organization + pk: 4553018634207249 +- fields: + config: + hello: hello + date_added: '2023-11-22T17:03:21.100Z' + date_updated: '2023-11-22T17:03:21.100Z' + default_auth_id: null + grace_period_end: null + integration: 1 + organization_id: 4553018634141712 + status: 0 + model: sentry.organizationintegration + pk: 1 +- fields: + key: sentry:account-rate-limit + organization: 4553018634141712 + value: 0 + model: sentry.organizationoption + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.988Z' + first_event: null + flags: '10' + forced_color: null + name: project-test-org + organization: 4553018634141712 + platform: null + public: false + slug: project-test-org + status: 0 + model: sentry.project + pk: 4553018634141714 +- fields: + date_added: '2023-11-22T17:03:21.126Z' + first_event: null + flags: '10' + forced_color: null + name: other-project-test-org + organization: 4553018634141712 + platform: null + public: false + slug: other-project-test-org + status: 0 + model: sentry.project + pk: 4553018634207248 +- fields: + date_added: '2023-11-22T17:03:21.319Z' + first_event: null + flags: '10' + forced_color: null + name: Pro Cow + organization: 4553018634141712 + platform: null + public: false + slug: pro-cow + status: 0 + model: sentry.project + pk: 4553018634207250 +- fields: + date_added: '2023-11-22T17:03:21.537Z' + first_event: null + flags: '10' + forced_color: null + name: Definite Crab + organization: 4553018634141712 + platform: null + public: false + slug: definite-crab + status: 0 + model: sentry.project + pk: 4553018634207251 +- fields: + config: + hello: hello + integration_id: 1 + project: 4553018634141714 + model: sentry.projectintegration + pk: 1 +- fields: + data: + dynamicSdkLoaderOptions: + hasPerformance: true + hasReplay: true + date_added: '2023-11-22T17:03:21.003Z' + label: Default + project: 4553018634141714 + public_key: 338d140a36347ff11576c1ffadcb8e79 + rate_limit_count: null + rate_limit_window: null + roles: '1' + secret_key: 9f8c719d53d2c9a1ae0995a884d87260 + status: 0 + model: sentry.projectkey + pk: 1 +- fields: + data: + dynamicSdkLoaderOptions: + hasPerformance: true + hasReplay: true + date_added: '2023-11-22T17:03:21.142Z' + label: Default + project: 4553018634207248 + public_key: cc8eb3c7f2cd126ec0ffba441565c752 + rate_limit_count: null + rate_limit_window: null + roles: '1' + secret_key: 421ed97e7839c5de1697acf4a1c9d640 + status: 0 + model: sentry.projectkey + pk: 2 +- fields: + data: + dynamicSdkLoaderOptions: + hasPerformance: true + hasReplay: true + date_added: '2023-11-22T17:03:21.338Z' + label: Default + project: 4553018634207250 + public_key: cf57bdcc00b04ef101d436559a95d211 + rate_limit_count: null + rate_limit_window: null + roles: '1' + secret_key: fb212438a814be1c3ee4c9e5c2a07c27 + status: 0 + model: sentry.projectkey + pk: 3 +- fields: + data: + dynamicSdkLoaderOptions: + hasPerformance: true + hasReplay: true + date_added: '2023-11-22T17:03:21.555Z' + label: Default + project: 4553018634207251 + public_key: c3723b27c44ed942f243c4f443f39d40 + rate_limit_count: null + rate_limit_window: null + roles: '1' + secret_key: 1beebe9902c0ca40d48771233179eb83 + status: 0 + model: sentry.projectkey + pk: 4 +- fields: + key: sentry:relay-rev + project: 4553018634141714 + value: '"ad40b8e9be03422d96014676b96695da"' + model: sentry.projectoption + pk: 1 +- fields: + key: sentry:relay-rev-lastchange + project: 4553018634141714 + value: '"2023-11-22T17:03:21.008347Z"' + model: sentry.projectoption + pk: 2 +- fields: + key: sentry:option-epoch + project: 4553018634141714 + value: 11 + model: sentry.projectoption + pk: 3 +- fields: + key: sentry:relay-rev + project: 4553018634207248 + value: '"e93c00bcb640427aaa4bb038b5725342"' + model: sentry.projectoption + pk: 4 +- fields: + key: sentry:relay-rev-lastchange + project: 4553018634207248 + value: '"2023-11-22T17:03:21.147169Z"' + model: sentry.projectoption + pk: 5 +- fields: + key: sentry:option-epoch + project: 4553018634207248 + value: 11 + model: sentry.projectoption + pk: 6 +- fields: + key: sentry:relay-rev + project: 4553018634207250 + value: '"743beeaa1b4941139374c5ea60a055e7"' + model: sentry.projectoption + pk: 7 +- fields: + key: sentry:relay-rev-lastchange + project: 4553018634207250 + value: '"2023-11-22T17:03:21.342947Z"' + model: sentry.projectoption + pk: 8 +- fields: + key: sentry:option-epoch + project: 4553018634207250 + value: 11 + model: sentry.projectoption + pk: 9 +- fields: + key: sentry:relay-rev + project: 4553018634207251 + value: '"5ba740f1e2c74e5298d71dcb41789359"' + model: sentry.projectoption + pk: 10 +- fields: + key: sentry:relay-rev-lastchange + project: 4553018634207251 + value: '"2023-11-22T17:03:21.560535Z"' + model: sentry.projectoption + pk: 11 +- fields: + key: sentry:option-epoch + project: 4553018634207251 + value: 11 + model: sentry.projectoption + pk: 12 +- fields: + auto_assignment: true + codeowners_auto_sync: true + date_created: '2023-11-22T17:03:21.022Z' + fallthrough: true + is_active: true + last_updated: '2023-11-22T17:03:21.022Z' + project: 4553018634141714 + raw: '{"hello":"hello"}' + schema: + hello: hello + suspect_committer_auto_assignment: false + model: sentry.projectownership + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.027Z' + organization: 4553018634141712 + project: 4553018634141714 + redirect_slug: project_slug_in_test-org + model: sentry.projectredirect + pk: 1 +- fields: + first_seen: null + is_internal: true + last_seen: null + public_key: WnHEPm_HcqrhnI4y6cRZjbj-q1YBk_buGA1OdhaB4-w + relay_id: 37034f75-ea8a-49bc-825b-1a01f53ffe3b + model: sentry.relay + pk: 1 +- fields: + first_seen: '2023-11-22T17:03:21.582Z' + last_seen: '2023-11-22T17:03:21.582Z' + public_key: WnHEPm_HcqrhnI4y6cRZjbj-q1YBk_buGA1OdhaB4-w + relay_id: 37034f75-ea8a-49bc-825b-1a01f53ffe3b + version: 0.0.1 + model: sentry.relayusage + pk: 1 +- fields: + config: {} + date_added: '2023-11-22T17:03:21.228Z' + external_id: null + integration_id: 1 + languages: '[]' + name: getsentry/getsentry + organization_id: 4553018634141712 + provider: integrations:github + status: 0 + url: https://github.com/getsentry/getsentry + model: sentry.repository + pk: 1 +- fields: + actor: 1 + date_added: '2023-11-22T17:03:20.941Z' + idp_provisioned: false + name: test_team_in_test-org + org_role: null + organization: 4553018634141712 + slug: test_team_in_test-org + status: 0 + model: sentry.team + pk: 4553018634141713 +- fields: + avatar_type: 0 + avatar_url: null + date_joined: '2023-11-22T17:03:20.673Z' + email: owner + flags: '0' + is_active: true + is_managed: false + is_password_expired: false + is_sentry_app: null + is_staff: true + is_superuser: true + is_unclaimed: false + last_active: '2023-11-22T17:03:20.673Z' + last_login: null + last_password_change: '2023-11-22T17:03:20.673Z' + name: '' + password: md5$RtQfehSvZPL1xxfpa98L4P$41d2a6c3d2eac7a1ae7cb169e24fc272 + session_nonce: null + username: owner + model: sentry.user + pk: 1 +- fields: + avatar_type: 0 + avatar_url: null + date_joined: '2023-11-22T17:03:20.799Z' + email: invitee + flags: '0' + is_active: true + is_managed: false + is_password_expired: false + is_sentry_app: null + is_staff: false + is_superuser: false + is_unclaimed: false + last_active: '2023-11-22T17:03:20.799Z' + last_login: null + last_password_change: '2023-11-22T17:03:20.799Z' + name: '' + password: md5$Y5OiBAysHpQ8KJPjE9TAUj$ee17e866435219d37e8d6adca4cd55c1 + session_nonce: null + username: invitee + model: sentry.user + pk: 2 +- fields: + avatar_type: 0 + avatar_url: null + date_joined: '2023-11-22T17:03:21.176Z' + email: admin@localhost + flags: '0' + is_active: true + is_managed: false + is_password_expired: false + is_sentry_app: null + is_staff: true + is_superuser: true + is_unclaimed: false + last_active: '2023-11-22T17:03:21.176Z' + last_login: null + last_password_change: '2023-11-22T17:03:21.176Z' + name: '' + password: md5$HYoFz1fB3ioVaz8WAWTOjZ$3e2882ef1bdca3156187cc2c8762f2ed + session_nonce: null + username: admin@localhost + model: sentry.user + pk: 3 +- fields: + avatar_type: 0 + avatar_url: null + date_joined: '2023-11-22T17:03:21.230Z' + email: [email protected] + flags: '0' + is_active: true + is_managed: false + is_password_expired: false + is_sentry_app: null + is_staff: true + is_superuser: false + is_unclaimed: false + last_active: '2023-11-22T17:03:21.230Z' + last_login: null + last_password_change: '2023-11-22T17:03:21.230Z' + name: '' + password: md5$rEUMy2DLlIFr4Y2HIwt0F7$65f3be8db96cbc4bf85883b31220cb14 + session_nonce: null + username: [email protected] + model: sentry.user + pk: 4 +- fields: + avatar_type: 0 + avatar_url: null + date_joined: '2023-11-22T17:03:21.291Z' + email: '' + flags: '0' + is_active: true + is_managed: false + is_password_expired: false + is_sentry_app: true + is_staff: false + is_superuser: false + is_unclaimed: false + last_active: '2023-11-22T17:03:21.291Z' + last_login: null + last_password_change: null + name: '' + password: '' + session_nonce: null + username: test-app-5263d0ec-75b6-4f94-b758-ae199d44bc7b + model: sentry.user + pk: 5 +- fields: + avatar_type: 0 + avatar_url: null + date_joined: '2023-11-22T17:03:21.514Z' + email: [email protected] + flags: '0' + is_active: true + is_managed: false + is_password_expired: false + is_sentry_app: null + is_staff: true + is_superuser: false + is_unclaimed: false + last_active: '2023-11-22T17:03:21.514Z' + last_login: null + last_password_change: '2023-11-22T17:03:21.514Z' + name: '' + password: md5$rJKBeQY4eDGSdRznysDxnD$d12ec654255fe80b27bf4e8ea39d0ba1 + session_nonce: null + username: [email protected] + model: sentry.user + pk: 6 +- fields: + country_code: null + first_seen: '2012-04-05T03:29:45.000Z' + ip_address: 127.0.0.2 + last_seen: '2012-04-05T03:29:45.000Z' + region_code: null + user: 1 + model: sentry.userip + pk: 1 +- fields: + country_code: null + first_seen: '2012-04-05T03:29:45.000Z' + ip_address: 127.0.0.2 + last_seen: '2012-04-05T03:29:45.000Z' + region_code: null + user: 2 + model: sentry.userip + pk: 2 +- fields: + key: timezone + organization_id: null + project_id: null + user: 1 + value: '"Europe/Vienna"' + model: sentry.useroption + pk: 1 +- fields: + key: timezone + organization_id: null + project_id: null + user: 2 + value: '"Europe/Vienna"' + model: sentry.useroption + pk: 2 +- fields: + permission: users.admin + user: 1 + model: sentry.userpermission + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.751Z' + date_updated: '2023-11-22T17:03:20.751Z' + name: test-admin-role + permissions: '[]' + model: sentry.userrole + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.757Z' + date_updated: '2023-11-22T17:03:20.757Z' + role: 1 + user: 1 + model: sentry.userroleuser + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.221Z' + is_global: false + name: Saved query for test-org + organization: 4553018634141712 + owner_id: null + query: saved query for test-org + sort: date + type: 0 + visibility: organization + model: sentry.savedsearch + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.220Z' + last_seen: '2023-11-22T17:03:21.220Z' + organization: 4553018634141712 + query: some query for test-org + query_hash: 7c69362cd42207b83f80087bc15ebccb + type: 0 + user_id: 1 + model: sentry.recentsearch + pk: 1 +- fields: + project: 4553018634141714 + team: 4553018634141713 + model: sentry.projectteam + pk: 1 +- fields: + project: 4553018634207248 + team: 4553018634141713 + model: sentry.projectteam + pk: 2 +- fields: + date_added: '2023-11-22T17:03:21.021Z' + project: 4553018634141714 + user_id: 1 + model: sentry.projectbookmark + pk: 1 +- fields: + created_by: null + date_added: '2023-11-22T17:03:21.084Z' + date_deactivated: null + date_last_used: null + name: token 1 for test-org + organization_id: 4553018634141712 + project_last_used_id: 4553018634141714 + scope_list: '[''org:ci'']' + token_hashed: ABCDEFtest-org + token_last_characters: xyz1 + model: sentry.orgauthtoken + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.879Z' + email: null + flags: '0' + has_global_access: true + invite_status: 0 + inviter_id: null + organization: 4553018634141712 + role: owner + token: null + token_expires_at: null + type: 50 + user_email: owner + user_id: 1 + user_is_active: true + model: sentry.organizationmember + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.909Z' + email: null + flags: '0' + has_global_access: true + invite_status: 0 + inviter_id: null + organization: 4553018634141712 + role: member + token: null + token_expires_at: null + type: 50 + user_email: invitee + user_id: 2 + user_is_active: true + model: sentry.organizationmember + pk: 2 +- fields: + member: 2 + requester_id: null + team: 4553018634141713 + model: sentry.organizationaccessrequest + pk: 1 +- fields: + config: + schedule: '* * * * *' + schedule_type: 1 + date_added: '2023-11-22T17:03:21.122Z' + guid: a451077c-9322-4723-aeb3-202ed20ae56f + name: '' + organization_id: 4553018634141712 + project_id: 4553018634141714 + slug: 4a000903877b + status: 0 + type: 3 + model: sentry.monitor + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.119Z' + name: fairly direct monkey + organization_id: 4553018634141712 + model: sentry.environment + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.678Z' + email: owner + model: sentry.email + pk: 1 +- fields: + date_added: '2023-11-22T17:03:20.803Z' + email: invitee + model: sentry.email + pk: 2 +- fields: + date_added: '2023-11-22T17:03:21.180Z' + email: admin@localhost + model: sentry.email + pk: 3 +- fields: + date_added: '2023-11-22T17:03:21.234Z' + email: [email protected] + model: sentry.email + pk: 4 +- fields: + date_added: '2023-11-22T17:03:21.294Z' + email: '' + model: sentry.email + pk: 5 +- fields: + date_added: '2023-11-22T17:03:21.517Z' + email: [email protected] + model: sentry.email + pk: 6 +- fields: + date_added: '2023-11-22T17:03:21.220Z' + organization: 4553018634141712 + slug: test-tombstone-in-test-org + model: sentry.dashboardtombstone + pk: 1 +- fields: + created_by_id: 1 + date_added: '2023-11-22T17:03:21.217Z' + filters: null + last_visited: '2023-11-22T17:03:21.217Z' + organization: 4553018634141712 + title: Dashboard 1 for test-org + visits: 1 + model: sentry.dashboard + pk: 1 +- fields: + condition: '{"op":"equals","name":"environment","value":"prod"}' + condition_hash: 2d37b9ed0a84e1ab7301636256a6197af5ce8dac + created_by_id: null + date_added: '2023-11-22T17:03:21.114Z' + end_date: '2023-11-22T18:03:21.110Z' + is_active: true + is_org_level: false + notification_sent: false + num_samples: 100 + organization: 4553018634141712 + query: environment:prod event.type:transaction + rule_id: 1 + sample_rate: 0.5 + start_date: '2023-11-22T17:03:21.110Z' + model: sentry.customdynamicsamplingrule + pk: 1 +- fields: + project: 4553018634141714 + value: 1 + model: sentry.counter + pk: 1 +- fields: + config: {} + date_added: '2023-11-22T17:03:21.050Z' + default_global_access: true + default_role: 50 + flags: '0' + last_sync: null + organization_id: 4553018634141712 + provider: sentry + sync_time: null + model: sentry.authprovider + pk: 1 +- fields: + auth_provider: 1 + data: + key1: value1 + key2: 42 + key3: + - 1 + - 2 + - 3 + key4: + nested_key: nested_value + date_added: '2023-11-22T17:03:21.067Z' + ident: 123456789test-org + last_synced: '2023-11-22T17:03:21.067Z' + last_verified: '2023-11-22T17:03:21.067Z' + user: 1 + model: sentry.authidentity + pk: 1 +- fields: + config: '""' + created_at: '2023-11-22T17:03:20.711Z' + last_used_at: null + type: 1 + user: 1 + model: sentry.authenticator + pk: 1 +- fields: + config: '""' + created_at: '2023-11-22T17:03:20.826Z' + last_used_at: null + type: 1 + user: 2 + model: sentry.authenticator + pk: 2 +- fields: + allowed_origins: null + date_added: '2023-11-22T17:03:21.034Z' + key: 4524e11a7e0c479390936aeed3dc2c73 + label: Default + organization_id: 4553018634141712 + scope_list: '[]' + scopes: '0' + status: 0 + model: sentry.apikey + pk: 1 +- fields: + allowed_origins: '' + client_id: 47e140730be26ed7c3f17ea5e08dddaa487bff0ef787a5e4b7526791c2d52b42 + client_secret: ba90465cbabd242ac39d7f4c1542d7f2cd21203fb3732874ad6f16795dfe3b4a + date_added: '2023-11-22T17:03:21.300Z' + homepage_url: null + name: Endless Garfish + owner: 5 + privacy_url: null + redirect_uris: '' + status: 0 + terms_url: null + model: sentry.apiapplication + pk: 1 +- fields: + team: 4553018634141713 + type: 0 + user_id: null + model: sentry.actor + pk: 1 +- fields: + date_hash_added: '2023-11-22T17:03:20.676Z' + email: owner + is_verified: true + user: 1 + validation_hash: SPhuOODrUjNzxTSckAgbhw50hkxWEVgQ + model: sentry.useremail + pk: 1 +- fields: + date_hash_added: '2023-11-22T17:03:20.801Z' + email: invitee + is_verified: true + user: 2 + validation_hash: MT2vbWiNJRTQoLriuPwxBsN9Qd9GX8hr + model: sentry.useremail + pk: 2 +- fields: + date_hash_added: '2023-11-22T17:03:21.178Z' + email: admin@localhost + is_verified: true + user: 3 + validation_hash: nVO8Aa04OFhJlz8xlWLanxHcczJa2BoG + model: sentry.useremail + pk: 3 +- fields: + date_hash_added: '2023-11-22T17:03:21.232Z' + email: [email protected] + is_verified: true + user: 4 + validation_hash: xux1niE71HIVH2zoYgFRUGB8Bf9UgEEk + model: sentry.useremail + pk: 4 +- fields: + date_hash_added: '2023-11-22T17:03:21.293Z' + email: '' + is_verified: false + user: 5 + validation_hash: lzvvrFG73X8h9z8lyfm6HHMxJDLzJ4ob + model: sentry.useremail + pk: 5 +- fields: + date_hash_added: '2023-11-22T17:03:21.516Z' + email: [email protected] + is_verified: true + user: 6 + validation_hash: 14NCghXzcpb1K9Oyj8dgmApQBUKkJdLN + model: sentry.useremail + pk: 6 +- fields: + aggregate: count() + dataset: events + date_added: '2023-11-22T17:03:21.160Z' + environment: null + query: level:error + resolution: 60 + time_window: 600 + type: 0 + model: sentry.snubaquery + pk: 1 +- fields: + aggregate: count() + dataset: events + date_added: '2023-11-22T17:03:21.201Z' + environment: null + query: test query + resolution: 60 + time_window: 60 + type: 0 + model: sentry.snubaquery + pk: 2 +- fields: + application: 1 + author: A Company + creator_label: [email protected] + creator_user: 4 + date_added: '2023-11-22T17:03:21.301Z' + date_deleted: null + date_published: null + date_updated: '2023-11-22T17:03:21.463Z' + events: '[]' + is_alertable: false + metadata: {} + name: test app + overview: null + owner_id: 4553018634141712 + popularity: 1 + proxy_user: 5 + redirect_url: null + schema: + elements: + - settings: + optional_fields: + - label: Points + name: points + options: + - - '1' + - '1' + - - '2' + - '2' + - - '3' + - '3' + - - '5' + - '5' + - - '8' + - '8' + type: select + - label: Assignee + name: assignee + type: select + uri: /sentry/members + required_fields: + - label: Title + name: title + type: text + - label: Summary + name: summary + type: text + type: alert-rule-settings + uri: /sentry/alert-rule + title: Create Task with App + type: alert-rule-action + scope_list: '[]' + scopes: '0' + slug: test-app + status: 0 + uuid: 355b78b2-97c4-4273-89d2-6b7c8f804d63 + verify_install: true + webhook_url: https://example.com/webhook + model: sentry.sentryapp + pk: 1 +- fields: + data: '{"conditions":[{"id":"sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"},{"id":"sentry.rules.conditions.every_event.EveryEventCondition"}],"action_match":"all","filter_match":"all","actions":[{"id":"sentry.rules.actions.notify_event.NotifyEventAction"},{"id":"sentry.rules.actions.notify_event_service.NotifyEventServiceAction","service":"mail"}]}' + date_added: '2023-11-17T03:25:04.134Z' + environment_id: null + label: '' + owner: null + project: 4553018634141714 + source: 0 + status: 0 + model: sentry.rule + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.166Z' + date_updated: '2023-11-22T17:03:21.166Z' + project: 4553018634141714 + snuba_query: 1 + status: 1 + subscription_id: null + type: incidents + model: sentry.querysubscription + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.203Z' + date_updated: '2023-11-22T17:03:21.203Z' + project: 4553018634141714 + snuba_query: 2 + status: 1 + subscription_id: null + type: incidents + model: sentry.querysubscription + pk: 2 +- fields: + date_added: '2023-11-22T17:03:21.322Z' + date_updated: '2023-11-22T17:03:21.322Z' + project: 4553018634207250 + snuba_query: 1 + status: 1 + subscription_id: null + type: incidents + model: sentry.querysubscription + pk: 3 +- fields: + date_added: '2023-11-22T17:03:21.540Z' + date_updated: '2023-11-22T17:03:21.541Z' + project: 4553018634207251 + snuba_query: 1 + status: 1 + subscription_id: null + type: incidents + model: sentry.querysubscription + pk: 4 +- fields: + is_active: true + organizationmember: 1 + role: null + team: 4553018634141713 + model: sentry.organizationmemberteam + pk: 1 +- fields: + integration_id: null + organization: 4553018634141712 + sentry_app_id: null + target_display: Sentry User + target_identifier: '1' + target_type: 1 + trigger_type: 0 + type: 5 + model: sentry.notificationaction + pk: 1 +- fields: + integration_id: null + organization: 4553018634141712 + sentry_app_id: 1 + target_display: Sentry User + target_identifier: '1' + target_type: 1 + trigger_type: 0 + type: 5 + model: sentry.notificationaction + pk: 2 +- fields: + disable_date: '2023-11-22T17:03:21.108Z' + opted_out: false + organization: 4553018634141712 + rule: 1 + sent_final_email_date: '2023-11-22T17:03:21.108Z' + sent_initial_email_date: '2023-11-22T17:03:21.108Z' + model: sentry.neglectedrule + pk: 1 +- fields: + environment: 1 + is_hidden: null + project: 4553018634141714 + model: sentry.environmentproject + pk: 1 +- fields: + dashboard: 1 + date_added: '2023-11-22T17:03:21.218Z' + description: null + detail: null + display_type: 0 + interval: null + limit: null + order: 1 + thresholds: null + title: Test Widget for test-org + widget_type: 0 + model: sentry.dashboardwidget + pk: 1 +- fields: + custom_dynamic_sampling_rule: 1 + project: 4553018634141714 + model: sentry.customdynamicsamplingruleproject + pk: 1 +- fields: + application: 1 + date_added: '2023-11-22T17:03:21.395Z' + expires_at: '2023-11-23T01:03:21.395Z' + name: null + refresh_token: 466835ef61e2202d145480c11a854e3924064f9ed294d7704a8a905bf5421577 + scope_list: '[]' + scopes: '0' + token: 206dbf6838f658cdb628af9cb37d1d723273d5fd003bdb732061653519938fea + token_last_characters: null + user: 5 + model: sentry.apitoken + pk: 1 +- fields: + application: 1 + date_added: '2023-11-22T17:03:21.470Z' + expires_at: null + name: create_exhaustive_sentry_app + refresh_token: 4a4df1b82684c9fabdbd17b7d4213f52998d8504c1565f4b31ad3f8b2e7335af + scope_list: '[]' + scopes: '0' + token: 676b6d7f6a7e01c02cc5c77a13579ce488e07ac63b65d24f6dace47f8f08b41d + token_last_characters: null + user: 1 + model: sentry.apitoken + pk: 2 +- fields: + application: null + date_added: '2023-11-22T17:03:21.586Z' + expires_at: null + name: create_exhaustive_global_configs + refresh_token: 7b291cd50c08c43514fb6544a10c4f822e8b069f4f13b852effc73be043d74e5 + scope_list: '[]' + scopes: '0' + token: 05aec126e32c464b40273a51d21147867f5494a636655c9ccd05d41588042afe + token_last_characters: null + user: 1 + model: sentry.apitoken + pk: 3 +- fields: + application: 1 + code: 7dc331c1ceb58bdb680212c69bc6e30cb03e5aa277038bbb5050b776355bd083 + expires_at: '2022-01-01T11:11:00.000Z' + redirect_uri: https://example.com + scope_list: '[''openid'', ''profile'', ''email'']' + scopes: '0' + user: 1 + model: sentry.apigrant + pk: 2 +- fields: + application: 1 + date_added: '2023-11-22T17:03:21.468Z' + scope_list: '[]' + scopes: '0' + user: 1 + model: sentry.apiauthorization + pk: 1 +- fields: + application: null + date_added: '2023-11-22T17:03:21.585Z' + scope_list: '[]' + scopes: '0' + user: 1 + model: sentry.apiauthorization + pk: 2 +- fields: + comparison_delta: null + date_added: '2023-11-22T17:03:21.162Z' + date_modified: '2023-11-22T17:03:21.162Z' + include_all_projects: true + name: Fast Woodcock + organization: 4553018634141712 + owner: null + resolve_threshold: null + snuba_query: 1 + status: 0 + team: null + threshold_period: 1 + threshold_type: 0 + user_id: null + model: sentry.alertrule + pk: 1 +- fields: + comparison_delta: null + date_added: '2023-11-22T17:03:21.202Z' + date_modified: '2023-11-22T17:03:21.202Z' + include_all_projects: false + name: Evolved Rabbit + organization: 4553018634141712 + owner: null + resolve_threshold: null + snuba_query: 2 + status: 0 + team: null + threshold_period: 1 + threshold_type: 0 + user_id: null + model: sentry.alertrule + pk: 2 +- fields: + snuba_query: 1 + type: 0 + model: sentry.snubaqueryeventtype + pk: 1 +- fields: + snuba_query: 2 + type: 0 + model: sentry.snubaqueryeventtype + pk: 2 +- fields: + api_grant: null + api_token: 1 + date_added: '2023-11-22T17:03:21.358Z' + date_deleted: null + date_updated: '2023-11-22T17:03:21.376Z' + organization_id: 4553018634141712 + sentry_app: 1 + status: 1 + uuid: 69dbda3a-7f60-4ede-a1fd-bee6c4f810d8 + model: sentry.sentryappinstallation + pk: 1 +- fields: + schema: + settings: + optional_fields: + - label: Points + name: points + options: + - - '1' + - '1' + - - '2' + - '2' + - - '3' + - '3' + - - '5' + - '5' + - - '8' + - '8' + type: select + - label: Assignee + name: assignee + type: select + uri: /sentry/members + required_fields: + - label: Title + name: title + type: text + - label: Summary + name: summary + type: text + type: alert-rule-settings + uri: /sentry/alert-rule + title: Create Task with App + type: alert-rule-action + sentry_app: 1 + type: alert-rule-action + uuid: 7c3fdc1d-59d5-4d12-bbe9-43da9db3490e + model: sentry.sentryappcomponent + pk: 1 +- fields: + alert_rule: null + date_added: '2023-11-22T17:03:21.107Z' + owner_id: 1 + rule: 1 + until: null + user_id: 1 + model: sentry.rulesnooze + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.106Z' + rule: 1 + type: 1 + user_id: null + model: sentry.ruleactivity + pk: 1 +- fields: + action: 1 + project: 4553018634141714 + model: sentry.notificationactionproject + pk: 1 +- fields: + action: 2 + project: 4553018634141714 + model: sentry.notificationactionproject + pk: 2 +- fields: + alert_rule: 2 + date_added: '2023-11-22T17:03:21.207Z' + date_closed: null + date_detected: '2023-11-22T17:03:21.206Z' + date_started: '2023-11-22T17:03:21.206Z' + detection_uuid: null + identifier: 1 + organization: 4553018634141712 + status: 1 + status_method: 3 + title: Evolving Hamster + type: 2 + model: sentry.incident + pk: 1 +- fields: + aggregates: null + columns: null + conditions: '' + date_added: '2023-11-22T17:03:21.219Z' + field_aliases: null + fields: '[]' + name: Test Query for test-org + order: 1 + orderby: '' + widget: 1 + model: sentry.dashboardwidgetquery + pk: 1 +- fields: + alert_rule: 1 + alert_threshold: 100.0 + date_added: '2023-11-22T17:03:21.172Z' + label: Light Ladybug + resolve_threshold: null + threshold_type: null + model: sentry.alertruletrigger + pk: 1 +- fields: + alert_rule: 1 + date_added: '2023-11-22T17:03:21.164Z' + project: 4553018634207248 + model: sentry.alertruleexcludedprojects + pk: 1 +- fields: + alert_rule: 1 + date_added: '2023-11-22T17:03:21.168Z' + previous_alert_rule: null + type: 1 + user_id: null + model: sentry.alertruleactivity + pk: 1 +- fields: + alert_rule: 2 + date_added: '2023-11-22T17:03:21.204Z' + previous_alert_rule: null + type: 1 + user_id: null + model: sentry.alertruleactivity + pk: 2 +- fields: + date_added: '2023-11-22T17:03:21.212Z' + end: '2023-11-22T17:03:21.212Z' + period: 1 + start: '2023-11-21T17:03:21.212Z' + values: '[[1.0, 2.0, 3.0], [1.5, 2.5, 3.5]]' + model: sentry.timeseriessnapshot + pk: 1 +- fields: + actor_id: 1 + application_id: 1 + date_added: '2023-11-22T17:03:21.374Z' + events: '[]' + guid: d10071be032a4f55982539f3e86c1aec + installation_id: 1 + organization_id: 4553018634141712 + project_id: null + secret: a3c9202b08771be6cf72ee3133151ddd8c3a5405d8d202d4221cc4f96cdf98d5 + status: 0 + url: https://example.com/webhook + version: 0 + model: sentry.servicehook + pk: 1 +- fields: + actor_id: 6 + application_id: 1 + date_added: '2023-11-22T17:03:21.571Z' + events: '[''event.created'']' + guid: de54e773e49143d6bac6180ce81c971a + installation_id: 1 + organization_id: 4553018634141712 + project_id: 4553018634207251 + secret: 1421c2af76292c00444445ac032c7af497677ddf9af679fa9d0e147b68397a8d + status: 0 + url: https://example.com/sentry/webhook + version: 0 + model: sentry.servicehook + pk: 2 +- fields: + date_added: '2023-11-22T17:03:21.216Z' + incident: 1 + target_run_date: '2023-11-22T21:03:21.216Z' + model: sentry.pendingincidentsnapshot + pk: 1 +- fields: + alert_rule_trigger: 1 + date_added: '2023-11-22T17:03:21.215Z' + date_modified: '2023-11-22T17:03:21.215Z' + incident: 1 + status: 1 + model: sentry.incidenttrigger + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.214Z' + incident: 1 + user_id: 1 + model: sentry.incidentsubscription + pk: 1 +- fields: + date_added: '2023-11-22T17:03:21.213Z' + event_stats_snapshot: 1 + incident: 1 + total_events: 1 + unique_users: 1 + model: sentry.incidentsnapshot + pk: 1 +- fields: + comment: hello test-org + date_added: '2023-11-22T17:03:21.211Z' + incident: 1 + notification_uuid: null + previous_value: null + type: 1 + user_id: null + value: null + model: sentry.incidentactivity + pk: 1 +- fields: + alert_rule_trigger: 1 + date_added: '2023-11-22T17:03:21.174Z' + query_subscription: 1 + model: sentry.alertruletriggerexclusion + pk: 1 +- fields: + alert_rule_trigger: 1 + date_added: '2023-11-22T17:03:21.199Z' + integration_id: null + sentry_app_config: null + sentry_app_id: null + target_display: null + target_identifier: '3' + target_type: 1 + type: 0 + model: sentry.alertruletriggeraction + pk: 1 diff --git a/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap b/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap index 11dd0904cf1706..5ccb84a819dc00 100644 --- a/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap +++ b/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap @@ -1,18 +1,18 @@ --- -created: '2023-11-22T17:03:21.909589Z' +created: '2023-11-30T19:30:41.548723Z' creator: sentry source: tests/sentry/backup/test_releases.py --- - fields: key: bar - last_updated: '2023-11-22T17:03:21.584Z' + last_updated: '2023-11-30T19:30:40.887Z' last_updated_by: unknown value: '"b"' model: sentry.controloption pk: 1 - fields: - date_added: '2023-11-22T17:03:21.099Z' - date_updated: '2023-11-22T17:03:21.099Z' + date_added: '2023-11-30T19:30:40.066Z' + date_updated: '2023-11-30T19:30:40.066Z' external_id: slack:test-org metadata: {} name: Slack for test-org @@ -22,13 +22,13 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: key: foo - last_updated: '2023-11-22T17:03:21.584Z' + last_updated: '2023-11-30T19:30:40.883Z' last_updated_by: unknown value: '"a"' model: sentry.option pk: 1 - fields: - date_added: '2023-11-22T17:03:20.842Z' + date_added: '2023-11-30T19:30:39.380Z' default_role: member flags: '1' is_test: false @@ -36,92 +36,92 @@ source: tests/sentry/backup/test_releases.py slug: test-org status: 0 model: sentry.organization - pk: 4553018634141712 + pk: 4553064511897616 - fields: - date_added: '2023-11-22T17:03:21.254Z' + date_added: '2023-11-30T19:30:40.256Z' default_role: member flags: '1' is_test: false - name: Present Kingfish - slug: present-kingfish + name: Tough Wasp + slug: tough-wasp status: 0 model: sentry.organization - pk: 4553018634207249 + pk: 4553064511963153 - fields: config: hello: hello - date_added: '2023-11-22T17:03:21.100Z' - date_updated: '2023-11-22T17:03:21.100Z' + date_added: '2023-11-30T19:30:40.067Z' + date_updated: '2023-11-30T19:30:40.067Z' default_auth_id: null grace_period_end: null integration: 1 - organization_id: 4553018634141712 + organization_id: 4553064511897616 status: 0 model: sentry.organizationintegration pk: 1 - fields: key: sentry:account-rate-limit - organization: 4553018634141712 + organization: 4553064511897616 value: 0 model: sentry.organizationoption pk: 1 - fields: - date_added: '2023-11-22T17:03:20.988Z' + date_added: '2023-11-30T19:30:39.832Z' first_event: null flags: '10' forced_color: null name: project-test-org - organization: 4553018634141712 + organization: 4553064511897616 platform: null public: false slug: project-test-org status: 0 model: sentry.project - pk: 4553018634141714 + pk: 4553064511897618 - fields: - date_added: '2023-11-22T17:03:21.126Z' + date_added: '2023-11-30T19:30:40.103Z' first_event: null flags: '10' forced_color: null name: other-project-test-org - organization: 4553018634141712 + organization: 4553064511897616 platform: null public: false slug: other-project-test-org status: 0 model: sentry.project - pk: 4553018634207248 + pk: 4553064511963152 - fields: - date_added: '2023-11-22T17:03:21.319Z' + date_added: '2023-11-30T19:30:40.356Z' first_event: null flags: '10' forced_color: null - name: Pro Cow - organization: 4553018634141712 + name: Polite Whippet + organization: 4553064511897616 platform: null public: false - slug: pro-cow + slug: polite-whippet status: 0 model: sentry.project - pk: 4553018634207250 + pk: 4553064511963154 - fields: - date_added: '2023-11-22T17:03:21.537Z' + date_added: '2023-11-30T19:30:40.806Z' first_event: null flags: '10' forced_color: null - name: Definite Crab - organization: 4553018634141712 + name: Closing Oarfish + organization: 4553064511897616 platform: null public: false - slug: definite-crab + slug: closing-oarfish status: 0 model: sentry.project - pk: 4553018634207251 + pk: 4553064511963155 - fields: config: hello: hello integration_id: 1 - project: 4553018634141714 + project: 4553064511897618 model: sentry.projectintegration pk: 1 - fields: @@ -129,14 +129,14 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-22T17:03:21.003Z' + date_added: '2023-11-30T19:30:39.876Z' label: Default - project: 4553018634141714 - public_key: 338d140a36347ff11576c1ffadcb8e79 + project: 4553064511897618 + public_key: 2daca131517658a5248a91b062a359af rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: 9f8c719d53d2c9a1ae0995a884d87260 + secret_key: bde0b7a5b09c2c7f5e4fac01c475ebbf status: 0 model: sentry.projectkey pk: 1 @@ -145,14 +145,14 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-22T17:03:21.142Z' + date_added: '2023-11-30T19:30:40.132Z' label: Default - project: 4553018634207248 - public_key: cc8eb3c7f2cd126ec0ffba441565c752 + project: 4553064511963152 + public_key: d5d49619c6857454bf91676d8b072790 rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: 421ed97e7839c5de1697acf4a1c9d640 + secret_key: 433d192c38f04aafb0357ab0a1a39f6f status: 0 model: sentry.projectkey pk: 2 @@ -161,14 +161,14 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-22T17:03:21.338Z' + date_added: '2023-11-30T19:30:40.383Z' label: Default - project: 4553018634207250 - public_key: cf57bdcc00b04ef101d436559a95d211 + project: 4553064511963154 + public_key: 8caa000bb29ac9e760544258637e24a1 rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: fb212438a814be1c3ee4c9e5c2a07c27 + secret_key: 69c6b484aa52393fa415cd4043e653a7 status: 0 model: sentry.projectkey pk: 3 @@ -177,97 +177,97 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-22T17:03:21.555Z' + date_added: '2023-11-30T19:30:40.834Z' label: Default - project: 4553018634207251 - public_key: c3723b27c44ed942f243c4f443f39d40 + project: 4553064511963155 + public_key: 2bba738e5dd3fbd36b3f880ed9b9dc97 rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: 1beebe9902c0ca40d48771233179eb83 + secret_key: 7ff13e6670375a6505b1d51e126e8455 status: 0 model: sentry.projectkey pk: 4 - fields: key: sentry:relay-rev - project: 4553018634141714 - value: '"ad40b8e9be03422d96014676b96695da"' + project: 4553064511897618 + value: '"f5f8cea502294fb29a1a3aec493f76ee"' model: sentry.projectoption pk: 1 - fields: key: sentry:relay-rev-lastchange - project: 4553018634141714 - value: '"2023-11-22T17:03:21.008347Z"' + project: 4553064511897618 + value: '"2023-11-30T19:30:39.884922Z"' model: sentry.projectoption pk: 2 - fields: key: sentry:option-epoch - project: 4553018634141714 + project: 4553064511897618 value: 11 model: sentry.projectoption pk: 3 - fields: key: sentry:relay-rev - project: 4553018634207248 - value: '"e93c00bcb640427aaa4bb038b5725342"' + project: 4553064511963152 + value: '"1074e31bb3904ec28e2b89cd603e20d3"' model: sentry.projectoption pk: 4 - fields: key: sentry:relay-rev-lastchange - project: 4553018634207248 - value: '"2023-11-22T17:03:21.147169Z"' + project: 4553064511963152 + value: '"2023-11-30T19:30:40.137824Z"' model: sentry.projectoption pk: 5 - fields: key: sentry:option-epoch - project: 4553018634207248 + project: 4553064511963152 value: 11 model: sentry.projectoption pk: 6 - fields: key: sentry:relay-rev - project: 4553018634207250 - value: '"743beeaa1b4941139374c5ea60a055e7"' + project: 4553064511963154 + value: '"ca2c6a4b80ad4a4695122bf90fb646b9"' model: sentry.projectoption pk: 7 - fields: key: sentry:relay-rev-lastchange - project: 4553018634207250 - value: '"2023-11-22T17:03:21.342947Z"' + project: 4553064511963154 + value: '"2023-11-30T19:30:40.390645Z"' model: sentry.projectoption pk: 8 - fields: key: sentry:option-epoch - project: 4553018634207250 + project: 4553064511963154 value: 11 model: sentry.projectoption pk: 9 - fields: key: sentry:relay-rev - project: 4553018634207251 - value: '"5ba740f1e2c74e5298d71dcb41789359"' + project: 4553064511963155 + value: '"b5f702aff74942a3aada9f27796aa11e"' model: sentry.projectoption pk: 10 - fields: key: sentry:relay-rev-lastchange - project: 4553018634207251 - value: '"2023-11-22T17:03:21.560535Z"' + project: 4553064511963155 + value: '"2023-11-30T19:30:40.840965Z"' model: sentry.projectoption pk: 11 - fields: key: sentry:option-epoch - project: 4553018634207251 + project: 4553064511963155 value: 11 model: sentry.projectoption pk: 12 - fields: auto_assignment: true codeowners_auto_sync: true - date_created: '2023-11-22T17:03:21.022Z' + date_created: '2023-11-30T19:30:39.914Z' fallthrough: true is_active: true - last_updated: '2023-11-22T17:03:21.022Z' - project: 4553018634141714 + last_updated: '2023-11-30T19:30:39.914Z' + project: 4553064511897618 raw: '{"hello":"hello"}' schema: hello: hello @@ -275,9 +275,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.projectownership pk: 1 - fields: - date_added: '2023-11-22T17:03:21.027Z' - organization: 4553018634141712 - project: 4553018634141714 + date_added: '2023-11-30T19:30:39.921Z' + organization: 4553064511897616 + project: 4553064511897618 redirect_slug: project_slug_in_test-org model: sentry.projectredirect pk: 1 @@ -285,26 +285,26 @@ source: tests/sentry/backup/test_releases.py first_seen: null is_internal: true last_seen: null - public_key: WnHEPm_HcqrhnI4y6cRZjbj-q1YBk_buGA1OdhaB4-w - relay_id: 37034f75-ea8a-49bc-825b-1a01f53ffe3b + public_key: 55Zuita-ukwJgTYW8cwhFlGu_EUXrXY_eGt8ngNXrLg + relay_id: 9db6999f-3b0c-4d26-8649-78e4ea346c58 model: sentry.relay pk: 1 - fields: - first_seen: '2023-11-22T17:03:21.582Z' - last_seen: '2023-11-22T17:03:21.582Z' - public_key: WnHEPm_HcqrhnI4y6cRZjbj-q1YBk_buGA1OdhaB4-w - relay_id: 37034f75-ea8a-49bc-825b-1a01f53ffe3b + first_seen: '2023-11-30T19:30:40.881Z' + last_seen: '2023-11-30T19:30:40.881Z' + public_key: 55Zuita-ukwJgTYW8cwhFlGu_EUXrXY_eGt8ngNXrLg + relay_id: 9db6999f-3b0c-4d26-8649-78e4ea346c58 version: 0.0.1 model: sentry.relayusage pk: 1 - fields: config: {} - date_added: '2023-11-22T17:03:21.228Z' + date_added: '2023-11-30T19:30:40.237Z' external_id: null integration_id: 1 languages: '[]' name: getsentry/getsentry - organization_id: 4553018634141712 + organization_id: 4553064511897616 provider: integrations:github status: 0 url: https://github.com/getsentry/getsentry @@ -312,19 +312,19 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: actor: 1 - date_added: '2023-11-22T17:03:20.941Z' + date_added: '2023-11-30T19:30:39.695Z' idp_provisioned: false name: test_team_in_test-org org_role: null - organization: 4553018634141712 + organization: 4553064511897616 slug: test_team_in_test-org status: 0 model: sentry.team - pk: 4553018634141713 + pk: 4553064511897617 - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-22T17:03:20.673Z' + date_joined: '2023-11-30T19:30:38.383Z' email: owner flags: '0' is_active: true @@ -334,11 +334,11 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: true is_unclaimed: false - last_active: '2023-11-22T17:03:20.673Z' + last_active: '2023-11-30T19:30:38.383Z' last_login: null - last_password_change: '2023-11-22T17:03:20.673Z' + last_password_change: '2023-11-30T19:30:38.383Z' name: '' - password: md5$RtQfehSvZPL1xxfpa98L4P$41d2a6c3d2eac7a1ae7cb169e24fc272 + password: md5$AYAGSUv64IfDqPTy3EmSFf$5b778e0d807e5fe9d56a08c789ecc6bc session_nonce: null username: owner model: sentry.user @@ -346,7 +346,7 @@ source: tests/sentry/backup/test_releases.py - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-22T17:03:20.799Z' + date_joined: '2023-11-30T19:30:39.354Z' email: invitee flags: '0' is_active: true @@ -356,11 +356,11 @@ source: tests/sentry/backup/test_releases.py is_staff: false is_superuser: false is_unclaimed: false - last_active: '2023-11-22T17:03:20.799Z' + last_active: '2023-11-30T19:30:39.354Z' last_login: null - last_password_change: '2023-11-22T17:03:20.799Z' + last_password_change: '2023-11-30T19:30:39.354Z' name: '' - password: md5$Y5OiBAysHpQ8KJPjE9TAUj$ee17e866435219d37e8d6adca4cd55c1 + password: md5$hKAPPaDA841KrIbMWOfXF8$763319d633c981d62f0383600330a8a9 session_nonce: null username: invitee model: sentry.user @@ -368,7 +368,7 @@ source: tests/sentry/backup/test_releases.py - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-22T17:03:21.176Z' + date_joined: '2023-11-30T19:30:40.179Z' email: admin@localhost flags: '0' is_active: true @@ -378,11 +378,11 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: true is_unclaimed: false - last_active: '2023-11-22T17:03:21.176Z' + last_active: '2023-11-30T19:30:40.179Z' last_login: null - last_password_change: '2023-11-22T17:03:21.176Z' + last_password_change: '2023-11-30T19:30:40.179Z' name: '' - password: md5$HYoFz1fB3ioVaz8WAWTOjZ$3e2882ef1bdca3156187cc2c8762f2ed + password: md5$mB7dc49zehvtRQVxbuqDTB$dda1ecc55976479cdbf2df393fdbc46c session_nonce: null username: admin@localhost model: sentry.user @@ -390,8 +390,8 @@ source: tests/sentry/backup/test_releases.py - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-22T17:03:21.230Z' - email: [email protected] + date_joined: '2023-11-30T19:30:40.240Z' + email: [email protected] flags: '0' is_active: true is_managed: false @@ -400,19 +400,19 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: false is_unclaimed: false - last_active: '2023-11-22T17:03:21.230Z' + last_active: '2023-11-30T19:30:40.240Z' last_login: null - last_password_change: '2023-11-22T17:03:21.230Z' + last_password_change: '2023-11-30T19:30:40.240Z' name: '' - password: md5$rEUMy2DLlIFr4Y2HIwt0F7$65f3be8db96cbc4bf85883b31220cb14 + password: md5$2sOK6Z9RqJzqiDRBQKypJ8$7238faceb91b4ef8e2a8beaebbbd7bf4 session_nonce: null - username: [email protected] + username: [email protected] model: sentry.user pk: 4 - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-22T17:03:21.291Z' + date_joined: '2023-11-30T19:30:40.332Z' email: '' flags: '0' is_active: true @@ -422,20 +422,20 @@ source: tests/sentry/backup/test_releases.py is_staff: false is_superuser: false is_unclaimed: false - last_active: '2023-11-22T17:03:21.291Z' + last_active: '2023-11-30T19:30:40.332Z' last_login: null last_password_change: null name: '' password: '' session_nonce: null - username: test-app-5263d0ec-75b6-4f94-b758-ae199d44bc7b + username: test-app-33150c69-03a5-408b-9040-d6c9cd3596f5 model: sentry.user pk: 5 - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-22T17:03:21.514Z' - email: [email protected] + date_joined: '2023-11-30T19:30:40.781Z' + email: [email protected] flags: '0' is_active: true is_managed: false @@ -444,13 +444,13 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: false is_unclaimed: false - last_active: '2023-11-22T17:03:21.514Z' + last_active: '2023-11-30T19:30:40.781Z' last_login: null - last_password_change: '2023-11-22T17:03:21.514Z' + last_password_change: '2023-11-30T19:30:40.781Z' name: '' - password: md5$rJKBeQY4eDGSdRznysDxnD$d12ec654255fe80b27bf4e8ea39d0ba1 + password: md5$1CNWHaXw77yDEBES8AAYET$f7bba4fbf30090c91845a81202f2a547 session_nonce: null - username: [email protected] + username: [email protected] model: sentry.user pk: 6 - fields: @@ -493,24 +493,24 @@ source: tests/sentry/backup/test_releases.py model: sentry.userpermission pk: 1 - fields: - date_added: '2023-11-22T17:03:20.751Z' - date_updated: '2023-11-22T17:03:20.751Z' + date_added: '2023-11-30T19:30:38.419Z' + date_updated: '2023-11-30T19:30:38.419Z' name: test-admin-role permissions: '[]' model: sentry.userrole pk: 1 - fields: - date_added: '2023-11-22T17:03:20.757Z' - date_updated: '2023-11-22T17:03:20.757Z' + date_added: '2023-11-30T19:30:38.427Z' + date_updated: '2023-11-30T19:30:38.427Z' role: 1 user: 1 model: sentry.userroleuser pk: 1 - fields: - date_added: '2023-11-22T17:03:21.221Z' + date_added: '2023-11-30T19:30:40.227Z' is_global: false name: Saved query for test-org - organization: 4553018634141712 + organization: 4553064511897616 owner_id: null query: saved query for test-org sort: date @@ -519,9 +519,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.savedsearch pk: 1 - fields: - date_added: '2023-11-22T17:03:21.220Z' - last_seen: '2023-11-22T17:03:21.220Z' - organization: 4553018634141712 + date_added: '2023-11-30T19:30:40.226Z' + last_seen: '2023-11-30T19:30:40.226Z' + organization: 4553064511897616 query: some query for test-org query_hash: 7c69362cd42207b83f80087bc15ebccb type: 0 @@ -529,42 +529,42 @@ source: tests/sentry/backup/test_releases.py model: sentry.recentsearch pk: 1 - fields: - project: 4553018634141714 - team: 4553018634141713 + project: 4553064511897618 + team: 4553064511897617 model: sentry.projectteam pk: 1 - fields: - project: 4553018634207248 - team: 4553018634141713 + project: 4553064511963152 + team: 4553064511897617 model: sentry.projectteam pk: 2 - fields: - date_added: '2023-11-22T17:03:21.021Z' - project: 4553018634141714 + date_added: '2023-11-30T19:30:39.911Z' + project: 4553064511897618 user_id: 1 model: sentry.projectbookmark pk: 1 - fields: created_by: null - date_added: '2023-11-22T17:03:21.084Z' + date_added: '2023-11-30T19:30:40.030Z' date_deactivated: null date_last_used: null name: token 1 for test-org - organization_id: 4553018634141712 - project_last_used_id: 4553018634141714 + organization_id: 4553064511897616 + project_last_used_id: 4553064511897618 scope_list: '[''org:ci'']' token_hashed: ABCDEFtest-org token_last_characters: xyz1 model: sentry.orgauthtoken pk: 1 - fields: - date_added: '2023-11-22T17:03:20.879Z' + date_added: '2023-11-30T19:30:39.489Z' email: null flags: '0' has_global_access: true invite_status: 0 inviter_id: null - organization: 4553018634141712 + organization: 4553064511897616 role: owner token: null token_expires_at: null @@ -575,13 +575,13 @@ source: tests/sentry/backup/test_releases.py model: sentry.organizationmember pk: 1 - fields: - date_added: '2023-11-22T17:03:20.909Z' + date_added: '2023-11-30T19:30:39.575Z' email: null flags: '0' has_global_access: true invite_status: 0 inviter_id: null - organization: 4553018634141712 + organization: 4553064511897616 role: member token: null token_expires_at: null @@ -594,105 +594,105 @@ source: tests/sentry/backup/test_releases.py - fields: member: 2 requester_id: null - team: 4553018634141713 + team: 4553064511897617 model: sentry.organizationaccessrequest pk: 1 - fields: config: schedule: '* * * * *' schedule_type: 1 - date_added: '2023-11-22T17:03:21.122Z' - guid: a451077c-9322-4723-aeb3-202ed20ae56f + date_added: '2023-11-30T19:30:40.098Z' + guid: 1b06c2dc-dfad-40cf-810e-2eeb546b7bca name: '' - organization_id: 4553018634141712 - project_id: 4553018634141714 - slug: 4a000903877b + organization_id: 4553064511897616 + project_id: 4553064511897618 + slug: cfa7b4f5f40a status: 0 type: 3 model: sentry.monitor pk: 1 - fields: - date_added: '2023-11-22T17:03:21.119Z' - name: fairly direct monkey - organization_id: 4553018634141712 + date_added: '2023-11-30T19:30:40.094Z' + name: steadily improved quail + organization_id: 4553064511897616 model: sentry.environment pk: 1 - fields: - date_added: '2023-11-22T17:03:20.678Z' + date_added: '2023-11-30T19:30:38.390Z' email: owner model: sentry.email pk: 1 - fields: - date_added: '2023-11-22T17:03:20.803Z' + date_added: '2023-11-30T19:30:39.360Z' email: invitee model: sentry.email pk: 2 - fields: - date_added: '2023-11-22T17:03:21.180Z' + date_added: '2023-11-30T19:30:40.184Z' email: admin@localhost model: sentry.email pk: 3 - fields: - date_added: '2023-11-22T17:03:21.234Z' - email: [email protected] + date_added: '2023-11-30T19:30:40.246Z' + email: [email protected] model: sentry.email pk: 4 - fields: - date_added: '2023-11-22T17:03:21.294Z' + date_added: '2023-11-30T19:30:40.339Z' email: '' model: sentry.email pk: 5 - fields: - date_added: '2023-11-22T17:03:21.517Z' - email: [email protected] + date_added: '2023-11-30T19:30:40.788Z' + email: [email protected] model: sentry.email pk: 6 - fields: - date_added: '2023-11-22T17:03:21.220Z' - organization: 4553018634141712 + date_added: '2023-11-30T19:30:40.224Z' + organization: 4553064511897616 slug: test-tombstone-in-test-org model: sentry.dashboardtombstone pk: 1 - fields: created_by_id: 1 - date_added: '2023-11-22T17:03:21.217Z' + date_added: '2023-11-30T19:30:40.220Z' filters: null - last_visited: '2023-11-22T17:03:21.217Z' - organization: 4553018634141712 + last_visited: '2023-11-30T19:30:40.220Z' + organization: 4553064511897616 title: Dashboard 1 for test-org visits: 1 model: sentry.dashboard pk: 1 - fields: condition: '{"op":"equals","name":"environment","value":"prod"}' - condition_hash: 2d37b9ed0a84e1ab7301636256a6197af5ce8dac + condition_hash: 47771eed5d259b46bdd1db30f80057efddf41001 created_by_id: null - date_added: '2023-11-22T17:03:21.114Z' - end_date: '2023-11-22T18:03:21.110Z' + date_added: '2023-11-30T19:30:40.087Z' + end_date: '2023-11-30T20:30:40.082Z' is_active: true is_org_level: false notification_sent: false num_samples: 100 - organization: 4553018634141712 + organization: 4553064511897616 query: environment:prod event.type:transaction rule_id: 1 sample_rate: 0.5 - start_date: '2023-11-22T17:03:21.110Z' + start_date: '2023-11-30T19:30:40.082Z' model: sentry.customdynamicsamplingrule pk: 1 - fields: - project: 4553018634141714 + project: 4553064511897618 value: 1 model: sentry.counter pk: 1 - fields: config: {} - date_added: '2023-11-22T17:03:21.050Z' + date_added: '2023-11-30T19:30:39.962Z' default_global_access: true default_role: 50 flags: '0' last_sync: null - organization_id: 4553018634141712 + organization_id: 4553064511897616 provider: sentry sync_time: null model: sentry.authprovider @@ -708,16 +708,16 @@ source: tests/sentry/backup/test_releases.py - 3 key4: nested_key: nested_value - date_added: '2023-11-22T17:03:21.067Z' + date_added: '2023-11-30T19:30:40.001Z' ident: 123456789test-org - last_synced: '2023-11-22T17:03:21.067Z' - last_verified: '2023-11-22T17:03:21.067Z' + last_synced: '2023-11-30T19:30:40.001Z' + last_verified: '2023-11-30T19:30:40.001Z' user: 1 model: sentry.authidentity pk: 1 - fields: config: '""' - created_at: '2023-11-22T17:03:20.711Z' + created_at: '2023-11-30T19:30:38.405Z' last_used_at: null type: 1 user: 1 @@ -725,7 +725,7 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: config: '""' - created_at: '2023-11-22T17:03:20.826Z' + created_at: '2023-11-30T19:30:39.373Z' last_used_at: null type: 1 user: 2 @@ -733,10 +733,10 @@ source: tests/sentry/backup/test_releases.py pk: 2 - fields: allowed_origins: null - date_added: '2023-11-22T17:03:21.034Z' - key: 4524e11a7e0c479390936aeed3dc2c73 + date_added: '2023-11-30T19:30:39.930Z' + key: 6895dfd29dae49f0b39f6a39c24690d6 label: Default - organization_id: 4553018634141712 + organization_id: 4553064511897616 scope_list: '[]' scopes: '0' status: 0 @@ -744,11 +744,11 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: allowed_origins: '' - client_id: 47e140730be26ed7c3f17ea5e08dddaa487bff0ef787a5e4b7526791c2d52b42 - client_secret: ba90465cbabd242ac39d7f4c1542d7f2cd21203fb3732874ad6f16795dfe3b4a - date_added: '2023-11-22T17:03:21.300Z' + client_id: 1e238c605fda59356ab4a90b297ad2beba80399ec60d3d56fd682390d53d1d18 + client_secret: 040e5921f0dc85a5f68639374f377d95053fee051c9f0c609d62fd68598cbb41 + date_added: '2023-11-30T19:30:40.348Z' homepage_url: null - name: Endless Garfish + name: Exotic Goshawk owner: 5 privacy_url: null redirect_uris: '' @@ -757,63 +757,63 @@ source: tests/sentry/backup/test_releases.py model: sentry.apiapplication pk: 1 - fields: - team: 4553018634141713 + team: 4553064511897617 type: 0 user_id: null model: sentry.actor pk: 1 - fields: - date_hash_added: '2023-11-22T17:03:20.676Z' + date_hash_added: '2023-11-30T19:30:38.387Z' email: owner is_verified: true user: 1 - validation_hash: SPhuOODrUjNzxTSckAgbhw50hkxWEVgQ + validation_hash: 1qVZqloIbR1kFJXuppd7ANgB8yRbeXLy model: sentry.useremail pk: 1 - fields: - date_hash_added: '2023-11-22T17:03:20.801Z' + date_hash_added: '2023-11-30T19:30:39.357Z' email: invitee is_verified: true user: 2 - validation_hash: MT2vbWiNJRTQoLriuPwxBsN9Qd9GX8hr + validation_hash: 9X6MwGi22YpoGG5vn2XdgKojWCVbspIo model: sentry.useremail pk: 2 - fields: - date_hash_added: '2023-11-22T17:03:21.178Z' + date_hash_added: '2023-11-30T19:30:40.181Z' email: admin@localhost is_verified: true user: 3 - validation_hash: nVO8Aa04OFhJlz8xlWLanxHcczJa2BoG + validation_hash: zzMxAnTCefmH6o7LYW50mRpZMoIAcPMz model: sentry.useremail pk: 3 - fields: - date_hash_added: '2023-11-22T17:03:21.232Z' - email: [email protected] + date_hash_added: '2023-11-30T19:30:40.243Z' + email: [email protected] is_verified: true user: 4 - validation_hash: xux1niE71HIVH2zoYgFRUGB8Bf9UgEEk + validation_hash: Fo4BvX2yCnCruL4bCLSNHKWK0b9uzGCZ model: sentry.useremail pk: 4 - fields: - date_hash_added: '2023-11-22T17:03:21.293Z' + date_hash_added: '2023-11-30T19:30:40.335Z' email: '' is_verified: false user: 5 - validation_hash: lzvvrFG73X8h9z8lyfm6HHMxJDLzJ4ob + validation_hash: hM0D9HXMko8MNVLgwdNEoO5vfvnrd24H model: sentry.useremail pk: 5 - fields: - date_hash_added: '2023-11-22T17:03:21.516Z' - email: [email protected] + date_hash_added: '2023-11-30T19:30:40.784Z' + email: [email protected] is_verified: true user: 6 - validation_hash: 14NCghXzcpb1K9Oyj8dgmApQBUKkJdLN + validation_hash: ExfVGVNOfOnDBZDWQsyXqZ8jQNF3bOnZ model: sentry.useremail pk: 6 - fields: aggregate: count() dataset: events - date_added: '2023-11-22T17:03:21.160Z' + date_added: '2023-11-30T19:30:40.156Z' environment: null query: level:error resolution: 60 @@ -824,7 +824,7 @@ source: tests/sentry/backup/test_releases.py - fields: aggregate: count() dataset: events - date_added: '2023-11-22T17:03:21.201Z' + date_added: '2023-11-30T19:30:40.197Z' environment: null query: test query resolution: 60 @@ -835,18 +835,18 @@ source: tests/sentry/backup/test_releases.py - fields: application: 1 author: A Company - creator_label: [email protected] + creator_label: [email protected] creator_user: 4 - date_added: '2023-11-22T17:03:21.301Z' + date_added: '2023-11-30T19:30:40.350Z' date_deleted: null date_published: null - date_updated: '2023-11-22T17:03:21.463Z' + date_updated: '2023-11-30T19:30:40.680Z' events: '[]' is_alertable: false metadata: {} name: test app overview: null - owner_id: 4553018634141712 + owner_id: 4553064511897616 popularity: 1 proxy_user: 5 redirect_url: null @@ -887,26 +887,26 @@ source: tests/sentry/backup/test_releases.py scopes: '0' slug: test-app status: 0 - uuid: 355b78b2-97c4-4273-89d2-6b7c8f804d63 + uuid: c79747f3-a76d-4587-ad2c-680955b57594 verify_install: true webhook_url: https://example.com/webhook model: sentry.sentryapp pk: 1 - fields: data: '{"conditions":[{"id":"sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"},{"id":"sentry.rules.conditions.every_event.EveryEventCondition"}],"action_match":"all","filter_match":"all","actions":[{"id":"sentry.rules.actions.notify_event.NotifyEventAction"},{"id":"sentry.rules.actions.notify_event_service.NotifyEventServiceAction","service":"mail"}]}' - date_added: '2023-11-17T03:25:04.134Z' + date_added: '2023-11-30T19:30:40.076Z' environment_id: null label: '' owner: null - project: 4553018634141714 + project: 4553064511897618 source: 0 status: 0 model: sentry.rule pk: 1 - fields: - date_added: '2023-11-22T17:03:21.166Z' - date_updated: '2023-11-22T17:03:21.166Z' - project: 4553018634141714 + date_added: '2023-11-30T19:30:40.167Z' + date_updated: '2023-11-30T19:30:40.167Z' + project: 4553064511897618 snuba_query: 1 status: 1 subscription_id: null @@ -914,9 +914,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.querysubscription pk: 1 - fields: - date_added: '2023-11-22T17:03:21.203Z' - date_updated: '2023-11-22T17:03:21.203Z' - project: 4553018634141714 + date_added: '2023-11-30T19:30:40.202Z' + date_updated: '2023-11-30T19:30:40.202Z' + project: 4553064511897618 snuba_query: 2 status: 1 subscription_id: null @@ -924,9 +924,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.querysubscription pk: 2 - fields: - date_added: '2023-11-22T17:03:21.322Z' - date_updated: '2023-11-22T17:03:21.322Z' - project: 4553018634207250 + date_added: '2023-11-30T19:30:40.361Z' + date_updated: '2023-11-30T19:30:40.361Z' + project: 4553064511963154 snuba_query: 1 status: 1 subscription_id: null @@ -934,9 +934,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.querysubscription pk: 3 - fields: - date_added: '2023-11-22T17:03:21.540Z' - date_updated: '2023-11-22T17:03:21.541Z' - project: 4553018634207251 + date_added: '2023-11-30T19:30:40.812Z' + date_updated: '2023-11-30T19:30:40.812Z' + project: 4553064511963155 snuba_query: 1 status: 1 subscription_id: null @@ -947,12 +947,12 @@ source: tests/sentry/backup/test_releases.py is_active: true organizationmember: 1 role: null - team: 4553018634141713 + team: 4553064511897617 model: sentry.organizationmemberteam pk: 1 - fields: integration_id: null - organization: 4553018634141712 + organization: 4553064511897616 sentry_app_id: null target_display: Sentry User target_identifier: '1' @@ -963,7 +963,7 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: integration_id: null - organization: 4553018634141712 + organization: 4553064511897616 sentry_app_id: 1 target_display: Sentry User target_identifier: '1' @@ -973,23 +973,23 @@ source: tests/sentry/backup/test_releases.py model: sentry.notificationaction pk: 2 - fields: - disable_date: '2023-11-22T17:03:21.108Z' + disable_date: '2023-11-30T19:30:40.080Z' opted_out: false - organization: 4553018634141712 + organization: 4553064511897616 rule: 1 - sent_final_email_date: '2023-11-22T17:03:21.108Z' - sent_initial_email_date: '2023-11-22T17:03:21.108Z' + sent_final_email_date: '2023-11-30T19:30:40.080Z' + sent_initial_email_date: '2023-11-30T19:30:40.080Z' model: sentry.neglectedrule pk: 1 - fields: environment: 1 is_hidden: null - project: 4553018634141714 + project: 4553064511897618 model: sentry.environmentproject pk: 1 - fields: dashboard: 1 - date_added: '2023-11-22T17:03:21.218Z' + date_added: '2023-11-30T19:30:40.222Z' description: null detail: null display_type: 0 @@ -1003,51 +1003,51 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: custom_dynamic_sampling_rule: 1 - project: 4553018634141714 + project: 4553064511897618 model: sentry.customdynamicsamplingruleproject pk: 1 - fields: application: 1 - date_added: '2023-11-22T17:03:21.395Z' - expires_at: '2023-11-23T01:03:21.395Z' + date_added: '2023-11-30T19:30:40.505Z' + expires_at: '2023-12-01T03:30:40.505Z' name: null - refresh_token: 466835ef61e2202d145480c11a854e3924064f9ed294d7704a8a905bf5421577 + refresh_token: abae390c6a5b718a552dd6ae212de7bf1cb09f23516a5d92326c1bc98768dc13 scope_list: '[]' scopes: '0' - token: 206dbf6838f658cdb628af9cb37d1d723273d5fd003bdb732061653519938fea + token: 3f43a9912b70d74019910dae4787a32f9373d8c6c704aa4b5fd008ff74e42359 token_last_characters: null user: 5 model: sentry.apitoken pk: 1 - fields: application: 1 - date_added: '2023-11-22T17:03:21.470Z' + date_added: '2023-11-30T19:30:40.701Z' expires_at: null name: create_exhaustive_sentry_app - refresh_token: 4a4df1b82684c9fabdbd17b7d4213f52998d8504c1565f4b31ad3f8b2e7335af + refresh_token: 50b3ec64acf07f3454338e2c5c84155a806f9d4e7b4a315e2beac458b556c621 scope_list: '[]' scopes: '0' - token: 676b6d7f6a7e01c02cc5c77a13579ce488e07ac63b65d24f6dace47f8f08b41d + token: 744306d1a46646e5a32342cd58d350adbec4d47318f72c074c56ce6b032bea19 token_last_characters: null user: 1 model: sentry.apitoken pk: 2 - fields: application: null - date_added: '2023-11-22T17:03:21.586Z' + date_added: '2023-11-30T19:30:40.896Z' expires_at: null name: create_exhaustive_global_configs - refresh_token: 7b291cd50c08c43514fb6544a10c4f822e8b069f4f13b852effc73be043d74e5 + refresh_token: 58e71f2e3b42f37d428face65275d7e5cd13e55c1176ead53abc29ba50054bf3 scope_list: '[]' scopes: '0' - token: 05aec126e32c464b40273a51d21147867f5494a636655c9ccd05d41588042afe + token: 3b4118073444b71122e229955cda61b8fe330ba34615c6ce71dff801bf017746 token_last_characters: null user: 1 model: sentry.apitoken pk: 3 - fields: application: 1 - code: 7dc331c1ceb58bdb680212c69bc6e30cb03e5aa277038bbb5050b776355bd083 + code: 65bd90551f67b47431cedcef66b2dcea46c155fa77fd97c9520f9816e98a1509 expires_at: '2022-01-01T11:11:00.000Z' redirect_uri: https://example.com scope_list: '[''openid'', ''profile'', ''email'']' @@ -1057,7 +1057,7 @@ source: tests/sentry/backup/test_releases.py pk: 2 - fields: application: 1 - date_added: '2023-11-22T17:03:21.468Z' + date_added: '2023-11-30T19:30:40.697Z' scope_list: '[]' scopes: '0' user: 1 @@ -1065,7 +1065,7 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: application: null - date_added: '2023-11-22T17:03:21.585Z' + date_added: '2023-11-30T19:30:40.890Z' scope_list: '[]' scopes: '0' user: 1 @@ -1073,11 +1073,11 @@ source: tests/sentry/backup/test_releases.py pk: 2 - fields: comparison_delta: null - date_added: '2023-11-22T17:03:21.162Z' - date_modified: '2023-11-22T17:03:21.162Z' + date_added: '2023-11-30T19:30:40.162Z' + date_modified: '2023-11-30T19:30:40.162Z' include_all_projects: true - name: Fast Woodcock - organization: 4553018634141712 + name: Adjusted Bobcat + organization: 4553064511897616 owner: null resolve_threshold: null snuba_query: 1 @@ -1090,11 +1090,11 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: comparison_delta: null - date_added: '2023-11-22T17:03:21.202Z' - date_modified: '2023-11-22T17:03:21.202Z' + date_added: '2023-11-30T19:30:40.200Z' + date_modified: '2023-11-30T19:30:40.200Z' include_all_projects: false - name: Evolved Rabbit - organization: 4553018634141712 + name: Deep Dove + organization: 4553064511897616 owner: null resolve_threshold: null snuba_query: 2 @@ -1118,13 +1118,13 @@ source: tests/sentry/backup/test_releases.py - fields: api_grant: null api_token: 1 - date_added: '2023-11-22T17:03:21.358Z' + date_added: '2023-11-30T19:30:40.428Z' date_deleted: null - date_updated: '2023-11-22T17:03:21.376Z' - organization_id: 4553018634141712 + date_updated: '2023-11-30T19:30:40.465Z' + organization_id: 4553064511897616 sentry_app: 1 status: 1 - uuid: 69dbda3a-7f60-4ede-a1fd-bee6c4f810d8 + uuid: ace3a80b-0c77-4ca1-b338-641b5754a988 model: sentry.sentryappinstallation pk: 1 - fields: @@ -1162,12 +1162,12 @@ source: tests/sentry/backup/test_releases.py type: alert-rule-action sentry_app: 1 type: alert-rule-action - uuid: 7c3fdc1d-59d5-4d12-bbe9-43da9db3490e + uuid: 7a81bbef-4f2c-4949-9df4-c70ab45edd3a model: sentry.sentryappcomponent pk: 1 - fields: alert_rule: null - date_added: '2023-11-22T17:03:21.107Z' + date_added: '2023-11-30T19:30:40.079Z' owner_id: 1 rule: 1 until: null @@ -1175,7 +1175,7 @@ source: tests/sentry/backup/test_releases.py model: sentry.rulesnooze pk: 1 - fields: - date_added: '2023-11-22T17:03:21.106Z' + date_added: '2023-11-30T19:30:40.078Z' rule: 1 type: 1 user_id: null @@ -1183,26 +1183,26 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: action: 1 - project: 4553018634141714 + project: 4553064511897618 model: sentry.notificationactionproject pk: 1 - fields: action: 2 - project: 4553018634141714 + project: 4553064511897618 model: sentry.notificationactionproject pk: 2 - fields: alert_rule: 2 - date_added: '2023-11-22T17:03:21.207Z' + date_added: '2023-11-30T19:30:40.207Z' date_closed: null - date_detected: '2023-11-22T17:03:21.206Z' - date_started: '2023-11-22T17:03:21.206Z' + date_detected: '2023-11-30T19:30:40.205Z' + date_started: '2023-11-30T19:30:40.205Z' detection_uuid: null identifier: 1 - organization: 4553018634141712 + organization: 4553064511897616 status: 1 status_method: 3 - title: Evolving Hamster + title: Decent Hornet type: 2 model: sentry.incident pk: 1 @@ -1210,7 +1210,7 @@ source: tests/sentry/backup/test_releases.py aggregates: null columns: null conditions: '' - date_added: '2023-11-22T17:03:21.219Z' + date_added: '2023-11-30T19:30:40.223Z' field_aliases: null fields: '[]' name: Test Query for test-org @@ -1222,21 +1222,21 @@ source: tests/sentry/backup/test_releases.py - fields: alert_rule: 1 alert_threshold: 100.0 - date_added: '2023-11-22T17:03:21.172Z' - label: Light Ladybug + date_added: '2023-11-30T19:30:40.175Z' + label: Adjusted Caribou resolve_threshold: null threshold_type: null model: sentry.alertruletrigger pk: 1 - fields: alert_rule: 1 - date_added: '2023-11-22T17:03:21.164Z' - project: 4553018634207248 + date_added: '2023-11-30T19:30:40.165Z' + project: 4553064511963152 model: sentry.alertruleexcludedprojects pk: 1 - fields: alert_rule: 1 - date_added: '2023-11-22T17:03:21.168Z' + date_added: '2023-11-30T19:30:40.169Z' previous_alert_rule: null type: 1 user_id: null @@ -1244,30 +1244,30 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: alert_rule: 2 - date_added: '2023-11-22T17:03:21.204Z' + date_added: '2023-11-30T19:30:40.203Z' previous_alert_rule: null type: 1 user_id: null model: sentry.alertruleactivity pk: 2 - fields: - date_added: '2023-11-22T17:03:21.212Z' - end: '2023-11-22T17:03:21.212Z' + date_added: '2023-11-30T19:30:40.214Z' + end: '2023-11-30T19:30:40.213Z' period: 1 - start: '2023-11-21T17:03:21.212Z' + start: '2023-11-29T19:30:40.213Z' values: '[[1.0, 2.0, 3.0], [1.5, 2.5, 3.5]]' model: sentry.timeseriessnapshot pk: 1 - fields: actor_id: 1 application_id: 1 - date_added: '2023-11-22T17:03:21.374Z' + date_added: '2023-11-30T19:30:40.456Z' events: '[]' - guid: d10071be032a4f55982539f3e86c1aec + guid: 2f0b9565ae4e436bad6c925e7b2449ea installation_id: 1 - organization_id: 4553018634141712 + organization_id: 4553064511897616 project_id: null - secret: a3c9202b08771be6cf72ee3133151ddd8c3a5405d8d202d4221cc4f96cdf98d5 + secret: b4468d5d398e660c271ec94a48be67d7ce557b65980ccb20e1fd3ae9569b4b1d status: 0 url: https://example.com/webhook version: 0 @@ -1276,40 +1276,40 @@ source: tests/sentry/backup/test_releases.py - fields: actor_id: 6 application_id: 1 - date_added: '2023-11-22T17:03:21.571Z' + date_added: '2023-11-30T19:30:40.859Z' events: '[''event.created'']' - guid: de54e773e49143d6bac6180ce81c971a + guid: 6b05fe935113493e8dd946e0ea6a2d82 installation_id: 1 - organization_id: 4553018634141712 - project_id: 4553018634207251 - secret: 1421c2af76292c00444445ac032c7af497677ddf9af679fa9d0e147b68397a8d + organization_id: 4553064511897616 + project_id: 4553064511963155 + secret: 1d7010d360ddccf9a384ef819356f79b09602f8d1154513ccd09a9e346a0a9fc status: 0 url: https://example.com/sentry/webhook version: 0 model: sentry.servicehook pk: 2 - fields: - date_added: '2023-11-22T17:03:21.216Z' + date_added: '2023-11-30T19:30:40.219Z' incident: 1 - target_run_date: '2023-11-22T21:03:21.216Z' + target_run_date: '2023-11-30T23:30:40.219Z' model: sentry.pendingincidentsnapshot pk: 1 - fields: alert_rule_trigger: 1 - date_added: '2023-11-22T17:03:21.215Z' - date_modified: '2023-11-22T17:03:21.215Z' + date_added: '2023-11-30T19:30:40.218Z' + date_modified: '2023-11-30T19:30:40.218Z' incident: 1 status: 1 model: sentry.incidenttrigger pk: 1 - fields: - date_added: '2023-11-22T17:03:21.214Z' + date_added: '2023-11-30T19:30:40.216Z' incident: 1 user_id: 1 model: sentry.incidentsubscription pk: 1 - fields: - date_added: '2023-11-22T17:03:21.213Z' + date_added: '2023-11-30T19:30:40.215Z' event_stats_snapshot: 1 incident: 1 total_events: 1 @@ -1318,7 +1318,7 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: comment: hello test-org - date_added: '2023-11-22T17:03:21.211Z' + date_added: '2023-11-30T19:30:40.212Z' incident: 1 notification_uuid: null previous_value: null @@ -1329,13 +1329,13 @@ source: tests/sentry/backup/test_releases.py pk: 1 - fields: alert_rule_trigger: 1 - date_added: '2023-11-22T17:03:21.174Z' + date_added: '2023-11-30T19:30:40.177Z' query_subscription: 1 model: sentry.alertruletriggerexclusion pk: 1 - fields: alert_rule_trigger: 1 - date_added: '2023-11-22T17:03:21.199Z' + date_added: '2023-11-30T19:30:40.195Z' integration_id: null sentry_app_config: null sentry_app_id: null diff --git a/tests/sentry/backup/test_releases.py b/tests/sentry/backup/test_releases.py index 012b67ac5ee028..b3e8fa950c9cbe 100644 --- a/tests/sentry/backup/test_releases.py +++ b/tests/sentry/backup/test_releases.py @@ -97,6 +97,17 @@ def test_at_head(self): # Return the export so that we can ensure that all models were seen. return exported + def test_at_23_11_2(self): + with tempfile.TemporaryDirectory() as tmp_dir: + _, snapshot_refval = read_snapshot_file(self.get_snapshot_path("23.11.2")) + snapshot_data = yaml.safe_load(snapshot_refval) + tmp_path = Path(tmp_dir).joinpath(f"{self._testMethodName}.json") + with open(tmp_path, "w") as f: + json.dump(snapshot_data, f) + + with open(tmp_path, "rb") as f: + import_in_global_scope(f) + def test_at_23_11_1(self): with tempfile.TemporaryDirectory() as tmp_dir: _, snapshot_refval = read_snapshot_file(self.get_snapshot_path("23.11.1"))
4a769087dcd2fdf9d9834c2992c624decb0e392e
2025-02-22 02:54:22
Colleen O'Rourke
feat(ACI): Detector details PUT endpoint (#84098)
false
Detector details PUT endpoint (#84098)
feat
diff --git a/src/sentry/workflow_engine/endpoints/project_detector_details.py b/src/sentry/workflow_engine/endpoints/project_detector_details.py index 8ea11df067c7c7..087cc47ad8b3fb 100644 --- a/src/sentry/workflow_engine/endpoints/project_detector_details.py +++ b/src/sentry/workflow_engine/endpoints/project_detector_details.py @@ -1,4 +1,5 @@ -from drf_spectacular.utils import extend_schema +from drf_spectacular.utils import PolymorphicProxySerializer, extend_schema +from rest_framework import status from rest_framework.request import Request from rest_framework.response import Response @@ -18,7 +19,9 @@ from sentry.apidocs.parameters import DetectorParams, GlobalParams from sentry.deletions.models.scheduleddeletion import RegionScheduledDeletion from sentry.grouping.grouptype import ErrorGroupType +from sentry.issues import grouptype from sentry.models.project import Project +from sentry.workflow_engine.endpoints.project_detector_index import get_detector_validator from sentry.workflow_engine.endpoints.serializers import DetectorSerializer from sentry.workflow_engine.models import Detector @@ -74,6 +77,43 @@ def get(self, request: Request, project: Project, detector: Detector): ) return Response(serialized_detector) + @extend_schema( + operation_id="Update a Detector", + parameters=[ + GlobalParams.ORG_ID_OR_SLUG, + GlobalParams.PROJECT_ID_OR_SLUG, + DetectorParams.DETECTOR_ID, + ], + request=PolymorphicProxySerializer( + "GenericDetectorSerializer", + serializers=[ + gt.detector_validator for gt in grouptype.registry.all() if gt.detector_validator + ], + resource_type_field_name=None, + ), + responses={ + 200: DetectorSerializer, + 400: RESPONSE_BAD_REQUEST, + 401: RESPONSE_UNAUTHORIZED, + 403: RESPONSE_FORBIDDEN, + 404: RESPONSE_NOT_FOUND, + }, + ) + def put(self, request: Request, project: Project, detector: Detector) -> Response: + """ + Update a Detector + ```````````````` + Update an existing detector for a project. + """ + group_type = request.data.get("detector_type") or detector.group_type.slug + validator = get_detector_validator(request, project, group_type, detector) + + if not validator.is_valid(): + return Response(validator.errors, status=status.HTTP_400_BAD_REQUEST) + + updated_detector = validator.save() + return Response(serialize(updated_detector, request.user), status=status.HTTP_200_OK) + @extend_schema( operation_id="Delete a Detector", parameters=[ diff --git a/src/sentry/workflow_engine/endpoints/urls.py b/src/sentry/workflow_engine/endpoints/urls.py index 5b1c1b67d59197..8bb6f4def62b37 100644 --- a/src/sentry/workflow_engine/endpoints/urls.py +++ b/src/sentry/workflow_engine/endpoints/urls.py @@ -9,7 +9,6 @@ # Remaining Detector Endpoints # - GET /detector w/ filters -# - PUT /detector/:id # Remaining Workflows Endpoints # - GET /workflow w/ filters diff --git a/src/sentry/workflow_engine/endpoints/validators/metric_alert_detector.py b/src/sentry/workflow_engine/endpoints/validators/metric_alert_detector.py index c817b2c89d2b6d..a83b5a33579658 100644 --- a/src/sentry/workflow_engine/endpoints/validators/metric_alert_detector.py +++ b/src/sentry/workflow_engine/endpoints/validators/metric_alert_detector.py @@ -1,15 +1,40 @@ +from datetime import timedelta +from typing import Any, TypedDict + from rest_framework import serializers +from sentry.snuba.models import QuerySubscription, SnubaQuery, SnubaQueryEventType from sentry.snuba.snuba_query_validator import SnubaQueryValidator +from sentry.snuba.subscriptions import update_snuba_query from sentry.workflow_engine.endpoints.validators.base import ( BaseDataConditionGroupValidator, BaseDetectorTypeValidator, NumericComparisonConditionValidator, ) -from sentry.workflow_engine.models.data_condition import Condition +from sentry.workflow_engine.models import DataConditionGroup, DataSource, Detector +from sentry.workflow_engine.models.data_condition import Condition, DataCondition from sentry.workflow_engine.types import DetectorPriorityLevel +class DataConditionType(TypedDict): + id: int | None + comparison: int + type: Condition + condition_result: DetectorPriorityLevel + condition_group_id: int + + +class DataSourceType(TypedDict): + query_type: int + dataset: str + query: str + aggregate: str + time_window: float + resolution: float + environment: str + event_types: list[SnubaQueryEventType] + + class MetricAlertComparisonConditionValidator(NumericComparisonConditionValidator): supported_conditions = frozenset((Condition.GREATER, Condition.LESS)) supported_condition_results = frozenset( @@ -38,3 +63,84 @@ def validate(self, attrs): if len(conditions) > 2: raise serializers.ValidationError("Too many conditions") return attrs + + def update_data_conditions(self, instance: Detector, data_conditions: list[DataConditionType]): + """ + Update the data condition if it already exists, create one if it does not + """ + if instance.workflow_condition_group: + try: + data_condition_group = DataConditionGroup.objects.get( + id=instance.workflow_condition_group.id + ) + except DataConditionGroup.DoesNotExist: + raise serializers.ValidationError("DataConditionGroup not found, can't update") + # TODO make one if it doesn't exist and data is passed? + + for data_condition in data_conditions: + if not data_condition.get("id"): + current_data_condition = None + else: + try: + current_data_condition = DataCondition.objects.get( + id=str(data_condition.get("id")), condition_group=data_condition_group + ) + except DataCondition.DoesNotExist: + continue + + if current_data_condition: + current_data_condition.update(**data_condition) + current_data_condition.save() + else: + DataCondition.objects.create( + type=data_condition["type"], + comparison=data_condition["comparison"], + condition_result=data_condition["condition_result"], + condition_group=data_condition_group, + ) + return data_condition_group + + def update_data_source(self, instance: Detector, data_source: DataSourceType): + try: + source_instance = DataSource.objects.get(detector=instance) + except DataSource.DoesNotExist: + return + if source_instance: + try: + query_subscription = QuerySubscription.objects.get(id=source_instance.source_id) + except QuerySubscription.DoesNotExist: + raise serializers.ValidationError("QuerySubscription not found, can't update") + if query_subscription: + try: + snuba_query = SnubaQuery.objects.get(id=query_subscription.snuba_query.id) + except SnubaQuery.DoesNotExist: + raise serializers.ValidationError("SnubaQuery not found, can't update") + + event_types = SnubaQueryEventType.objects.filter(snuba_query_id=snuba_query.id) + update_snuba_query( + snuba_query=snuba_query, + query_type=data_source.get("query_type", snuba_query.type), + dataset=data_source.get("dataset", snuba_query.dataset), + query=data_source.get("query", snuba_query.query), + aggregate=data_source.get("aggregate", snuba_query.aggregate), + time_window=timedelta(minutes=data_source.get("time_window", snuba_query.time_window)), + resolution=timedelta(seconds=data_source.get("resolution", snuba_query.resolution)), + environment=data_source.get("environment", snuba_query.environment), + event_types=data_source.get("event_types", [event_type for event_type in event_types]), + ) + + def update(self, instance: Detector, validated_data: dict[str, Any]): + instance.name = validated_data.get("name", instance.name) + instance.type = validated_data.get("detector_type", instance.group_type).slug + condition_group = validated_data.pop("condition_group") + data_conditions: list[DataConditionType] = condition_group.get("conditions") + + if data_conditions: + self.update_data_conditions(instance, data_conditions) + + data_source: DataSourceType = validated_data.pop("data_source") + if data_source: + self.update_data_source(instance, data_source) + + instance.save() + return instance diff --git a/src/sentry/workflow_engine/models/detector.py b/src/sentry/workflow_engine/models/detector.py index 4c0658b76b1051..c2172fa09f636b 100644 --- a/src/sentry/workflow_engine/models/detector.py +++ b/src/sentry/workflow_engine/models/detector.py @@ -74,8 +74,11 @@ class Meta(OwnerModel.Meta): } @property - def group_type(self) -> builtins.type[GroupType] | None: - return grouptype.registry.get_by_slug(self.type) + def group_type(self) -> builtins.type[GroupType]: + group_type = grouptype.registry.get_by_slug(self.type) + if not group_type: + raise ValueError(f"Group type {self.type} not registered") + return group_type @property def detector_handler(self) -> DetectorHandler | None: diff --git a/tests/sentry/workflow_engine/endpoints/test_project_detector_details.py b/tests/sentry/workflow_engine/endpoints/test_project_detector_details.py index 9f61e1b2d1e662..80953d7ab9aecf 100644 --- a/tests/sentry/workflow_engine/endpoints/test_project_detector_details.py +++ b/tests/sentry/workflow_engine/endpoints/test_project_detector_details.py @@ -1,20 +1,72 @@ +from datetime import timedelta + +import pytest +from django.utils import timezone + from sentry.api.serializers import serialize from sentry.deletions.models.scheduleddeletion import RegionScheduledDeletion from sentry.grouping.grouptype import ErrorGroupType from sentry.incidents.grouptype import MetricAlertFire +from sentry.incidents.utils.constants import INCIDENTS_SNUBA_SUBSCRIPTION_TYPE +from sentry.snuba.dataset import Dataset +from sentry.snuba.models import QuerySubscription, SnubaQuery, SnubaQueryEventType +from sentry.snuba.subscriptions import create_snuba_query, create_snuba_subscription from sentry.testutils.cases import APITestCase from sentry.testutils.outbox import outbox_runner from sentry.testutils.silo import region_silo_test +from sentry.testutils.skips import requires_kafka, requires_snuba +from sentry.workflow_engine.models import ( + DataCondition, + DataConditionGroup, + DataSource, + DataSourceDetector, + Detector, +) +from sentry.workflow_engine.models.data_condition import Condition +from sentry.workflow_engine.types import DetectorPriorityLevel + +pytestmark = [pytest.mark.sentry_metrics, requires_snuba, requires_kafka] [email protected]_ci class ProjectDetectorDetailsBaseTest(APITestCase): endpoint = "sentry-api-0-project-detector-details" def setUp(self): super().setUp() self.login_as(user=self.user) - self.data_source = self.create_data_source(organization=self.organization) - self.data_condition_group = self.create_data_condition_group() + self.environment = self.create_environment( + organization_id=self.organization.id, name="production" + ) + with self.tasks(): + self.snuba_query = create_snuba_query( + query_type=SnubaQuery.Type.ERROR, + dataset=Dataset.Events, + query="hello", + aggregate="count()", + time_window=timedelta(minutes=1), + resolution=timedelta(minutes=1), + environment=self.environment, + event_types=[SnubaQueryEventType.EventType.ERROR], + ) + self.query_subscription = create_snuba_subscription( + project=self.project, + subscription_type=INCIDENTS_SNUBA_SUBSCRIPTION_TYPE, + snuba_query=self.snuba_query, + ) + self.data_source = self.create_data_source( + organization=self.organization, source_id=self.query_subscription.id + ) + self.data_condition_group = self.create_data_condition_group( + organization_id=self.organization.id, + logic_type=DataConditionGroup.Type.ANY, + ) + self.condition = self.create_data_condition( + condition_group=self.data_condition_group, + type=Condition.LESS, + comparison=50, + condition_result=DetectorPriorityLevel.LOW, + ) self.detector = self.create_detector( project_id=self.project.id, name="Test Detector", @@ -24,10 +76,11 @@ def setUp(self): self.data_source_detector = self.create_data_source_detector( data_source=self.data_source, detector=self.detector ) + assert self.detector.data_sources is not None @region_silo_test -class ProjectDetectorIndexGetTest(ProjectDetectorDetailsBaseTest): +class ProjectDetectorDetailsGetTest(ProjectDetectorDetailsBaseTest): def test_simple(self): response = self.get_success_response( self.organization.slug, self.project.slug, self.detector.id @@ -69,3 +122,139 @@ def test_error_group_type(self): assert not RegionScheduledDeletion.objects.filter( model_name="Detector", object_id=error_detector.id ).exists() + + +@region_silo_test +class ProjectDetectorDetailsPutTest(ProjectDetectorDetailsBaseTest): + method = "PUT" + + def setUp(self): + super().setUp() + self.valid_data = { + "id": self.detector.id, + "projectId": self.project.id, + "name": "Updated Detector", + "detectorType": MetricAlertFire.slug, + "dateCreated": self.detector.date_added, + "dateUpdated": timezone.now(), + "dataSource": { + "queryType": self.snuba_query.type, + "dataset": self.snuba_query.dataset, + "query": "updated query", + "aggregate": self.snuba_query.aggregate, + "timeWindow": 5, # minutes + "environment": self.environment.name, + "eventTypes": [event_type.name for event_type in self.snuba_query.event_types], + }, + "conditionGroup": { + "id": self.data_condition_group.id, + "organizationId": self.organization.id, + "logicType": self.data_condition_group.logic_type, + "conditions": [ + { + "id": self.condition.id, + "comparison": 100, + "type": Condition.GREATER, + "conditionResult": DetectorPriorityLevel.HIGH, + "conditionGroupId": self.condition.condition_group.id, + }, + ], + }, + "config": self.detector.config, + } + assert SnubaQuery.objects.get(id=self.snuba_query.id) + + def assert_detector_updated(self, detector): + assert detector.name == "Updated Detector" + assert detector.type == MetricAlertFire.slug + assert detector.project_id == self.project.id + + def assert_condition_group_updated(self, condition_group): + assert condition_group + assert condition_group.logic_type == DataConditionGroup.Type.ANY + assert condition_group.organization_id == self.organization.id + + def assert_data_condition_updated(self, condition): + assert condition.type == Condition.GREATER.value + assert condition.comparison == 100 + assert condition.condition_result == DetectorPriorityLevel.HIGH + + def assert_snuba_query_updated(self, snuba_query): + assert snuba_query.query == "updated query" + assert snuba_query.time_window == 300 # seconds = 5 minutes + + def test_update(self): + with self.tasks(): + response = self.get_success_response( + self.organization.slug, + self.project.slug, + self.detector.id, + **self.valid_data, + status_code=200, + ) + + detector = Detector.objects.get(id=response.data["id"]) + assert response.data == serialize([detector])[0] + self.assert_detector_updated(detector) + + condition_group = detector.workflow_condition_group + self.assert_condition_group_updated(condition_group) + + conditions = list(DataCondition.objects.filter(condition_group=condition_group)) + assert len(conditions) == 1 + condition = conditions[0] + self.assert_data_condition_updated(condition) + + data_source_detector = DataSourceDetector.objects.get(detector=detector) + data_source = DataSource.objects.get(id=data_source_detector.data_source.id) + query_subscription = QuerySubscription.objects.get(id=data_source.source_id) + snuba_query = SnubaQuery.objects.get(id=query_subscription.snuba_query.id) + self.assert_snuba_query_updated(snuba_query) + + def test_update_add_data_condition(self): + """ + Test that we can add an additional data condition + """ + data = {**self.valid_data} + condition_group_data = { + "comparison": 50, + "type": Condition.GREATER, + "conditionResult": DetectorPriorityLevel.MEDIUM, + "conditionGroupId": self.condition.condition_group.id, + } + data["conditionGroup"]["conditions"].append(condition_group_data) + with self.tasks(): + response = self.get_success_response( + self.organization.slug, + self.project.slug, + self.detector.id, + **data, + status_code=200, + ) + + detector = Detector.objects.get(id=response.data["id"]) + condition_group = detector.workflow_condition_group + assert condition_group + conditions = list(DataCondition.objects.filter(condition_group=condition_group)) + assert len(conditions) == 2 + + def test_update_bad_schema(self): + """ + Test when we encounter bad data in the payload + """ + data = {**self.valid_data} + condition_group_data = { + "comparison": "betterThan", + "type": Condition.GREATER, + "conditionResult": DetectorPriorityLevel.MEDIUM, + "conditionGroupId": self.condition.condition_group.id, + } + data["conditionGroup"]["conditions"].append(condition_group_data) + with self.tasks(): + self.get_error_response( + self.organization.slug, + self.project.slug, + self.detector.id, + **data, + status_code=400, + )
8d94439eed6ab3db16aa4abc6dee65f843070123
2024-01-26 23:44:13
anthony sottile
ref: re-enable django 5.x timezone.utc warning (#63946)
false
re-enable django 5.x timezone.utc warning (#63946)
ref
diff --git a/pyproject.toml b/pyproject.toml index 866a68790c51cc..8759b1cbd09ff8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,6 @@ filterwarnings = [ # TODO: after upgrading to django 4.x "ignore:'index_together' is deprecated. Use 'Meta.indexes' in.*", "ignore:Passing unsaved model instances to related filters is deprecated.", - "ignore:The django.utils.timezone.utc alias is deprecated.*", # a bunch of google packages use legacy namespace packages "ignore:pkg_resources is deprecated as an API",
a3a4764810d09e9d97dcc0b8bd54a2e2b4f7f720
2022-05-07 03:15:54
Pierre Massat
fix(profiling): Convert the Apple debug images to Mach-O (#34345)
false
Convert the Apple debug images to Mach-O (#34345)
fix
diff --git a/src/sentry/profiles/task.py b/src/sentry/profiles/task.py index 042801f69e3979..6a12e3d6492fc8 100644 --- a/src/sentry/profiles/task.py +++ b/src/sentry/profiles/task.py @@ -106,7 +106,14 @@ def _symbolicate(profile: MutableMapping[str, Any]) -> MutableMapping[str, Any]: symbolicator = Symbolicator(project=project, event_id=profile["profile_id"]) for i in profile["debug_meta"]["images"]: - i["debug_id"] = i["uuid"] + if i["type"] == "apple": + i.update( + { + "type": "macho", + "debug_file": i["name"], + "debug_id": i["uuid"], + } + ) for s in profile["sampled_profile"]["samples"]: for f in s["frames"]:
ea799cd6f41c03d464cf5a81861c1a72171b68ca
2019-01-03 00:31:53
Dan Fuller
feat(api): Add list of features to ProjectSummarySerializer
false
Add list of features to ProjectSummarySerializer
feat
diff --git a/src/sentry/api/serializers/models/project.py b/src/sentry/api/serializers/models/project.py index a0d909fc36c3fb..63dd56be6afadd 100644 --- a/src/sentry/api/serializers/models/project.py +++ b/src/sentry/api/serializers/models/project.py @@ -155,7 +155,7 @@ def get_attrs(self, item_list, user): result[item]['stats'] = stats[item.id] return result - def serialize(self, obj, attrs, user): + def get_feature_list(self, obj, user): from sentry import features from sentry.features.base import ProjectFeature @@ -172,6 +172,10 @@ def serialize(self, obj, attrs, user): if obj.flags.has_releases: feature_list.add('releases') + return feature_list + + def serialize(self, obj, attrs, user): + feature_list = self.get_feature_list(obj, user) status_label = STATUS_LABELS.get(obj.status, 'unknown') @@ -298,6 +302,7 @@ def get_attrs(self, item_list, user): return attrs def serialize(self, obj, attrs, user): + feature_list = self.get_feature_list(obj, user) context = { 'team': attrs['teams'][0] if attrs['teams'] else None, 'teams': attrs['teams'], @@ -308,6 +313,7 @@ def serialize(self, obj, attrs, user): 'isMember': attrs['is_member'], 'hasAccess': attrs['has_access'], 'dateCreated': obj.date_added, + 'features': feature_list, 'firstEvent': obj.first_event, 'platform': obj.platform, 'platforms': attrs['platforms'], diff --git a/tests/sentry/api/serializers/test_project.py b/tests/sentry/api/serializers/test_project.py index edd22ece481072..972b3058dc17a1 100644 --- a/tests/sentry/api/serializers/test_project.py +++ b/tests/sentry/api/serializers/test_project.py @@ -155,6 +155,8 @@ def test_simple(self): organization = self.create_organization(owner=user) team = self.create_team(organization=organization) project = self.create_project(teams=[team], organization=organization, name='foo') + project.flags.has_releases = True + project.save() release = Release.objects.create( organization_id=organization.id, @@ -182,6 +184,13 @@ def test_simple(self): result = serialize(project, user, ProjectSummarySerializer()) + assert result['id'] == six.text_type(project.id) + assert result['name'] == project.name + assert result['slug'] == project.slug + assert result['firstEvent'] == project.first_event + assert 'releases' in result['features'] + assert result['platform'] == project.platform + assert result['latestDeploys'] == { 'production': {'dateFinished': date, 'version': '1'} }
35f695242b0ea79cb68c492dc6292d0fab5e572e
2020-03-26 00:40:03
Evan Purkhiser
chore(ui): Remove Box/Flex from accountEmails (#17893)
false
Remove Box/Flex from accountEmails (#17893)
chore
diff --git a/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx b/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx index a1858458ed695a..e6b57aa964faca 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx @@ -1,4 +1,3 @@ -import {Flex, Box} from 'reflexbox'; import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; @@ -15,6 +14,7 @@ import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader import Tag from 'app/views/settings/components/tag'; import accountEmailsFields from 'app/data/forms/accountEmails'; import space from 'app/styles/space'; +import ButtonBar from 'app/components/buttonBar'; const ENDPOINT = '/users/me/emails/'; @@ -47,15 +47,13 @@ class EmailRow extends React.Component { const {email, isPrimary, isVerified, hideRemove} = this.props; return ( - <PanelItem justifyContent="space-between"> - <Flex alignItems="center"> + <EmailItem> + <EmailTags> {email} - {!isVerified && ( - <TagWithSpace priority="warning">{t('Unverified')}</TagWithSpace> - )} - {isPrimary && <TagWithSpace priority="success">{t('Primary')}</TagWithSpace>} - </Flex> - <Flex> + {!isVerified && <Tag priority="warning">{t('Unverified')}</Tag>} + {isPrimary && <Tag priority="success">{t('Primary')}</Tag>} + </EmailTags> + <ButtonBar gap={1}> {!isPrimary && isVerified && ( <Button size="small" onClick={this.handleSetPrimary}> {t('Set as primary')} @@ -67,18 +65,16 @@ class EmailRow extends React.Component { </Button> )} {!hideRemove && !isPrimary && ( - <Box ml={1}> - <Button - data-test-id="remove" - priority="danger" - size="small" - icon="icon-trash" - onClick={this.handleRemove} - /> - </Box> + <Button + data-test-id="remove" + priority="danger" + size="small" + icon="icon-trash" + onClick={this.handleRemove} + /> )} - </Flex> - </PanelItem> + </ButtonBar> + </EmailItem> ); } } @@ -194,6 +190,13 @@ class AccountEmails extends AsyncView { export default AccountEmails; -const TagWithSpace = styled(Tag)` - margin-left: ${space(1)}; +const EmailTags = styled('div')` + display: grid; + grid-auto-flow: column; + grid-gap: ${space(1)}; + align-items: center; +`; + +const EmailItem = styled(PanelItem)` + justify-content: space-between; `;
8a609c6c675600e4785a3fe2cbbc9938f2c86bb1
2023-01-27 21:09:17
Jonas
fix(profiling): remove zoomAtFrame (#43783)
false
remove zoomAtFrame (#43783)
fix
diff --git a/static/app/components/profiling/flamegraph/flamegraph.tsx b/static/app/components/profiling/flamegraph/flamegraph.tsx index 3e2a21d1c19dd0..4a16d01a3a5ac5 100644 --- a/static/app/components/profiling/flamegraph/flamegraph.tsx +++ b/static/app/components/profiling/flamegraph/flamegraph.tsx @@ -122,8 +122,7 @@ function Flamegraph(props: FlamegraphProps): ReactElement { const flamegraphTheme = useFlamegraphTheme(); const position = useFlamegraphZoomPosition(); const {sorting, view, xAxis} = useFlamegraphPreferences(); - const {threadId, selectedRoot, zoomIntoFrame, highlightFrames} = - useFlamegraphProfiles(); + const {threadId, selectedRoot, highlightFrames} = useFlamegraphProfiles(); const [flamegraphCanvasRef, setFlamegraphCanvasRef] = useState<HTMLCanvasElement | null>(null); @@ -287,26 +286,7 @@ function Flamegraph(props: FlamegraphProps): ReactElement { previousView.configView.withHeight(newView.configView.height) ); } - } else if ( - // When the profile changes, it may be because it finally loaded and if a zoom - // was specified, this should be used as the initial view. - defined(zoomIntoFrame) - ) { - const newConfigView = computeConfigViewWithStrategy( - 'min', - newView.configView, - new Rect( - zoomIntoFrame.start, - zoomIntoFrame.depth, - zoomIntoFrame.end - zoomIntoFrame.start, - 1 - ) - ); - newView.setConfigView(newConfigView); - return newView; - } - - if (defined(highlightFrames)) { + } else if (defined(highlightFrames)) { const frames = flamegraph.findAllMatchingFrames( highlightFrames.name, highlightFrames.package @@ -328,9 +308,8 @@ function Flamegraph(props: FlamegraphProps): ReactElement { // Because we render empty flamechart while we fetch the data, we need to make sure // to have some heuristic when the data is fetched to determine if we should // initialize the config view to the full view or a predefined value - if ( + else if ( !defined(highlightFrames) && - !defined(zoomIntoFrame) && position.view && !position.view.isEmpty() && previousView?.model === LOADING_OR_FALLBACK_FLAMEGRAPH @@ -346,7 +325,7 @@ function Flamegraph(props: FlamegraphProps): ReactElement { // We skip position.view dependency because it will go into an infinite loop // eslint-disable-next-line react-hooks/exhaustive-deps - [flamegraph, flamegraphCanvas, flamegraphTheme, zoomIntoFrame, xAxis] + [flamegraph, flamegraphCanvas, flamegraphTheme, xAxis] ); const uiFramesView = useMemoWithPrevious<CanvasView<UIFrames> | null>( diff --git a/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContext.tsx b/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContext.tsx index 063e34765a1c91..c1c86577c940ed 100644 --- a/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContext.tsx +++ b/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContext.tsx @@ -14,7 +14,6 @@ export const DEFAULT_FLAMEGRAPH_STATE: FlamegraphState = { selectedRoot: null, threadId: null, highlightFrames: null, - zoomIntoFrame: null, }, position: { view: Rect.Empty(), diff --git a/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContextProvider.tsx b/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContextProvider.tsx index c98593cf31557f..86b6aeedccaf3e 100644 --- a/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContextProvider.tsx +++ b/static/app/utils/profiling/flamegraph/flamegraphStateProvider/flamegraphContextProvider.tsx @@ -86,7 +86,6 @@ export function FlamegraphStateProvider( threadId: props.initialState?.profiles?.threadId ?? DEFAULT_FLAMEGRAPH_STATE.profiles.threadId, - zoomIntoFrame: null, }, position: { view: (props.initialState?.position?.view ?? @@ -180,11 +179,8 @@ export function FlamegraphStateProvider( if (defined(candidate)) { dispatch({ - type: 'jump to frame', - payload: { - frame: candidate.frame, - threadId: candidate.threadId, - }, + type: 'set thread id', + payload: candidate.threadId, }); return; } diff --git a/static/app/utils/profiling/flamegraph/flamegraphStateProvider/reducers/flamegraphProfiles.tsx b/static/app/utils/profiling/flamegraph/flamegraphStateProvider/reducers/flamegraphProfiles.tsx index e454e36bf4bbc7..a7ebd5e8edc4dd 100644 --- a/static/app/utils/profiling/flamegraph/flamegraphStateProvider/reducers/flamegraphProfiles.tsx +++ b/static/app/utils/profiling/flamegraph/flamegraphStateProvider/reducers/flamegraphProfiles.tsx @@ -18,25 +18,12 @@ type SetHighlightAllFrames = { type: 'set highlight all frames'; }; -type JumpToView = { - payload: { - frame: FlamegraphFrame; - threadId?: number; - }; - type: 'jump to frame'; -}; - -type FlamegraphProfilesAction = - | SetHighlightAllFrames - | SetProfilesThreadId - | SetRootNode - | JumpToView; +type FlamegraphProfilesAction = SetHighlightAllFrames | SetProfilesThreadId | SetRootNode; export type FlamegraphProfiles = { highlightFrames: {name: string; package: string} | null; selectedRoot: FlamegraphFrame | null; threadId: number | null; - zoomIntoFrame: FlamegraphFrame | null; }; export function flamegraphProfilesReducer( @@ -58,17 +45,9 @@ export function flamegraphProfilesReducer( return { ...state, selectedRoot: null, - zoomIntoFrame: null, threadId: action.payload, }; } - case 'jump to frame': { - return { - ...state, - threadId: action.payload.threadId ?? state.threadId, - zoomIntoFrame: action.payload.frame, - }; - } default: { return state; }
89cf6145627c95d9810fd45678c326190b5cddf1
2024-01-18 22:29:26
Colleen O'Rourke
ref(slack): Add support for mentions (#63390)
false
Add support for mentions (#63390)
ref
diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index 199c2ca7e5a287..9280bf1ed4a7c0 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -1888,6 +1888,8 @@ def custom_parameter_sort(parameter: dict) -> tuple[str, int]: "organizations:spike-protection-decay-heuristic": False, # Enable Slack messages using Block Kit "organizations:slack-block-kit": False, + # Enable new Slack message formatting + "organizations:slack-formatting-update": False, # Enable basic SSO functionality, providing configurable single sign on # using services like GitHub / Google. This is *not* the same as the signup # and login with Github / Azure DevOps that sentry.io provides. diff --git a/src/sentry/features/__init__.py b/src/sentry/features/__init__.py index 721224fc56ac1b..0a51daa68e9007 100644 --- a/src/sentry/features/__init__.py +++ b/src/sentry/features/__init__.py @@ -261,6 +261,7 @@ default_manager.add("organizations:session-replay-weekly-email", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) default_manager.add("organizations:set-grouping-config", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) default_manager.add("organizations:slack-block-kit", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) +default_manager.add("organizations:slack-formatting-update", OrganizationFeature, FeatureHandlerStrategy.INTERNAL) default_manager.add("organizations:slack-overage-notifications", OrganizationFeature, FeatureHandlerStrategy.REMOTE) default_manager.add("organizations:source-maps-debugger-blue-thunder-edition", OrganizationFeature, FeatureHandlerStrategy.REMOTE) default_manager.add("organizations:sourcemaps-bundle-flat-file-indexing", OrganizationFeature, FeatureHandlerStrategy.REMOTE) diff --git a/src/sentry/integrations/slack/actions/notification.py b/src/sentry/integrations/slack/actions/notification.py index ebb4be42f83512..e96d4573dba4c7 100644 --- a/src/sentry/integrations/slack/actions/notification.py +++ b/src/sentry/integrations/slack/actions/notification.py @@ -22,13 +22,16 @@ class SlackNotifyServiceAction(IntegrationEventAction): id = "sentry.integrations.slack.notify_action.SlackNotifyServiceAction" form_cls = SlackNotifyServiceForm - label = "Send a notification to the {workspace} Slack workspace to {channel} (optionally, an ID: {channel_id}) and show tags {tags} in notification" prompt = "Send a Slack notification" provider = "slack" integration_key = "workspace" def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) + # XXX(CEO): when removing the feature flag, put `label` back up as a class var + self.label = "Send a notification to the {workspace} Slack workspace to {channel} (optionally, an ID: {channel_id}) and show tags {tags} in notification" # type: ignore + if features.has("organizations:slack-formatting-update", self.project.organization): + self.label = "Send a notification to the {workspace} Slack workspace to {channel} (optionally, an ID: {channel_id}) and show tags {tags} and mentions {mentions} in notification" # type: ignore self.form_fields = { "workspace": { "type": "choice", @@ -38,6 +41,11 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: "channel_id": {"type": "string", "placeholder": "e.g., CA2FRA079 or UA1J9RTE1"}, "tags": {"type": "string", "placeholder": "e.g., environment,user,my_tag"}, } + if features.has("organizations:slack-formatting-update", self.project.organization): + self.form_fields["mentions"] = { + "type": "string", + "placeholder": "e.g. @jane, @on-call-team", + } def after( self, event: GroupEvent, state: EventState, notification_uuid: Optional[str] = None @@ -65,6 +73,7 @@ def send_notification(event: GroupEvent, futures: Sequence[RuleFuture]) -> None: tags=tags, rules=rules, notification_uuid=notification_uuid, + mentions=self.get_option("mentions", ""), ) if additional_attachment: for block in additional_attachment: @@ -127,6 +136,15 @@ def send_notification(event: GroupEvent, futures: Sequence[RuleFuture]) -> None: def render_label(self) -> str: tags = self.get_tags_list() + if features.has("organizations:slack-formatting-update", self.project.organization): + return self.label.format( + workspace=self.get_integration_name(), + channel=self.get_option("channel"), + channel_id=self.get_option("channel_id"), + tags="[{}]".format(", ".join(tags)), + mentions=self.get_option("mentions", ""), + ) + return self.label.format( workspace=self.get_integration_name(), channel=self.get_option("channel"), diff --git a/src/sentry/integrations/slack/message_builder/base/block.py b/src/sentry/integrations/slack/message_builder/base/block.py index 2321865b405713..ef29aaa84e0e3b 100644 --- a/src/sentry/integrations/slack/message_builder/base/block.py +++ b/src/sentry/integrations/slack/message_builder/base/block.py @@ -45,7 +45,6 @@ def get_tags_block(tags) -> SlackBlock: title = tag["title"] value = tag["value"] fields.append({"type": "mrkdwn", "text": f"*{title}:*\n{value}"}) - return {"type": "section", "fields": fields} @staticmethod diff --git a/src/sentry/integrations/slack/message_builder/issues.py b/src/sentry/integrations/slack/message_builder/issues.py index 70059cb88a7ae2..1076feec464cb6 100644 --- a/src/sentry/integrations/slack/message_builder/issues.py +++ b/src/sentry/integrations/slack/message_builder/issues.py @@ -300,6 +300,7 @@ def __init__( recipient: RpcActor | None = None, is_unfurl: bool = False, skip_fallback: bool = False, + mentions: str | None = None, ) -> None: super().__init__() self.group = group @@ -314,6 +315,7 @@ def __init__( self.recipient = recipient self.is_unfurl = is_unfurl self.skip_fallback = skip_fallback + self.mentions = mentions @property def escape_text(self) -> bool: @@ -385,7 +387,6 @@ def build(self, notification_uuid: str | None = None) -> Union[SlackBlock, Slack ) # build up the blocks for newer issue alert formatting # - tags = get_tags(event_for_tags, self.tags) # build title block title_link = get_title_link( @@ -407,6 +408,14 @@ def build(self, notification_uuid: str | None = None) -> Union[SlackBlock, Slack if tags: blocks.append(self.get_tags_block(tags)) + # add mentions + if ( + features.has("organizations:slack-formatting-update", self.group.project.organization) + and self.mentions + ): + mentions_text = f"Mentions: {self.mentions}" + blocks.append(self.get_markdown_block(mentions_text)) + # build footer block timestamp = None if not self.issue_details: @@ -458,6 +467,7 @@ def build_group_attachment( issue_details: bool = False, is_unfurl: bool = False, notification_uuid: str | None = None, + mentions: str | None = None, ) -> Union[SlackBlock, SlackAttachment]: return SlackIssuesMessageBuilder( @@ -470,4 +480,5 @@ def build_group_attachment( link_to_event, issue_details, is_unfurl=is_unfurl, + mentions=mentions, ).build(notification_uuid=notification_uuid) diff --git a/tests/sentry/integrations/slack/test_message_builder.py b/tests/sentry/integrations/slack/test_message_builder.py index e76cef6b0894fe..b40b74c4fc1b7e 100644 --- a/tests/sentry/integrations/slack/test_message_builder.py +++ b/tests/sentry/integrations/slack/test_message_builder.py @@ -48,6 +48,8 @@ def build_test_message_blocks( group: Group, event: Event | None = None, link_to_event: bool = False, + tags: dict[str, str] | None = None, + mentions: str | None = None, ) -> dict[str, Any]: project = group.project @@ -66,44 +68,66 @@ def build_test_message_blocks( event_date = "<!date^{:.0f}^{} at {} | Sentry Issue>".format( to_timestamp(timestamp), "{date_pretty}", "{time}" ) - return { - "blocks": [ + blocks: list[dict[str, Any]] = [ + { + "type": "section", + "text": {"type": "mrkdwn", "text": f"<{title_link}|*{formatted_title}*> \n"}, + "block_id": f'{{"issue":{group.id}}}', + }, + ] + if tags: + tags_section = { + "type": "section", + "fields": [ + {"type": "mrkdwn", "text": f"*{key}:*\n{value}"} for key, value in tags.items() + ], + } + blocks.append(tags_section) + + if mentions: + mentions_text = f"Mentions: {mentions}" + mentions_section = { + "type": "section", + "text": {"type": "mrkdwn", "text": mentions_text}, + } + blocks.append(mentions_section) + + context = { + "type": "context", + "elements": [{"type": "mrkdwn", "text": f"BAR-{group.short_id} | {event_date}"}], + } + blocks.append(context) + + actions = { + "type": "actions", + "elements": [ { - "type": "section", - "text": {"type": "mrkdwn", "text": f"<{title_link}|*{formatted_title}*> \n"}, - "block_id": f'{{"issue":{group.id}}}', + "type": "button", + "action_id": "resolve_dialog", + "text": {"type": "plain_text", "text": "Resolve"}, + "value": "resolve_dialog", }, { - "type": "context", - "elements": [{"type": "mrkdwn", "text": f"BAR-{group.short_id} | {event_date}"}], + "type": "button", + "action_id": "ignored:until_escalating", + "text": {"type": "plain_text", "text": "Archive"}, + "value": "ignored:until_escalating", }, { - "type": "actions", - "elements": [ - { - "type": "button", - "action_id": "resolve_dialog", - "text": {"type": "plain_text", "text": "Resolve"}, - "value": "resolve_dialog", - }, - { - "type": "button", - "action_id": "ignored:until_escalating", - "text": {"type": "plain_text", "text": "Archive"}, - "value": "ignored:until_escalating", - }, - { - "type": "external_select", - "placeholder": { - "type": "plain_text", - "text": "Select Assignee...", - "emoji": True, - }, - "action_id": "assign", - }, - ], + "type": "external_select", + "placeholder": { + "type": "plain_text", + "text": "Select Assignee...", + "emoji": True, + }, + "action_id": "assign", }, ], + } + blocks.append(actions) + + return { + "blocks": blocks, "text": f"[{project.slug}] {title}", } @@ -178,7 +202,6 @@ def build_test_message( class BuildGroupAttachmentTest(TestCase, PerformanceIssueTestCase, OccurrenceTestMixin): def test_build_group_attachment(self): group = self.create_group(project=self.project) - assert SlackIssuesMessageBuilder(group).build() == build_test_message( teams={self.team}, users={self.user}, @@ -230,9 +253,22 @@ def test_build_group_attachment(self): @with_feature("organizations:slack-block-kit") def test_build_group_block(self): - group = self.create_group(project=self.project) + event = self.store_event( + data={ + "event_id": "a" * 32, + "timestamp": iso_format(before_now(minutes=1)), + "logentry": {"formatted": "bar"}, + "_meta": {"logentry": {"formatted": {"": {"err": ["some error"]}}}}, + }, + project_id=self.project.id, + assert_no_errors=False, + ) + group = event.group + assert group self.project.flags.has_releases = True self.project.save(update_fields=["flags"]) + tags = {"level": "error"} + mentions = "hey @colleen fix it" assert SlackIssuesMessageBuilder(group).build() == build_test_message_blocks( teams={self.team}, @@ -240,8 +276,43 @@ def test_build_group_block(self): timestamp=group.last_seen, group=group, ) + # add tags to message + assert SlackIssuesMessageBuilder( + group, event.for_group(group), tags={"level"} + ).build() == build_test_message_blocks( + teams={self.team}, + users={self.user}, + timestamp=group.last_seen, + group=group, + tags=tags, + event=event, + ) + # add mentions to message + with self.feature("organizations:slack-formatting-update"): + assert SlackIssuesMessageBuilder( + group, event.for_group(group), mentions=mentions + ).build() == build_test_message_blocks( + teams={self.team}, + users={self.user}, + timestamp=group.last_seen, + group=group, + mentions=mentions, + event=event, + ) + # add tags and mentions to message + with self.feature("organizations:slack-formatting-update"): + assert SlackIssuesMessageBuilder( + group, event.for_group(group), tags={"level"}, mentions=mentions + ).build() == build_test_message_blocks( + teams={self.team}, + users={self.user}, + timestamp=group.last_seen, + group=group, + tags=tags, + mentions=mentions, + event=event, + ) - event = self.store_event(data={}, project_id=self.project.id) assert SlackIssuesMessageBuilder( group, event.for_group(group) ).build() == build_test_message_blocks( diff --git a/tests/sentry/integrations/slack/test_notify_action.py b/tests/sentry/integrations/slack/test_notify_action.py index ef4b53e9d8d6f4..c1bbf38bf28698 100644 --- a/tests/sentry/integrations/slack/test_notify_action.py +++ b/tests/sentry/integrations/slack/test_notify_action.py @@ -10,6 +10,7 @@ from sentry.notifications.additional_attachment_manager import manager from sentry.testutils.cases import RuleTestCase from sentry.testutils.helpers import install_slack +from sentry.testutils.helpers.features import with_feature from sentry.testutils.skips import requires_snuba from sentry.types.integrations import ExternalProviders from sentry.utils import json @@ -75,6 +76,23 @@ def test_render_label(self): == "Send a notification to the Awesome Team Slack workspace to #my-channel (optionally, an ID: ) and show tags [one, two] in notification" ) + @with_feature("organizations:slack-formatting-update") + def test_render_label_with_mentions(self): + rule = self.get_rule( + data={ + "workspace": self.integration.id, + "channel": "#my-channel", + "channel_id": "", + "tags": "one, two", + "mentions": "fix this @colleen", + } + ) + + assert ( + rule.render_label() + == "Send a notification to the Awesome Team Slack workspace to #my-channel (optionally, an ID: ) and show tags [one, two] and mentions fix this @colleen in notification" + ) + def test_render_label_without_integration(self): self.integration.delete()
6aaa964df91dfa7342601f7e747d665d836ebe4b
2023-03-01 01:16:35
Evan Purkhiser
ref(db): Drop `project_id` from Environment (model state) (#45094)
false
Drop `project_id` from Environment (model state) (#45094)
ref
diff --git a/migrations_lockfile.txt b/migrations_lockfile.txt index f61d5643f6e271..7fb436afba352a 100644 --- a/migrations_lockfile.txt +++ b/migrations_lockfile.txt @@ -6,5 +6,5 @@ To resolve this, rebase against latest master and regenerate your migration. Thi will then be regenerated, and you should be able to merge without conflicts. nodestore: 0002_nodestore_no_dictfield -sentry: 0363_debug_id_artifact_bundle +sentry: 0364_remove_project_id_from_environment social_auth: 0001_initial diff --git a/src/sentry/migrations/0364_remove_project_id_from_environment.py b/src/sentry/migrations/0364_remove_project_id_from_environment.py new file mode 100644 index 00000000000000..dd2308f0281b74 --- /dev/null +++ b/src/sentry/migrations/0364_remove_project_id_from_environment.py @@ -0,0 +1,35 @@ +# Generated by Django 2.2.28 on 2023-02-24 20:34 + +from django.db import migrations + +from sentry.new_migrations.migrations import CheckedMigration + + +class Migration(CheckedMigration): + # This flag is used to mark that a migration shouldn't be automatically run in production. For + # the most part, this should only be used for operations where it's safe to run the migration + # after your code has deployed. So this should not be used for most operations that alter the + # schema of a table. + # Here are some things that make sense to mark as dangerous: + # - Large data migrations. Typically we want these to be run manually by ops so that they can + # be monitored and not block the deploy for a long period of time while they run. + # - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to + # have ops run this and not block the deploy. Note that while adding an index is a schema + # change, it's completely safe to run the operation after the code has deployed. + is_dangerous = False + + dependencies = [ + ("sentry", "0363_debug_id_artifact_bundle"), + ] + + operations = [ + migrations.SeparateDatabaseAndState( + database_operations=[], + state_operations=[ + migrations.RemoveField( + model_name="environment", + name="project_id", + ), + ], + ), + ] diff --git a/src/sentry/models/environment.py b/src/sentry/models/environment.py index e40a0fefad653f..645e9001c48337 100644 --- a/src/sentry/models/environment.py +++ b/src/sentry/models/environment.py @@ -38,8 +38,6 @@ class Environment(Model): organization_id = BoundedBigIntegerField() projects = models.ManyToManyField("sentry.Project", through=EnvironmentProject) - # DEPRECATED, use projects - project_id = BoundedBigIntegerField(null=True) name = models.CharField(max_length=64) date_added = models.DateTimeField(default=timezone.now)
2f8031934269efcbe432d6cc1c91352d4020f3c6
2024-11-12 02:18:37
Scott Cooper
fix(issues): Add name subtext to integration dropdown (#80468)
false
Add name subtext to integration dropdown (#80468)
fix
diff --git a/static/app/components/group/externalIssuesList/hooks/types.tsx b/static/app/components/group/externalIssuesList/hooks/types.tsx index e07ac939c485d9..39cbacc6f1370c 100644 --- a/static/app/components/group/externalIssuesList/hooks/types.tsx +++ b/static/app/components/group/externalIssuesList/hooks/types.tsx @@ -22,6 +22,7 @@ interface LinkedIssue extends BaseIssueAction { } export interface ExternalIssueAction { + id: string; name: string; /** * Usually opens a modal to create an external issue diff --git a/static/app/components/group/externalIssuesList/hooks/useIntegrationExternalIssues.tsx b/static/app/components/group/externalIssuesList/hooks/useIntegrationExternalIssues.tsx index 02ffad864549d9..aa10ecaec532a7 100644 --- a/static/app/components/group/externalIssuesList/hooks/useIntegrationExternalIssues.tsx +++ b/static/app/components/group/externalIssuesList/hooks/useIntegrationExternalIssues.tsx @@ -55,6 +55,7 @@ export function useIntegrationExternalIssues({ const actions = configurations .filter(config => config.externalIssues.length === 0) .map<ExternalIssueAction>(config => ({ + id: config.id, name: config.name, nameSubText: config.domainName ?? undefined, disabled: config.status === 'disabled', diff --git a/static/app/components/group/externalIssuesList/hooks/usePluginExternalIssues.tsx b/static/app/components/group/externalIssuesList/hooks/usePluginExternalIssues.tsx index adf3dc9e968b50..6b1e5d2d588ec9 100644 --- a/static/app/components/group/externalIssuesList/hooks/usePluginExternalIssues.tsx +++ b/static/app/components/group/externalIssuesList/hooks/usePluginExternalIssues.tsx @@ -60,6 +60,7 @@ export function usePluginExternalIssues({ displayIcon, actions: [ { + id: plugin.id, name: plugin.shortName, onClick: () => { plugins.load(plugin, () => { diff --git a/static/app/components/group/externalIssuesList/hooks/useSentryAppExternalIssues.tsx b/static/app/components/group/externalIssuesList/hooks/useSentryAppExternalIssues.tsx index c0afd9ef9110d5..42b54637032883 100644 --- a/static/app/components/group/externalIssuesList/hooks/useSentryAppExternalIssues.tsx +++ b/static/app/components/group/externalIssuesList/hooks/useSentryAppExternalIssues.tsx @@ -82,6 +82,7 @@ export function useSentryAppExternalIssues({ disabledText: t('Unable to connect to %s', displayName), actions: [ { + id: component.sentryApp.slug, name: 'Create Issue', onClick: () => { doOpenSentryAppIssueModal({ diff --git a/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.spec.tsx b/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.spec.tsx index f2cad639b526c0..0c3a0755c188eb 100644 --- a/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.spec.tsx +++ b/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.spec.tsx @@ -1,6 +1,7 @@ import {EventFixture} from 'sentry-fixture/event'; import {GitHubIntegrationFixture} from 'sentry-fixture/githubIntegration'; import {GroupFixture} from 'sentry-fixture/group'; +import {JiraIntegrationFixture} from 'sentry-fixture/jiraIntegration'; import {OrganizationFixture} from 'sentry-fixture/organization'; import {PlatformExternalIssueFixture} from 'sentry-fixture/platformExternalIssue'; import {ProjectFixture} from 'sentry-fixture/project'; @@ -170,10 +171,10 @@ describe('StreamlinedExternalIssueList', () => { // Both items are listed inside the dropdown expect( - await screen.findByRole('menuitemradio', {name: 'GitHub sentry'}) + await screen.findByRole('menuitemradio', {name: /GitHub sentry/}) ).toBeInTheDocument(); expect( - screen.getByRole('menuitemradio', {name: 'GitHub codecov'}) + await screen.findByRole('menuitemradio', {name: /GitHub codecov/}) ).toBeInTheDocument(); }); @@ -195,4 +196,47 @@ describe('StreamlinedExternalIssueList', () => { await screen.findByText('Track this issue in Jira, GitHub, etc.') ).toBeInTheDocument(); }); + + it('should render dropdown items with subtext correctly', async () => { + MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/issues/${group.id}/external-issues/`, + body: [], + }); + + MockApiClient.addMockResponse({ + url: `/organizations/${organization.slug}/issues/${group.id}/integrations/`, + body: [ + JiraIntegrationFixture({ + id: '1', + status: 'active', + externalIssues: [], + name: 'Jira Integration 1', + domainName: 'hello.com', + }), + JiraIntegrationFixture({ + id: '2', + status: 'active', + externalIssues: [], + name: 'Jira', + domainName: 'example.com', + }), + ], + }); + + render( + <StreamlinedExternalIssueList event={event} group={group} project={project} /> + ); + + expect(await screen.findByRole('button', {name: 'Jira'})).toBeInTheDocument(); + await userEvent.click(await screen.findByRole('button', {name: 'Jira'})); + + // Item with different name and subtext should show both + const menuItem = await screen.findByRole('menuitemradio', { + name: /Jira Integration 1/, + }); + expect(menuItem).toHaveTextContent('hello.com'); + + // Item with name matching integration name should only show subtext + expect(screen.getByRole('menuitemradio', {name: 'example.com'})).toBeInTheDocument(); + }); }); diff --git a/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.tsx b/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.tsx index 9d8712a0bf71b0..058d0d9d73059a 100644 --- a/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.tsx +++ b/static/app/components/group/externalIssuesList/streamlinedExternalIssueList.tsx @@ -2,8 +2,10 @@ import styled from '@emotion/styled'; import AlertLink from 'sentry/components/alertLink'; import {Button, type ButtonProps, LinkButton} from 'sentry/components/button'; +import DropdownButton from 'sentry/components/dropdownButton'; import {DropdownMenu} from 'sentry/components/dropdownMenu'; import ErrorBoundary from 'sentry/components/errorBoundary'; +import type {ExternalIssueAction} from 'sentry/components/group/externalIssuesList/hooks/types'; import Placeholder from 'sentry/components/placeholder'; import * as SidebarSection from 'sentry/components/sidebarSection'; import {Tooltip} from 'sentry/components/tooltip'; @@ -18,6 +20,41 @@ import {SidebarSectionTitle} from 'sentry/views/issueDetails/streamline/sidebar' import useStreamLinedExternalIssueData from './hooks/useGroupExternalIssues'; +function getActionLabelAndTextValue({ + action, + integrationDisplayName, +}: { + action: ExternalIssueAction; + integrationDisplayName: string; +}): {label: string | JSX.Element; textValue: string} { + // If there's no subtext or subtext matches name, just show name + if (!action.nameSubText || action.nameSubText === action.name) { + return { + label: action.name, + textValue: action.name, + }; + } + + // If action name matches integration name, just show subtext + if (action.name === integrationDisplayName) { + return { + label: action.nameSubText, + textValue: `${action.name} ${action.nameSubText}`, + }; + } + + // Otherwise show both name and subtext + return { + label: ( + <div> + <strong>{action.name}</strong> + <div>{action.nameSubText}</div> + </div> + ), + textValue: `${action.name} ${action.nameSubText}`, + }; +} + interface StreamlinedExternalIssueListProps { event: Event; group: Group; @@ -109,11 +146,18 @@ export function StreamlinedExternalIssueList({ <ErrorBoundary key={integration.key} mini> <DropdownMenu trigger={triggerProps => ( - <IssueActionButton {...sharedButtonProps} {...triggerProps} /> + <IssueActionDropdownMenu + {...sharedButtonProps} + {...triggerProps} + showChevron={false} + /> )} items={integration.actions.map(action => ({ - key: action.name, - label: action.name, + key: action.id, + ...getActionLabelAndTextValue({ + action, + integrationDisplayName: integration.displayName, + }), onAction: action.onClick, disabled: integration.disabled, }))} @@ -162,6 +206,19 @@ const IssueActionButton = styled(Button)` font-weight: normal; `; +const IssueActionDropdownMenu = styled(DropdownButton)` + display: flex; + align-items: center; + padding: ${space(0.5)} ${space(0.75)}; + border: 1px dashed ${p => p.theme.border}; + border-radius: ${p => p.theme.borderRadius}; + font-weight: normal; + + &[aria-expanded='true'] { + border: 1px solid ${p => p.theme.border}; + } +`; + const IssueActionName = styled('div')` ${p => p.theme.overflowEllipsis} max-width: 200px;
ed0d0f2cb68aaf214565ce64fe5313cd0cfa126a
2024-04-09 03:02:32
Lyn Nagara
ref: Remove sessions result consumer (#68390)
false
Remove sessions result consumer (#68390)
ref
diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index cfc941a14c12ae..1bed046818700c 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -3468,7 +3468,6 @@ def build_cdc_postgres_init_db_volume(settings: Any) -> dict[str, dict[str, str] "events-subscription-results": "default", "transactions-subscription-results": "default", "generic-metrics-subscription-results": "default", - "sessions-subscription-results": "default", "metrics-subscription-results": "default", "ingest-events": "default", "ingest-feedback-events": "default", diff --git a/src/sentry/conf/types/kafka_definition.py b/src/sentry/conf/types/kafka_definition.py index 40d4393a69ed16..5fcaa94288c4e1 100644 --- a/src/sentry/conf/types/kafka_definition.py +++ b/src/sentry/conf/types/kafka_definition.py @@ -22,7 +22,6 @@ class Topic(Enum): EVENTS_SUBSCRIPTIONS_RESULTS = "events-subscription-results" TRANSACTIONS_SUBSCRIPTIONS_RESULTS = "transactions-subscription-results" GENERIC_METRICS_SUBSCRIPTIONS_RESULTS = "generic-metrics-subscription-results" - SESSIONS_SUBSCRIPTIONS_RESULTS = "sessions-subscription-results" METRICS_SUBSCRIPTIONS_RESULTS = "metrics-subscription-results" INGEST_EVENTS = "ingest-events" INGEST_EVENTS_DLQ = "ingest-events-dlq" diff --git a/src/sentry/consumers/__init__.py b/src/sentry/consumers/__init__.py index 8e7850f2f4c279..61f1e31fe1a771 100644 --- a/src/sentry/consumers/__init__.py +++ b/src/sentry/consumers/__init__.py @@ -239,14 +239,6 @@ def ingest_events_options() -> list[click.Option]: "click_options": multiprocessing_options(default_max_batch_size=100), "static_args": {"dataset": "generic_metrics"}, }, - "sessions-subscription-results": { - "topic": Topic.SESSIONS_SUBSCRIPTIONS_RESULTS, - "strategy_factory": "sentry.snuba.query_subscriptions.run.QuerySubscriptionStrategyFactory", - "click_options": multiprocessing_options(), - "static_args": { - "dataset": "events", - }, - }, "metrics-subscription-results": { "topic": Topic.METRICS_SUBSCRIPTIONS_RESULTS, "strategy_factory": "sentry.snuba.query_subscriptions.run.QuerySubscriptionStrategyFactory", diff --git a/src/sentry/snuba/query_subscriptions/constants.py b/src/sentry/snuba/query_subscriptions/constants.py index ceb49368ac7671..b04cf11f619fc6 100644 --- a/src/sentry/snuba/query_subscriptions/constants.py +++ b/src/sentry/snuba/query_subscriptions/constants.py @@ -6,7 +6,6 @@ Dataset.Events: "events-subscription-results", Dataset.Transactions: "transactions-subscription-results", Dataset.PerformanceMetrics: "generic-metrics-subscription-results", - Dataset.Sessions: "sessions-subscription-results", Dataset.Metrics: "metrics-subscription-results", }
ecea0d85e592857222538ca087cd61e66862ffdf
2021-12-15 07:08:28
Vu Luong
fix(ui): Span tree connector design (#30498)
false
Span tree connector design (#30498)
fix
diff --git a/static/app/components/events/interfaces/spans/spanBar.tsx b/static/app/components/events/interfaces/spans/spanBar.tsx index 229cab5376d402..b78d46d8994ef8 100644 --- a/static/app/components/events/interfaces/spans/spanBar.tsx +++ b/static/app/components/events/interfaces/spans/spanBar.tsx @@ -323,7 +323,7 @@ class SpanBar extends React.Component<SpanBarProps, SpanBarState> { if (hasToggler) { return ( <ConnectorBar - style={{right: '16px', height: '10px', bottom: '-5px', top: 'auto'}} + style={{right: '15px', height: '10px', bottom: '-5px', top: 'auto'}} key={`${spanID}-last`} orphanBranch={false} /> @@ -342,7 +342,7 @@ class SpanBar extends React.Component<SpanBarProps, SpanBarState> { // which does not exist. return null; } - const left = ((spanTreeDepth - depth) * (TOGGLE_BORDER_BOX / 2) + 1) * -1; + const left = ((spanTreeDepth - depth) * (TOGGLE_BORDER_BOX / 2) + 2) * -1; return ( <ConnectorBar @@ -359,9 +359,9 @@ class SpanBar extends React.Component<SpanBarProps, SpanBarState> { connectorBars.push( <ConnectorBar style={{ - right: '16px', + right: '15px', height: `${ROW_HEIGHT / 2}px`, - bottom: isLast ? `-${ROW_HEIGHT / 2}px` : '0', + bottom: isLast ? `-${ROW_HEIGHT / 2 + 2}px` : '0', top: 'auto', }} key={`${spanID}-last-bottom`} diff --git a/static/app/components/events/interfaces/spans/spanGroupBar.tsx b/static/app/components/events/interfaces/spans/spanGroupBar.tsx index e929461ca3d445..03531496230ceb 100644 --- a/static/app/components/events/interfaces/spans/spanGroupBar.tsx +++ b/static/app/components/events/interfaces/spans/spanGroupBar.tsx @@ -233,7 +233,7 @@ class SpanGroupBar extends React.Component<Props> { // which does not exist. return null; } - const left = ((spanTreeDepth - depth) * (TOGGLE_BORDER_BOX / 2) + 1) * -1; + const left = ((spanTreeDepth - depth) * (TOGGLE_BORDER_BOX / 2) + 2) * -1; return ( <ConnectorBar @@ -247,9 +247,9 @@ class SpanGroupBar extends React.Component<Props> { connectorBars.push( <ConnectorBar style={{ - right: '16px', + right: '15px', height: `${ROW_HEIGHT / 2}px`, - bottom: `-${ROW_HEIGHT / 2}px`, + bottom: `-${ROW_HEIGHT / 2 + 1}px`, top: 'auto', }} key="collapsed-span-group-row-bottom" diff --git a/static/app/components/performance/waterfall/treeConnector.tsx b/static/app/components/performance/waterfall/treeConnector.tsx index 7cc1d00500e573..66f374ca820877 100644 --- a/static/app/components/performance/waterfall/treeConnector.tsx +++ b/static/app/components/performance/waterfall/treeConnector.tsx @@ -14,9 +14,9 @@ const TREE_TOGGLE_CONTAINER_WIDTH = 40; export const ConnectorBar = styled('div')<{orphanBranch: boolean}>` height: 250%; - border-left: 1px ${p => (p.orphanBranch ? 'dashed' : 'solid')} ${p => p.theme.border}; - top: -5px; + border-left: 2px ${p => (p.orphanBranch ? 'dashed' : 'solid')} ${p => p.theme.border}; position: absolute; + top: 0; `; type TogglerTypes = OmitHtmlDivProps<{ @@ -25,34 +25,37 @@ type TogglerTypes = OmitHtmlDivProps<{ }>; export const TreeConnector = styled('div')<TogglerTypes & {orphanBranch: boolean}>` - height: ${p => (p.isLast ? ROW_HEIGHT / 2 : ROW_HEIGHT)}px; + height: ${p => (p.isLast ? ROW_HEIGHT / 2 + 1 : ROW_HEIGHT)}px; width: 100%; - border-left: ${p => { - return `1px ${p.orphanBranch ? 'dashed' : 'solid'} ${p.theme.border}`; - }}; + border-left: ${p => `2px ${p.orphanBranch ? 'dashed' : 'solid'} ${p.theme.border};`}; position: absolute; top: 0; - &:before { - content: ''; - height: 1px; - border-bottom: ${p => - `1px ${p.orphanBranch ? 'dashed' : 'solid'} ${p.theme.border};`}; - left: 0; - width: 100%; - position: absolute; - bottom: ${p => (p.isLast ? '0' : '50%')}; - } + ${p => + p.isLast + ? ` + border-bottom: 2px ${p.orphanBranch ? 'dashed' : 'solid'} ${p.theme.border}; + border-bottom-left-radius: ${p.theme.borderRadius};` + : ` + &:before { + content: ''; + height: 2px; + left: -2px; + border-bottom: 2px solid ${p.theme.border}; + width: calc(100% - 2px); + position: absolute; + bottom: calc(50% - 1px); + }`} &:after { content: ''; background-color: ${p => p.theme.border}; - border-radius: 4px; - height: 3px; - width: 3px; + border-radius: 50%; + height: 6px; + width: 6px; position: absolute; right: 0; - top: ${ROW_HEIGHT / 2 - 2}px; + top: ${ROW_HEIGHT / 2 - 3}px; } `; @@ -76,6 +79,7 @@ export const TreeToggle = styled('div')<SpanTreeTogglerAndDivProps>` font-size: 10px; line-height: 0; z-index: 1; + box-shadow: ${p => p.theme.dropShadowLightest}; ${p => getToggleTheme(p)} `; diff --git a/static/app/views/performance/compare/spanBar.tsx b/static/app/views/performance/compare/spanBar.tsx index 05764803124cb6..6b2e9d46f8ec55 100644 --- a/static/app/views/performance/compare/spanBar.tsx +++ b/static/app/views/performance/compare/spanBar.tsx @@ -93,7 +93,7 @@ class SpanBar extends React.Component<Props, State> { if (hasToggler) { return ( <ConnectorBar - style={{right: '16px', height: '10px', bottom: '-5px', top: 'auto'}} + style={{right: '15px', height: '10px', bottom: '-5px', top: 'auto'}} key={`${spanID}-last`} orphanBranch={false} /> @@ -112,7 +112,7 @@ class SpanBar extends React.Component<Props, State> { // which does not exist. return null; } - const left = ((spanTreeDepth - depth) * (TOGGLE_BORDER_BOX / 2) + 1) * -1; + const left = ((spanTreeDepth - depth) * (TOGGLE_BORDER_BOX / 2) + 2) * -1; return ( <ConnectorBar @@ -129,9 +129,9 @@ class SpanBar extends React.Component<Props, State> { connectorBars.push( <ConnectorBar style={{ - right: '16px', + right: '15px', height: '10px', - bottom: isLast ? `-${ROW_HEIGHT / 2}px` : '0', + bottom: isLast ? `-${ROW_HEIGHT / 2 + 1}px` : '0', top: 'auto', }} key={`${spanID}-last`} diff --git a/static/app/views/performance/traceDetails/transactionBar.tsx b/static/app/views/performance/traceDetails/transactionBar.tsx index a693447d26f4da..db1c255d58e591 100644 --- a/static/app/views/performance/traceDetails/transactionBar.tsx +++ b/static/app/views/performance/traceDetails/transactionBar.tsx @@ -105,7 +105,7 @@ class TransactionBar extends React.Component<Props, State> { if (hasToggle) { return ( <ConnectorBar - style={{right: '16px', height: '10px', bottom: '-5px', top: 'auto'}} + style={{right: '15px', height: '10px', bottom: '-5px', top: 'auto'}} orphanBranch={false} /> ); @@ -122,7 +122,7 @@ class TransactionBar extends React.Component<Props, State> { return null; } - const left = -1 * getOffset(generation - depth - 1) - 1; + const left = -1 * getOffset(generation - depth - 1) - 2; return ( <ConnectorBar @@ -138,9 +138,9 @@ class TransactionBar extends React.Component<Props, State> { connectorBars.push( <ConnectorBar style={{ - right: '16px', + right: '15px', height: '10px', - bottom: isLast ? `-${ROW_HEIGHT / 2}px` : '0', + bottom: isLast ? `-${ROW_HEIGHT / 2 + 1}px` : '0', top: 'auto', }} key={`${eventId}-last`}
2f72a72bdcaa718946fdfec8373a7e7495ebb7d6
2019-10-10 04:52:00
Lyn Nagara
test(eventstore): Add a test for a transaction event (#15021)
false
Add a test for a transaction event (#15021)
test
diff --git a/tests/sentry/eventstore/snuba/test_backend.py b/tests/sentry/eventstore/snuba/test_backend.py index 42eb21e57cf3d2..ef32cc2315f955 100644 --- a/tests/sentry/eventstore/snuba/test_backend.py +++ b/tests/sentry/eventstore/snuba/test_backend.py @@ -7,6 +7,8 @@ from sentry.eventstore.snuba.backend import SnubaEventStorage from sentry.eventstore.base import Filter +from sentry.utils.samples import load_data + class SnubaEventStorageTest(TestCase, SnubaTestCase): def setUp(self): @@ -50,17 +52,24 @@ def setUp(self): project_id=self.project2.id, ) + event_data = load_data("transaction") + event_data["timestamp"] = self.min_ago + event_data["event_id"] = "d" * 32 + + self.transaction_event = self.store_event(data=event_data, project_id=self.project2.id) + self.eventstore = SnubaEventStorage() def test_get_events(self): events = self.eventstore.get_events( filter=Filter(project_ids=[self.project1.id, self.project2.id]) ) - assert len(events) == 3 + assert len(events) == 4 # Default sort is timestamp desc, event_id desc - assert events[0].id == "c" * 32 - assert events[1].id == "b" * 32 - assert events[2].id == "a" * 32 + assert events[0].id == "d" * 32 + assert events[1].id == "c" * 32 + assert events[2].id == "b" * 32 + assert events[3].id == "a" * 32 # No events found project = self.create_project() @@ -86,7 +95,7 @@ def test_get_event_by_id(self): assert len(event.snuba_data.keys()) == 17 # Get non existent event - event = self.eventstore.get_event_by_id(self.project2.id, "d" * 32) + event = self.eventstore.get_event_by_id(self.project2.id, "e" * 32) assert event is None def test_get_next_prev_event_id(self): @@ -106,3 +115,10 @@ def test_get_next_prev_event_id(self): # Returns None if no event assert self.eventstore.get_prev_event_id(None, filter=filter) is None assert self.eventstore.get_next_event_id(None, filter=filter) is None + + def test_get_transaction_event_by_id(self): + event = self.eventstore.get_event_by_id(self.project2.id, self.transaction_event.event_id) + + assert event.id == "d" * 32 + assert event.get_event_type() == "transaction" + assert event.project_id == self.project2.id
934bdd9fd5e90b1f7d677856da42afeddf1f877e
2023-01-26 23:37:51
getsentry-bot
meta: Bump new development version
false
Bump new development version
meta
diff --git a/setup.cfg b/setup.cfg index b9c41426298118..74fedf2eb1dafc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = sentry -version = 23.1.1 +version = 23.2.0.dev0 description = A realtime logging and aggregation server. long_description = file: README.md long_description_content_type = text/markdown
b8bf85948d4c4832c60ab31e9f1a5a3c39fd53cf
2020-11-21 05:25:30
Billy Vong
build(eslint): Add `simple-import-sort` eslint plugin (#22104)
false
Add `simple-import-sort` eslint plugin (#22104)
build
diff --git a/.eslintrc.js b/.eslintrc.js index 0933eb2fa35400..b7057a742def5e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -9,7 +9,46 @@ module.exports = { tick: true, jest: true, }, - rules: {}, + plugins: ['simple-import-sort'], + + rules: { + 'simple-import-sort/imports': [ + 'error', + { + groups: [ + // Side effect imports. + ['^\\u0000'], + + // Node.js builtins. You could also generate this regex if you use a `.js` config. + // For example: `^(${require("module").builtinModules.join("|")})(/|$)` + [ + '^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)', + ], + + // Packages. `react` related packages come first. + ['^react', '^@?\\w'], + + // Test should be separate from the app + ['^(sentry-test)(/.*|$)'], + + // Internal packages. + ['^(app|sentry|sentry-locale)(/.*|$)'], + + // Style imports. + ['^.+\\.less$'], + + // Parent imports. Put `..` last. + ['^\\.\\.(?!/?$)', '^\\.\\./?$'], + + // Other relative imports. Put same-folder imports and `.` last. + ['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'], + ], + }, + ], + 'simple-import-sort/exports': 'error', + 'sort-imports': 'off', + 'import/order': 'off', + }, overrides: [ { files: ['*.ts', '*.tsx'], diff --git a/package.json b/package.json index 9ff95d19b4102e..106cae535c82ff 100644 --- a/package.json +++ b/package.json @@ -157,6 +157,7 @@ "enzyme-to-json": "3.4.3", "eslint": "5.11.1", "eslint-config-sentry-app": "^1.44.0", + "eslint-plugin-simple-import-sort": "^6.0.0", "html-webpack-plugin": "^4.3.0", "jest": "24.9.0", "jest-canvas-mock": "^2.2.0", diff --git a/src/sentry/static/sentry/app/actionCreators/account.tsx b/src/sentry/static/sentry/app/actionCreators/account.tsx index e486cc47ee73d3..30ead903be8236 100644 --- a/src/sentry/static/sentry/app/actionCreators/account.tsx +++ b/src/sentry/static/sentry/app/actionCreators/account.tsx @@ -1,7 +1,7 @@ -import {Client} from 'app/api'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; import ConfigStore from 'app/stores/configStore'; -import {User, Identity} from 'app/types'; +import {Identity, User} from 'app/types'; export async function disconnectIdentity(identity: Identity) { const api = new Client(); diff --git a/src/sentry/static/sentry/app/actionCreators/dashboards.tsx b/src/sentry/static/sentry/app/actionCreators/dashboards.tsx index 2ea15539a7af47..9d963ef59541d1 100644 --- a/src/sentry/static/sentry/app/actionCreators/dashboards.tsx +++ b/src/sentry/static/sentry/app/actionCreators/dashboards.tsx @@ -1,10 +1,10 @@ +import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; import {t} from 'app/locale'; -import {addErrorMessage} from 'app/actionCreators/indicator'; import { DashboardListItem, - OrgDashboardResponse, OrgDashboard, + OrgDashboardResponse, OrgDashboardUpdate, } from 'app/views/dashboardsV2/types'; diff --git a/src/sentry/static/sentry/app/actionCreators/deployPreview.tsx b/src/sentry/static/sentry/app/actionCreators/deployPreview.tsx index cd49fa3e38a73f..91f02abad3cbbe 100644 --- a/src/sentry/static/sentry/app/actionCreators/deployPreview.tsx +++ b/src/sentry/static/sentry/app/actionCreators/deployPreview.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {DEPLOY_PREVIEW_CONFIG, EXPERIMENTAL_SPA} from 'app/constants'; -import {t, tct} from 'app/locale'; import AlertActions from 'app/actions/alertActions'; import ExternalLink from 'app/components/links/externalLink'; +import {DEPLOY_PREVIEW_CONFIG, EXPERIMENTAL_SPA} from 'app/constants'; +import {t, tct} from 'app/locale'; export function displayDeployPreviewAlert() { if (!DEPLOY_PREVIEW_CONFIG) { diff --git a/src/sentry/static/sentry/app/actionCreators/discoverSavedQueries.tsx b/src/sentry/static/sentry/app/actionCreators/discoverSavedQueries.tsx index 145068721e01ba..e40c170897e078 100644 --- a/src/sentry/static/sentry/app/actionCreators/discoverSavedQueries.tsx +++ b/src/sentry/static/sentry/app/actionCreators/discoverSavedQueries.tsx @@ -1,7 +1,7 @@ +import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; -import {SavedQuery, NewQuery} from 'app/types'; import {t} from 'app/locale'; -import {addErrorMessage} from 'app/actionCreators/indicator'; +import {NewQuery, SavedQuery} from 'app/types'; export function fetchSavedQueries(api: Client, orgId: string): Promise<SavedQuery[]> { const promise: Promise<SavedQuery[]> = api.requestPromise( diff --git a/src/sentry/static/sentry/app/actionCreators/events.tsx b/src/sentry/static/sentry/app/actionCreators/events.tsx index 0e4716ce419ede..a05443ca9e6060 100644 --- a/src/sentry/static/sentry/app/actionCreators/events.tsx +++ b/src/sentry/static/sentry/app/actionCreators/events.tsx @@ -2,16 +2,16 @@ import {LocationDescriptor} from 'history'; import pick from 'lodash/pick'; import {Client} from 'app/api'; -import {URL_PARAM} from 'app/constants/globalSelectionHeader'; import {canIncludePreviousPeriod} from 'app/components/charts/utils'; -import {getPeriod} from 'app/utils/getPeriod'; +import {URL_PARAM} from 'app/constants/globalSelectionHeader'; import { - EventsStats, DateString, - OrganizationSummary, + EventsStats, MultiSeriesEventsStats, + OrganizationSummary, } from 'app/types'; import {LocationQuery} from 'app/utils/discover/eventView'; +import {getPeriod} from 'app/utils/getPeriod'; type Options = { organization: OrganizationSummary; diff --git a/src/sentry/static/sentry/app/actionCreators/formSearch.tsx b/src/sentry/static/sentry/app/actionCreators/formSearch.tsx index 24a9b67d4b4322..c155a37194d2fb 100644 --- a/src/sentry/static/sentry/app/actionCreators/formSearch.tsx +++ b/src/sentry/static/sentry/app/actionCreators/formSearch.tsx @@ -1,8 +1,8 @@ -import flatten from 'lodash/flatten'; import flatMap from 'lodash/flatMap'; +import flatten from 'lodash/flatten'; -import {Field, JsonFormObject} from 'app/views/settings/components/forms/type'; import FormSearchActions from 'app/actions/formSearchActions'; +import {Field, JsonFormObject} from 'app/views/settings/components/forms/type'; type Params = { route: string; diff --git a/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx b/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx index cc6d0425605690..2cb66a1abf92f0 100644 --- a/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx +++ b/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx @@ -1,10 +1,15 @@ import * as ReactRouter from 'react-router'; +import * as Sentry from '@sentry/react'; import isInteger from 'lodash/isInteger'; import omit from 'lodash/omit'; import pick from 'lodash/pick'; import * as qs from 'query-string'; -import * as Sentry from '@sentry/react'; +import GlobalSelectionActions from 'app/actions/globalSelectionActions'; +import { + getDefaultSelection, + getStateFromQuery, +} from 'app/components/organizations/globalSelectionHeader/utils'; import { DATE_TIME, LOCAL_STORAGE_KEY, @@ -18,12 +23,7 @@ import { Project, } from 'app/types'; import {defined} from 'app/utils'; -import { - getDefaultSelection, - getStateFromQuery, -} from 'app/components/organizations/globalSelectionHeader/utils'; import {getUtcDateString} from 'app/utils/dates'; -import GlobalSelectionActions from 'app/actions/globalSelectionActions'; import localStorage from 'app/utils/localStorage'; /** diff --git a/src/sentry/static/sentry/app/actionCreators/group.tsx b/src/sentry/static/sentry/app/actionCreators/group.tsx index b41ca480474fcc..9c8d6b8722451f 100644 --- a/src/sentry/static/sentry/app/actionCreators/group.tsx +++ b/src/sentry/static/sentry/app/actionCreators/group.tsx @@ -1,11 +1,11 @@ import * as Sentry from '@sentry/react'; -import {Client} from 'app/api'; -import {buildUserId, buildTeamId} from 'app/utils'; -import {uniqueId} from 'app/utils/guid'; import GroupActions from 'app/actions/groupActions'; +import {Client} from 'app/api'; import GroupStore from 'app/stores/groupStore'; -import {Member, User, Group, Actor, Note} from 'app/types'; +import {Actor, Group, Member, Note, User} from 'app/types'; +import {buildTeamId, buildUserId} from 'app/utils'; +import {uniqueId} from 'app/utils/guid'; type AssignToUserParams = { /** diff --git a/src/sentry/static/sentry/app/actionCreators/guides.tsx b/src/sentry/static/sentry/app/actionCreators/guides.tsx index f7f984c8d4af02..00cda92d27064e 100644 --- a/src/sentry/static/sentry/app/actionCreators/guides.tsx +++ b/src/sentry/static/sentry/app/actionCreators/guides.tsx @@ -1,6 +1,6 @@ +import GuideActions from 'app/actions/guideActions'; import {Client} from 'app/api'; import ConfigStore from 'app/stores/configStore'; -import GuideActions from 'app/actions/guideActions'; import {trackAnalyticsEvent} from 'app/utils/analytics'; const api = new Client(); diff --git a/src/sentry/static/sentry/app/actionCreators/incident.tsx b/src/sentry/static/sentry/app/actionCreators/incident.tsx index 2f0bc00975f13e..85cbf50a8f4ba7 100644 --- a/src/sentry/static/sentry/app/actionCreators/incident.tsx +++ b/src/sentry/static/sentry/app/actionCreators/incident.tsx @@ -1,6 +1,6 @@ import {addErrorMessage, clearIndicators} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; import {Client} from 'app/api'; +import {t} from 'app/locale'; import {NoteType} from 'app/types/alerts'; /** diff --git a/src/sentry/static/sentry/app/actionCreators/indicator.tsx b/src/sentry/static/sentry/app/actionCreators/indicator.tsx index 0c82ea8f1e70e4..57c2ed7845f8c3 100644 --- a/src/sentry/static/sentry/app/actionCreators/indicator.tsx +++ b/src/sentry/static/sentry/app/actionCreators/indicator.tsx @@ -1,12 +1,12 @@ -import * as Sentry from '@sentry/react'; import React from 'react'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; +import IndicatorActions from 'app/actions/indicatorActions'; import {DEFAULT_TOAST_DURATION} from 'app/constants'; import {t, tct} from 'app/locale'; -import FormModel, {FieldValue} from 'app/views/settings/components/forms/model'; -import IndicatorActions from 'app/actions/indicatorActions'; import space from 'app/styles/space'; +import FormModel, {FieldValue} from 'app/views/settings/components/forms/model'; type IndicatorType = 'loading' | 'error' | 'success' | 'undo' | ''; diff --git a/src/sentry/static/sentry/app/actionCreators/integrations.tsx b/src/sentry/static/sentry/app/actionCreators/integrations.tsx index 94c40a90293a4a..2b939be8da064e 100644 --- a/src/sentry/static/sentry/app/actionCreators/integrations.tsx +++ b/src/sentry/static/sentry/app/actionCreators/integrations.tsx @@ -1,10 +1,10 @@ -import {Client} from 'app/api'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, clearIndicators, } from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; import {t, tct} from 'app/locale'; import {Integration, Repository} from 'app/types'; diff --git a/src/sentry/static/sentry/app/actionCreators/members.tsx b/src/sentry/static/sentry/app/actionCreators/members.tsx index aa4a539a489853..f9ac68301ea25d 100644 --- a/src/sentry/static/sentry/app/actionCreators/members.tsx +++ b/src/sentry/static/sentry/app/actionCreators/members.tsx @@ -1,9 +1,9 @@ import * as Sentry from '@sentry/react'; -import {Client} from 'app/api'; -import {Member} from 'app/types'; import MemberActions from 'app/actions/memberActions'; +import {Client} from 'app/api'; import MemberListStore from 'app/stores/memberListStore'; +import {Member} from 'app/types'; function getMemberUser(member: Member) { return { diff --git a/src/sentry/static/sentry/app/actionCreators/modal.tsx b/src/sentry/static/sentry/app/actionCreators/modal.tsx index 8282499d128741..c7219bf7941075 100644 --- a/src/sentry/static/sentry/app/actionCreators/modal.tsx +++ b/src/sentry/static/sentry/app/actionCreators/modal.tsx @@ -1,9 +1,9 @@ import React from 'react'; +import {ModalBody, ModalFooter, ModalHeader} from 'react-bootstrap'; import {css} from '@emotion/core'; -import {ModalHeader, ModalBody, ModalFooter} from 'react-bootstrap'; import ModalActions from 'app/actions/modalActions'; -import {Organization, SentryApp, Project, Team, Group, Event} from 'app/types'; +import {Event, Group, Organization, Project, SentryApp, Team} from 'app/types'; export type ModalRenderProps = { closeModal: () => void; diff --git a/src/sentry/static/sentry/app/actionCreators/navigation.tsx b/src/sentry/static/sentry/app/actionCreators/navigation.tsx index 9674815d85c8a5..d5523be8450ce1 100644 --- a/src/sentry/static/sentry/app/actionCreators/navigation.tsx +++ b/src/sentry/static/sentry/app/actionCreators/navigation.tsx @@ -1,10 +1,10 @@ +import React from 'react'; import {InjectedRouter} from 'react-router/lib/Router'; import {Location} from 'history'; -import React from 'react'; import {openModal} from 'app/actionCreators/modal'; -import ContextPickerModal from 'app/components/contextPickerModal'; import NavigationActions from 'app/actions/navigationActions'; +import ContextPickerModal from 'app/components/contextPickerModal'; // TODO(ts): figure out better typing for react-router here export function navigateTo(to: string, router: InjectedRouter & {location?: Location}) { diff --git a/src/sentry/static/sentry/app/actionCreators/onboardingTasks.tsx b/src/sentry/static/sentry/app/actionCreators/onboardingTasks.tsx index f27e3afaaa6d5b..e1b6f42f0d6d6d 100644 --- a/src/sentry/static/sentry/app/actionCreators/onboardingTasks.tsx +++ b/src/sentry/static/sentry/app/actionCreators/onboardingTasks.tsx @@ -1,7 +1,7 @@ -import {Client} from 'app/api'; -import {Organization, OnboardingTask} from 'app/types'; import OrganizationActions from 'app/actions/organizationActions'; +import {Client} from 'app/api'; import ConfigStore from 'app/stores/configStore'; +import {OnboardingTask, Organization} from 'app/types'; /** * Update an onboarding task. diff --git a/src/sentry/static/sentry/app/actionCreators/organization.tsx b/src/sentry/static/sentry/app/actionCreators/organization.tsx index 9e8f0b4e893445..f9ac38da846e56 100644 --- a/src/sentry/static/sentry/app/actionCreators/organization.tsx +++ b/src/sentry/static/sentry/app/actionCreators/organization.tsx @@ -1,13 +1,13 @@ import * as Sentry from '@sentry/react'; -import {Client} from 'app/api'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {setActiveOrganization} from 'app/actionCreators/organizations'; import GlobalSelectionActions from 'app/actions/globalSelectionActions'; import OrganizationActions from 'app/actions/organizationActions'; import ProjectActions from 'app/actions/projectActions'; -import ProjectsStore from 'app/stores/projectsStore'; import TeamActions from 'app/actions/teamActions'; +import {Client} from 'app/api'; +import ProjectsStore from 'app/stores/projectsStore'; import TeamStore from 'app/stores/teamStore'; /** diff --git a/src/sentry/static/sentry/app/actionCreators/organizations.tsx b/src/sentry/static/sentry/app/actionCreators/organizations.tsx index b251f10adcc868..b858883402f55b 100644 --- a/src/sentry/static/sentry/app/actionCreators/organizations.tsx +++ b/src/sentry/static/sentry/app/actionCreators/organizations.tsx @@ -1,14 +1,14 @@ import {browserHistory} from 'react-router'; -import {Client} from 'app/api'; -import {Organization, LightWeightOrganization} from 'app/types'; -import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {resetGlobalSelection} from 'app/actionCreators/globalSelection'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import OrganizationActions from 'app/actions/organizationActions'; import OrganizationsActions from 'app/actions/organizationsActions'; +import {Client} from 'app/api'; import OrganizationsStore from 'app/stores/organizationsStore'; import ProjectsStore from 'app/stores/projectsStore'; import TeamStore from 'app/stores/teamStore'; +import {LightWeightOrganization, Organization} from 'app/types'; type RedirectRemainingOrganizationParams = { /** diff --git a/src/sentry/static/sentry/app/actionCreators/performance.tsx b/src/sentry/static/sentry/app/actionCreators/performance.tsx index 93e55729653237..c2ea89eae17ae6 100644 --- a/src/sentry/static/sentry/app/actionCreators/performance.tsx +++ b/src/sentry/static/sentry/app/actionCreators/performance.tsx @@ -1,6 +1,6 @@ +import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; import {t} from 'app/locale'; -import {addErrorMessage} from 'app/actionCreators/indicator'; export function toggleKeyTransaction( api: Client, diff --git a/src/sentry/static/sentry/app/actionCreators/platformExternalIssues.tsx b/src/sentry/static/sentry/app/actionCreators/platformExternalIssues.tsx index 587cd43b777558..cd062b3edbd470 100644 --- a/src/sentry/static/sentry/app/actionCreators/platformExternalIssues.tsx +++ b/src/sentry/static/sentry/app/actionCreators/platformExternalIssues.tsx @@ -1,5 +1,5 @@ -import {Client} from 'app/api'; import PlatformExternalIssueActions from 'app/actions/platformExternalIssueActions'; +import {Client} from 'app/api'; export async function deleteExternalIssue( api: Client, diff --git a/src/sentry/static/sentry/app/actionCreators/plugins.tsx b/src/sentry/static/sentry/app/actionCreators/plugins.tsx index f2978fad02dd8b..fe986e82192f12 100644 --- a/src/sentry/static/sentry/app/actionCreators/plugins.tsx +++ b/src/sentry/static/sentry/app/actionCreators/plugins.tsx @@ -1,11 +1,11 @@ -import {Client, RequestOptions} from 'app/api'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; import PluginActions from 'app/actions/pluginActions'; +import {Client, RequestOptions} from 'app/api'; +import {t} from 'app/locale'; import {Plugin} from 'app/types'; const activeFetch = {}; diff --git a/src/sentry/static/sentry/app/actionCreators/projects.tsx b/src/sentry/static/sentry/app/actionCreators/projects.tsx index fcaa22a89cc84b..cf50215dab535b 100644 --- a/src/sentry/static/sentry/app/actionCreators/projects.tsx +++ b/src/sentry/static/sentry/app/actionCreators/projects.tsx @@ -1,18 +1,18 @@ +import {Query} from 'history'; import chunk from 'lodash/chunk'; import debounce from 'lodash/debounce'; -import {Query} from 'history'; -import {Client} from 'app/api'; -import {PlatformKey} from 'app/data/platformCategories'; -import {Project, Team} from 'app/types'; import { - addLoadingMessage, addErrorMessage, + addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {t, tct} from 'app/locale'; import ProjectActions from 'app/actions/projectActions'; +import {Client} from 'app/api'; +import {PlatformKey} from 'app/data/platformCategories'; +import {t, tct} from 'app/locale'; import ProjectsStatsStore from 'app/stores/projectsStatsStore'; +import {Project, Team} from 'app/types'; type UpdateParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/actionCreators/release.tsx b/src/sentry/static/sentry/app/actionCreators/release.tsx index 1432991e8964b5..8d52c66207f38d 100644 --- a/src/sentry/static/sentry/app/actionCreators/release.tsx +++ b/src/sentry/static/sentry/app/actionCreators/release.tsx @@ -1,15 +1,15 @@ import * as Sentry from '@sentry/react'; -import {t} from 'app/locale'; -import ReleaseActions from 'app/actions/releaseActions'; -import {Client} from 'app/api'; -import ReleaseStore, {getReleaseStoreKey} from 'app/stores/releaseStore'; -import {Deploy, Release, ReleaseStatus} from 'app/types'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; +import ReleaseActions from 'app/actions/releaseActions'; +import {Client} from 'app/api'; +import {t} from 'app/locale'; +import ReleaseStore, {getReleaseStoreKey} from 'app/stores/releaseStore'; +import {Deploy, Release, ReleaseStatus} from 'app/types'; type ParamsGet = { orgSlug: string; diff --git a/src/sentry/static/sentry/app/actionCreators/savedSearches.tsx b/src/sentry/static/sentry/app/actionCreators/savedSearches.tsx index a3ac4a648cf9d1..da217cf3b90563 100644 --- a/src/sentry/static/sentry/app/actionCreators/savedSearches.tsx +++ b/src/sentry/static/sentry/app/actionCreators/savedSearches.tsx @@ -1,10 +1,10 @@ +import {addErrorMessage} from 'app/actionCreators/indicator'; +import SavedSearchesActions from 'app/actions/savedSearchesActions'; import {Client} from 'app/api'; import {MAX_AUTOCOMPLETE_RECENT_SEARCHES} from 'app/constants'; -import {addErrorMessage} from 'app/actionCreators/indicator'; import {t} from 'app/locale'; -import SavedSearchesActions from 'app/actions/savedSearchesActions'; +import {RecentSearch, SavedSearch, SavedSearchType} from 'app/types'; import handleXhrErrorResponse from 'app/utils/handleXhrErrorResponse'; -import {SavedSearch, RecentSearch, SavedSearchType} from 'app/types'; export function resetSavedSearches() { SavedSearchesActions.resetSavedSearches(); diff --git a/src/sentry/static/sentry/app/actionCreators/sentryAppInstallations.tsx b/src/sentry/static/sentry/app/actionCreators/sentryAppInstallations.tsx index 1c7548c3770834..e9c99d65378a80 100644 --- a/src/sentry/static/sentry/app/actionCreators/sentryAppInstallations.tsx +++ b/src/sentry/static/sentry/app/actionCreators/sentryAppInstallations.tsx @@ -4,8 +4,8 @@ import { addSuccessMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; import {Client} from 'app/api'; +import {t} from 'app/locale'; import {SentryApp, SentryAppInstallation} from 'app/types'; /** diff --git a/src/sentry/static/sentry/app/actionCreators/sentryAppTokens.tsx b/src/sentry/static/sentry/app/actionCreators/sentryAppTokens.tsx index 777e98d0d7e7ff..a8ca7a887d122e 100644 --- a/src/sentry/static/sentry/app/actionCreators/sentryAppTokens.tsx +++ b/src/sentry/static/sentry/app/actionCreators/sentryAppTokens.tsx @@ -3,9 +3,9 @@ import { addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import {SentryApp, InternalAppApiToken} from 'app/types'; import {Client} from 'app/api'; +import {t} from 'app/locale'; +import {InternalAppApiToken, SentryApp} from 'app/types'; /** * Install a sentry application diff --git a/src/sentry/static/sentry/app/actionCreators/sentryApps.tsx b/src/sentry/static/sentry/app/actionCreators/sentryApps.tsx index 5825684eca77b3..a9b7bedafd4840 100644 --- a/src/sentry/static/sentry/app/actionCreators/sentryApps.tsx +++ b/src/sentry/static/sentry/app/actionCreators/sentryApps.tsx @@ -4,8 +4,8 @@ import { addSuccessMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; import {Client} from 'app/api'; +import {t} from 'app/locale'; import {SentryApp} from 'app/types'; /** diff --git a/src/sentry/static/sentry/app/actionCreators/tags.tsx b/src/sentry/static/sentry/app/actionCreators/tags.tsx index 58cc72b5bfc659..43fd40c77ef938 100644 --- a/src/sentry/static/sentry/app/actionCreators/tags.tsx +++ b/src/sentry/static/sentry/app/actionCreators/tags.tsx @@ -1,12 +1,12 @@ import {Query} from 'history'; -import {t} from 'app/locale'; -import {Client} from 'app/api'; -import {Tag, GlobalSelection} from 'app/types'; -import TagStore from 'app/stores/tagStore'; -import TagActions from 'app/actions/tagActions'; import AlertActions from 'app/actions/alertActions'; +import TagActions from 'app/actions/tagActions'; +import {Client} from 'app/api'; import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; +import {t} from 'app/locale'; +import TagStore from 'app/stores/tagStore'; +import {GlobalSelection, Tag} from 'app/types'; const MAX_TAGS = 1000; diff --git a/src/sentry/static/sentry/app/actionCreators/teams.tsx b/src/sentry/static/sentry/app/actionCreators/teams.tsx index cba99e1310e088..ba82951aa9b319 100644 --- a/src/sentry/static/sentry/app/actionCreators/teams.tsx +++ b/src/sentry/static/sentry/app/actionCreators/teams.tsx @@ -1,10 +1,10 @@ -import {Client} from 'app/api'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import TeamActions from 'app/actions/teamActions'; +import {Client} from 'app/api'; import {tct} from 'app/locale'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; -import {uniqueId} from 'app/utils/guid'; import {Team} from 'app/types'; import {callIfFunction} from 'app/utils/callIfFunction'; +import {uniqueId} from 'app/utils/guid'; type CallbackOptions = { success?: Function; diff --git a/src/sentry/static/sentry/app/api.tsx b/src/sentry/static/sentry/app/api.tsx index 254716708b5934..c38ddb16ec73dc 100644 --- a/src/sentry/static/sentry/app/api.tsx +++ b/src/sentry/static/sentry/app/api.tsx @@ -1,18 +1,18 @@ -import isUndefined from 'lodash/isUndefined'; -import isNil from 'lodash/isNil'; -import $ from 'jquery'; import {Severity} from '@sentry/react'; +import $ from 'jquery'; +import isNil from 'lodash/isNil'; +import isUndefined from 'lodash/isUndefined'; +import {openSudo, redirectToProject} from 'app/actionCreators/modal'; +import GroupActions from 'app/actions/groupActions'; import { PROJECT_MOVED, SUDO_REQUIRED, SUPERUSER_REQUIRED, } from 'app/constants/apiErrorCodes'; -import {run} from 'app/utils/apiSentryClient'; import {metric} from 'app/utils/analytics'; -import {openSudo, redirectToProject} from 'app/actionCreators/modal'; +import {run} from 'app/utils/apiSentryClient'; import {uniqueId} from 'app/utils/guid'; -import GroupActions from 'app/actions/groupActions'; import createRequestError from 'app/utils/requestError/createRequestError'; export class Request { diff --git a/src/sentry/static/sentry/app/bootstrap.tsx b/src/sentry/static/sentry/app/bootstrap.tsx index c17ef4c2c49547..cdd49bac875e16 100644 --- a/src/sentry/static/sentry/app/bootstrap.tsx +++ b/src/sentry/static/sentry/app/bootstrap.tsx @@ -2,31 +2,30 @@ import 'bootstrap/js/alert'; import 'bootstrap/js/tab'; import 'bootstrap/js/dropdown'; import 'focus-visible'; - import 'app/utils/statics-setup'; -import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; -import Reflux from 'reflux'; import * as Router from 'react-router'; +import {ExtraErrorData} from '@sentry/integrations'; +import * as Sentry from '@sentry/react'; import SentryRRWeb from '@sentry/rrweb'; +import {Integrations} from '@sentry/tracing'; import createReactClass from 'create-react-class'; import jQuery from 'jquery'; import moment from 'moment'; -import {Integrations} from '@sentry/tracing'; -import {ExtraErrorData} from '@sentry/integrations'; -import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; -import {NODE_ENV, DISABLE_RR_WEB, SPA_DSN} from 'app/constants'; -import {metric} from 'app/utils/analytics'; -import {setupColorScheme} from 'app/utils/matchMedia'; -import {init as initApiSentryClient} from 'app/utils/apiSentryClient'; -import ConfigStore from 'app/stores/configStore'; +import {DISABLE_RR_WEB, NODE_ENV, SPA_DSN} from 'app/constants'; import Main from 'app/main'; -import ajaxCsrfSetup from 'app/utils/ajaxCsrfSetup'; import plugins from 'app/plugins'; import routes from 'app/routes'; +import ConfigStore from 'app/stores/configStore'; +import ajaxCsrfSetup from 'app/utils/ajaxCsrfSetup'; +import {metric} from 'app/utils/analytics'; +import {init as initApiSentryClient} from 'app/utils/apiSentryClient'; +import {setupColorScheme} from 'app/utils/matchMedia'; if (NODE_ENV === 'development') { import( diff --git a/src/sentry/static/sentry/app/components/acl/access.tsx b/src/sentry/static/sentry/app/components/acl/access.tsx index d031d650c0c847..3f2f20b25719b7 100644 --- a/src/sentry/static/sentry/app/components/acl/access.tsx +++ b/src/sentry/static/sentry/app/components/acl/access.tsx @@ -1,14 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {Config, Organization, Scope} from 'app/types'; import Alert from 'app/components/alert'; import {IconInfo} from 'app/icons'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {Config, Organization, Scope} from 'app/types'; +import {isRenderFunc} from 'app/utils/isRenderFunc'; import withConfig from 'app/utils/withConfig'; import withOrganization from 'app/utils/withOrganization'; -import {isRenderFunc} from 'app/utils/isRenderFunc'; const DEFAULT_NO_ACCESS_MESSAGE = ( <Alert type="error" icon={<IconInfo size="md" />}> diff --git a/src/sentry/static/sentry/app/components/acl/comingSoon.tsx b/src/sentry/static/sentry/app/components/acl/comingSoon.tsx index f5809ca79ad9a2..8b4517d1fc1fc5 100644 --- a/src/sentry/static/sentry/app/components/acl/comingSoon.tsx +++ b/src/sentry/static/sentry/app/components/acl/comingSoon.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {t} from 'app/locale'; -import {IconInfo} from 'app/icons'; import Alert from 'app/components/alert'; +import {IconInfo} from 'app/icons'; +import {t} from 'app/locale'; const ComingSoon = () => ( <Alert type="info" icon={<IconInfo size="md" />}> diff --git a/src/sentry/static/sentry/app/components/acl/feature.tsx b/src/sentry/static/sentry/app/components/acl/feature.tsx index 912d5997a6e8f8..705c82a9f3eaca 100644 --- a/src/sentry/static/sentry/app/components/acl/feature.tsx +++ b/src/sentry/static/sentry/app/components/acl/feature.tsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {Project, Organization, Config} from 'app/types'; -import {FeatureDisabledHooks} from 'app/types/hooks'; -import HookStore from 'app/stores/hookStore'; import SentryTypes from 'app/sentryTypes'; +import HookStore from 'app/stores/hookStore'; +import {Config, Organization, Project} from 'app/types'; +import {FeatureDisabledHooks} from 'app/types/hooks'; +import {isRenderFunc} from 'app/utils/isRenderFunc'; import withConfig from 'app/utils/withConfig'; import withOrganization from 'app/utils/withOrganization'; import withProject from 'app/utils/withProject'; -import {isRenderFunc} from 'app/utils/isRenderFunc'; import ComingSoon from './comingSoon'; diff --git a/src/sentry/static/sentry/app/components/acl/featureDisabled.tsx b/src/sentry/static/sentry/app/components/acl/featureDisabled.tsx index c6b3af249c7527..bde677d437cf04 100644 --- a/src/sentry/static/sentry/app/components/acl/featureDisabled.tsx +++ b/src/sentry/static/sentry/app/components/acl/featureDisabled.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {selectText} from 'app/utils/selectText'; -import {IconInfo, IconChevron, IconLock, IconCopy} from 'app/icons'; -import {t, tct} from 'app/locale'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; import Clipboard from 'app/components/clipboard'; import ExternalLink from 'app/components/links/externalLink'; -import space from 'app/styles/space'; import {CONFIG_DOCS_URL} from 'app/constants'; +import {IconChevron, IconCopy, IconInfo, IconLock} from 'app/icons'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {selectText} from 'app/utils/selectText'; const installText = (features: string[], featureName: string): string => `# ${t('Enables the %s feature', featureName)}\n${features diff --git a/src/sentry/static/sentry/app/components/acl/role.tsx b/src/sentry/static/sentry/app/components/acl/role.tsx index 04268db83ab95b..c8559b6f248270 100644 --- a/src/sentry/static/sentry/app/components/acl/role.tsx +++ b/src/sentry/static/sentry/app/components/acl/role.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {Organization} from 'app/types'; import ConfigStore from 'app/stores/configStore'; -import withOrganization from 'app/utils/withOrganization'; +import {Organization} from 'app/types'; import {isRenderFunc} from 'app/utils/isRenderFunc'; +import withOrganization from 'app/utils/withOrganization'; type RoleRenderProps = { hasRole: boolean; diff --git a/src/sentry/static/sentry/app/components/actions/ignore.tsx b/src/sentry/static/sentry/app/components/actions/ignore.tsx index a6868922418a60..006e0022e14320 100644 --- a/src/sentry/static/sentry/app/components/actions/ignore.tsx +++ b/src/sentry/static/sentry/app/components/actions/ignore.tsx @@ -1,23 +1,23 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import classNames from 'classnames'; import styled from '@emotion/styled'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; +import ActionLink from 'app/components/actions/actionLink'; +import CustomIgnoreCountModal from 'app/components/customIgnoreCountModal'; +import CustomIgnoreDurationModal from 'app/components/customIgnoreDurationModal'; +import DropdownLink from 'app/components/dropdownLink'; +import Duration from 'app/components/duration'; +import MenuItem from 'app/components/menuItem'; +import Tooltip from 'app/components/tooltip'; import {IconNot} from 'app/icons'; +import {t, tn} from 'app/locale'; +import space from 'app/styles/space'; import { ResolutionStatus, ResolutionStatusDetails, UpdateResolutionStatus, } from 'app/types'; -import {t, tn} from 'app/locale'; -import MenuItem from 'app/components/menuItem'; -import DropdownLink from 'app/components/dropdownLink'; -import Duration from 'app/components/duration'; -import CustomIgnoreCountModal from 'app/components/customIgnoreCountModal'; -import CustomIgnoreDurationModal from 'app/components/customIgnoreDurationModal'; -import ActionLink from 'app/components/actions/actionLink'; -import Tooltip from 'app/components/tooltip'; -import space from 'app/styles/space'; enum ModalStates { COUNT, diff --git a/src/sentry/static/sentry/app/components/actions/resolve.tsx b/src/sentry/static/sentry/app/components/actions/resolve.tsx index e5b4ebcf6b0099..5659ab3bdfe770 100644 --- a/src/sentry/static/sentry/app/components/actions/resolve.tsx +++ b/src/sentry/static/sentry/app/components/actions/resolve.tsx @@ -1,16 +1,15 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import classNames from 'classnames'; import styled from '@emotion/styled'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {IconCheckmark} from 'app/icons'; +import ActionLink from 'app/components/actions/actionLink'; import CustomResolutionModal from 'app/components/customResolutionModal'; -import MenuItem from 'app/components/menuItem'; import DropdownLink from 'app/components/dropdownLink'; -import ActionLink from 'app/components/actions/actionLink'; +import MenuItem from 'app/components/menuItem'; import Tooltip from 'app/components/tooltip'; -import {formatVersion} from 'app/utils/formatters'; +import {IconCheckmark} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import { Release, @@ -18,6 +17,7 @@ import { ResolutionStatusDetails, UpdateResolutionStatus, } from 'app/types'; +import {formatVersion} from 'app/utils/formatters'; const defaultProps = { isResolved: false, diff --git a/src/sentry/static/sentry/app/components/activity/item/avatar.tsx b/src/sentry/static/sentry/app/components/activity/item/avatar.tsx index 6b2be80d33bb11..f70ff1aa3aa6e6 100644 --- a/src/sentry/static/sentry/app/components/activity/item/avatar.tsx +++ b/src/sentry/static/sentry/app/components/activity/item/avatar.tsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {AvatarUser} from 'app/types'; import UserAvatar from 'app/components/avatar/userAvatar'; -import {IconSentry} from 'app/icons'; import Placeholder from 'app/components/placeholder'; +import {IconSentry} from 'app/icons'; import SentryTypes from 'app/sentryTypes'; +import {AvatarUser} from 'app/types'; type Props = { type: 'system' | 'user'; diff --git a/src/sentry/static/sentry/app/components/activity/item/bubble.tsx b/src/sentry/static/sentry/app/components/activity/item/bubble.tsx index a236e175a28b49..25c5dbf66ae944 100644 --- a/src/sentry/static/sentry/app/components/activity/item/bubble.tsx +++ b/src/sentry/static/sentry/app/components/activity/item/bubble.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; type Props = { backgroundColor?: string; diff --git a/src/sentry/static/sentry/app/components/activity/item/index.tsx b/src/sentry/static/sentry/app/components/activity/item/index.tsx index 1a490709c23caf..7a5a944bbec9fd 100644 --- a/src/sentry/static/sentry/app/components/activity/item/index.tsx +++ b/src/sentry/static/sentry/app/components/activity/item/index.tsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; import moment from 'moment-timezone'; +import PropTypes from 'prop-types'; -import {AvatarUser} from 'app/types'; import DateTime from 'app/components/dateTime'; import TimeSince from 'app/components/timeSince'; import space from 'app/styles/space'; import textStyles from 'app/styles/text'; +import {AvatarUser} from 'app/types'; import {isRenderFunc} from 'app/utils/isRenderFunc'; import ActivityAvatar from './avatar'; diff --git a/src/sentry/static/sentry/app/components/activity/note/body.tsx b/src/sentry/static/sentry/app/components/activity/note/body.tsx index c97a16b37e5418..78076972487f07 100644 --- a/src/sentry/static/sentry/app/components/activity/note/body.tsx +++ b/src/sentry/static/sentry/app/components/activity/note/body.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import marked from 'app/utils/marked'; diff --git a/src/sentry/static/sentry/app/components/activity/note/header.tsx b/src/sentry/static/sentry/app/components/activity/note/header.tsx index a749ce186534ea..643612238208a7 100644 --- a/src/sentry/static/sentry/app/components/activity/note/header.tsx +++ b/src/sentry/static/sentry/app/components/activity/note/header.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import ActivityAuthor from 'app/components/activity/author'; -import ConfigStore from 'app/stores/configStore'; import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; +import Tooltip from 'app/components/tooltip'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import {User} from 'app/types'; import {Theme} from 'app/utils/theme'; -import Tooltip from 'app/components/tooltip'; import EditorTools from './editorTools'; diff --git a/src/sentry/static/sentry/app/components/activity/note/index.tsx b/src/sentry/static/sentry/app/components/activity/note/index.tsx index 91b8a9e0624ced..4897a5334f010c 100644 --- a/src/sentry/static/sentry/app/components/activity/note/index.tsx +++ b/src/sentry/static/sentry/app/components/activity/note/index.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {ActivityType} from 'app/views/alerts/types'; -import {User} from 'app/types'; -import {NoteType} from 'app/types/alerts'; import ActivityItem, {ActivityAuthorType} from 'app/components/activity/item'; import space from 'app/styles/space'; +import {User} from 'app/types'; +import {NoteType} from 'app/types/alerts'; +import {ActivityType} from 'app/views/alerts/types'; -import EditorTools from './editorTools'; import NoteBody from './body'; +import EditorTools from './editorTools'; import NoteHeader from './header'; import NoteInput from './input'; diff --git a/src/sentry/static/sentry/app/components/activity/note/input.tsx b/src/sentry/static/sentry/app/components/activity/note/input.tsx index 88c31a247fb6a0..0bb70517bc1a5a 100644 --- a/src/sentry/static/sentry/app/components/activity/note/input.tsx +++ b/src/sentry/static/sentry/app/components/activity/note/input.tsx @@ -1,20 +1,20 @@ -import {MentionsInput, Mention} from 'react-mentions'; import React from 'react'; +import {Mention, MentionsInput} from 'react-mentions'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {NoteType} from 'app/types/alerts'; import Button from 'app/components/button'; -import ConfigStore from 'app/stores/configStore'; import NavTabs from 'app/components/navTabs'; import {IconMarkdown} from 'app/icons'; -import marked from 'app/utils/marked'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; import textStyles from 'app/styles/text'; +import {NoteType} from 'app/types/alerts'; +import marked from 'app/utils/marked'; -import {Mentionable, Mentioned, MentionChangeEvent, CreateError} from './types'; import Mentionables from './mentionables'; import mentionStyle from './mentionStyle'; +import {CreateError, Mentionable, MentionChangeEvent, Mentioned} from './types'; const defaultProps = { placeholder: t('Add a comment.\nTag users with @, or teams with #'), diff --git a/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.tsx b/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.tsx index 1d778805cb91d1..13114b03cc9eff 100644 --- a/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.tsx +++ b/src/sentry/static/sentry/app/components/activity/note/inputWithStorage.tsx @@ -1,10 +1,10 @@ -import debounce from 'lodash/debounce'; import React from 'react'; import * as Sentry from '@sentry/react'; +import debounce from 'lodash/debounce'; -import {NoteType} from 'app/types/alerts'; -import {MentionChangeEvent} from 'app/components/activity/note/types'; import NoteInput from 'app/components/activity/note/input'; +import {MentionChangeEvent} from 'app/components/activity/note/types'; +import {NoteType} from 'app/types/alerts'; import localStorage from 'app/utils/localStorage'; const defaultProps = { diff --git a/src/sentry/static/sentry/app/components/activity/note/mentionables.tsx b/src/sentry/static/sentry/app/components/activity/note/mentionables.tsx index 8ac6e60beb9f06..cdc76caa53fccf 100644 --- a/src/sentry/static/sentry/app/components/activity/note/mentionables.tsx +++ b/src/sentry/static/sentry/app/components/activity/note/mentionables.tsx @@ -1,12 +1,12 @@ -import uniqBy from 'lodash/uniqBy'; import React from 'react'; +import uniqBy from 'lodash/uniqBy'; import MemberListStore from 'app/stores/memberListStore'; -import Projects from 'app/utils/projects'; +import {Organization, Project, User} from 'app/types'; import {callIfFunction} from 'app/utils/callIfFunction'; import {isRenderFunc} from 'app/utils/isRenderFunc'; +import Projects from 'app/utils/projects'; import withOrganization from 'app/utils/withOrganization'; -import {User, Project, Organization} from 'app/types'; import {Mentionable} from './types'; diff --git a/src/sentry/static/sentry/app/components/alert.tsx b/src/sentry/static/sentry/app/components/alert.tsx index 1eee3e36192beb..80739ab9e66aec 100644 --- a/src/sentry/static/sentry/app/components/alert.tsx +++ b/src/sentry/static/sentry/app/components/alert.tsx @@ -1,8 +1,8 @@ -import {css} from '@emotion/core'; -import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; +import {css} from '@emotion/core'; import styled from '@emotion/styled'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/alertLink.tsx b/src/sentry/static/sentry/app/components/alertLink.tsx index 99a5d6addd41e4..00ddd002c94b7d 100644 --- a/src/sentry/static/sentry/app/components/alertLink.tsx +++ b/src/sentry/static/sentry/app/components/alertLink.tsx @@ -1,9 +1,9 @@ -import styled from '@emotion/styled'; import React from 'react'; +import styled from '@emotion/styled'; import omit from 'lodash/omit'; -import Link from 'app/components/links/link'; import ExternalLink from 'app/components/links/externalLink'; +import Link from 'app/components/links/link'; import {IconChevron} from 'app/icons'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/alerts/toastIndicator.tsx b/src/sentry/static/sentry/app/components/alerts/toastIndicator.tsx index 204e0b9904ca6d..780a60e0f3de36 100644 --- a/src/sentry/static/sentry/app/components/alerts/toastIndicator.tsx +++ b/src/sentry/static/sentry/app/components/alerts/toastIndicator.tsx @@ -1,15 +1,15 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; import styled from '@emotion/styled'; +import classNames from 'classnames'; import {motion} from 'framer-motion'; +import PropTypes from 'prop-types'; import {Indicator} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import {IconCheckmark, IconClose} from 'app/icons'; import LoadingIndicator from 'app/components/loadingIndicator'; -import testableTransition from 'app/utils/testableTransition'; +import {IconCheckmark, IconClose} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import testableTransition from 'app/utils/testableTransition'; const Toast = styled(motion.div)` display: flex; diff --git a/src/sentry/static/sentry/app/components/assigneeSelector.tsx b/src/sentry/static/sentry/app/components/assigneeSelector.tsx index 9cd823bc1d66d9..311268fcb7a812 100644 --- a/src/sentry/static/sentry/app/components/assigneeSelector.tsx +++ b/src/sentry/static/sentry/app/components/assigneeSelector.tsx @@ -1,30 +1,30 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; -import SentryTypes from 'app/sentryTypes'; -import {User} from 'app/types'; -import {assignToUser, assignToActor, clearAssignment} from 'app/actionCreators/group'; +import {assignToActor, assignToUser, clearAssignment} from 'app/actionCreators/group'; import {openInviteMembersModal} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; -import {valueIsEqual, buildUserId, buildTeamId} from 'app/utils'; import ActorAvatar from 'app/components/avatar/actorAvatar'; -import UserAvatar from 'app/components/avatar/userAvatar'; import TeamAvatar from 'app/components/avatar/teamAvatar'; -import ConfigStore from 'app/stores/configStore'; +import UserAvatar from 'app/components/avatar/userAvatar'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownBubble from 'app/components/dropdownBubble'; -import GroupStore from 'app/stores/groupStore'; import Highlight from 'app/components/highlight'; import Link from 'app/components/links/link'; import LoadingIndicator from 'app/components/loadingIndicator'; +import TextOverflow from 'app/components/textOverflow'; +import {IconAdd, IconChevron, IconClose, IconUser} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import ConfigStore from 'app/stores/configStore'; +import GroupStore from 'app/stores/groupStore'; import MemberListStore from 'app/stores/memberListStore'; import ProjectsStore from 'app/stores/projectsStore'; -import TextOverflow from 'app/components/textOverflow'; import space from 'app/styles/space'; -import {IconAdd, IconClose, IconChevron, IconUser} from 'app/icons'; +import {User} from 'app/types'; +import {buildTeamId, buildUserId, valueIsEqual} from 'app/utils'; type Props = { id: string | null; diff --git a/src/sentry/static/sentry/app/components/assistant/getGuidesContent.tsx b/src/sentry/static/sentry/app/components/assistant/getGuidesContent.tsx index d63c8605314912..0824ae20eaba78 100644 --- a/src/sentry/static/sentry/app/components/assistant/getGuidesContent.tsx +++ b/src/sentry/static/sentry/app/components/assistant/getGuidesContent.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {t, tct} from 'app/locale'; import {GuidesContent} from 'app/components/assistant/types'; import ExternalLink from 'app/components/links/externalLink'; +import {t, tct} from 'app/locale'; export default function getGuidesContent(): GuidesContent { return [ diff --git a/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx b/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx index b0dffa18f1749a..6d6b501aa8dad7 100644 --- a/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx +++ b/src/sentry/static/sentry/app/components/assistant/guideAnchor.tsx @@ -1,9 +1,9 @@ -import createReactClass from 'create-react-class'; -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; import { closeGuide, @@ -14,10 +14,10 @@ import { unregisterAnchor, } from 'app/actionCreators/guides'; import {Guide} from 'app/components/assistant/types'; -import {t, tct} from 'app/locale'; import Button from 'app/components/button'; -import GuideStore from 'app/stores/guideStore'; import Hovercard, {Body as HovercardBody} from 'app/components/hovercard'; +import {t, tct} from 'app/locale'; +import GuideStore from 'app/stores/guideStore'; import space from 'app/styles/space'; import theme from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/asyncComponent.tsx b/src/sentry/static/sentry/app/components/asyncComponent.tsx index 1a0060a32a7b87..ce3463708009fb 100644 --- a/src/sentry/static/sentry/app/components/asyncComponent.tsx +++ b/src/sentry/static/sentry/app/components/asyncComponent.tsx @@ -1,19 +1,19 @@ -import isEqual from 'lodash/isEqual'; -import PropTypes from 'prop-types'; import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {WithRouterProps} from 'react-router/lib/withRouter'; import * as Sentry from '@sentry/react'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; import {Client} from 'app/api'; -import {t} from 'app/locale'; import AsyncComponentSearchInput from 'app/components/asyncComponentSearchInput'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import PermissionDenied from 'app/views/permissionDenied'; -import RouteError from 'app/views/routeError'; +import {t} from 'app/locale'; import {metric} from 'app/utils/analytics'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; +import PermissionDenied from 'app/views/permissionDenied'; +import RouteError from 'app/views/routeError'; type AsyncComponentProps = Partial<RouteComponentProps<{}, {}>>; diff --git a/src/sentry/static/sentry/app/components/asyncComponentSearchInput.tsx b/src/sentry/static/sentry/app/components/asyncComponentSearchInput.tsx index c9ac53a4330019..2c7b69ebcd16db 100644 --- a/src/sentry/static/sentry/app/components/asyncComponentSearchInput.tsx +++ b/src/sentry/static/sentry/app/components/asyncComponentSearchInput.tsx @@ -1,12 +1,12 @@ -import * as ReactRouter from 'react-router'; -import debounce from 'lodash/debounce'; import React from 'react'; +import * as ReactRouter from 'react-router'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; +import {Client} from 'app/api'; +import LoadingIndicator from 'app/components/loadingIndicator'; import {t} from 'app/locale'; import Input from 'app/views/settings/components/forms/controls/input'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import {Client} from 'app/api'; type RenderProps = { defaultSearchBar: React.ReactNode; diff --git a/src/sentry/static/sentry/app/components/autoComplete.jsx b/src/sentry/static/sentry/app/components/autoComplete.jsx index dd1f35c1aa963b..5e5cc9ef4f7acb 100644 --- a/src/sentry/static/sentry/app/components/autoComplete.jsx +++ b/src/sentry/static/sentry/app/components/autoComplete.jsx @@ -8,11 +8,11 @@ * This component handles logic like when the dropdown menu should be displayed, as well as handling keyboard input, how * it is rendered should be left to the child. */ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {callIfFunction} from 'app/utils/callIfFunction'; import DropdownMenu from 'app/components/dropdownMenu'; +import {callIfFunction} from 'app/utils/callIfFunction'; class AutoComplete extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/autoSelectText.tsx b/src/sentry/static/sentry/app/components/autoSelectText.tsx index de88a3ad438bb8..532cc9f1eb515a 100644 --- a/src/sentry/static/sentry/app/components/autoSelectText.tsx +++ b/src/sentry/static/sentry/app/components/autoSelectText.tsx @@ -1,9 +1,9 @@ import React, {CSSProperties} from 'react'; -import PropTypes from 'prop-types'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; -import {selectText} from 'app/utils/selectText'; import {isRenderFunc} from 'app/utils/isRenderFunc'; +import {selectText} from 'app/utils/selectText'; type ChildRenderProps = { doSelect: () => void; diff --git a/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx b/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx index 4aab8212f71995..073eec501beaef 100644 --- a/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/actorAvatar.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import PropTypes from 'prop-types'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; -import SentryTypes from 'app/sentryTypes'; -import UserAvatar from 'app/components/avatar/userAvatar'; import TeamAvatar from 'app/components/avatar/teamAvatar'; +import UserAvatar from 'app/components/avatar/userAvatar'; +import SentryTypes from 'app/sentryTypes'; import MemberListStore from 'app/stores/memberListStore'; import TeamStore from 'app/stores/teamStore'; import {Actor} from 'app/types'; diff --git a/src/sentry/static/sentry/app/components/avatar/avatarList.tsx b/src/sentry/static/sentry/app/components/avatar/avatarList.tsx index 1e68cb39930bc7..b0e86139f7ce42 100644 --- a/src/sentry/static/sentry/app/components/avatar/avatarList.tsx +++ b/src/sentry/static/sentry/app/components/avatar/avatarList.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {AvatarUser} from 'app/types'; -import SentryTypes from 'app/sentryTypes'; import UserAvatar from 'app/components/avatar/userAvatar'; import Tooltip from 'app/components/tooltip'; +import SentryTypes from 'app/sentryTypes'; +import {AvatarUser} from 'app/types'; const defaultProps = { avatarSize: 28, diff --git a/src/sentry/static/sentry/app/components/avatar/baseAvatar.tsx b/src/sentry/static/sentry/app/components/avatar/baseAvatar.tsx index 69161da4af3c45..4472abf854d5c6 100644 --- a/src/sentry/static/sentry/app/components/avatar/baseAvatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/baseAvatar.tsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import styled from '@emotion/styled'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import * as qs from 'query-string'; -import styled from '@emotion/styled'; import LetterAvatar from 'app/components/letterAvatar'; import Tooltip from 'app/components/tooltip'; -import {imageStyle} from './styles'; import Gravatar from './gravatar'; +import {imageStyle} from './styles'; const DEFAULT_GRAVATAR_SIZE = 64; const ALLOWED_SIZES = [20, 32, 36, 48, 52, 64, 80, 96, 120]; diff --git a/src/sentry/static/sentry/app/components/avatar/gravatar.tsx b/src/sentry/static/sentry/app/components/avatar/gravatar.tsx index dc87a8b1ba3537..1b9b681857e08c 100644 --- a/src/sentry/static/sentry/app/components/avatar/gravatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/gravatar.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import * as qs from 'query-string'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import * as qs from 'query-string'; import ConfigStore from 'app/stores/configStore'; import {callIfFunction} from 'app/utils/callIfFunction'; diff --git a/src/sentry/static/sentry/app/components/avatar/index.tsx b/src/sentry/static/sentry/app/components/avatar/index.tsx index 7b5b1434ade70d..ee6c085a9d217d 100644 --- a/src/sentry/static/sentry/app/components/avatar/index.tsx +++ b/src/sentry/static/sentry/app/components/avatar/index.tsx @@ -4,7 +4,7 @@ import OrganizationAvatar from 'app/components/avatar/organizationAvatar'; import ProjectAvatar from 'app/components/avatar/projectAvatar'; import TeamAvatar from 'app/components/avatar/teamAvatar'; import UserAvatar from 'app/components/avatar/userAvatar'; -import {Team, OrganizationSummary, AvatarProject} from 'app/types'; +import {AvatarProject, OrganizationSummary, Team} from 'app/types'; type Props = { team?: Team; diff --git a/src/sentry/static/sentry/app/components/avatar/organizationAvatar.tsx b/src/sentry/static/sentry/app/components/avatar/organizationAvatar.tsx index 5c7fff6544c2d5..d7783971b17ed2 100644 --- a/src/sentry/static/sentry/app/components/avatar/organizationAvatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/organizationAvatar.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {OrganizationSummary} from 'app/types'; -import {explodeSlug} from 'app/utils'; import BaseAvatar from 'app/components/avatar/baseAvatar'; import SentryTypes from 'app/sentryTypes'; +import {OrganizationSummary} from 'app/types'; +import {explodeSlug} from 'app/utils'; type Props = { organization?: OrganizationSummary; diff --git a/src/sentry/static/sentry/app/components/avatar/projectAvatar.tsx b/src/sentry/static/sentry/app/components/avatar/projectAvatar.tsx index 4d1db7df7f8684..be92f683fdeb31 100644 --- a/src/sentry/static/sentry/app/components/avatar/projectAvatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/projectAvatar.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import BaseAvatar from 'app/components/avatar/baseAvatar'; import PlatformList from 'app/components/platformList'; diff --git a/src/sentry/static/sentry/app/components/avatar/teamAvatar.tsx b/src/sentry/static/sentry/app/components/avatar/teamAvatar.tsx index 1185202b0a4503..4dfc038d7f28ee 100644 --- a/src/sentry/static/sentry/app/components/avatar/teamAvatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/teamAvatar.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {explodeSlug} from 'app/utils'; import BaseAvatar from 'app/components/avatar/baseAvatar'; import SentryTypes from 'app/sentryTypes'; import {Team} from 'app/types'; +import {explodeSlug} from 'app/utils'; type Props = { team: Team | null; diff --git a/src/sentry/static/sentry/app/components/avatar/userAvatar.tsx b/src/sentry/static/sentry/app/components/avatar/userAvatar.tsx index f9b990808f1962..219a4c49d222d4 100644 --- a/src/sentry/static/sentry/app/components/avatar/userAvatar.tsx +++ b/src/sentry/static/sentry/app/components/avatar/userAvatar.tsx @@ -1,10 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {Actor, AvatarUser} from 'app/types'; -import {userDisplayName} from 'app/utils/formatters'; import BaseAvatar from 'app/components/avatar/baseAvatar'; import SentryTypes from 'app/sentryTypes'; +import {Actor, AvatarUser} from 'app/types'; +import {userDisplayName} from 'app/utils/formatters'; import {isRenderFunc} from 'app/utils/isRenderFunc'; type RenderTooltipFunc = (user: AvatarUser | Actor) => React.ReactNode; diff --git a/src/sentry/static/sentry/app/components/avatarChooser.tsx b/src/sentry/static/sentry/app/components/avatarChooser.tsx index 67d778a6f0ee87..7f6a64a35f4801 100644 --- a/src/sentry/static/sentry/app/components/avatarChooser.tsx +++ b/src/sentry/static/sentry/app/components/avatarChooser.tsx @@ -1,20 +1,20 @@ import React from 'react'; import styled from '@emotion/styled'; -import RadioGroup from 'app/views/settings/components/forms/controls/radioGroup'; -import {t} from 'app/locale'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import withApi from 'app/utils/withApi'; -import Well from 'app/components/well'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {Client} from 'app/api'; import Avatar from 'app/components/avatar'; import AvatarCropper from 'app/components/avatarCropper'; import Button from 'app/components/button'; import ExternalLink from 'app/components/links/externalLink'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import {Client} from 'app/api'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import Well from 'app/components/well'; +import {t} from 'app/locale'; import {AvatarUser, Organization, Team} from 'app/types'; +import withApi from 'app/utils/withApi'; +import RadioGroup from 'app/views/settings/components/forms/controls/radioGroup'; type Model = Pick<AvatarUser, 'avatar'>; type AvatarType = Required<Model>['avatar']['avatarType']; diff --git a/src/sentry/static/sentry/app/components/avatarCropper.tsx b/src/sentry/static/sentry/app/components/avatarCropper.tsx index d89ff4756cb8f5..83f1d62c5ad552 100644 --- a/src/sentry/static/sentry/app/components/avatarCropper.tsx +++ b/src/sentry/static/sentry/app/components/avatarCropper.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import Well from 'app/components/well'; import {AVATAR_URL_MAP} from 'app/constants'; import {t, tct} from 'app/locale'; -import Well from 'app/components/well'; import {AvatarUser} from 'app/types'; const resizerPositions = { diff --git a/src/sentry/static/sentry/app/components/badge.tsx b/src/sentry/static/sentry/app/components/badge.tsx index b3665387ec8597..9304bd2d978474 100644 --- a/src/sentry/static/sentry/app/components/badge.tsx +++ b/src/sentry/static/sentry/app/components/badge.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import space from 'app/styles/space'; import theme from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/banner.tsx b/src/sentry/static/sentry/app/components/banner.tsx index c643293443aff0..46373ff855cf2a 100644 --- a/src/sentry/static/sentry/app/components/banner.tsx +++ b/src/sentry/static/sentry/app/components/banner.tsx @@ -1,5 +1,5 @@ -import {css} from '@emotion/core'; import React from 'react'; +import {css} from '@emotion/core'; import styled from '@emotion/styled'; import {IconClose} from 'app/icons/iconClose'; diff --git a/src/sentry/static/sentry/app/components/bases/pluginComponentBase.tsx b/src/sentry/static/sentry/app/components/bases/pluginComponentBase.tsx index 6d1a8392722c9f..5fb83056a6d7ba 100644 --- a/src/sentry/static/sentry/app/components/bases/pluginComponentBase.tsx +++ b/src/sentry/static/sentry/app/components/bases/pluginComponentBase.tsx @@ -1,14 +1,14 @@ import React from 'react'; import isFunction from 'lodash/isFunction'; -import {Client} from 'app/api'; -import {FormState, GenericField} from 'app/components/forms'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, clearIndicators, } from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; +import {FormState, GenericField} from 'app/components/forms'; import {t} from 'app/locale'; const callbackWithArgs = function (context: any, callback: any, ...args: any) { diff --git a/src/sentry/static/sentry/app/components/breadcrumbs.tsx b/src/sentry/static/sentry/app/components/breadcrumbs.tsx index 6a7a7237770bbf..3e1e28dd6b31a7 100644 --- a/src/sentry/static/sentry/app/components/breadcrumbs.tsx +++ b/src/sentry/static/sentry/app/components/breadcrumbs.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {IconChevron} from 'app/icons'; -import Link from 'app/components/links/link'; import GlobalSelectionLink from 'app/components/globalSelectionLink'; +import Link from 'app/components/links/link'; +import {IconChevron} from 'app/icons'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {Theme} from 'app/utils/theme'; export type Crumb = { diff --git a/src/sentry/static/sentry/app/components/bulkController/bulkNotice.tsx b/src/sentry/static/sentry/app/components/bulkController/bulkNotice.tsx index d7f3428d9a26a0..61de6de40eb300 100644 --- a/src/sentry/static/sentry/app/components/bulkController/bulkNotice.tsx +++ b/src/sentry/static/sentry/app/components/bulkController/bulkNotice.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import {tn, tct, t} from 'app/locale'; +import {t, tct, tn} from 'app/locale'; import {defined} from 'app/utils'; -import {PanelAlert} from '../panels'; import Button from '../button'; +import {PanelAlert} from '../panels'; function getSelectAllText(allRowsCount?: number, bulkLimit?: number) { if (!defined(allRowsCount)) { diff --git a/src/sentry/static/sentry/app/components/bulkController/index.tsx b/src/sentry/static/sentry/app/components/bulkController/index.tsx index 1a503a63a2516e..dc5903b0440bbf 100644 --- a/src/sentry/static/sentry/app/components/bulkController/index.tsx +++ b/src/sentry/static/sentry/app/components/bulkController/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import xor from 'lodash/xor'; -import uniq from 'lodash/uniq'; import intersection from 'lodash/intersection'; +import uniq from 'lodash/uniq'; +import xor from 'lodash/xor'; import BulkNotice from './bulkNotice'; diff --git a/src/sentry/static/sentry/app/components/button.tsx b/src/sentry/static/sentry/app/components/button.tsx index 924ce486672705..03ecf648b796e7 100644 --- a/src/sentry/static/sentry/app/components/button.tsx +++ b/src/sentry/static/sentry/app/components/button.tsx @@ -1,13 +1,13 @@ +import React from 'react'; import {Link} from 'react-router'; import {css} from '@emotion/core'; -import PropTypes from 'prop-types'; -import React from 'react'; import isPropValid from '@emotion/is-prop-valid'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Theme} from 'app/utils/theme'; import ExternalLink from 'app/components/links/externalLink'; import Tooltip from 'app/components/tooltip'; +import {Theme} from 'app/utils/theme'; /** * The button can actually also be an anchor or React router Link (which seems diff --git a/src/sentry/static/sentry/app/components/buttonBar.tsx b/src/sentry/static/sentry/app/components/buttonBar.tsx index 9a8915778db837..8274c142348813 100644 --- a/src/sentry/static/sentry/app/components/buttonBar.tsx +++ b/src/sentry/static/sentry/app/components/buttonBar.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import classNames from 'classnames'; import styled from '@emotion/styled'; +import classNames from 'classnames'; import Button from 'app/components/button'; import space, {ValidSize} from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/charts/barChartZoom.tsx b/src/sentry/static/sentry/app/components/charts/barChartZoom.tsx index 567f01393a718a..930579ea749654 100644 --- a/src/sentry/static/sentry/app/components/charts/barChartZoom.tsx +++ b/src/sentry/static/sentry/app/components/charts/barChartZoom.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import {Location} from 'history'; import {browserHistory} from 'react-router'; import {EChartOption} from 'echarts/lib/echarts'; +import {Location} from 'history'; import DataZoomInside from 'app/components/charts/components/dataZoomInside'; import ToolBox from 'app/components/charts/components/toolBox'; -import {callIfFunction} from 'app/utils/callIfFunction'; import {EChartChartReadyHandler, EChartDataZoomHandler} from 'app/types/echarts'; +import {callIfFunction} from 'app/utils/callIfFunction'; export type RenderProps = { dataZoom: EChartOption['dataZoom']; diff --git a/src/sentry/static/sentry/app/components/charts/baseChart.tsx b/src/sentry/static/sentry/app/components/charts/baseChart.tsx index c435925eedff4c..dd35124d62bff8 100644 --- a/src/sentry/static/sentry/app/components/charts/baseChart.tsx +++ b/src/sentry/static/sentry/app/components/charts/baseChart.tsx @@ -1,27 +1,28 @@ -import {withTheme} from 'emotion-theming'; -import React from 'react'; import 'zrender/lib/svg/svg'; -import ReactEchartsCore from 'echarts-for-react/lib/core'; -import echarts, {EChartOption, ECharts} from 'echarts/lib/echarts'; + +import React from 'react'; import styled from '@emotion/styled'; +import echarts, {EChartOption, ECharts} from 'echarts/lib/echarts'; +import ReactEchartsCore from 'echarts-for-react/lib/core'; +import {withTheme} from 'emotion-theming'; import {IS_ACCEPTANCE_TEST} from 'app/constants'; +import space from 'app/styles/space'; import { - Series, - EChartEventHandler, EChartChartReadyHandler, EChartDataZoomHandler, + EChartEventHandler, ReactEchartsRef, + Series, } from 'app/types/echarts'; import {Theme} from 'app/utils/theme'; -import space from 'app/styles/space'; import Grid from './components/grid'; import Legend from './components/legend'; -import LineSeries from './series/lineSeries'; import Tooltip from './components/tooltip'; import XAxis from './components/xAxis'; import YAxis from './components/yAxis'; +import LineSeries from './series/lineSeries'; // If dimension is a number convert it to pixels, otherwise use dimension without transform const getDimensionValue = (dimension?: ReactEChartOpts['height']) => { diff --git a/src/sentry/static/sentry/app/components/charts/breakdownBars.tsx b/src/sentry/static/sentry/app/components/charts/breakdownBars.tsx index 87db08ec89338d..8de1b47e58f627 100644 --- a/src/sentry/static/sentry/app/components/charts/breakdownBars.tsx +++ b/src/sentry/static/sentry/app/components/charts/breakdownBars.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {formatPercentage} from 'app/utils/formatters'; import space from 'app/styles/space'; +import {formatPercentage} from 'app/utils/formatters'; type Point = { label: string; diff --git a/src/sentry/static/sentry/app/components/charts/chartZoom.jsx b/src/sentry/static/sentry/app/components/charts/chartZoom.jsx index 8f98b5f1de9959..b9f5b4753593e3 100644 --- a/src/sentry/static/sentry/app/components/charts/chartZoom.jsx +++ b/src/sentry/static/sentry/app/components/charts/chartZoom.jsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; import moment from 'moment'; +import PropTypes from 'prop-types'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import {getUtcToLocalDateObject} from 'app/utils/dates'; import {updateDateTime} from 'app/actionCreators/globalSelection'; import DataZoomInside from 'app/components/charts/components/dataZoomInside'; -import SentryTypes from 'app/sentryTypes'; import ToolBox from 'app/components/charts/components/toolBox'; +import SentryTypes from 'app/sentryTypes'; +import {callIfFunction} from 'app/utils/callIfFunction'; +import {getUtcToLocalDateObject} from 'app/utils/dates'; const getDate = date => date ? moment.utc(date).format(moment.HTML5_FMT.DATETIME_LOCAL_SECONDS) : null; diff --git a/src/sentry/static/sentry/app/components/charts/components/dataZoomInside.tsx b/src/sentry/static/sentry/app/components/charts/components/dataZoomInside.tsx index 333d1e76d08730..57a32ad90f8950 100644 --- a/src/sentry/static/sentry/app/components/charts/components/dataZoomInside.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/dataZoomInside.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/dataZoomInside'; +import {EChartOption} from 'echarts'; + const DEFAULT = { type: 'inside', zoomOnMouseWheel: 'shift', diff --git a/src/sentry/static/sentry/app/components/charts/components/graphic.tsx b/src/sentry/static/sentry/app/components/charts/components/graphic.tsx index 2415146abae839..83d2d2165e97db 100644 --- a/src/sentry/static/sentry/app/components/charts/components/graphic.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/graphic.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/graphic'; +import {EChartOption} from 'echarts'; + /** * eCharts graphic * diff --git a/src/sentry/static/sentry/app/components/charts/components/legend.tsx b/src/sentry/static/sentry/app/components/charts/components/legend.tsx index 82c51da09a6e50..d1aa11be8a19c3 100644 --- a/src/sentry/static/sentry/app/components/charts/components/legend.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/legend.tsx @@ -1,7 +1,8 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/legend'; import 'echarts/lib/component/legendScroll'; +import {EChartOption} from 'echarts'; + import BaseChart from 'app/components/charts/baseChart'; import {truncationFormatter} from '../utils'; diff --git a/src/sentry/static/sentry/app/components/charts/components/markArea.tsx b/src/sentry/static/sentry/app/components/charts/components/markArea.tsx index 8d20319f120715..1e3c296f122a1b 100644 --- a/src/sentry/static/sentry/app/components/charts/components/markArea.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/markArea.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/markArea'; +import {EChartOption} from 'echarts'; + /** * eCharts markArea * diff --git a/src/sentry/static/sentry/app/components/charts/components/markLine.tsx b/src/sentry/static/sentry/app/components/charts/components/markLine.tsx index c331241913e48b..f7579dcea1c42f 100644 --- a/src/sentry/static/sentry/app/components/charts/components/markLine.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/markLine.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/markLine'; +import {EChartOption} from 'echarts'; + /** * eCharts markLine * diff --git a/src/sentry/static/sentry/app/components/charts/components/markPoint.tsx b/src/sentry/static/sentry/app/components/charts/components/markPoint.tsx index bbf75eb5505c91..6989d093a84fc7 100644 --- a/src/sentry/static/sentry/app/components/charts/components/markPoint.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/markPoint.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/markPoint'; +import {EChartOption} from 'echarts'; + /** * eCharts markPoint * diff --git a/src/sentry/static/sentry/app/components/charts/components/toolBox.tsx b/src/sentry/static/sentry/app/components/charts/components/toolBox.tsx index 0efcfe6a162d7c..e141139342caee 100644 --- a/src/sentry/static/sentry/app/components/charts/components/toolBox.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/toolBox.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/toolbox'; +import {EChartOption} from 'echarts'; + function getFeatures({dataZoom, ...features}) { return { ...(dataZoom diff --git a/src/sentry/static/sentry/app/components/charts/components/tooltip.tsx b/src/sentry/static/sentry/app/components/charts/components/tooltip.tsx index d465977d4efd1f..f053b0bd48b2f0 100644 --- a/src/sentry/static/sentry/app/components/charts/components/tooltip.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/tooltip.tsx @@ -1,9 +1,10 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/tooltip'; + +import {EChartOption} from 'echarts'; import moment from 'moment'; -import {getFormattedDate, getTimeFormat} from 'app/utils/dates'; import BaseChart from 'app/components/charts/baseChart'; +import {getFormattedDate, getTimeFormat} from 'app/utils/dates'; import {truncationFormatter} from '../utils'; diff --git a/src/sentry/static/sentry/app/components/charts/components/visualMap.tsx b/src/sentry/static/sentry/app/components/charts/components/visualMap.tsx index 5a5f79df668fa8..31e8b4bcea3086 100644 --- a/src/sentry/static/sentry/app/components/charts/components/visualMap.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/visualMap.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/component/visualMap'; +import {EChartOption} from 'echarts'; + export default function VisualMap(visualMap: EChartOption.VisualMap) { return visualMap; } diff --git a/src/sentry/static/sentry/app/components/charts/components/xAxis.tsx b/src/sentry/static/sentry/app/components/charts/components/xAxis.tsx index e7f781f10489de..f9d59d253727c9 100644 --- a/src/sentry/static/sentry/app/components/charts/components/xAxis.tsx +++ b/src/sentry/static/sentry/app/components/charts/components/xAxis.tsx @@ -1,8 +1,8 @@ import {EChartOption} from 'echarts'; +import BaseChart from 'app/components/charts/baseChart'; import {getFormattedDate, getTimeFormat} from 'app/utils/dates'; import {Theme} from 'app/utils/theme'; -import BaseChart from 'app/components/charts/baseChart'; import {truncationFormatter, useShortInterval} from '../utils'; diff --git a/src/sentry/static/sentry/app/components/charts/eventsChart.tsx b/src/sentry/static/sentry/app/components/charts/eventsChart.tsx index 6a0abd3c9a043f..a46970c3455f18 100644 --- a/src/sentry/static/sentry/app/components/charts/eventsChart.tsx +++ b/src/sentry/static/sentry/app/components/charts/eventsChart.tsx @@ -1,25 +1,25 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import isEqual from 'lodash/isEqual'; import {InjectedRouter} from 'react-router/lib/Router'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; import {Client} from 'app/api'; -import {DateString, OrganizationSummary} from 'app/types'; -import {Series} from 'app/types/echarts'; -import {t} from 'app/locale'; -import {getInterval} from 'app/components/charts/utils'; -import ChartZoom from 'app/components/charts/chartZoom'; import AreaChart from 'app/components/charts/areaChart'; import BarChart from 'app/components/charts/barChart'; +import ChartZoom from 'app/components/charts/chartZoom'; +import ErrorPanel from 'app/components/charts/errorPanel'; import LineChart from 'app/components/charts/lineChart'; -import TransitionChart from 'app/components/charts/transitionChart'; import ReleaseSeries from 'app/components/charts/releaseSeries'; -import {IconWarning} from 'app/icons'; -import theme from 'app/utils/theme'; +import TransitionChart from 'app/components/charts/transitionChart'; import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; -import ErrorPanel from 'app/components/charts/errorPanel'; -import {tooltipFormatter, axisLabelFormatter} from 'app/utils/discover/charts'; +import {getInterval} from 'app/components/charts/utils'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import {DateString, OrganizationSummary} from 'app/types'; +import {Series} from 'app/types/echarts'; +import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; import {aggregateMultiPlotType} from 'app/utils/discover/fields'; +import theme from 'app/utils/theme'; import EventsRequest from './eventsRequest'; diff --git a/src/sentry/static/sentry/app/components/charts/eventsRequest.tsx b/src/sentry/static/sentry/app/components/charts/eventsRequest.tsx index 9b2b8f73e68861..ce88045572c9b1 100644 --- a/src/sentry/static/sentry/app/components/charts/eventsRequest.tsx +++ b/src/sentry/static/sentry/app/components/charts/eventsRequest.tsx @@ -1,23 +1,23 @@ +import React from 'react'; import isEqual from 'lodash/isEqual'; import omitBy from 'lodash/omitBy'; import PropTypes from 'prop-types'; -import React from 'react'; +import {doEventsRequest} from 'app/actionCreators/events'; +import {addErrorMessage} from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; +import LoadingPanel from 'app/components/charts/loadingPanel'; +import {canIncludePreviousPeriod} from 'app/components/charts/utils'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import { DateString, EventsStats, EventsStatsData, - OrganizationSummary, MultiSeriesEventsStats, + OrganizationSummary, } from 'app/types'; import {Series, SeriesDataUnit} from 'app/types/echarts'; -import LoadingPanel from 'app/components/charts/loadingPanel'; -import {Client} from 'app/api'; -import {doEventsRequest} from 'app/actionCreators/events'; -import {canIncludePreviousPeriod} from 'app/components/charts/utils'; -import {addErrorMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import SentryTypes from 'app/sentryTypes'; export type TimeSeriesData = { // timeseries data diff --git a/src/sentry/static/sentry/app/components/charts/lineChart.tsx b/src/sentry/static/sentry/app/components/charts/lineChart.tsx index 9a2ff5d2fefba6..0e1d31c0442461 100644 --- a/src/sentry/static/sentry/app/components/charts/lineChart.tsx +++ b/src/sentry/static/sentry/app/components/charts/lineChart.tsx @@ -3,8 +3,8 @@ import {EChartOption} from 'echarts'; import {Series} from 'app/types/echarts'; -import BaseChart from './baseChart'; import LineSeries from './series/lineSeries'; +import BaseChart from './baseChart'; type ChartProps = React.ComponentProps<typeof BaseChart>; diff --git a/src/sentry/static/sentry/app/components/charts/miniBarChart.tsx b/src/sentry/static/sentry/app/components/charts/miniBarChart.tsx index facac0668107e9..2efa30f60c1836 100644 --- a/src/sentry/static/sentry/app/components/charts/miniBarChart.tsx +++ b/src/sentry/static/sentry/app/components/charts/miniBarChart.tsx @@ -1,13 +1,14 @@ +// Import to ensure echarts components are loaded. +import './components/markPoint'; + import React from 'react'; import set from 'lodash/set'; -import theme from 'app/utils/theme'; import {getFormattedDate} from 'app/utils/dates'; +import theme from 'app/utils/theme'; import BarChart, {BarChartSeries} from './barChart'; import BaseChart from './baseChart'; -// Import to ensure echarts components are loaded. -import './components/markPoint'; import {truncationFormatter} from './utils'; type Marker = { diff --git a/src/sentry/static/sentry/app/components/charts/optionSelector.tsx b/src/sentry/static/sentry/app/components/charts/optionSelector.tsx index 92dcc8516513e0..b523ce7ff5f5ee 100644 --- a/src/sentry/static/sentry/app/components/charts/optionSelector.tsx +++ b/src/sentry/static/sentry/app/components/charts/optionSelector.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import DropdownButton from 'app/components/dropdownButton'; -import DropdownMenu from 'app/components/dropdownMenu'; import {InlineContainer, SectionHeading} from 'app/components/charts/styles'; -import {DropdownItem} from 'app/components/dropdownControl'; import DropdownBubble from 'app/components/dropdownBubble'; +import DropdownButton from 'app/components/dropdownButton'; +import {DropdownItem} from 'app/components/dropdownControl'; +import DropdownMenu from 'app/components/dropdownMenu'; import Tooltip from 'app/components/tooltip'; import space from 'app/styles/space'; import {SelectValue} from 'app/types'; diff --git a/src/sentry/static/sentry/app/components/charts/percentageAreaChart.tsx b/src/sentry/static/sentry/app/components/charts/percentageAreaChart.tsx index 28b511ae686c7a..beff9eef288959 100644 --- a/src/sentry/static/sentry/app/components/charts/percentageAreaChart.tsx +++ b/src/sentry/static/sentry/app/components/charts/percentageAreaChart.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import moment from 'moment'; import {EChartOption} from 'echarts'; +import moment from 'moment'; +import PropTypes from 'prop-types'; import {Series, SeriesDataUnit} from 'app/types/echarts'; diff --git a/src/sentry/static/sentry/app/components/charts/percentageTableChart.jsx b/src/sentry/static/sentry/app/components/charts/percentageTableChart.jsx index 83b9f2458965e0..144e169bd2cf1d 100644 --- a/src/sentry/static/sentry/app/components/charts/percentageTableChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/percentageTableChart.jsx @@ -1,15 +1,15 @@ -import {Link} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; +import {Link} from 'react-router'; import isPropValid from '@emotion/is-prop-valid'; import styled from '@emotion/styled'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; -import {PanelItem} from 'app/components/panels'; -import {t} from 'app/locale'; +import TableChart from 'app/components/charts/tableChart'; import Count from 'app/components/count'; +import {PanelItem} from 'app/components/panels'; import {IconChevron} from 'app/icons'; -import TableChart from 'app/components/charts/tableChart'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/charts/pieChart.jsx b/src/sentry/static/sentry/app/components/charts/pieChart.jsx index 3fb0349c65b928..1164e7d2e6935a 100644 --- a/src/sentry/static/sentry/app/components/charts/pieChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/pieChart.jsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import theme from 'app/utils/theme'; -import BaseChart from './baseChart'; import Legend from './components/legend'; import PieSeries from './series/pieSeries'; +import BaseChart from './baseChart'; class PieChart extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx b/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx index 1e98801cd5ff77..5e1d8dd7c70338 100644 --- a/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx +++ b/src/sentry/static/sentry/app/components/charts/releaseSeries.jsx @@ -1,21 +1,21 @@ -import {withRouter} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {withRouter} from 'react-router'; import isEqual from 'lodash/isEqual'; import memoize from 'lodash/memoize'; import partition from 'lodash/partition'; +import PropTypes from 'prop-types'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {getFormattedDate, getUtcDateString} from 'app/utils/dates'; -import {t} from 'app/locale'; import MarkLine from 'app/components/charts/components/markLine'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {escape} from 'app/utils'; +import {getFormattedDate, getUtcDateString} from 'app/utils/dates'; +import {formatVersion} from 'app/utils/formatters'; +import parseLinkHeader from 'app/utils/parseLinkHeader'; import theme from 'app/utils/theme'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; -import parseLinkHeader from 'app/utils/parseLinkHeader'; -import {escape} from 'app/utils'; -import {formatVersion} from 'app/utils/formatters'; // This is not an exported action/function because releases list uses AsyncComponent // and this is not re-used anywhere else afaict diff --git a/src/sentry/static/sentry/app/components/charts/series/barSeries.tsx b/src/sentry/static/sentry/app/components/charts/series/barSeries.tsx index 9790b30c5f5029..16f67237025ed5 100644 --- a/src/sentry/static/sentry/app/components/charts/series/barSeries.tsx +++ b/src/sentry/static/sentry/app/components/charts/series/barSeries.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/chart/bar'; +import {EChartOption} from 'echarts'; + /** * TODO(ts): Bar chart can accept multiple values with an object, currently defined types are incorrect * See https://echarts.apache.org/en/option.html#series-bar.data diff --git a/src/sentry/static/sentry/app/components/charts/series/lineSeries.tsx b/src/sentry/static/sentry/app/components/charts/series/lineSeries.tsx index e98b98578e62f3..4a0e6eb80b3d2f 100644 --- a/src/sentry/static/sentry/app/components/charts/series/lineSeries.tsx +++ b/src/sentry/static/sentry/app/components/charts/series/lineSeries.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/chart/line'; +import {EChartOption} from 'echarts'; + import theme from 'app/utils/theme'; export default function LineSeries( diff --git a/src/sentry/static/sentry/app/components/charts/series/mapSeries.tsx b/src/sentry/static/sentry/app/components/charts/series/mapSeries.tsx index 992905608b16e0..3db275356276d2 100644 --- a/src/sentry/static/sentry/app/components/charts/series/mapSeries.tsx +++ b/src/sentry/static/sentry/app/components/charts/series/mapSeries.tsx @@ -1,4 +1,5 @@ import 'echarts/lib/chart/map'; + import {EChartOption} from 'echarts'; export default function MapSeries( diff --git a/src/sentry/static/sentry/app/components/charts/series/pieSeries.tsx b/src/sentry/static/sentry/app/components/charts/series/pieSeries.tsx index 4bed159e92e2bd..58d3703943bd9d 100644 --- a/src/sentry/static/sentry/app/components/charts/series/pieSeries.tsx +++ b/src/sentry/static/sentry/app/components/charts/series/pieSeries.tsx @@ -1,6 +1,7 @@ -import {EChartOption} from 'echarts'; import 'echarts/lib/chart/pie'; +import {EChartOption} from 'echarts'; + export default function PieSeries( props: EChartOption.SeriesPie = {} ): EChartOption.SeriesPie { diff --git a/src/sentry/static/sentry/app/components/charts/tableChart.jsx b/src/sentry/static/sentry/app/components/charts/tableChart.jsx index 371718a4be36a0..fee7518c7e16ed 100644 --- a/src/sentry/static/sentry/app/components/charts/tableChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/tableChart.jsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {Panel, PanelHeader, PanelItem} from 'app/components/panels'; diff --git a/src/sentry/static/sentry/app/components/charts/utils.tsx b/src/sentry/static/sentry/app/components/charts/utils.tsx index cec68fb79bbae9..e20201ea541179 100644 --- a/src/sentry/static/sentry/app/components/charts/utils.tsx +++ b/src/sentry/static/sentry/app/components/charts/utils.tsx @@ -2,11 +2,11 @@ import {EChartOption} from 'echarts'; import {Location} from 'history'; import moment from 'moment'; -import {GlobalSelection} from 'app/types'; import {DEFAULT_STATS_PERIOD} from 'app/constants'; +import {GlobalSelection} from 'app/types'; +import {escape} from 'app/utils'; import {parsePeriodToHours} from 'app/utils/dates'; import {decodeList} from 'app/utils/queryString'; -import {escape} from 'app/utils'; const DEFAULT_TRUNCATE_LENGTH = 80; diff --git a/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx b/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx index 6d968dca64eb08..89d9b13bb61d40 100644 --- a/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx +++ b/src/sentry/static/sentry/app/components/charts/worldMapChart.jsx @@ -1,12 +1,12 @@ +import React from 'react'; +import echarts from 'echarts'; import {withTheme} from 'emotion-theming'; import max from 'lodash/max'; import PropTypes from 'prop-types'; -import React from 'react'; -import echarts from 'echarts'; -import BaseChart from './baseChart'; -import MapSeries from './series/mapSeries'; import VisualMap from './components/visualMap'; +import MapSeries from './series/mapSeries'; +import BaseChart from './baseChart'; class WorldMapChart extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/checkboxFancy/checkboxFancy.tsx b/src/sentry/static/sentry/app/components/checkboxFancy/checkboxFancy.tsx index 4c9dce827b13a1..4928f86b8758d1 100644 --- a/src/sentry/static/sentry/app/components/checkboxFancy/checkboxFancy.tsx +++ b/src/sentry/static/sentry/app/components/checkboxFancy/checkboxFancy.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import {Theme} from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/circleIndicator.tsx b/src/sentry/static/sentry/app/components/circleIndicator.tsx index d20e026de7cb5d..59ebc94e27d0f5 100644 --- a/src/sentry/static/sentry/app/components/circleIndicator.tsx +++ b/src/sentry/static/sentry/app/components/circleIndicator.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {Theme} from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/clipboard.tsx b/src/sentry/static/sentry/app/components/clipboard.tsx index 66342a6d63148f..dbeae32ede12af 100644 --- a/src/sentry/static/sentry/app/components/clipboard.tsx +++ b/src/sentry/static/sentry/app/components/clipboard.tsx @@ -1,7 +1,7 @@ -import Clip from 'clipboard'; -import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; +import Clip from 'clipboard'; +import PropTypes from 'prop-types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; diff --git a/src/sentry/static/sentry/app/components/clippedBox.tsx b/src/sentry/static/sentry/app/components/clippedBox.tsx index 2d896ae4baa129..57aebc7e8f1f14 100644 --- a/src/sentry/static/sentry/app/components/clippedBox.tsx +++ b/src/sentry/static/sentry/app/components/clippedBox.tsx @@ -2,8 +2,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import Button from 'app/components/button'; +import {t} from 'app/locale'; import space from 'app/styles/space'; type DefaultProps = { diff --git a/src/sentry/static/sentry/app/components/commitLink.tsx b/src/sentry/static/sentry/app/components/commitLink.tsx index b5c0247a4654eb..19fc0ee269b6a5 100644 --- a/src/sentry/static/sentry/app/components/commitLink.tsx +++ b/src/sentry/static/sentry/app/components/commitLink.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import {Repository} from 'app/types'; -import {t} from 'app/locale'; -import {getShortCommitHash} from 'app/utils'; import Button from 'app/components/button'; -import {IconBitbucket, IconGithub, IconGitlab, IconVsts} from 'app/icons'; import ExternalLink from 'app/components/links/externalLink'; +import {IconBitbucket, IconGithub, IconGitlab, IconVsts} from 'app/icons'; +import {t} from 'app/locale'; +import {Repository} from 'app/types'; +import {getShortCommitHash} from 'app/utils'; type CommitFormatterParameters = { baseUrl: string; diff --git a/src/sentry/static/sentry/app/components/commitRow.tsx b/src/sentry/static/sentry/app/components/commitRow.tsx index 0b57c2ea50b2e5..511d9494f4b031 100644 --- a/src/sentry/static/sentry/app/components/commitRow.tsx +++ b/src/sentry/static/sentry/app/components/commitRow.tsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Commit} from 'app/types'; import {openInviteMembersModal} from 'app/actionCreators/modal'; -import {PanelItem} from 'app/components/panels'; -import {t, tct} from 'app/locale'; import UserAvatar from 'app/components/avatar/userAvatar'; import CommitLink from 'app/components/commitLink'; import Hovercard from 'app/components/hovercard'; -import {IconWarning} from 'app/icons'; import Link from 'app/components/links/link'; +import {PanelItem} from 'app/components/panels'; import TextOverflow from 'app/components/textOverflow'; import TimeSince from 'app/components/timeSince'; +import {IconWarning} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Commit} from 'app/types'; type Props = { commit: Commit; diff --git a/src/sentry/static/sentry/app/components/confirm.tsx b/src/sentry/static/sentry/app/components/confirm.tsx index bad999dd12c8a8..7e0e1c7781ee7e 100644 --- a/src/sentry/static/sentry/app/components/confirm.tsx +++ b/src/sentry/static/sentry/app/components/confirm.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import PropTypes from 'prop-types'; import Modal from 'react-bootstrap/lib/Modal'; +import PropTypes from 'prop-types'; import Button from 'app/components/button'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/confirmDelete.tsx b/src/sentry/static/sentry/app/components/confirmDelete.tsx index 5d0c9f7079ea4f..35e1df794fccbc 100644 --- a/src/sentry/static/sentry/app/components/confirmDelete.tsx +++ b/src/sentry/static/sentry/app/components/confirmDelete.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import Confirm from 'app/components/confirm'; import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import Confirm from 'app/components/confirm'; +import {t} from 'app/locale'; import Input from 'app/views/settings/components/forms/controls/input'; import Field from 'app/views/settings/components/forms/field'; -import {t} from 'app/locale'; -import Button from 'app/components/button'; const defaultProps = { priority: 'primary' as React.ComponentProps<typeof Button>['priority'], diff --git a/src/sentry/static/sentry/app/components/contextData.jsx b/src/sentry/static/sentry/app/components/contextData.jsx index 606bdc745fd775..7daf2b205dc107 100644 --- a/src/sentry/static/sentry/app/components/contextData.jsx +++ b/src/sentry/static/sentry/app/components/contextData.jsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import isString from 'lodash/isString'; -import isNumber from 'lodash/isNumber'; -import isArray from 'lodash/isArray'; import styled from '@emotion/styled'; +import isArray from 'lodash/isArray'; +import isNumber from 'lodash/isNumber'; +import isString from 'lodash/isString'; +import PropTypes from 'prop-types'; import AnnotatedText from 'app/components/events/meta/annotatedText'; -import {IconOpen, IconAdd, IconSubtract} from 'app/icons'; -import {isUrl} from 'app/utils'; import ExternalLink from 'app/components/links/externalLink'; +import {IconAdd, IconOpen, IconSubtract} from 'app/icons'; +import {isUrl} from 'app/utils'; function looksLikeObjectRepr(value) { const a = value[0]; diff --git a/src/sentry/static/sentry/app/components/contextPickerModal.tsx b/src/sentry/static/sentry/app/components/contextPickerModal.tsx index fc92d64587e2c0..990dfd5ce53e9a 100644 --- a/src/sentry/static/sentry/app/components/contextPickerModal.tsx +++ b/src/sentry/static/sentry/app/components/contextPickerModal.tsx @@ -1,22 +1,22 @@ -import ReactSelect, {components} from 'react-select'; import React from 'react'; import ReactDOM from 'react-dom'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; +import ReactSelect, {components} from 'react-select'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import {Organization, Project} from 'app/types'; -import {t, tct} from 'app/locale'; +import {ModalRenderProps} from 'app/actionCreators/modal'; +import SelectControl from 'app/components/forms/selectControl'; +import IdBadge from 'app/components/idBadge'; +import Link from 'app/components/links/link'; import LoadingIndicator from 'app/components/loadingIndicator'; -import OrganizationStore from 'app/stores/organizationStore'; +import {t, tct} from 'app/locale'; import OrganizationsStore from 'app/stores/organizationsStore'; +import OrganizationStore from 'app/stores/organizationStore'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; import Projects from 'app/utils/projects'; -import SelectControl from 'app/components/forms/selectControl'; import replaceRouterParams from 'app/utils/replaceRouterParams'; -import space from 'app/styles/space'; -import Link from 'app/components/links/link'; -import IdBadge from 'app/components/idBadge'; -import {ModalRenderProps} from 'app/actionCreators/modal'; type Props = ModalRenderProps & { /** diff --git a/src/sentry/static/sentry/app/components/count.tsx b/src/sentry/static/sentry/app/components/count.tsx index add88f34f334bb..da653801fe4983 100644 --- a/src/sentry/static/sentry/app/components/count.tsx +++ b/src/sentry/static/sentry/app/components/count.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {formatAbbreviatedNumber} from 'app/utils/formatters'; diff --git a/src/sentry/static/sentry/app/components/createAlertButton.tsx b/src/sentry/static/sentry/app/components/createAlertButton.tsx index d54c12229e395c..0e2366be878ff1 100644 --- a/src/sentry/static/sentry/app/components/createAlertButton.tsx +++ b/src/sentry/static/sentry/app/components/createAlertButton.tsx @@ -1,21 +1,21 @@ import React from 'react'; -import styled from '@emotion/styled'; import {withRouter, WithRouterProps} from 'react-router'; +import styled from '@emotion/styled'; -import {Project, Organization} from 'app/types'; -import {t, tct} from 'app/locale'; -import {IconInfo, IconClose, IconSiren} from 'app/icons'; +import {navigateTo} from 'app/actionCreators/navigation'; +import Access from 'app/components/acl/access'; +import Alert from 'app/components/alert'; import Button from 'app/components/button'; +import Link from 'app/components/links/link'; +import {IconClose, IconInfo, IconSiren} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {Organization, Project} from 'app/types'; import EventView from 'app/utils/discover/eventView'; -import Alert from 'app/components/alert'; -import Access from 'app/components/acl/access'; -import {explodeFieldString, AGGREGATIONS, Aggregation} from 'app/utils/discover/fields'; +import {Aggregation, AGGREGATIONS, explodeFieldString} from 'app/utils/discover/fields'; import { errorFieldConfig, transactionFieldConfig, } from 'app/views/settings/incidentRules/constants'; -import Link from 'app/components/links/link'; -import {navigateTo} from 'app/actionCreators/navigation'; /** * Discover query supports more features than alert rules diff --git a/src/sentry/static/sentry/app/components/customIgnoreCountModal.tsx b/src/sentry/static/sentry/app/components/customIgnoreCountModal.tsx index aaa209a0352afd..f38770d2e66d4f 100644 --- a/src/sentry/static/sentry/app/components/customIgnoreCountModal.tsx +++ b/src/sentry/static/sentry/app/components/customIgnoreCountModal.tsx @@ -1,11 +1,11 @@ +import React from 'react'; import Modal from 'react-bootstrap/lib/Modal'; import PropTypes from 'prop-types'; -import React from 'react'; -import {t} from 'app/locale'; -import {ResolutionStatusDetails} from 'app/types'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import {t} from 'app/locale'; +import {ResolutionStatusDetails} from 'app/types'; import InputField from 'app/views/settings/components/forms/inputField'; import SelectField from 'app/views/settings/components/forms/selectField'; diff --git a/src/sentry/static/sentry/app/components/customIgnoreDurationModal.tsx b/src/sentry/static/sentry/app/components/customIgnoreDurationModal.tsx index 17add15b782db1..2d24ee28befd29 100644 --- a/src/sentry/static/sentry/app/components/customIgnoreDurationModal.tsx +++ b/src/sentry/static/sentry/app/components/customIgnoreDurationModal.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import moment from 'moment'; import Modal from 'react-bootstrap/lib/Modal'; +import moment from 'moment'; import {sprintf} from 'sprintf-js'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; -import {IconWarning} from 'app/icons'; import ButtonBar from 'app/components/buttonBar'; -import {ResolutionStatusDetails} from 'app/types'; +import {IconWarning} from 'app/icons'; import {t} from 'app/locale'; +import {ResolutionStatusDetails} from 'app/types'; const defaultProps = { label: t('Ignore this issue until \u2026'), diff --git a/src/sentry/static/sentry/app/components/customResolutionModal.tsx b/src/sentry/static/sentry/app/components/customResolutionModal.tsx index 5e26de45083140..ddfa0437c27e55 100644 --- a/src/sentry/static/sentry/app/components/customResolutionModal.tsx +++ b/src/sentry/static/sentry/app/components/customResolutionModal.tsx @@ -1,14 +1,14 @@ import React from 'react'; +import Modal, {Body, Footer, Header} from 'react-bootstrap/lib/Modal'; import PropTypes from 'prop-types'; -import Modal, {Header, Body, Footer} from 'react-bootstrap/lib/Modal'; -import {SelectAsyncField} from 'app/components/forms'; -import {t} from 'app/locale'; import Button from 'app/components/button'; +import {SelectAsyncField} from 'app/components/forms'; import TimeSince from 'app/components/timeSince'; import Version from 'app/components/version'; -import {Release} from 'app/types'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Release} from 'app/types'; type Props = { onSelected: ({inRelease: string}) => void; diff --git a/src/sentry/static/sentry/app/components/dataExport.tsx b/src/sentry/static/sentry/app/components/dataExport.tsx index 23f425700b01fa..43356c9734dd21 100644 --- a/src/sentry/static/sentry/app/components/dataExport.tsx +++ b/src/sentry/static/sentry/app/components/dataExport.tsx @@ -1,9 +1,9 @@ +import React from 'react'; import debounce from 'lodash/debounce'; import isEqual from 'lodash/isEqual'; -import React from 'react'; -import {Client} from 'app/api'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; import Feature from 'app/components/acl/feature'; import Button from 'app/components/button'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/dateTime.tsx b/src/sentry/static/sentry/app/components/dateTime.tsx index 8db638cb22a6f8..47b5aa725f3eee 100644 --- a/src/sentry/static/sentry/app/components/dateTime.tsx +++ b/src/sentry/static/sentry/app/components/dateTime.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import moment from 'moment-timezone'; +import PropTypes from 'prop-types'; import ConfigStore from 'app/stores/configStore'; diff --git a/src/sentry/static/sentry/app/components/debugFileFeature.tsx b/src/sentry/static/sentry/app/components/debugFileFeature.tsx index d8930821e374ff..059c08bd7584a7 100644 --- a/src/sentry/static/sentry/app/components/debugFileFeature.tsx +++ b/src/sentry/static/sentry/app/components/debugFileFeature.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import Tag from 'app/components/tagDeprecated'; import Tooltip from 'app/components/tooltip'; import {IconCheckmark, IconClose} from 'app/icons'; import {t} from 'app/locale'; -import Tag from 'app/components/tagDeprecated'; const FEATURE_TOOLTIPS = { symtab: t( diff --git a/src/sentry/static/sentry/app/components/deployBadge.tsx b/src/sentry/static/sentry/app/components/deployBadge.tsx index 2c9021a6cc3566..3bc8d90c334ee6 100644 --- a/src/sentry/static/sentry/app/components/deployBadge.tsx +++ b/src/sentry/static/sentry/app/components/deployBadge.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; -import {Deploy} from 'app/types'; -import Tag from 'app/components/tagDeprecated'; import Link from 'app/components/links/link'; +import Tag from 'app/components/tagDeprecated'; import {IconOpen} from 'app/icons'; -import {stringifyQueryObject, QueryResults} from 'app/utils/tokenizeSearch'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; +import {Deploy} from 'app/types'; +import {QueryResults, stringifyQueryObject} from 'app/utils/tokenizeSearch'; type Props = { deploy: Deploy; diff --git a/src/sentry/static/sentry/app/components/deviceName.tsx b/src/sentry/static/sentry/app/components/deviceName.tsx index 01bf1749ebd4cb..8bbd175ef643e2 100644 --- a/src/sentry/static/sentry/app/components/deviceName.tsx +++ b/src/sentry/static/sentry/app/components/deviceName.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {IOSDeviceList} from 'app/types/iOSDeviceList'; diff --git a/src/sentry/static/sentry/app/components/discover/transactionsList.tsx b/src/sentry/static/sentry/app/components/discover/transactionsList.tsx index 320b09fdf6b93b..a06fe1e24b1fb8 100644 --- a/src/sentry/static/sentry/app/components/discover/transactionsList.tsx +++ b/src/sentry/static/sentry/app/components/discover/transactionsList.tsx @@ -1,36 +1,36 @@ import React from 'react'; -import {Location, LocationDescriptor, Query} from 'history'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import {Location, LocationDescriptor, Query} from 'history'; import {Client} from 'app/api'; -import {t} from 'app/locale'; import DiscoverButton from 'app/components/discoverButton'; -import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import DropdownButton from 'app/components/dropdownButton'; +import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import SortLink from 'app/components/gridEditable/sortLink'; import Link from 'app/components/links/link'; import LoadingIndicator from 'app/components/loadingIndicator'; import Pagination from 'app/components/pagination'; import PanelTable from 'app/components/panels/panelTable'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; import {Organization} from 'app/types'; import DiscoverQuery, {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; -import {TrendsEventsDiscoverQuery} from 'app/views/performance/trends/trendsDiscoverQuery'; -import { - TrendView, - TrendsDataEvents, - TrendChangeType, -} from 'app/views/performance/trends/types'; -import {decodeColumnOrder} from 'app/views/eventsV2/utils'; import EventView, {MetaType} from 'app/utils/discover/eventView'; -import {Sort, getAggregateAlias} from 'app/utils/discover/fields'; import {getFieldRenderer} from 'app/utils/discover/fieldRenderers'; +import {getAggregateAlias, Sort} from 'app/utils/discover/fields'; import {decodeScalar} from 'app/utils/queryString'; import HeaderCell from 'app/views/eventsV2/table/headerCell'; import {TableColumn} from 'app/views/eventsV2/table/types'; +import {decodeColumnOrder} from 'app/views/eventsV2/utils'; import {GridCell, GridCellNumber} from 'app/views/performance/styles'; +import {TrendsEventsDiscoverQuery} from 'app/views/performance/trends/trendsDiscoverQuery'; +import { + TrendChangeType, + TrendsDataEvents, + TrendView, +} from 'app/views/performance/trends/types'; const DEFAULT_TRANSACTION_LIMIT = 5; diff --git a/src/sentry/static/sentry/app/components/discoverButton.tsx b/src/sentry/static/sentry/app/components/discoverButton.tsx index c6d5edd8073719..c5d3a5080af8b9 100644 --- a/src/sentry/static/sentry/app/components/discoverButton.tsx +++ b/src/sentry/static/sentry/app/components/discoverButton.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import Button from 'app/components/button'; import Feature from 'app/components/acl/feature'; +import Button from 'app/components/button'; type Props = React.PropsWithChildren<{ className?: string; diff --git a/src/sentry/static/sentry/app/components/dropdownAutoComplete/autoCompleteFilter.tsx b/src/sentry/static/sentry/app/components/dropdownAutoComplete/autoCompleteFilter.tsx index 86f167408366cf..850e1aa1be09a7 100644 --- a/src/sentry/static/sentry/app/components/dropdownAutoComplete/autoCompleteFilter.tsx +++ b/src/sentry/static/sentry/app/components/dropdownAutoComplete/autoCompleteFilter.tsx @@ -1,7 +1,7 @@ import flatMap from 'lodash/flatMap'; -import type {Item, ItemsBeforeFilter, ItemsAfterFilter} from './types'; import type Menu from './menu'; +import type {Item, ItemsAfterFilter, ItemsBeforeFilter} from './types'; type MenuProps = React.ComponentProps<typeof Menu>; type Items = MenuProps['items']; diff --git a/src/sentry/static/sentry/app/components/dropdownAutoComplete/list.tsx b/src/sentry/static/sentry/app/components/dropdownAutoComplete/list.tsx index 7ac10eed7442db..981ad8a04432a6 100644 --- a/src/sentry/static/sentry/app/components/dropdownAutoComplete/list.tsx +++ b/src/sentry/static/sentry/app/components/dropdownAutoComplete/list.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import styled from '@emotion/styled'; import {AutoSizer, List as ReactVirtualizedList, ListRowProps} from 'react-virtualized'; +import styled from '@emotion/styled'; -import {ItemsAfterFilter} from './types'; import Row from './row'; +import {ItemsAfterFilter} from './types'; type RowProps = Pick< React.ComponentProps<typeof Row>, diff --git a/src/sentry/static/sentry/app/components/dropdownAutoComplete/menu.tsx b/src/sentry/static/sentry/app/components/dropdownAutoComplete/menu.tsx index bf52a33df87ba7..a04f687b24953e 100644 --- a/src/sentry/static/sentry/app/components/dropdownAutoComplete/menu.tsx +++ b/src/sentry/static/sentry/app/components/dropdownAutoComplete/menu.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import AutoComplete from 'app/components/autoComplete'; import DropdownBubble from 'app/components/dropdownBubble'; -import Input from 'app/views/settings/components/forms/controls/input'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import Input from 'app/views/settings/components/forms/controls/input'; -import List from './list'; -import {ItemsBeforeFilter, Item} from './types'; import autoCompleteFilter from './autoCompleteFilter'; +import List from './list'; +import {Item, ItemsBeforeFilter} from './types'; export type MenuFooterChildProps = { actions: Actions; diff --git a/src/sentry/static/sentry/app/components/dropdownBubble.tsx b/src/sentry/static/sentry/app/components/dropdownBubble.tsx index c7c2c6371869f6..341a3c3505cd95 100644 --- a/src/sentry/static/sentry/app/components/dropdownBubble.tsx +++ b/src/sentry/static/sentry/app/components/dropdownBubble.tsx @@ -1,8 +1,8 @@ import {css} from '@emotion/core'; import styled from '@emotion/styled'; -import SettingsHeader from 'app/views/settings/components/settingsHeader'; import {Theme} from 'app/utils/theme'; +import SettingsHeader from 'app/views/settings/components/settingsHeader'; type Params = { /** diff --git a/src/sentry/static/sentry/app/components/dropdownButton.tsx b/src/sentry/static/sentry/app/components/dropdownButton.tsx index 8be5aa8aaff35e..3daf4a92b9890b 100644 --- a/src/sentry/static/sentry/app/components/dropdownButton.tsx +++ b/src/sentry/static/sentry/app/components/dropdownButton.tsx @@ -2,8 +2,8 @@ import React from 'react'; import styled from '@emotion/styled'; import Button from 'app/components/button'; -import space from 'app/styles/space'; import {IconChevron} from 'app/icons'; +import space from 'app/styles/space'; type Props = React.ComponentProps<typeof Button> & { /** diff --git a/src/sentry/static/sentry/app/components/dropdownLink.tsx b/src/sentry/static/sentry/app/components/dropdownLink.tsx index 2df59272e1f839..13f020cf593911 100644 --- a/src/sentry/static/sentry/app/components/dropdownLink.tsx +++ b/src/sentry/static/sentry/app/components/dropdownLink.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import DropdownMenu from 'app/components/dropdownMenu'; import {IconChevron} from 'app/icons'; diff --git a/src/sentry/static/sentry/app/components/dropdownMenu.tsx b/src/sentry/static/sentry/app/components/dropdownMenu.tsx index 325ab685ed9a9b..5f4e57301f2679 100644 --- a/src/sentry/static/sentry/app/components/dropdownMenu.tsx +++ b/src/sentry/static/sentry/app/components/dropdownMenu.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; import {MENU_CLOSE_DELAY} from 'app/constants'; diff --git a/src/sentry/static/sentry/app/components/duration.tsx b/src/sentry/static/sentry/app/components/duration.tsx index 784a839d452b86..1d8f0c8787e4cb 100644 --- a/src/sentry/static/sentry/app/components/duration.tsx +++ b/src/sentry/static/sentry/app/components/duration.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {getDuration, getExactDuration} from 'app/utils/formatters'; diff --git a/src/sentry/static/sentry/app/components/emptyStateWarning.tsx b/src/sentry/static/sentry/app/components/emptyStateWarning.tsx index 9fd66e747c6178..e01a038ab56d91 100644 --- a/src/sentry/static/sentry/app/components/emptyStateWarning.tsx +++ b/src/sentry/static/sentry/app/components/emptyStateWarning.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import {IconSearch} from 'app/icons'; import space from 'app/styles/space'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = { small?: boolean; diff --git a/src/sentry/static/sentry/app/components/errorBoundary.tsx b/src/sentry/static/sentry/app/components/errorBoundary.tsx index 0bdd221540a4c2..fe1a6342331bfe 100644 --- a/src/sentry/static/sentry/app/components/errorBoundary.tsx +++ b/src/sentry/static/sentry/app/components/errorBoundary.tsx @@ -1,13 +1,13 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import Alert from 'app/components/alert'; import DetailedError from 'app/components/errors/detailedError'; import {IconFlag} from 'app/icons'; +import {t} from 'app/locale'; import getDynamicText from 'app/utils/getDynamicText'; type DefaultProps = { diff --git a/src/sentry/static/sentry/app/components/errorRobot.tsx b/src/sentry/static/sentry/app/components/errorRobot.tsx index 4a392ee392f6f2..642fab346dc11a 100644 --- a/src/sentry/static/sentry/app/components/errorRobot.tsx +++ b/src/sentry/static/sentry/app/components/errorRobot.tsx @@ -1,16 +1,16 @@ -import {Link} from 'react-router'; import React from 'react'; +import {Link} from 'react-router'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; -import Button from 'app/components/button'; -import CreateSampleEventButton from 'app/views/onboarding/createSampleEventButton'; -import withApi from 'app/utils/withApi'; +import robotBackground from 'app/../images/spot/sentry-robot.png'; import {Client} from 'app/api'; +import Button from 'app/components/button'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; import {LightWeightOrganization, Project} from 'app/types'; import {defined} from 'app/utils'; -import space from 'app/styles/space'; -import robotBackground from 'app/../images/spot/sentry-robot.png'; +import withApi from 'app/utils/withApi'; +import CreateSampleEventButton from 'app/views/onboarding/createSampleEventButton'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/components/errors/detailedError.tsx b/src/sentry/static/sentry/app/components/errors/detailedError.tsx index 6f1c5786412e6c..35c79b234f1339 100644 --- a/src/sentry/static/sentry/app/components/errors/detailedError.tsx +++ b/src/sentry/static/sentry/app/components/errors/detailedError.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; import * as Sentry from '@sentry/react'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {IconFlag} from 'app/icons'; import Button from 'app/components/button'; +import {IconFlag} from 'app/icons'; +import {t} from 'app/locale'; type DefaultProps = { /** diff --git a/src/sentry/static/sentry/app/components/errors/groupEventDetailsLoadingError.tsx b/src/sentry/static/sentry/app/components/errors/groupEventDetailsLoadingError.tsx index 440cf324b843ff..60ddf2d2b8134d 100644 --- a/src/sentry/static/sentry/app/components/errors/groupEventDetailsLoadingError.tsx +++ b/src/sentry/static/sentry/app/components/errors/groupEventDetailsLoadingError.tsx @@ -1,8 +1,8 @@ import React from 'react'; +import DetailedError from 'app/components/errors/detailedError'; import {t} from 'app/locale'; import {Environment} from 'app/types'; -import DetailedError from 'app/components/errors/detailedError'; type Props = { environments: Environment[]; diff --git a/src/sentry/static/sentry/app/components/errors/notFound.tsx b/src/sentry/static/sentry/app/components/errors/notFound.tsx index 0646b76f5b44de..15f639dca47362 100644 --- a/src/sentry/static/sentry/app/components/errors/notFound.tsx +++ b/src/sentry/static/sentry/app/components/errors/notFound.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; import Alert from 'app/components/alert'; -import {IconInfo} from 'app/icons'; -import space from 'app/styles/space'; import ExternalLink from 'app/components/links/externalLink'; import Link from 'app/components/links/link'; +import {IconInfo} from 'app/icons'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; const NotFound = () => ( <NotFoundAlert type="error" icon={<IconInfo size="lg" />}> diff --git a/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.tsx b/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.tsx index b5f00862419d5d..d4ad2cf47a8657 100644 --- a/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.tsx +++ b/src/sentry/static/sentry/app/components/eventOrGroupExtraDetails.tsx @@ -2,19 +2,19 @@ import React from 'react'; import {Link, withRouter, WithRouterProps} from 'react-router'; import styled from '@emotion/styled'; -import {Event, Group, Organization} from 'app/types'; -import {IconChat} from 'app/icons'; -import {tct} from 'app/locale'; import EventAnnotation from 'app/components/events/eventAnnotation'; +import InboxCommentsLink from 'app/components/group/inboxBadges/commentsLink'; +import InboxEventAnnotation from 'app/components/group/inboxBadges/eventAnnotation'; +import InboxShortId from 'app/components/group/inboxBadges/shortId'; +import UnhandledTag from 'app/components/group/inboxBadges/unhandledTag'; +import Times from 'app/components/group/times'; import ProjectBadge from 'app/components/idBadge/projectBadge'; import ShortId from 'app/components/shortId'; -import Times from 'app/components/group/times'; +import {IconChat} from 'app/icons'; +import {tct} from 'app/locale'; import space from 'app/styles/space'; +import {Event, Group, Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; -import UnhandledTag from 'app/components/group/inboxBadges/unhandledTag'; -import InboxShortId from 'app/components/group/inboxBadges/shortId'; -import InboxCommentsLink from 'app/components/group/inboxBadges/commentsLink'; -import InboxEventAnnotation from 'app/components/group/inboxBadges/eventAnnotation'; type Props = WithRouterProps<{orgId: string}> & { data: Event | Group; diff --git a/src/sentry/static/sentry/app/components/eventOrGroupHeader.tsx b/src/sentry/static/sentry/app/components/eventOrGroupHeader.tsx index fd6e583fe763dc..a23b3dde568bb7 100644 --- a/src/sentry/static/sentry/app/components/eventOrGroupHeader.tsx +++ b/src/sentry/static/sentry/app/components/eventOrGroupHeader.tsx @@ -1,17 +1,17 @@ import React from 'react'; import {withRouter, WithRouterProps} from 'react-router'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import capitalize from 'lodash/capitalize'; -import {tct} from 'app/locale'; -import {Event, Group, GroupTombstone, Level, Organization} from 'app/types'; -import {IconMute, IconStar} from 'app/icons'; import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; +import GlobalSelectionLink from 'app/components/globalSelectionLink'; import Tooltip from 'app/components/tooltip'; -import {getMessage, getLocation} from 'app/utils/events'; +import {IconMute, IconStar} from 'app/icons'; +import {tct} from 'app/locale'; +import {Event, Group, GroupTombstone, Level, Organization} from 'app/types'; +import {getLocation, getMessage} from 'app/utils/events'; import withOrganization from 'app/utils/withOrganization'; -import GlobalSelectionLink from 'app/components/globalSelectionLink'; import UnhandledTag, { TagAndMessageWrapper, } from 'app/views/organizationGroupDetails/unhandledTag'; diff --git a/src/sentry/static/sentry/app/components/eventOrGroupTitle.tsx b/src/sentry/static/sentry/app/components/eventOrGroupTitle.tsx index 1fc6f4ae14184b..6a284abb3d158f 100644 --- a/src/sentry/static/sentry/app/components/eventOrGroupTitle.tsx +++ b/src/sentry/static/sentry/app/components/eventOrGroupTitle.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {Organization, Event, Group, GroupTombstone} from 'app/types'; -import {getTitle} from 'app/utils/events'; import GuideAnchor from 'app/components/assistant/guideAnchor'; +import {Event, Group, GroupTombstone, Organization} from 'app/types'; +import {getTitle} from 'app/utils/events'; import withOrganization from 'app/utils/withOrganization'; import StacktracePreview from './stacktracePreview'; diff --git a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummary.jsx b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummary.jsx index 8d939aa13b0dbe..e2217963b32114 100644 --- a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummary.jsx +++ b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummary.jsx @@ -2,15 +2,15 @@ import React from 'react'; import styled from '@emotion/styled'; import {t} from 'app/locale'; -import {objectIsEmpty} from 'app/utils'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {objectIsEmpty} from 'app/utils'; -import ContextSummaryUser from './contextSummaryUser'; -import ContextSummaryGeneric from './contextSummaryGeneric'; import ContextSummaryDevice from './contextSummaryDevice'; +import ContextSummaryGeneric from './contextSummaryGeneric'; import ContextSummaryGPU from './contextSummaryGPU'; import ContextSummaryOS from './contextSummaryOS'; +import ContextSummaryUser from './contextSummaryUser'; import filterContexts from './filterContexts'; const MIN_CONTEXTS = 3; diff --git a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryDevice.tsx b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryDevice.tsx index c8b8c64b7d4b2b..36aa3a33316821 100644 --- a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryDevice.tsx +++ b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryDevice.tsx @@ -1,17 +1,17 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {Meta} from 'app/types'; -import {getMeta} from 'app/components/events/meta/metaProxy'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; import DeviceName from 'app/components/deviceName'; -import space from 'app/styles/space'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; +import {getMeta} from 'app/components/events/meta/metaProxy'; import TextOverflow from 'app/components/textOverflow'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Meta} from 'app/types'; -import generateClassName from './generateClassName'; import ContextSummaryNoSummary from './contextSummaryNoSummary'; +import generateClassName from './generateClassName'; import Item from './item'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGPU.tsx b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGPU.tsx index e7d7fd105e82bd..c124e0b4dbe545 100644 --- a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGPU.tsx +++ b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGPU.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {Meta} from 'app/types'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import AnnotatedText from 'app/components/events/meta/annotatedText'; -import space from 'app/styles/space'; +import {getMeta} from 'app/components/events/meta/metaProxy'; import TextOverflow from 'app/components/textOverflow'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Meta} from 'app/types'; import ContextSummaryNoSummary from './contextSummaryNoSummary'; import generateClassName from './generateClassName'; diff --git a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGeneric.tsx b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGeneric.tsx index 7e5d2cb1d85597..33f9bf919bc132 100644 --- a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGeneric.tsx +++ b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryGeneric.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import AnnotatedText from 'app/components/events/meta/annotatedText'; -import space from 'app/styles/space'; +import {getMeta} from 'app/components/events/meta/metaProxy'; import TextOverflow from 'app/components/textOverflow'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import ContextSummaryNoSummary from './contextSummaryNoSummary'; import generateClassName from './generateClassName'; diff --git a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryOS.tsx b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryOS.tsx index b4b9e438fa27ef..efce5fa1cf8cc6 100644 --- a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryOS.tsx +++ b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryOS.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {Meta} from 'app/types'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import AnnotatedText from 'app/components/events/meta/annotatedText'; -import space from 'app/styles/space'; +import {getMeta} from 'app/components/events/meta/metaProxy'; import TextOverflow from 'app/components/textOverflow'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Meta} from 'app/types'; import ContextSummaryNoSummary from './contextSummaryNoSummary'; import generateClassName from './generateClassName'; diff --git a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryUser.tsx b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryUser.tsx index 7147c929f02ccf..131d2d6e85bc9a 100644 --- a/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryUser.tsx +++ b/src/sentry/static/sentry/app/components/events/contextSummary/contextSummaryUser.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {Meta, EventUser} from 'app/types'; -import {removeFilterMaskedEntries} from 'app/components/events/interfaces/utils'; import UserAvatar from 'app/components/avatar/userAvatar'; -import {getMeta} from 'app/components/events/meta/metaProxy'; +import {removeFilterMaskedEntries} from 'app/components/events/interfaces/utils'; import AnnotatedText from 'app/components/events/meta/annotatedText'; -import space from 'app/styles/space'; +import {getMeta} from 'app/components/events/meta/metaProxy'; import TextOverflow from 'app/components/textOverflow'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {EventUser, Meta} from 'app/types'; import ContextSummaryNoSummary from './contextSummaryNoSummary'; import Item from './item'; diff --git a/src/sentry/static/sentry/app/components/events/contexts.jsx b/src/sentry/static/sentry/app/components/events/contexts.jsx index e03409a3c94b1d..5bb07f45fe08db 100644 --- a/src/sentry/static/sentry/app/components/events/contexts.jsx +++ b/src/sentry/static/sentry/app/components/events/contexts.jsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {objectIsEmpty, toTitleCase, defined} from 'app/utils'; import EventDataSection from 'app/components/events/eventDataSection'; -import plugins from 'app/plugins'; import {t} from 'app/locale'; +import plugins from 'app/plugins'; +import {defined, objectIsEmpty, toTitleCase} from 'app/utils'; const CONTEXT_TYPES = { default: require('app/components/events/contexts/default').default, diff --git a/src/sentry/static/sentry/app/components/events/contexts/app/app.tsx b/src/sentry/static/sentry/app/components/events/contexts/app/app.tsx index a605783d0be465..2105d13a1b4707 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/app/app.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/app/app.tsx @@ -2,9 +2,10 @@ import React from 'react'; import ContextBlock from 'app/components/events/contexts/contextBlock'; +import getUnknownData from '../getUnknownData'; + import getAppKnownData from './getAppKnownData'; import {AppData, AppKnownDataType} from './types'; -import getUnknownData from '../getUnknownData'; type Props = { data: AppData; diff --git a/src/sentry/static/sentry/app/components/events/contexts/default.tsx b/src/sentry/static/sentry/app/components/events/contexts/default.tsx index 8f9fdce60d3634..14549d30747edf 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/default.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/default.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {Event} from 'app/types'; import ContextBlock from 'app/components/events/contexts/contextBlock'; +import {Event} from 'app/types'; type Props = { data: Record<string, React.ReactNode | undefined>; diff --git a/src/sentry/static/sentry/app/components/events/contexts/device/device.tsx b/src/sentry/static/sentry/app/components/events/contexts/device/device.tsx index 131f35c013b3dc..5237b11a16b7be 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/device/device.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/device/device.tsx @@ -2,10 +2,11 @@ import React from 'react'; import ContextBlock from 'app/components/events/contexts/contextBlock'; -import {DeviceData, DeviceKnownDataType} from './types'; -import getDeviceKnownData from './getDeviceKnownData'; import getUnknownData from '../getUnknownData'; +import getDeviceKnownData from './getDeviceKnownData'; +import {DeviceData, DeviceKnownDataType} from './types'; + type Props = { data: DeviceData; }; diff --git a/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownData.tsx b/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownData.tsx index 013fb562e68a42..cd911939ce4be0 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownData.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownData.tsx @@ -3,7 +3,7 @@ import {getMeta} from 'app/components/events/meta/metaProxy'; import {defined} from 'app/utils'; import getDeviceKnownDataDetails from './getDeviceKnownDataDetails'; -import {DeviceKnownDataType, DeviceData} from './types'; +import {DeviceData, DeviceKnownDataType} from './types'; function getOperatingSystemKnownData( data: DeviceData, diff --git a/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownDataDetails.tsx b/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownDataDetails.tsx index c6428d5db6499e..7c32b2c9cfb361 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownDataDetails.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/device/getDeviceKnownDataDetails.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import {t} from 'app/locale'; -import {defined} from 'app/utils'; import DeviceName from 'app/components/deviceName'; import FileSize from 'app/components/fileSize'; +import {t} from 'app/locale'; +import {defined} from 'app/utils'; import formatMemory from './formatMemory'; import formatStorage from './formatStorage'; -import {DeviceKnownDataType, DeviceData} from './types'; +import {DeviceData, DeviceKnownDataType} from './types'; type Output = { subject: string; diff --git a/src/sentry/static/sentry/app/components/events/contexts/gpu/gpu.tsx b/src/sentry/static/sentry/app/components/events/contexts/gpu/gpu.tsx index 62b1d2bed20d3a..0827e88ce82353 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/gpu/gpu.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/gpu/gpu.tsx @@ -2,9 +2,10 @@ import React from 'react'; import ContextBlock from 'app/components/events/contexts/contextBlock'; +import getUnknownData from '../getUnknownData'; + import getOperatingSystemKnownData from './getGPUKnownData'; import {GPUData, GPUKnownDataType} from './types'; -import getUnknownData from '../getUnknownData'; type Props = { data: GPUData; diff --git a/src/sentry/static/sentry/app/components/events/contexts/operatingSystem/operatingSystem.tsx b/src/sentry/static/sentry/app/components/events/contexts/operatingSystem/operatingSystem.tsx index 6a9b86e94fc194..675bc5f536c25b 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/operatingSystem/operatingSystem.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/operatingSystem/operatingSystem.tsx @@ -2,13 +2,14 @@ import React from 'react'; import ContextBlock from 'app/components/events/contexts/contextBlock'; +import getUnknownData from '../getUnknownData'; + import getOperatingSystemKnownData from './getOperatingSystemKnownData'; import { + OperatingSystemIgnoredDataType, OperatingSystemKnownData, OperatingSystemKnownDataType, - OperatingSystemIgnoredDataType, } from './types'; -import getUnknownData from '../getUnknownData'; type Props = { data: OperatingSystemKnownData; diff --git a/src/sentry/static/sentry/app/components/events/contexts/redux.tsx b/src/sentry/static/sentry/app/components/events/contexts/redux.tsx index daad2d299cc1b6..8f2861e25ae047 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/redux.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/redux.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {t} from 'app/locale'; +import ClippedBox from 'app/components/clippedBox'; import ContextBlock from 'app/components/events/contexts/contextBlock'; import {KeyValueListData} from 'app/components/events/interfaces/keyValueList/types'; -import ClippedBox from 'app/components/clippedBox'; +import {t} from 'app/locale'; type Props = { alias: string; diff --git a/src/sentry/static/sentry/app/components/events/contexts/runtime/runtime.tsx b/src/sentry/static/sentry/app/components/events/contexts/runtime/runtime.tsx index 758a30963bc536..545cb61a3db227 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/runtime/runtime.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/runtime/runtime.tsx @@ -2,10 +2,11 @@ import React from 'react'; import ContextBlock from 'app/components/events/contexts/contextBlock'; -import getRuntimeKnownData from './getRuntimeKnownData'; -import {RuntimeData, RuntimeKnownDataType, RuntimeIgnoredDataType} from './types'; import getUnknownData from '../getUnknownData'; +import getRuntimeKnownData from './getRuntimeKnownData'; +import {RuntimeData, RuntimeIgnoredDataType, RuntimeKnownDataType} from './types'; + type Props = { data: RuntimeData; }; diff --git a/src/sentry/static/sentry/app/components/events/contexts/state.tsx b/src/sentry/static/sentry/app/components/events/contexts/state.tsx index 56b9ceb7cbbf13..9a48a0bc280de4 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/state.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/state.tsx @@ -1,11 +1,11 @@ import React from 'react'; import upperFirst from 'lodash/upperFirst'; -import {t} from 'app/locale'; +import ClippedBox from 'app/components/clippedBox'; import ContextBlock from 'app/components/events/contexts/contextBlock'; import {KeyValueListData} from 'app/components/events/interfaces/keyValueList/types'; -import ClippedBox from 'app/components/clippedBox'; import {getMeta} from 'app/components/events/meta/metaProxy'; +import {t} from 'app/locale'; type StateDescription = { type?: string; diff --git a/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownData.tsx b/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownData.tsx index 04ccfc54a9f275..8b6e8fe5ac3473 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownData.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownData.tsx @@ -1,10 +1,10 @@ -import {Event, Organization} from 'app/types'; -import {defined} from 'app/utils'; import {KeyValueListData} from 'app/components/events/interfaces/keyValueList/types'; import {getMeta} from 'app/components/events/meta/metaProxy'; +import {Event, Organization} from 'app/types'; +import {defined} from 'app/utils'; -import {TraceKnownData, TraceKnownDataType} from './types'; import getUserKnownDataDetails from './getTraceKnownDataDetails'; +import {TraceKnownData, TraceKnownDataType} from './types'; type TraceKnownDataKeys = Extract<keyof TraceKnownData, string>; diff --git a/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownDataDetails.tsx b/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownDataDetails.tsx index 42141caeac1570..3b069c482343f9 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownDataDetails.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/trace/getTraceKnownDataDetails.tsx @@ -2,14 +2,14 @@ import React from 'react'; import styled from '@emotion/styled'; import moment from 'moment-timezone'; -import {Event, Organization} from 'app/types'; -import {t} from 'app/locale'; import Button from 'app/components/button'; +import {getTraceDateTimeRange} from 'app/components/events/interfaces/spans/utils'; +import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Event, Organization} from 'app/types'; import EventView from 'app/utils/discover/eventView'; -import {getTraceDateTimeRange} from 'app/components/events/interfaces/spans/utils'; import {transactionSummaryRouteWithQuery} from 'app/views/performance/transactionSummary/utils'; -import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; import {TraceKnownData, TraceKnownDataType} from './types'; diff --git a/src/sentry/static/sentry/app/components/events/contexts/trace/trace.tsx b/src/sentry/static/sentry/app/components/events/contexts/trace/trace.tsx index 1b2b8fda27118b..6a726a2afd8dca 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/trace/trace.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/trace/trace.tsx @@ -1,14 +1,15 @@ import React from 'react'; -import {Event, Organization} from 'app/types'; -import withOrganization from 'app/utils/withOrganization'; import ErrorBoundary from 'app/components/errorBoundary'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueListV2'; +import {Event, Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; -import {TraceKnownData, TraceKnownDataType} from './types'; -import getTraceKnownData from './getTraceKnownData'; import getUnknownData from '../getUnknownData'; +import getTraceKnownData from './getTraceKnownData'; +import {TraceKnownData, TraceKnownDataType} from './types'; + const traceKnownDataValues = [ TraceKnownDataType.STATUS, TraceKnownDataType.TRACE_ID, diff --git a/src/sentry/static/sentry/app/components/events/contexts/user/getUserKnownDataDetails.tsx b/src/sentry/static/sentry/app/components/events/contexts/user/getUserKnownDataDetails.tsx index 347725666615f1..fb07fa84f7be4c 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/user/getUserKnownDataDetails.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/user/getUserKnownDataDetails.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {t} from 'app/locale'; +import ExternalLink from 'app/components/links/externalLink'; import {IconMail} from 'app/icons'; +import {t} from 'app/locale'; import {AvatarUser as UserType} from 'app/types'; -import ExternalLink from 'app/components/links/externalLink'; import {UserKnownDataType} from './types'; diff --git a/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx b/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx index 4f94e8d817acee..94d5a4abc8b841 100644 --- a/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx +++ b/src/sentry/static/sentry/app/components/events/contexts/user/user.tsx @@ -1,17 +1,18 @@ import React from 'react'; import UserAvatar from 'app/components/avatar/userAvatar'; -import {AvatarUser as UserType} from 'app/types'; -import {removeFilterMaskedEntries} from 'app/components/events/interfaces/utils'; -import ContextBlock from 'app/components/events/contexts/contextBlock'; import ErrorBoundary from 'app/components/errorBoundary'; +import ContextBlock from 'app/components/events/contexts/contextBlock'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; +import {removeFilterMaskedEntries} from 'app/components/events/interfaces/utils'; +import {AvatarUser as UserType} from 'app/types'; import {defined} from 'app/utils'; -import getUserKnownData from './getUserKnownData'; -import {UserKnownDataType, UserIgnoredDataType} from './types'; import getUnknownData from '../getUnknownData'; +import getUserKnownData from './getUserKnownData'; +import {UserIgnoredDataType, UserKnownDataType} from './types'; + type Props = { data: Data; }; diff --git a/src/sentry/static/sentry/app/components/events/device.tsx b/src/sentry/static/sentry/app/components/events/device.tsx index 5f8fda785df0b8..169cec620dcc4f 100644 --- a/src/sentry/static/sentry/app/components/events/device.tsx +++ b/src/sentry/static/sentry/app/components/events/device.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import ContextData from 'app/components/contextData'; +import EventDataSection from 'app/components/events/eventDataSection'; import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import {Event} from 'app/types'; -import EventDataSection from 'app/components/events/eventDataSection'; -import ContextData from 'app/components/contextData'; type Props = { event: Event; diff --git a/src/sentry/static/sentry/app/components/events/errorItem.tsx b/src/sentry/static/sentry/app/components/events/errorItem.tsx index 71714d9acac6bc..dadbdb383c2b35 100644 --- a/src/sentry/static/sentry/app/components/events/errorItem.tsx +++ b/src/sentry/static/sentry/app/components/events/errorItem.tsx @@ -1,8 +1,8 @@ +import React from 'react'; +import isEmpty from 'lodash/isEmpty'; import mapKeys from 'lodash/mapKeys'; -import moment from 'moment'; import startCase from 'lodash/startCase'; -import isEmpty from 'lodash/isEmpty'; -import React from 'react'; +import moment from 'moment'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/events/errors.tsx b/src/sentry/static/sentry/app/components/events/errors.tsx index 204f152f670242..af20aaa6b74c1c 100644 --- a/src/sentry/static/sentry/app/components/events/errors.tsx +++ b/src/sentry/static/sentry/app/components/events/errors.tsx @@ -1,16 +1,16 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import {css} from '@emotion/core'; import styled from '@emotion/styled'; -import uniqWith from 'lodash/uniqWith'; import isEqual from 'lodash/isEqual'; -import {css} from '@emotion/core'; +import uniqWith from 'lodash/uniqWith'; +import PropTypes from 'prop-types'; import Button from 'app/components/button'; import EventErrorItem from 'app/components/events/errorItem'; -import {Event} from 'app/types'; import {IconWarning} from 'app/icons'; import {t, tn} from 'app/locale'; import space from 'app/styles/space'; +import {Event} from 'app/types'; import {Theme} from 'app/utils/theme'; import {BannerContainer, BannerSummary} from './styles'; diff --git a/src/sentry/static/sentry/app/components/events/eventAttachmentActions.tsx b/src/sentry/static/sentry/app/components/events/eventAttachmentActions.tsx index bd99423bef92ce..8fe8679a1d64d9 100644 --- a/src/sentry/static/sentry/app/components/events/eventAttachmentActions.tsx +++ b/src/sentry/static/sentry/app/components/events/eventAttachmentActions.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import Button from 'app/components/button'; -import space from 'app/styles/space'; import Confirm from 'app/components/confirm'; import {IconDelete, IconDownload} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/components/events/eventAttachments.tsx b/src/sentry/static/sentry/app/components/events/eventAttachments.tsx index 2ac3281a830162..589bc87bf3f281 100644 --- a/src/sentry/static/sentry/app/components/events/eventAttachments.tsx +++ b/src/sentry/static/sentry/app/components/events/eventAttachments.tsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; import {Location} from 'history'; +import PropTypes from 'prop-types'; import {Client} from 'app/api'; -import {Event, EventAttachment} from 'app/types'; -import {t} from 'app/locale'; -import {Panel, PanelBody, PanelItem} from 'app/components/panels'; import EventAttachmentActions from 'app/components/events/eventAttachmentActions'; import EventDataSection from 'app/components/events/eventDataSection'; import FileSize from 'app/components/fileSize'; +import {Panel, PanelBody, PanelItem} from 'app/components/panels'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; +import {Event, EventAttachment} from 'app/types'; import AttachmentUrl from 'app/utils/attachmentUrl'; import withApi from 'app/utils/withApi'; diff --git a/src/sentry/static/sentry/app/components/events/eventAttachmentsCrashReportsNotice.tsx b/src/sentry/static/sentry/app/components/events/eventAttachmentsCrashReportsNotice.tsx index 02eb08778e1078..88b30a0ff4f52f 100644 --- a/src/sentry/static/sentry/app/components/events/eventAttachmentsCrashReportsNotice.tsx +++ b/src/sentry/static/sentry/app/components/events/eventAttachmentsCrashReportsNotice.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {Location} from 'history'; -import {tct} from 'app/locale'; import {IconInfo} from 'app/icons'; +import {tct} from 'app/locale'; import {crashReportTypes} from 'app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsFilter'; import Alert from '../alert'; diff --git a/src/sentry/static/sentry/app/components/events/eventCause.tsx b/src/sentry/static/sentry/app/components/events/eventCause.tsx index 7f4eccb9f34c63..c9c37524359889 100644 --- a/src/sentry/static/sentry/app/components/events/eventCause.tsx +++ b/src/sentry/static/sentry/app/components/events/eventCause.tsx @@ -1,18 +1,18 @@ import React from 'react'; -import uniqBy from 'lodash/uniqBy'; -import flatMap from 'lodash/flatMap'; import styled from '@emotion/styled'; +import flatMap from 'lodash/flatMap'; +import uniqBy from 'lodash/uniqBy'; +import {Client} from 'app/api'; import CommitRow from 'app/components/commitRow'; -import {IconAdd, IconSubtract} from 'app/icons'; +import {CauseHeader, DataSection} from 'app/components/events/styles'; import {Panel} from 'app/components/panels'; -import {DataSection, CauseHeader} from 'app/components/events/styles'; +import {IconAdd, IconSubtract} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {AvatarProject, Committer, Event, Group, Organization} from 'app/types'; import withApi from 'app/utils/withApi'; import withCommitters from 'app/utils/withCommitters'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; -import {Event, Group, Organization, AvatarProject, Committer} from 'app/types'; -import {Client} from 'app/api'; type Props = { // injected by HoC diff --git a/src/sentry/static/sentry/app/components/events/eventCauseEmpty.jsx b/src/sentry/static/sentry/app/components/events/eventCauseEmpty.jsx index 162ac67a956578..520f47b820328c 100644 --- a/src/sentry/static/sentry/app/components/events/eventCauseEmpty.jsx +++ b/src/sentry/static/sentry/app/components/events/eventCauseEmpty.jsx @@ -1,20 +1,20 @@ -import moment from 'moment'; -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import moment from 'moment'; +import PropTypes from 'prop-types'; -import Button from 'app/components/button'; import codesworth from 'app/../images/spot/codesworth.png'; +import {promptsUpdate} from 'app/actionCreators/prompts'; +import Button from 'app/components/button'; import CommitRow from 'app/components/commitRow'; -import getDynamicText from 'app/utils/getDynamicText'; import {DataSection} from 'app/components/events/styles'; import {Panel} from 'app/components/panels'; -import {promptsUpdate} from 'app/actionCreators/prompts'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import {snoozedDays} from 'app/utils/promptsActivity'; import space from 'app/styles/space'; -import {t} from 'app/locale'; import {trackAdhocEvent, trackAnalyticsEvent} from 'app/utils/analytics'; +import getDynamicText from 'app/utils/getDynamicText'; +import {snoozedDays} from 'app/utils/promptsActivity'; import withApi from 'app/utils/withApi'; const EXAMPLE_COMMITS = ['dec0de', 'de1e7e', '5ca1ed']; diff --git a/src/sentry/static/sentry/app/components/events/eventDataSection.tsx b/src/sentry/static/sentry/app/components/events/eventDataSection.tsx index ece63985bef722..1e33de403383c7 100644 --- a/src/sentry/static/sentry/app/components/events/eventDataSection.tsx +++ b/src/sentry/static/sentry/app/components/events/eventDataSection.tsx @@ -1,15 +1,15 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import {DataSection} from 'app/components/events/styles'; -import {IconAnchor} from 'app/icons/iconAnchor'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import {DataSection} from 'app/components/events/styles'; +import {IconAnchor} from 'app/icons/iconAnchor'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {callIfFunction} from 'app/utils/callIfFunction'; const defaultProps = { wrapTitle: true, diff --git a/src/sentry/static/sentry/app/components/events/eventEntries.tsx b/src/sentry/static/sentry/app/components/events/eventEntries.tsx index b224e6913f8f10..b9cf903e2d2eab 100644 --- a/src/sentry/static/sentry/app/components/events/eventEntries.tsx +++ b/src/sentry/static/sentry/app/components/events/eventEntries.tsx @@ -1,44 +1,44 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; import {Location} from 'history'; +import PropTypes from 'prop-types'; -import {analytics} from 'app/utils/analytics'; -import {logException} from 'app/utils/logging'; -import {objectIsEmpty} from 'app/utils'; -import {t} from 'app/locale'; -import CspInterface from 'app/components/events/interfaces/csp'; -import DebugMetaInterface from 'app/components/events/interfaces/debugMeta'; +import EventContexts from 'app/components/events/contexts'; +import EventContextSummary from 'app/components/events/contextSummary/contextSummary'; +import EventDevice from 'app/components/events/device'; +import EventErrors from 'app/components/events/errors'; import EventAttachments from 'app/components/events/eventAttachments'; import EventCause from 'app/components/events/eventCause'; import EventCauseEmpty from 'app/components/events/eventCauseEmpty'; -import EventContextSummary from 'app/components/events/contextSummary/contextSummary'; -import EventContexts from 'app/components/events/contexts'; import EventDataSection from 'app/components/events/eventDataSection'; -import EventDevice from 'app/components/events/device'; -import EventErrors from 'app/components/events/errors'; import EventExtraData from 'app/components/events/eventExtraData/eventExtraData'; -import EventGroupingInfo from 'app/components/events/groupingInfo'; -import EventPackageData from 'app/components/events/packageData'; import EventSdk from 'app/components/events/eventSdk'; -import EventSdkUpdates from 'app/components/events/sdkUpdates'; import EventTags from 'app/components/events/eventTags/eventTags'; -import EventUserFeedback from 'app/components/events/userFeedback'; +import EventGroupingInfo from 'app/components/events/groupingInfo'; +import BreadcrumbsInterface from 'app/components/events/interfaces/breadcrumbs'; +import CspInterface from 'app/components/events/interfaces/csp'; +import DebugMetaInterface from 'app/components/events/interfaces/debugMeta'; import ExceptionInterface from 'app/components/events/interfaces/exception'; import GenericInterface from 'app/components/events/interfaces/generic'; import MessageInterface from 'app/components/events/interfaces/message'; import RequestInterface from 'app/components/events/interfaces/request'; -import RRWebIntegration from 'app/components/events/rrwebIntegration'; -import SentryTypes from 'app/sentryTypes'; -import BreadcrumbsInterface from 'app/components/events/interfaces/breadcrumbs'; import SpansInterface from 'app/components/events/interfaces/spans'; import StacktraceInterface from 'app/components/events/interfaces/stacktrace'; import TemplateInterface from 'app/components/events/interfaces/template'; import ThreadsInterface from 'app/components/events/interfaces/threads'; +import EventPackageData from 'app/components/events/packageData'; +import RRWebIntegration from 'app/components/events/rrwebIntegration'; +import EventSdkUpdates from 'app/components/events/sdkUpdates'; import {DataSection} from 'app/components/events/styles'; +import EventUserFeedback from 'app/components/events/userFeedback'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {AvatarProject, Entry, Event, Group, Organization} from 'app/types'; +import {objectIsEmpty} from 'app/utils'; +import {analytics} from 'app/utils/analytics'; +import {logException} from 'app/utils/logging'; import withOrganization from 'app/utils/withOrganization'; -import {Event, AvatarProject, Group, Entry, Organization} from 'app/types'; export const INTERFACES = { exception: ExceptionInterface, diff --git a/src/sentry/static/sentry/app/components/events/eventExtraData/eventDataContent.tsx b/src/sentry/static/sentry/app/components/events/eventExtraData/eventDataContent.tsx index b96322149ad44a..0d1ef10859f18a 100644 --- a/src/sentry/static/sentry/app/components/events/eventExtraData/eventDataContent.tsx +++ b/src/sentry/static/sentry/app/components/events/eventExtraData/eventDataContent.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {defined} from 'app/utils'; import ContextBlock from 'app/components/events/contexts/contextBlock'; +import {defined} from 'app/utils'; import getEventExtraDataKnownData from './getEventExtraDataKnownData'; diff --git a/src/sentry/static/sentry/app/components/events/eventExtraData/eventExtraData.tsx b/src/sentry/static/sentry/app/components/events/eventExtraData/eventExtraData.tsx index 3bb7473d1db3c3..5a0113f040f5e1 100644 --- a/src/sentry/static/sentry/app/components/events/eventExtraData/eventExtraData.tsx +++ b/src/sentry/static/sentry/app/components/events/eventExtraData/eventExtraData.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {Event} from 'app/types'; -import {t} from 'app/locale'; import EventDataSection from 'app/components/events/eventDataSection'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {Event} from 'app/types'; import EventDataContent from './eventDataContent'; diff --git a/src/sentry/static/sentry/app/components/events/eventExtraData/getEventExtraDataKnownDataDetails.tsx b/src/sentry/static/sentry/app/components/events/eventExtraData/getEventExtraDataKnownDataDetails.tsx index f66f119170eef1..ba62abbc38ac5b 100644 --- a/src/sentry/static/sentry/app/components/events/eventExtraData/getEventExtraDataKnownDataDetails.tsx +++ b/src/sentry/static/sentry/app/components/events/eventExtraData/getEventExtraDataKnownDataDetails.tsx @@ -2,7 +2,7 @@ import React from 'react'; import {t} from 'app/locale'; -import {EventExtraDataType, EventExtraData} from './types'; +import {EventExtraData, EventExtraDataType} from './types'; type Output = { subject: string; diff --git a/src/sentry/static/sentry/app/components/events/eventMessage.tsx b/src/sentry/static/sentry/app/components/events/eventMessage.tsx index 94aaebf3d772dc..5f5ed0bd523ab2 100644 --- a/src/sentry/static/sentry/app/components/events/eventMessage.tsx +++ b/src/sentry/static/sentry/app/components/events/eventMessage.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Level} from 'app/types'; import ErrorLevel from 'app/components/events/errorLevel'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; +import {Level} from 'app/types'; type Props = { level?: Level; diff --git a/src/sentry/static/sentry/app/components/events/eventMetadata.tsx b/src/sentry/static/sentry/app/components/events/eventMetadata.tsx index 5bbd773c42a5bc..2885118688b58b 100644 --- a/src/sentry/static/sentry/app/components/events/eventMetadata.tsx +++ b/src/sentry/static/sentry/app/components/events/eventMetadata.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {Event, OrganizationSummary} from 'app/types'; import {SectionHeading} from 'app/components/charts/styles'; import DateTime from 'app/components/dateTime'; -import ExternalLink from 'app/components/links/externalLink'; import FileSize from 'app/components/fileSize'; import ProjectBadge from 'app/components/idBadge/projectBadge'; +import ExternalLink from 'app/components/links/externalLink'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Event, OrganizationSummary} from 'app/types'; import getDynamicText from 'app/utils/getDynamicText'; import Projects from 'app/utils/projects'; diff --git a/src/sentry/static/sentry/app/components/events/eventRow.jsx b/src/sentry/static/sentry/app/components/events/eventRow.jsx index 9937e64a890f4b..2b1a2d1d28fe58 100644 --- a/src/sentry/static/sentry/app/components/events/eventRow.jsx +++ b/src/sentry/static/sentry/app/components/events/eventRow.jsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {Link} from 'react-router'; +import PropTypes from 'prop-types'; -import EventStore from 'app/stores/eventStore'; import UserAvatar from 'app/components/avatar/userAvatar'; import TimeSince from 'app/components/timeSince'; +import EventStore from 'app/stores/eventStore'; class EventRow extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/events/eventSdk.tsx b/src/sentry/static/sentry/app/components/events/eventSdk.tsx index 2dd9dbf4dbf6c0..5b5b9f300032c5 100644 --- a/src/sentry/static/sentry/app/components/events/eventSdk.tsx +++ b/src/sentry/static/sentry/app/components/events/eventSdk.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {Event} from 'app/types'; import EventDataSection from 'app/components/events/eventDataSection'; import Annotated from 'app/components/events/meta/annotated'; import {t} from 'app/locale'; +import {Event} from 'app/types'; type Props = { sdk: NonNullable<Event['sdk']>; diff --git a/src/sentry/static/sentry/app/components/events/eventTags/eventTags.tsx b/src/sentry/static/sentry/app/components/events/eventTags/eventTags.tsx index 690565fefa0195..2b4d38bac10850 100644 --- a/src/sentry/static/sentry/app/components/events/eventTags/eventTags.tsx +++ b/src/sentry/static/sentry/app/components/events/eventTags/eventTags.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import isEmpty from 'lodash/isEmpty'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; +import isEmpty from 'lodash/isEmpty'; -import {Event} from 'app/types'; import EventDataSection from 'app/components/events/eventDataSection'; -import {defined, generateQueryWithTag} from 'app/utils'; -import {t} from 'app/locale'; import Pills from 'app/components/pills'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Event} from 'app/types'; +import {defined, generateQueryWithTag} from 'app/utils'; import EventTagsPill from './eventTagsPill'; diff --git a/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPill.tsx b/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPill.tsx index 4de8073049e621..58d94b22ad8329 100644 --- a/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPill.tsx +++ b/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPill.tsx @@ -1,18 +1,18 @@ import React from 'react'; import {Link} from 'react-router'; import {css} from '@emotion/core'; +import {Location, Query} from 'history'; import * as queryString from 'query-string'; -import {Query, Location} from 'history'; -import {EventTag} from 'app/types'; import AnnotatedText from 'app/components/events/meta/annotatedText'; -import {isUrl} from 'app/utils'; +import {getMeta} from 'app/components/events/meta/metaProxy'; +import ExternalLink from 'app/components/links/externalLink'; import Pill from 'app/components/pill'; import VersionHoverCard from 'app/components/versionHoverCard'; +import {IconInfo, IconOpen} from 'app/icons'; +import {EventTag} from 'app/types'; +import {isUrl} from 'app/utils'; import TraceHoverCard from 'app/utils/discover/traceHoverCard'; -import {IconOpen, IconInfo} from 'app/icons'; -import ExternalLink from 'app/components/links/externalLink'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import EventTagsPillValue from './eventTagsPillValue'; diff --git a/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPillValue.tsx b/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPillValue.tsx index 09bc7c9bd62905..0a8583b22f712e 100644 --- a/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPillValue.tsx +++ b/src/sentry/static/sentry/app/components/events/eventTags/eventTagsPillValue.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import {Meta, EventTag} from 'app/types'; -import Version from 'app/components/version'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; import DeviceName from 'app/components/deviceName'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; import Link from 'app/components/links/link'; +import Version from 'app/components/version'; +import {EventTag, Meta} from 'app/types'; import {defined} from 'app/utils'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponent.tsx b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponent.tsx index 6677273a9bec0e..0704382854f6df 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponent.tsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponent.tsx @@ -4,9 +4,9 @@ import styled from '@emotion/styled'; import space from 'app/styles/space'; import {EventGroupComponent} from 'app/types'; -import {shouldInlineComponentValue} from './utils'; -import GroupingComponentStacktrace from './groupingComponentStacktrace'; import GroupingComponentChildren from './groupingComponentChildren'; +import GroupingComponentStacktrace from './groupingComponentStacktrace'; +import {shouldInlineComponentValue} from './utils'; type Props = { component: EventGroupComponent; diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentChildren.tsx b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentChildren.tsx index d6eb4aa89f32e6..285aafba9aac74 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentChildren.tsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentChildren.tsx @@ -4,8 +4,8 @@ import isObject from 'lodash/isObject'; import {EventGroupComponent} from 'app/types'; import GroupingComponent, { - GroupingValue, GroupingComponentListItem, + GroupingValue, } from './groupingComponent'; import {groupingComponentFilter} from './utils'; diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentFrames.tsx b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentFrames.tsx index 5e5b37f660787c..0d32a1b807658a 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentFrames.tsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentFrames.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {tct} from 'app/locale'; import Button from 'app/components/button'; import {IconAdd, IconSubtract} from 'app/icons'; +import {tct} from 'app/locale'; +import space from 'app/styles/space'; import {GroupingComponentListItem} from './groupingComponent'; diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentStacktrace.tsx b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentStacktrace.tsx index 3e48a07c28528d..cbfd23d471fe0e 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentStacktrace.tsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingComponentStacktrace.tsx @@ -3,8 +3,8 @@ import React from 'react'; import {EventGroupComponent} from 'app/types'; import GroupingComponent from './groupingComponent'; -import {groupingComponentFilter} from './utils'; import GroupingComponentFrames from './groupingComponentFrames'; +import {groupingComponentFilter} from './utils'; type FrameGroup = { key: string; diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingConfigSelect.tsx b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingConfigSelect.tsx index bf06bb34af6cb7..2ceb3186b390e8 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingConfigSelect.tsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingConfigSelect.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {EventGroupingConfig} from 'app/types'; import AsyncComponent from 'app/components/asyncComponent'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; import Tooltip from 'app/components/tooltip'; import {t} from 'app/locale'; +import {EventGroupingConfig} from 'app/types'; import {GroupingConfigItem} from '.'; diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingVariant.tsx b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingVariant.tsx index 07ed329c0da87b..71e53aaf982cf2 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo/groupingVariant.tsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo/groupingVariant.tsx @@ -2,19 +2,19 @@ import React from 'react'; import styled from '@emotion/styled'; import capitalize from 'lodash/capitalize'; -import {t} from 'app/locale'; -import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; -import {EventGroupVariant, EventGroupVariantType, EventGroupComponent} from 'app/types'; -import ButtonBar from 'app/components/buttonBar'; import Button from 'app/components/button'; -import {IconCheckmark, IconClose} from 'app/icons'; -import space from 'app/styles/space'; -import Tooltip from 'app/components/tooltip'; +import ButtonBar from 'app/components/buttonBar'; +import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; import QuestionTooltip from 'app/components/questionTooltip'; +import Tooltip from 'app/components/tooltip'; +import {IconCheckmark, IconClose} from 'app/icons'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; +import {EventGroupComponent, EventGroupVariant, EventGroupVariantType} from 'app/types'; -import {hasNonContributingComponent} from './utils'; import GroupingComponent from './groupingComponent'; +import {hasNonContributingComponent} from './utils'; type Props = { variant: EventGroupVariant; diff --git a/src/sentry/static/sentry/app/components/events/groupingInfo/index.tsx b/src/sentry/static/sentry/app/components/events/groupingInfo/index.tsx index d1f982487a1dcd..9b385a5b6b5d89 100644 --- a/src/sentry/static/sentry/app/components/events/groupingInfo/index.tsx +++ b/src/sentry/static/sentry/app/components/events/groupingInfo/index.tsx @@ -2,16 +2,16 @@ import React from 'react'; import styled from '@emotion/styled'; import AsyncComponent from 'app/components/asyncComponent'; +import Button from 'app/components/button'; import EventDataSection from 'app/components/events/eventDataSection'; +import LoadingIndicator from 'app/components/loadingIndicator'; import {t} from 'app/locale'; -import withOrganization from 'app/utils/withOrganization'; -import {Organization, Event, EventGroupInfo} from 'app/types'; import space from 'app/styles/space'; -import Button from 'app/components/button'; -import LoadingIndicator from 'app/components/loadingIndicator'; +import {Event, EventGroupInfo, Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; -import GroupVariant from './groupingVariant'; import GroupingConfigSelect from './groupingConfigSelect'; +import GroupVariant from './groupingVariant'; type Props = AsyncComponent['props'] & { organization: Organization; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx b/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx index 11b4fd70eb8eaa..5007cbc37c0387 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/assembly.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {IconReturn} from 'app/icons/iconReturn'; -import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; import {t} from 'app/locale'; import space from 'app/styles/space'; import theme from 'app/utils/theme'; +import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; interface Props { name: string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/category.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/category.tsx index f65cde0d955d90..8ead32867bb2c1 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/category.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/category.tsx @@ -4,8 +4,8 @@ import styled from '@emotion/styled'; import Highlight from 'app/components/highlight'; import TextOverflow from 'app/components/textOverflow'; import Tooltip from 'app/components/tooltip'; -import {defined} from 'app/utils'; import {t} from 'app/locale'; +import {defined} from 'app/utils'; type Props = { searchTerm: string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/default.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/default.tsx index ec1953e56f483e..fad6aadb53ad0b 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/default.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/default.tsx @@ -1,14 +1,15 @@ import React from 'react'; -import {Event, Project} from 'app/types'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; import {getMeta} from 'app/components/events/meta/metaProxy'; -import withProjects from 'app/utils/withProjects'; -import {generateEventSlug, eventDetailsRoute} from 'app/utils/discover/urls'; -import Link from 'app/components/links/link'; import Highlight from 'app/components/highlight'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; +import Link from 'app/components/links/link'; +import {Event, Project} from 'app/types'; +import {eventDetailsRoute, generateEventSlug} from 'app/utils/discover/urls'; +import withProjects from 'app/utils/withProjects'; import {BreadcrumbTypeDefault, BreadcrumbTypeNavigation} from '../types'; + import Summary from './summary'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/exception.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/exception.tsx index 9104b1241dd495..0bae7b2016d924 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/exception.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/exception.tsx @@ -1,12 +1,13 @@ import React from 'react'; import omit from 'lodash/omit'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; import {getMeta} from 'app/components/events/meta/metaProxy'; -import {defined} from 'app/utils'; import Highlight from 'app/components/highlight'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; +import {defined} from 'app/utils'; import {BreadcrumbTypeDefault} from '../types'; + import Summary from './summary'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/http.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/http.tsx index 0f2ae14fb3486c..2842ddacdb7717 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/http.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/http.tsx @@ -1,14 +1,15 @@ import React from 'react'; import omit from 'lodash/omit'; -import ExternalLink from 'app/components/links/externalLink'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; import {getMeta} from 'app/components/events/meta/metaProxy'; +import Highlight from 'app/components/highlight'; +import ExternalLink from 'app/components/links/externalLink'; import {t} from 'app/locale'; import {defined} from 'app/utils'; -import Highlight from 'app/components/highlight'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; import {BreadcrumbTypeHTTP} from '../types'; + import Summary from './summary'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/index.tsx index 24b7742c68bab8..2a79301a03a82e 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/index.tsx @@ -2,10 +2,11 @@ import React from 'react'; import {Event} from 'app/types'; +import {Breadcrumb, BreadcrumbType} from '../types'; + import Default from './default'; import Exception from './exception'; import Http from './http'; -import {Breadcrumb, BreadcrumbType} from '../types'; type Props = { searchTerm: string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/summary.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/summary.tsx index db908dccb6cbd3..bbae73b42d4103 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/summary.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/data/summary.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import Highlight from 'app/components/highlight'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import AnnotatedText from 'app/components/events/meta/annotatedText'; +import {getMeta} from 'app/components/events/meta/metaProxy'; +import Highlight from 'app/components/highlight'; import {defined} from 'app/utils'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/dropdownButton.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/dropdownButton.tsx index 164fd860431f1a..dd50aa0a78ff71 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/dropdownButton.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/dropdownButton.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tn} from 'app/locale'; -import {GetActorPropsFn} from 'app/components/dropdownMenu'; import DropdownButton from 'app/components/dropdownButton'; +import {GetActorPropsFn} from 'app/components/dropdownMenu'; +import {t, tn} from 'app/locale'; type DropdownButtonProps = React.ComponentProps<typeof DropdownButton>; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/index.tsx index ce3906b4f9e8f4..d4d33bea926250 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/index.tsx @@ -6,7 +6,7 @@ import DropdownControl from 'app/components/dropdownControl'; import DropDownButton from './dropdownButton'; import OptionsGroup from './optionsGroup'; -import {OptionType, OptionLevel, Option} from './types'; +import {Option, OptionLevel, OptionType} from './types'; type OnClick = React.ComponentProps<typeof OptionsGroup>['onClick']; type Options = [Array<OptionType>, Array<OptionLevel>]; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/optionsGroup.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/optionsGroup.tsx index bf8b1da0de0c41..d04a773c6e2dc6 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/optionsGroup.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/optionsGroup.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; +import CheckboxFancy from 'app/components/checkboxFancy/checkboxFancy'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import CheckboxFancy from 'app/components/checkboxFancy/checkboxFancy'; import {Option} from './types'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/types.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/types.tsx index 912ba3ce8f08aa..65b2760957f879 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/types.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/filter/types.tsx @@ -1,4 +1,4 @@ -import {BreadcrumbType, BreadcrumbLevelType} from '../types'; +import {BreadcrumbLevelType, BreadcrumbType} from '../types'; type OptionBase = { symbol: React.ReactElement; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/getCrumbDetails.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/getCrumbDetails.tsx index 60af29335d1630..c3dfdc82fc5630 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/getCrumbDetails.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/getCrumbDetails.tsx @@ -1,16 +1,16 @@ import { + IconFire, + IconFix, IconInfo, - IconWarning, IconLocation, - IconUser, + IconMobile, IconRefresh, - IconFix, - IconFire, - IconTerminal, + IconSpan, IconStack, - IconMobile, IconSwitch, - IconSpan, + IconTerminal, + IconUser, + IconWarning, } from 'app/icons'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/index.tsx index b15f17e3335087..def7c9159bf08c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/index.tsx @@ -1,32 +1,32 @@ import React from 'react'; import styled from '@emotion/styled'; -import pick from 'lodash/pick'; import omit from 'lodash/omit'; +import pick from 'lodash/pick'; +import GuideAnchor from 'app/components/assistant/guideAnchor'; +import Button from 'app/components/button'; import ErrorBoundary from 'app/components/errorBoundary'; import EventDataSection from 'app/components/events/eventDataSection'; -import GuideAnchor from 'app/components/assistant/guideAnchor'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {t} from 'app/locale'; -import {Event} from 'app/types'; -import space from 'app/styles/space'; import SearchBar from 'app/components/searchBar'; -import Button from 'app/components/button'; import {IconWarning} from 'app/icons/iconWarning'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Event} from 'app/types'; import {defined} from 'app/utils'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import Filter from './filter'; +import Icon from './icon'; +import Level from './level'; +import List from './list'; +import {aroundContentStyle} from './styles'; +import transformCrumbs from './transformCrumbs'; import { Breadcrumb, + BreadcrumbLevelType, BreadcrumbsWithDetails, BreadcrumbType, - BreadcrumbLevelType, } from './types'; -import transformCrumbs from './transformCrumbs'; -import Filter from './filter'; -import List from './list'; -import Level from './level'; -import Icon from './icon'; -import {aroundContentStyle} from './styles'; const ISO_STRING_DATE_AND_TIME_DIVISION = 10; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/level.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/level.tsx index b904199466b5ed..aaa5a4bca12732 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/level.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/level.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import Highlight from 'app/components/highlight'; import Tag from 'app/components/tagDeprecated'; +import {t} from 'app/locale'; import {Color} from 'app/utils/theme'; import {BreadcrumbLevelType} from './types'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/list.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/list.tsx index af447fde31dd5d..869f44b88807c9 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/list.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/list.tsx @@ -1,18 +1,18 @@ import React from 'react'; -import styled from '@emotion/styled'; import { - List, - ListRowProps, + AutoSizer, CellMeasurer, CellMeasurerCache, - AutoSizer, + List, + ListRowProps, ScrollbarPresenceParams, } from 'react-virtualized'; +import styled from '@emotion/styled'; import isEqual from 'lodash/isEqual'; -import {aroundContentStyle} from './styles'; -import ListHeader from './listHeader'; import ListBody from './listBody'; +import ListHeader from './listHeader'; +import {aroundContentStyle} from './styles'; import {BreadcrumbsWithDetails} from './types'; const LIST_MAX_HEIGHT = 400; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listBody.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listBody.tsx index 7772a6684400ea..86ef602b9276e7 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listBody.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listBody.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Event} from 'app/types'; import Tooltip from 'app/components/tooltip'; import space from 'app/styles/space'; +import {Event} from 'app/types'; -import Time from './time'; -import Data from './data'; import Category from './category'; +import Data from './data'; import Icon from './icon'; import Level from './level'; import {GridCell, GridCellLeft} from './styles'; +import Time from './time'; import {BreadcrumbsWithDetails, BreadcrumbType} from './types'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listHeader.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listHeader.tsx index 1370a254debf0b..d34177206a17d2 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listHeader.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/listHeader.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import Tooltip from 'app/components/tooltip'; -import space from 'app/styles/space'; import {IconSwitch} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import {GridCell} from './styles'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/styles.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/styles.tsx index 60a12d0a2c1b87..b6ba2490b2c0e1 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/styles.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/styles.tsx @@ -1,8 +1,8 @@ -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import theme, {Color} from 'app/utils/theme'; import space from 'app/styles/space'; +import theme, {Color} from 'app/utils/theme'; const IconWrapper = styled('div', { shouldForwardProp: prop => prop !== 'color', @@ -86,4 +86,4 @@ const aroundContentStyle = css` z-index: 1; `; -export {GridCell, GridCellLeft, IconWrapper, aroundContentStyle}; +export {aroundContentStyle, GridCell, GridCellLeft, IconWrapper}; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/index.tsx index eb98f1e50148db..fac8bcc2c34b05 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/index.tsx @@ -2,10 +2,10 @@ import React from 'react'; import styled from '@emotion/styled'; import Highlight from 'app/components/highlight'; -import {defined} from 'app/utils'; +import TextOverflow from 'app/components/textOverflow'; import Tooltip from 'app/components/tooltip'; +import {defined} from 'app/utils'; import getDynamicText from 'app/utils/getDynamicText'; -import TextOverflow from 'app/components/textOverflow'; import {getFormattedTimestamp} from './utils'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/utils.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/utils.tsx index 7c97b73cce70ff..34fc3e59c735e6 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/utils.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/time/utils.tsx @@ -1,8 +1,8 @@ import moment from 'moment'; -import {use24Hours} from 'app/utils/dates'; -import {defined} from 'app/utils'; import {t} from 'app/locale'; +import {defined} from 'app/utils'; +import {use24Hours} from 'app/utils/dates'; import {getDuration} from 'app/utils/formatters'; const timeFormat = 'HH:mm:ss'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/types.tsx b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/types.tsx index d7df652907a9dd..f7713c65f9e590 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/types.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/breadcrumbs/types.tsx @@ -1,5 +1,5 @@ -import {Color} from 'app/utils/theme'; import SvgIcon from 'app/icons/svgIcon'; +import {Color} from 'app/utils/theme'; export type IconProps = React.ComponentProps<typeof SvgIcon>; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/contextLine.tsx b/src/sentry/static/sentry/app/components/events/interfaces/contextLine.tsx index 2b7a2b58d27aa7..74449c7093b7c0 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/contextLine.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/contextLine.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; import styled from '@emotion/styled'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; import {defined} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/crashContent/exception.tsx b/src/sentry/static/sentry/app/components/events/interfaces/crashContent/exception.tsx index 34e081b6206d91..e6c3ea543c2736 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/crashContent/exception.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/crashContent/exception.tsx @@ -1,10 +1,10 @@ import React from 'react'; import ErrorBoundary from 'app/components/errorBoundary'; -import RawExceptionContent from 'app/components/events/interfaces/rawExceptionContent'; import ExceptionContent from 'app/components/events/interfaces/exceptionContent'; -import {STACK_VIEW, STACK_TYPE} from 'app/types/stacktrace'; -import {PlatformType, Project, Event, ExceptionType} from 'app/types'; +import RawExceptionContent from 'app/components/events/interfaces/rawExceptionContent'; +import {Event, ExceptionType, PlatformType, Project} from 'app/types'; +import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; type Props = { stackView: STACK_VIEW; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/crashContent/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/crashContent/index.tsx index a8935fdb813513..d6dcf30f2ef5fc 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/crashContent/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/crashContent/index.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {PlatformType, ExceptionType, ExceptionValue} from 'app/types'; +import {ExceptionType, ExceptionValue, PlatformType} from 'app/types'; import Exception from './exception'; import Stacktrace from './stacktrace'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/crashContent/stacktrace.tsx b/src/sentry/static/sentry/app/components/events/interfaces/crashContent/stacktrace.tsx index 7e22d6d41b4bc2..c0c82f4ef2d733 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/crashContent/stacktrace.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/crashContent/stacktrace.tsx @@ -1,10 +1,10 @@ import React from 'react'; import ErrorBoundary from 'app/components/errorBoundary'; -import StacktraceContent from 'app/components/events/interfaces/stacktraceContent'; import rawStacktraceContent from 'app/components/events/interfaces/rawStacktraceContent'; +import StacktraceContent from 'app/components/events/interfaces/stacktraceContent'; +import {Event, PlatformType} from 'app/types'; import {STACK_VIEW, StacktraceType} from 'app/types/stacktrace'; -import {PlatformType, Event} from 'app/types'; type Props = { stackView: STACK_VIEW; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashActions.tsx b/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashActions.tsx index eab847cf556240..322c931aa179d4 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashActions.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashActions.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; import {ExceptionValue} from 'app/types'; +import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; type NotifyOptions = { stackView?: STACK_VIEW; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashTitle.tsx b/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashTitle.tsx index 8b2c9c6ce9d15d..1708090d14fe57 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashTitle.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/crashHeader/crashTitle.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import GuideAnchor from 'app/components/assistant/guideAnchor'; import Tooltip from 'app/components/tooltip'; +import {t} from 'app/locale'; type Props = { title: string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/csp.tsx b/src/sentry/static/sentry/app/components/events/interfaces/csp.tsx index 7bdabf1078bf4a..d3e98dead039fb 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/csp.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/csp.tsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import ButtonBar from 'app/components/buttonBar'; import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import EventDataSection from 'app/components/events/eventDataSection'; import CSPContent from 'app/components/events/interfaces/cspContent'; import CSPHelp from 'app/components/events/interfaces/cspHelp'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/cspContent.tsx b/src/sentry/static/sentry/app/components/events/interfaces/cspContent.tsx index 852244272b6b37..677a44f06c36a0 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/cspContent.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/cspContent.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/cspHelp/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/cspHelp/index.tsx index b13b3770435461..2f82ca2a6635a3 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/cspHelp/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/cspHelp/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {IconOpen} from 'app/icons'; import ExternalLink from 'app/components/links/externalLink'; +import {IconOpen} from 'app/icons'; import space from 'app/styles/space'; import effectiveDirectives from './effectiveDirectives'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/debugImage.tsx b/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/debugImage.tsx index c6802ab25bb114..fbf9f212e23285 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/debugImage.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/debugImage.tsx @@ -1,19 +1,19 @@ -import isNil from 'lodash/isNil'; import React from 'react'; import styled from '@emotion/styled'; +import isNil from 'lodash/isNil'; -import space from 'app/styles/space'; import Access from 'app/components/acl/access'; import Button from 'app/components/button'; import DebugFileFeature from 'app/components/debugFileFeature'; +import {formatAddress, getImageRange} from 'app/components/events/interfaces/utils'; import {PanelItem} from 'app/components/panels'; import Tooltip from 'app/components/tooltip'; -import {formatAddress, getImageRange} from 'app/components/events/interfaces/utils'; +import {IconCheckmark, IconCircle, IconFlag, IconSearch} from 'app/icons'; import {t} from 'app/locale'; -import {IconSearch, IconCircle, IconCheckmark, IconFlag} from 'app/icons'; +import space from 'app/styles/space'; import {Organization, Project} from 'app/types'; -import {getFileName, combineStatus} from './utils'; +import {combineStatus, getFileName} from './utils'; type Status = ReturnType<typeof combineStatus>; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/index.tsx index 3414ae49bd73dc..9036786798b5e7 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/index.tsx @@ -1,30 +1,30 @@ -import isNil from 'lodash/isNil'; import React from 'react'; -import styled from '@emotion/styled'; -import isEqual from 'lodash/isEqual'; import { - List, - ListRowProps, AutoSizer, CellMeasurer, CellMeasurerCache, + List, + ListRowProps, } from 'react-virtualized'; +import styled from '@emotion/styled'; +import isEqual from 'lodash/isEqual'; +import isNil from 'lodash/isNil'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import space from 'app/styles/space'; import GuideAnchor from 'app/components/assistant/guideAnchor'; import Button from 'app/components/button'; import Checkbox from 'app/components/checkbox'; +import ClippedBox from 'app/components/clippedBox'; import EventDataSection from 'app/components/events/eventDataSection'; +import ImageForBar from 'app/components/events/interfaces/imageForBar'; +import {getImageRange, parseAddress} from 'app/components/events/interfaces/utils'; import {Panel, PanelBody} from 'app/components/panels'; -import DebugMetaStore, {DebugMetaActions} from 'app/stores/debugMetaStore'; import SearchBar from 'app/components/searchBar'; -import {parseAddress, getImageRange} from 'app/components/events/interfaces/utils'; -import ImageForBar from 'app/components/events/interfaces/imageForBar'; -import {t, tct} from 'app/locale'; -import ClippedBox from 'app/components/clippedBox'; import {IconWarning} from 'app/icons'; -import {Organization, Project, Event, Frame} from 'app/types'; +import {t, tct} from 'app/locale'; +import DebugMetaStore, {DebugMetaActions} from 'app/stores/debugMetaStore'; +import space from 'app/styles/space'; +import {Event, Frame, Organization, Project} from 'app/types'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; import DebugImage from './debugImage'; import {getFileName} from './utils'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/utils.tsx b/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/utils.tsx index 167a0e338856aa..3ff7baf9fe7a0d 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/utils.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/debugMeta/utils.tsx @@ -35,4 +35,4 @@ function getFileName(path: string) { return path.split(directorySeparator).pop(); } -export {getFileName, combineStatus}; +export {combineStatus, getFileName}; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exception.tsx b/src/sentry/static/sentry/app/components/events/interfaces/exception.tsx index d5cea059c4ff13..2069b1ac118023 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exception.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exception.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import {t} from 'app/locale'; import EventDataSection from 'app/components/events/eventDataSection'; -import {isStacktraceNewestFirst} from 'app/components/events/interfaces/stacktrace'; -import CrashTitle from 'app/components/events/interfaces/crashHeader/crashTitle'; -import CrashActions from 'app/components/events/interfaces/crashHeader/crashActions'; -import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; import CrashContent from 'app/components/events/interfaces/crashContent'; +import CrashActions from 'app/components/events/interfaces/crashHeader/crashActions'; +import CrashTitle from 'app/components/events/interfaces/crashHeader/crashTitle'; +import {isStacktraceNewestFirst} from 'app/components/events/interfaces/stacktrace'; +import {t} from 'app/locale'; import {Event, ExceptionType} from 'app/types'; +import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; const defaultProps = { hideGuide: false, diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.tsx b/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.tsx index 114b197009fa58..475142c7b750f6 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exceptionContent.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import Annotated from 'app/components/events/meta/annotated'; import ExceptionMechanism from 'app/components/events/interfaces/exceptionMechanism'; +import Annotated from 'app/components/events/meta/annotated'; +import space from 'app/styles/space'; import {Event, ExceptionType} from 'app/types'; import {STACK_TYPE} from 'app/types/stacktrace'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx b/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx index 3e779205df14b6..a8b8eaf29843bf 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exceptionMechanism.jsx @@ -1,18 +1,18 @@ -import isNil from 'lodash/isNil'; +import React from 'react'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import forOwn from 'lodash/forOwn'; +import isNil from 'lodash/isNil'; import isObject from 'lodash/isObject'; import PropTypes from 'prop-types'; -import React from 'react'; -import styled from '@emotion/styled'; -import {css} from '@emotion/core'; -import space from 'app/styles/space'; -import Pills from 'app/components/pills'; -import Pill from 'app/components/pill'; -import ExternalLink from 'app/components/links/externalLink'; import Hovercard from 'app/components/hovercard'; -import {t} from 'app/locale'; +import ExternalLink from 'app/components/links/externalLink'; +import Pill from 'app/components/pill'; +import Pills from 'app/components/pills'; import {IconInfo, IconOpen} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import {isUrl} from 'app/utils'; class ExceptionMechanism extends React.Component { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx b/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx index 612e35f6868cee..6918a9890d716d 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import {defined} from 'app/utils'; import StacktraceContent from 'app/components/events/interfaces/stacktraceContent'; import {Panel} from 'app/components/panels'; import {IconWarning} from 'app/icons'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import {Event, ExceptionValue, PlatformType} from 'app/types'; import {STACK_VIEW} from 'app/types/stacktrace'; -import {PlatformType, Event, ExceptionValue} from 'app/types'; +import {defined} from 'app/utils'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = { stackView: STACK_VIEW; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exceptionTitle.tsx b/src/sentry/static/sentry/app/components/events/interfaces/exceptionTitle.tsx index e7a0a627d417dd..5cbddddaf98736 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exceptionTitle.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exceptionTitle.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; import Tooltip from 'app/components/tooltip'; import {tct} from 'app/locale'; +import space from 'app/styles/space'; import {defined} from 'app/utils'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/context.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/context.tsx index 25851652ae4213..03b0dbdbc30fed 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/context.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/context.tsx @@ -1,21 +1,21 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Frame, SentryAppComponent, Event, Organization} from 'app/types'; -import {t} from 'app/locale'; -import {defined} from 'app/utils'; import ClippedBox from 'app/components/clippedBox'; +import ErrorBoundary from 'app/components/errorBoundary'; +import {Assembly} from 'app/components/events/interfaces/assembly'; import ContextLine from 'app/components/events/interfaces/contextLine'; import FrameRegisters from 'app/components/events/interfaces/frameRegisters/frameRegisters'; import FrameVariables from 'app/components/events/interfaces/frameVariables'; -import ErrorBoundary from 'app/components/errorBoundary'; -import {IconFlag} from 'app/icons'; -import {Assembly} from 'app/components/events/interfaces/assembly'; -import {parseAssembly} from 'app/components/events/interfaces/utils'; import {OpenInContextLine} from 'app/components/events/interfaces/openInContextLine'; import StacktraceLink from 'app/components/events/interfaces/stacktraceLink'; -import withOrganization from 'app/utils/withOrganization'; +import {parseAssembly} from 'app/components/events/interfaces/utils'; +import {IconFlag} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Event, Frame, Organization, SentryAppComponent} from 'app/types'; +import {defined} from 'app/utils'; +import withOrganization from 'app/utils/withOrganization'; type Props = { frame: Frame; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/defaultTitle/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/defaultTitle/index.tsx index 9f37a8f8e5518e..f952c4c9381d38 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/defaultTitle/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/defaultTitle/index.tsx @@ -1,19 +1,20 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Frame, PlatformType, Meta} from 'app/types'; -import {defined, isUrl} from 'app/utils'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; +import {getMeta} from 'app/components/events/meta/metaProxy'; +import ExternalLink from 'app/components/links/externalLink'; import Tooltip from 'app/components/tooltip'; import Truncate from 'app/components/truncate'; -import {IconQuestion, IconOpen} from 'app/icons'; -import ExternalLink from 'app/components/links/externalLink'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; +import {IconOpen, IconQuestion} from 'app/icons'; import {t} from 'app/locale'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import space from 'app/styles/space'; +import {Frame, Meta, PlatformType} from 'app/types'; +import {defined, isUrl} from 'app/utils'; import FunctionName from '../functionName'; import {getPlatform, trimPackage} from '../utils'; + import OriginalSourceInfo from './originalSourceInfo'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/functionName.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/functionName.tsx index 211fa97fb17f49..a59f3302c02094 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/functionName.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/functionName.tsx @@ -1,9 +1,9 @@ import React from 'react'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; +import {getMeta} from 'app/components/events/meta/metaProxy'; import {t} from 'app/locale'; import {Frame} from 'app/types'; -import {getMeta} from 'app/components/events/meta/metaProxy'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; type Props = { frame: Frame; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx index d6e52228cba2bb..2b094e0465481c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx @@ -1,33 +1,33 @@ import React from 'react'; +import styled from '@emotion/styled'; import classNames from 'classnames'; import scrollToElement from 'scroll-to-element'; -import styled from '@emotion/styled'; import Button from 'app/components/button'; -import {defined, objectIsEmpty} from 'app/utils'; -import {t} from 'app/locale'; -import TogglableAddress, { - AddressToggleIcon, -} from 'app/components/events/interfaces/togglableAddress'; +import DebugImage from 'app/components/events/interfaces/debugMeta/debugImage'; +import {combineStatus} from 'app/components/events/interfaces/debugMeta/utils'; import PackageLink from 'app/components/events/interfaces/packageLink'; import PackageStatus, { PackageStatusIcon, } from 'app/components/events/interfaces/packageStatus'; +import TogglableAddress, { + AddressToggleIcon, +} from 'app/components/events/interfaces/togglableAddress'; +import {SymbolicatorStatus} from 'app/components/events/interfaces/types'; import StrictClick from 'app/components/strictClick'; -import space from 'app/styles/space'; -import withSentryAppComponents from 'app/utils/withSentryAppComponents'; +import {IconChevron, IconRefresh} from 'app/icons'; +import {t} from 'app/locale'; import {DebugMetaActions} from 'app/stores/debugMetaStore'; -import {SymbolicatorStatus} from 'app/components/events/interfaces/types'; -import {combineStatus} from 'app/components/events/interfaces/debugMeta/utils'; -import {IconRefresh, IconChevron} from 'app/icons'; import overflowEllipsis from 'app/styles/overflowEllipsis'; -import {Frame, SentryAppComponent, PlatformType, Event} from 'app/types'; -import DebugImage from 'app/components/events/interfaces/debugMeta/debugImage'; +import space from 'app/styles/space'; +import {Event, Frame, PlatformType, SentryAppComponent} from 'app/types'; +import {defined, objectIsEmpty} from 'app/utils'; +import withSentryAppComponents from 'app/utils/withSentryAppComponents'; import Context from './context'; -import {getPlatform} from './utils'; import DefaultTitle from './defaultTitle'; import Symbol, {FunctionNameToggleIcon} from './symbol'; +import {getPlatform} from './utils'; type Props = { data: Frame; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/symbol.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/symbol.tsx index 0269d9851df3b6..fc3ba60a3bb40d 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/symbol.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/symbol.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; import Tooltip from 'app/components/tooltip'; +import {IconFilter} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import {Frame} from 'app/types'; import {defined} from 'app/utils'; -import {t} from 'app/locale'; -import {IconFilter} from 'app/icons'; import FunctionName from './functionName'; import {getFrameHint} from './utils'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx index 1f69212a505114..ac6c6adb2567bb 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {PlatformType, Frame} from 'app/types'; -import {t} from 'app/locale'; -import {IconQuestion, IconWarning} from 'app/icons'; import {SymbolicatorStatus} from 'app/components/events/interfaces/types'; +import {IconQuestion, IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import {Frame, PlatformType} from 'app/types'; export function trimPackage(pkg: string) { const pieces = pkg.split(/^([a-z]:\\|\\\\)/i.test(pkg) ? '\\' : '/'); diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegisters.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegisters.tsx index 9127aca54ead36..46ae8426531a41 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegisters.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegisters.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {defined} from 'app/utils'; -import {t} from 'app/locale'; import FrameRegistersValue from 'app/components/events/interfaces/frameRegisters/frameRegistersValue'; import {getMeta} from 'app/components/events/meta/metaProxy'; +import {t} from 'app/locale'; +import {defined} from 'app/utils'; type Props = { data: {[key: string]: string}; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx index f888bd1af45f58..5d40ee5789dc1c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frameRegisters/frameRegistersValue.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Meta} from 'app/types'; -import Tooltip from 'app/components/tooltip'; import AnnotatedText from 'app/components/events/meta/annotatedText'; +import Tooltip from 'app/components/tooltip'; import {IconSliders} from 'app/icons'; import {t} from 'app/locale'; +import {Meta} from 'app/types'; const REGISTER_VIEWS = [t('Hexadecimal'), t('Numeric')]; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frameVariables.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frameVariables.tsx index f2450c9e38e4ac..8a230c33975c9b 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frameVariables.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frameVariables.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueListV2'; import {KeyValueListData} from 'app/components/events/interfaces/keyValueList/types'; +import {getMeta} from 'app/components/events/meta/metaProxy'; type Props = { data: {[key: string]: string}; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/generic.tsx b/src/sentry/static/sentry/app/components/events/interfaces/generic.tsx index 59abc7eef153bb..2a31e5ce46409c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/generic.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/generic.tsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React, {Component} from 'react'; +import PropTypes from 'prop-types'; -import ButtonBar from 'app/components/buttonBar'; import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import EventDataSection from 'app/components/events/eventDataSection'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx b/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx index c4de9adcea2f5a..0c6c6419a633da 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/imageForBar.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import FunctionName from 'app/components/events/interfaces/frame/functionName'; -import space from 'app/styles/space'; import {t} from 'app/locale'; +import space from 'app/styles/space'; import {Frame} from 'app/types'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueList.jsx b/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueList.jsx index 69d109575bade6..1e8cffe41c4a6b 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueList.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueList.jsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import sortBy from 'lodash/sortBy'; import styled from '@emotion/styled'; +import sortBy from 'lodash/sortBy'; +import PropTypes from 'prop-types'; import ContextData from 'app/components/contextData'; import theme from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueListV2.tsx b/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueListV2.tsx index ddd1434b7576ea..ee450aa3f0d6e6 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueListV2.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/keyValueList/keyValueListV2.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import sortBy from 'lodash/sortBy'; import styled from '@emotion/styled'; +import sortBy from 'lodash/sortBy'; -import {defined} from 'app/utils'; import ContextData from 'app/components/contextData'; import AnnotatedText from 'app/components/events/meta/annotatedText'; +import {defined} from 'app/utils'; import theme from 'app/utils/theme'; import {KeyValueListData} from './types'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/message.tsx b/src/sentry/static/sentry/app/components/events/interfaces/message.tsx index f196fc3c857825..67ceaa30d5130a 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/message.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/message.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; import EventDataSection from 'app/components/events/eventDataSection'; +import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; import Annotated from 'app/components/events/meta/annotated'; import {t} from 'app/locale'; import {objectIsEmpty} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/openInContextLine.tsx b/src/sentry/static/sentry/app/components/events/interfaces/openInContextLine.tsx index b5ce3790eed0e6..d2d34b08576c89 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/openInContextLine.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/openInContextLine.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; +import ExternalLink from 'app/components/links/externalLink'; import {SentryAppIcon} from 'app/components/sentryAppIcon'; -import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; -import space from 'app/styles/space'; import {t} from 'app/locale'; -import {recordInteraction} from 'app/utils/recordSentryAppInteraction'; -import ExternalLink from 'app/components/links/externalLink'; +import space from 'app/styles/space'; import {SentryAppComponent} from 'app/types'; +import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; +import {recordInteraction} from 'app/utils/recordSentryAppInteraction'; type Props = { lineNo: number; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/packageLink.tsx b/src/sentry/static/sentry/app/components/events/interfaces/packageLink.tsx index 322d0f73ee89fb..d336e722836079 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/packageLink.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/packageLink.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; +import {trimPackage} from 'app/components/events/interfaces/frame/utils'; import Tooltip from 'app/components/tooltip'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; import {defined} from 'app/utils'; -import {trimPackage} from 'app/components/events/interfaces/frame/utils'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; type Props = { onClick: (event: React.MouseEvent<HTMLAnchorElement>) => void; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/packageStatus.tsx b/src/sentry/static/sentry/app/components/events/interfaces/packageStatus.tsx index ecf3065fbc8430..e40ec559b4633c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/packageStatus.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/packageStatus.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {IconCircle, IconCheckmark, IconFlag} from 'app/icons'; import Tooltip from 'app/components/tooltip'; +import {IconCheckmark, IconCircle, IconFlag} from 'app/icons'; import space from 'app/styles/space'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/rawExceptionContent.tsx b/src/sentry/static/sentry/app/components/events/interfaces/rawExceptionContent.tsx index 993d7be17ce589..48f0d1e86db6f3 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/rawExceptionContent.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/rawExceptionContent.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; +import {Client} from 'app/api'; +import Button from 'app/components/button'; +import ClippedBox from 'app/components/clippedBox'; import rawStacktraceContent from 'app/components/events/interfaces/rawStacktraceContent'; -import LoadingIndicator from 'app/components/loadingIndicator'; import LoadingError from 'app/components/loadingError'; -import ClippedBox from 'app/components/clippedBox'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; +import {Event, ExceptionType, Organization, PlatformType, Project} from 'app/types'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; -import Button from 'app/components/button'; -import {t} from 'app/locale'; -import {Event, Project, Organization, PlatformType, ExceptionType} from 'app/types'; -import {Client} from 'app/api'; type Props = { projectId: Project['id']; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/rawStacktraceContent.jsx b/src/sentry/static/sentry/app/components/events/interfaces/rawStacktraceContent.jsx index f895564c94f47e..e12f93c635124a 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/rawStacktraceContent.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/rawStacktraceContent.jsx @@ -1,5 +1,5 @@ -import {defined, trim} from 'app/utils'; import {trimPackage} from 'app/components/events/interfaces/frame/utils'; +import {defined, trim} from 'app/utils'; function getJavaScriptFrame(frame) { let result = ''; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx index 288556b3615c73..007cba4c5ecc95 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/request.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/request.jsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import EventDataSection from 'app/components/events/eventDataSection'; -import SentryTypes from 'app/sentryTypes'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import EventDataSection from 'app/components/events/eventDataSection'; import RichHttpContent from 'app/components/events/interfaces/richHttpContent/richHttpContent'; -import {getFullUrl, getCurlCommand} from 'app/components/events/interfaces/utils'; -import {isUrl} from 'app/utils'; -import {t} from 'app/locale'; +import {getCurlCommand, getFullUrl} from 'app/components/events/interfaces/utils'; import ExternalLink from 'app/components/links/externalLink'; +import Truncate from 'app/components/truncate'; import {IconOpen} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; -import Truncate from 'app/components/truncate'; +import {isUrl} from 'app/utils'; class RequestInterface extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContent.tsx b/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContent.tsx index f57fe412b26ccc..3afceabbeb206f 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContent.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContent.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import {getMeta} from 'app/components/events/meta/metaProxy'; -import {defined} from 'app/utils'; -import {t} from 'app/locale'; import ClippedBox from 'app/components/clippedBox'; import ErrorBoundary from 'app/components/errorBoundary'; +import {getMeta} from 'app/components/events/meta/metaProxy'; +import {t} from 'app/locale'; +import {defined} from 'app/utils'; -import RichHttpContentClippedBoxKeyValueList from './richHttpContentClippedBoxKeyValueList'; import RichHttpContentClippedBoxBodySection from './richHttpContentClippedBoxBodySection'; +import RichHttpContentClippedBoxKeyValueList from './richHttpContentClippedBoxKeyValueList'; import {RichHttpContentData} from './types'; const RichHttpContent = ({data}: RichHttpContentData) => ( diff --git a/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxBodySection.tsx b/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxBodySection.tsx index cf8c308047ce77..38fa8e94a547a8 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxBodySection.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxBodySection.tsx @@ -1,17 +1,17 @@ import React from 'react'; import PropTypes from 'prop-types'; -import AnnotatedText from 'app/components/events/meta/annotatedText'; -import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueListV2'; -import {Meta} from 'app/types'; +import ClippedBox from 'app/components/clippedBox'; import ContextData from 'app/components/contextData'; -import {defined} from 'app/utils'; import ErrorBoundary from 'app/components/errorBoundary'; -import ClippedBox from 'app/components/clippedBox'; +import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueListV2'; +import AnnotatedText from 'app/components/events/meta/annotatedText'; import {t} from 'app/locale'; +import {Meta} from 'app/types'; +import {defined} from 'app/utils'; import getTransformedData from './getTransformedData'; -import {SubData, InferredContentType} from './types'; +import {InferredContentType, SubData} from './types'; type Props = { data: SubData; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxKeyValueList.tsx b/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxKeyValueList.tsx index add50891f81bb4..f2c5b03825649f 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxKeyValueList.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/richHttpContent/richHttpContentClippedBoxKeyValueList.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import ErrorBoundary from 'app/components/errorBoundary'; import ClippedBox from 'app/components/clippedBox'; +import ErrorBoundary from 'app/components/errorBoundary'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueListV2'; import {Meta} from 'app/types'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx index 9a4d5184d4b62a..734471960e42fc 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/cursorGuideHandler.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {rectOfContent, clamp} from './utils'; -import {ParsedTraceType} from './types'; import {DragManagerChildrenProps} from './dragManager'; +import {ParsedTraceType} from './types'; +import {clamp, rectOfContent} from './utils'; export type CursorGuideManagerChildrenProps = { showCursorGuide: boolean; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx index 2937835e45bddb..b92ec129ab0659 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/dividerHandlerManager.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { - rectOfContent, clamp, + rectOfContent, + setBodyUserSelect, toPercent, UserSelectValues, - setBodyUserSelect, } from './utils'; // divider handle is positioned at 50% width from the left-hand side diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx index e497cbe303167e..d221fe20e97394 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/dragManager.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import {rectOfContent, clamp, UserSelectValues, setBodyUserSelect} from './utils'; +import {clamp, rectOfContent, setBodyUserSelect, UserSelectValues} from './utils'; // we establish the minimum window size so that the window size of 0% is not possible const MINIMUM_WINDOW_SIZE = 0.5 / 100; // 0.5% window size diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/filter.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/filter.tsx index 9378c0b0e2d583..c15fdadb948aa8 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/filter.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/filter.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tn} from 'app/locale'; -import space from 'app/styles/space'; -import {IconFilter} from 'app/icons'; -import DropdownControl from 'app/components/dropdownControl'; -import DropdownButton from 'app/components/dropdownButton'; import CheckboxFancy from 'app/components/checkboxFancy/checkboxFancy'; +import DropdownButton from 'app/components/dropdownButton'; +import DropdownControl from 'app/components/dropdownControl'; import {pickSpanBarColour} from 'app/components/events/interfaces/spans/utils'; +import {IconFilter} from 'app/icons'; +import {t, tn} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {ParsedTraceType} from './types'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx index c2533337e841fc..37fc7a4c1d604d 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/header.tsx @@ -3,26 +3,26 @@ import styled from '@emotion/styled'; import space from 'app/styles/space'; +import * as CursorGuideHandler from './cursorGuideHandler'; +import {DragManagerChildrenProps} from './dragManager'; +import {zIndex} from './styles'; import { - rectOfContent, - toPercent, + ParsedTraceType, + RawSpanType, + SpanChildrenLookupType, + TickAlignment, +} from './types'; +import { + boundsGenerator, getHumanDuration, + getSpanID, + getSpanOperation, pickSpanBarColour, - boundsGenerator, + rectOfContent, SpanBoundsType, SpanGeneratedBoundsType, - getSpanID, - getSpanOperation, + toPercent, } from './utils'; -import {DragManagerChildrenProps} from './dragManager'; -import * as CursorGuideHandler from './cursorGuideHandler'; -import { - ParsedTraceType, - TickAlignment, - SpanChildrenLookupType, - RawSpanType, -} from './types'; -import {zIndex} from './styles'; export const MINIMAP_CONTAINER_HEIGHT = 106; export const MINIMAP_SPAN_BAR_HEIGHT = 4; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/index.tsx index 92968c5d0aaecd..fb41ad3ab13b73 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/index.tsx @@ -1,31 +1,31 @@ -import PropTypes from 'prop-types'; import React from 'react'; import * as ReactRouter from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {IconWarning} from 'app/icons'; -import {Panel} from 'app/components/panels'; -import {SentryTransactionEvent, Organization} from 'app/types'; -import {stringifyQueryObject, QueryResults} from 'app/utils/tokenizeSearch'; -import {t, tn} from 'app/locale'; import Alert from 'app/components/alert'; -import DiscoverQuery, {TableData} from 'app/utils/discover/discoverQuery'; -import EventView from 'app/utils/discover/eventView'; +import {Panel} from 'app/components/panels'; import SearchBar from 'app/components/searchBar'; +import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; +import {IconWarning} from 'app/icons'; +import {t, tn} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {Organization, SentryTransactionEvent} from 'app/types'; +import DiscoverQuery, {TableData} from 'app/utils/discover/discoverQuery'; +import EventView from 'app/utils/discover/eventView'; +import {QueryResults, stringifyQueryObject} from 'app/utils/tokenizeSearch'; import withOrganization from 'app/utils/withOrganization'; -import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; -import {ParsedTraceType} from './types'; -import {parseTrace, getTraceDateTimeRange} from './utils'; -import TraceView from './traceView'; import Filter, { ActiveOperationFilter, noFilter, - toggleFilter, toggleAllFilters, + toggleFilter, } from './filter'; +import TraceView from './traceView'; +import {ParsedTraceType} from './types'; +import {getTraceDateTimeRange, parseTrace} from './utils'; type Props = { orgId: string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/inlineDocs.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/inlineDocs.tsx index 2ffa156d51204d..19d07d607a445c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/inlineDocs.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/inlineDocs.tsx @@ -2,12 +2,12 @@ import React from 'react'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; -import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; import {loadDocs} from 'app/actionCreators/projects'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import LoadingIndicator from 'app/components/loadingIndicator'; import {PlatformKey} from 'app/data/platformCategories'; +import {t, tct} from 'app/locale'; +import withApi from 'app/utils/withApi'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/measurementsPanel.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/measurementsPanel.tsx index 491c591232cdf4..53a05897e1c255 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/measurementsPanel.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/measurementsPanel.tsx @@ -1,22 +1,22 @@ import React from 'react'; import styled from '@emotion/styled'; +import Tooltip from 'app/components/tooltip'; import {SentryTransactionEvent} from 'app/types'; import {defined} from 'app/utils'; import { - WEB_VITAL_ACRONYMS, LONG_WEB_VITAL_NAMES, + WEB_VITAL_ACRONYMS, } from 'app/views/performance/transactionVitals/constants'; -import Tooltip from 'app/components/tooltip'; +import * as MeasurementsManager from './measurementsManager'; import { - getMeasurements, - toPercent, getMeasurementBounds, + getMeasurements, SpanBoundsType, SpanGeneratedBoundsType, + toPercent, } from './utils'; -import * as MeasurementsManager from './measurementsManager'; type Props = { event: SentryTransactionEvent; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx index e9e70cb718a190..bcc2573b5c13d1 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanBar.tsx @@ -1,50 +1,51 @@ +import 'intersection-observer'; // this is a polyfill + import React from 'react'; import styled from '@emotion/styled'; -import 'intersection-observer'; // this is a polyfill -import {Organization, SentryTransactionEvent} from 'app/types'; -import {t} from 'app/locale'; -import {defined, OmitHtmlDivProps} from 'app/utils'; -import space from 'app/styles/space'; import Count from 'app/components/count'; import Tooltip from 'app/components/tooltip'; -import {TableDataRow} from 'app/utils/discover/discoverQuery'; import {IconChevron, IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, SentryTransactionEvent} from 'app/types'; +import {defined, OmitHtmlDivProps} from 'app/utils'; +import {TableDataRow} from 'app/utils/discover/discoverQuery'; import globalTheme from 'app/utils/theme'; -import { - toPercent, - SpanBoundsType, - SpanGeneratedBoundsType, - SpanViewBoundsType, - getHumanDuration, - getSpanID, - getSpanOperation, - isOrphanSpan, - unwrapTreeDepth, - isOrphanTreeDepth, - isEventFromBrowserJavaScriptSDK, - durationlessBrowserOps, - getMeasurements, - getMeasurementBounds, -} from './utils'; -import {ParsedTraceType, ProcessedSpanType, TreeDepthType} from './types'; +import * as CursorGuideHandler from './cursorGuideHandler'; +import * as DividerHandlerManager from './dividerHandlerManager'; import { MINIMAP_CONTAINER_HEIGHT, MINIMAP_SPAN_BAR_HEIGHT, NUM_OF_SPANS_FIT_IN_MINI_MAP, } from './header'; +import * as MeasurementsManager from './measurementsManager'; +import SpanDetail from './spanDetail'; import { + getHatchPattern, SPAN_ROW_HEIGHT, SPAN_ROW_PADDING, SpanRow, zIndex, - getHatchPattern, } from './styles'; -import * as DividerHandlerManager from './dividerHandlerManager'; -import * as CursorGuideHandler from './cursorGuideHandler'; -import * as MeasurementsManager from './measurementsManager'; -import SpanDetail from './spanDetail'; +import {ParsedTraceType, ProcessedSpanType, TreeDepthType} from './types'; +import { + durationlessBrowserOps, + getHumanDuration, + getMeasurementBounds, + getMeasurements, + getSpanID, + getSpanOperation, + isEventFromBrowserJavaScriptSDK, + isOrphanSpan, + isOrphanTreeDepth, + SpanBoundsType, + SpanGeneratedBoundsType, + SpanViewBoundsType, + toPercent, + unwrapTreeDepth, +} from './utils'; // TODO: maybe use babel-plugin-preval // for (let i = 0; i <= 1.0; i += 0.01) { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx index 7ef4e76debe248..3c7e14f35c6dfc 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanDetail.tsx @@ -1,33 +1,33 @@ import React from 'react'; -import map from 'lodash/map'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import map from 'lodash/map'; -import {Organization, SentryTransactionEvent} from 'app/types'; import {Client} from 'app/api'; -import {IconWarning} from 'app/icons'; -import {assert} from 'app/types/utils'; -import {generateEventSlug, eventDetailsRoute} from 'app/utils/discover/urls'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; -import {t, tct} from 'app/locale'; import Alert from 'app/components/alert'; -import DiscoverButton from 'app/components/discoverButton'; import DateTime from 'app/components/dateTime'; -import EventView from 'app/utils/discover/eventView'; +import DiscoverButton from 'app/components/discoverButton'; import Link from 'app/components/links/link'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import Pill from 'app/components/pill'; import Pills from 'app/components/pills'; +import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; +import {IconWarning} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import getDynamicText from 'app/utils/getDynamicText'; +import {Organization, SentryTransactionEvent} from 'app/types'; +import {assert} from 'app/types/utils'; import {TableDataRow} from 'app/utils/discover/discoverQuery'; +import EventView from 'app/utils/discover/eventView'; +import {eventDetailsRoute, generateEventSlug} from 'app/utils/discover/urls'; +import getDynamicText from 'app/utils/getDynamicText'; import withApi from 'app/utils/withApi'; -import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; -import {ProcessedSpanType, RawSpanType, ParsedTraceType, rawSpanKeys} from './types'; -import {isGapSpan, isOrphanSpan, getTraceDateTimeRange} from './utils'; import * as SpanEntryContext from './context'; import InlineDocs from './inlineDocs'; +import {ParsedTraceType, ProcessedSpanType, rawSpanKeys, RawSpanType} from './types'; +import {getTraceDateTimeRange, isGapSpan, isOrphanSpan} from './utils'; type TransactionResult = { 'project.name': string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx index f9c9c92cc7877c..6fae1699e37e49 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanGroup.tsx @@ -3,9 +3,9 @@ import React from 'react'; import {Organization, SentryTransactionEvent} from 'app/types'; import {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; -import {SpanBoundsType, SpanGeneratedBoundsType, isGapSpan, getSpanID} from './utils'; -import {ProcessedSpanType, ParsedTraceType, TreeDepthType} from './types'; import SpanBar from './spanBar'; +import {ParsedTraceType, ProcessedSpanType, TreeDepthType} from './types'; +import {getSpanID, isGapSpan, SpanBoundsType, SpanGeneratedBoundsType} from './utils'; type PropType = { orgId: string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx index afd8286fca4128..9595b7fdd2f1d9 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/spanTree.tsx @@ -1,41 +1,41 @@ import React from 'react'; import styled from '@emotion/styled'; -import {SentryTransactionEvent, Organization} from 'app/types'; import {t, tct} from 'app/locale'; +import {Organization, SentryTransactionEvent} from 'app/types'; import {TableData} from 'app/utils/discover/discoverQuery'; +import * as DividerHandlerManager from './dividerHandlerManager'; +import {DragManagerChildrenProps} from './dragManager'; +import {ActiveOperationFilter} from './filter'; +import * as MeasurementsManager from './measurementsManager'; +import MeasurementsPanel from './measurementsPanel'; +import SpanGroup from './spanGroup'; +import {SpanRowMessage} from './styles'; +import {FilterSpans} from './traceView'; import { + GapSpanType, + OrphanTreeDepth, + ParsedTraceType, ProcessedSpanType, RawSpanType, SpanChildrenLookupType, - ParsedTraceType, - GapSpanType, TreeDepthType, - OrphanTreeDepth, } from './types'; import { boundsGenerator, - SpanBoundsType, - SpanGeneratedBoundsType, - pickSpanBarColour, generateRootSpan, getSpanID, getSpanOperation, getSpanTraceID, + isEventFromBrowserJavaScriptSDK, isGapSpan, isOrphanSpan, - isEventFromBrowserJavaScriptSDK, + pickSpanBarColour, + SpanBoundsType, + SpanGeneratedBoundsType, toPercent, } from './utils'; -import {DragManagerChildrenProps} from './dragManager'; -import SpanGroup from './spanGroup'; -import {SpanRowMessage} from './styles'; -import * as DividerHandlerManager from './dividerHandlerManager'; -import {FilterSpans} from './traceView'; -import {ActiveOperationFilter} from './filter'; -import MeasurementsPanel from './measurementsPanel'; -import * as MeasurementsManager from './measurementsManager'; type RenderedSpanTree = { spanTree: JSX.Element | null; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx index 0fb0b3b6b988cb..1e4ab458ee6751 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/traceView.tsx @@ -1,19 +1,19 @@ import React from 'react'; import pick from 'lodash/pick'; -import {t} from 'app/locale'; import EmptyStateWarning from 'app/components/emptyStateWarning'; -import {SentryTransactionEvent, Organization} from 'app/types'; +import {t} from 'app/locale'; +import {Organization, SentryTransactionEvent} from 'app/types'; import {createFuzzySearch} from 'app/utils/createFuzzySearch'; import {TableData} from 'app/utils/discover/discoverQuery'; +import * as CursorGuideHandler from './cursorGuideHandler'; import DragManager, {DragManagerChildrenProps} from './dragManager'; +import {ActiveOperationFilter} from './filter'; +import TraceViewHeader from './header'; import SpanTree from './spanTree'; -import {RawSpanType, ParsedTraceType} from './types'; +import {ParsedTraceType, RawSpanType} from './types'; import {generateRootSpan, getSpanID, getTraceContext} from './utils'; -import TraceViewHeader from './header'; -import * as CursorGuideHandler from './cursorGuideHandler'; -import {ActiveOperationFilter} from './filter'; type IndexedFusedSpan = { span: RawSpanType; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx b/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx index 3b3fd6bb65e749..213e23f16674b5 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/spans/utils.tsx @@ -1,24 +1,24 @@ +import isNumber from 'lodash/isNumber'; import isString from 'lodash/isString'; -import moment from 'moment'; import set from 'lodash/set'; -import isNumber from 'lodash/isNumber'; +import moment from 'moment'; +import CHART_PALETTE from 'app/constants/chartPalette'; import {SentryTransactionEvent} from 'app/types'; import {assert} from 'app/types/utils'; -import CHART_PALETTE from 'app/constants/chartPalette'; import {WEB_VITAL_DETAILS} from 'app/views/performance/transactionVitals/constants'; import { + GapSpanType, + OrphanSpanType, + OrphanTreeDepth, ParsedTraceType, ProcessedSpanType, - GapSpanType, RawSpanType, - OrphanSpanType, - SpanType, SpanEntry, + SpanType, TraceContextType, TreeDepthType, - OrphanTreeDepth, } from './types'; type Rect = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx b/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx index dd68fd07374c96..c92a2354f0af49 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import ConfigStore from 'app/stores/configStore'; import EventDataSection from 'app/components/events/eventDataSection'; -import {t} from 'app/locale'; -import CrashTitle from 'app/components/events/interfaces/crashHeader/crashTitle'; -import CrashActions from 'app/components/events/interfaces/crashHeader/crashActions'; import CrashContent from 'app/components/events/interfaces/crashContent'; +import CrashActions from 'app/components/events/interfaces/crashHeader/crashActions'; +import CrashTitle from 'app/components/events/interfaces/crashHeader/crashTitle'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import {Event, Project} from 'app/types'; -import {STACK_VIEW, STACK_TYPE} from 'app/types/stacktrace'; +import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; export function isStacktraceNewestFirst() { const user = ConfigStore.get('user'); diff --git a/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.tsx b/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.tsx index 88591a7ee64882..1bd4a34a4e19b7 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/stacktraceContent.tsx @@ -3,10 +3,10 @@ import styled from '@emotion/styled'; import PlatformIcon from 'platformicons'; import Line from 'app/components/events/interfaces/frame/line'; +import {getImageRange, parseAddress} from 'app/components/events/interfaces/utils'; import {t} from 'app/locale'; -import {parseAddress, getImageRange} from 'app/components/events/interfaces/utils'; +import {Event, Frame, PlatformType} from 'app/types'; import {StacktraceType} from 'app/types/stacktrace'; -import {PlatformType, Event, Frame} from 'app/types'; const defaultProps = { includeSystemFrames: true, diff --git a/src/sentry/static/sentry/app/components/events/interfaces/stacktraceLink.tsx b/src/sentry/static/sentry/app/components/events/interfaces/stacktraceLink.tsx index fecbab4a95379b..e883ee8e2bf760 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/stacktraceLink.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/stacktraceLink.tsx @@ -1,19 +1,19 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; -import withOrganization from 'app/utils/withOrganization'; -import withProjects from 'app/utils/withProjects'; +import {t} from 'app/locale'; import { + Event, Frame, - RepositoryProjectPathConfig, Organization, - Event, Project, + RepositoryProjectPathConfig, } from 'app/types'; import {getIntegrationIcon, trackIntegrationEvent} from 'app/utils/integrationUtil'; +import withOrganization from 'app/utils/withOrganization'; +import withProjects from 'app/utils/withProjects'; import {OpenInContainer, OpenInLink, OpenInName} from './openInContextLine'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/template.tsx b/src/sentry/static/sentry/app/components/events/interfaces/template.tsx index 98485fa089109a..04e25cdb758b99 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/template.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/template.tsx @@ -3,7 +3,7 @@ import React from 'react'; import EventDataSection from 'app/components/events/eventDataSection'; import Line from 'app/components/events/interfaces/frame/line'; import {t} from 'app/locale'; -import {Frame, Event} from 'app/types'; +import {Event, Frame} from 'app/types'; type Props = { type: string; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/content.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/content.tsx index 0f547efe0d1b03..8bac907b72340a 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/content.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/content.tsx @@ -1,13 +1,13 @@ import React from 'react'; import isNil from 'lodash/isNil'; -import {t} from 'app/locale'; -import {Event, Project} from 'app/types'; -import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; import CrashContent from 'app/components/events/interfaces/crashContent'; -import Pills from 'app/components/pills'; import Pill from 'app/components/pill'; +import Pills from 'app/components/pills'; +import {t} from 'app/locale'; +import {Event, Project} from 'app/types'; import {Thread} from 'app/types/events'; +import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; type CrashContentProps = React.ComponentProps<typeof CrashContent>; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/index.tsx index 89f81b615e11df..cd142448c40291 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/index.tsx @@ -1,19 +1,19 @@ import React from 'react'; +import EventDataSection from 'app/components/events/eventDataSection'; +import CrashActions from 'app/components/events/interfaces/crashHeader/crashActions'; +import CrashTitle from 'app/components/events/interfaces/crashHeader/crashTitle'; +import {isStacktraceNewestFirst} from 'app/components/events/interfaces/stacktrace'; import {t} from 'app/locale'; import {Event, Project} from 'app/types'; +import {Thread} from 'app/types/events'; import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; import {defined} from 'app/utils'; -import {isStacktraceNewestFirst} from 'app/components/events/interfaces/stacktrace'; -import EventDataSection from 'app/components/events/eventDataSection'; -import CrashTitle from 'app/components/events/interfaces/crashHeader/crashTitle'; -import CrashActions from 'app/components/events/interfaces/crashHeader/crashActions'; -import {Thread} from 'app/types/events'; -import ThreadSelector from './threadSelector'; -import Content from './content'; -import getThreadStacktrace from './threadSelector/getThreadStacktrace'; import getThreadException from './threadSelector/getThreadException'; +import getThreadStacktrace from './threadSelector/getThreadStacktrace'; +import Content from './content'; +import ThreadSelector from './threadSelector'; const defaultProps = { hideGuide: false, diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/filterThreadInfo.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/filterThreadInfo.tsx index fa2354dc351a21..1716ec03182f2c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/filterThreadInfo.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/filterThreadInfo.tsx @@ -1,9 +1,9 @@ -import {Thread} from 'app/types/events'; -import {Event, Frame} from 'app/types'; import {trimPackage} from 'app/components/events/interfaces/frame/utils'; +import {Event, Frame} from 'app/types'; +import {Thread} from 'app/types/events'; -import getThreadStacktrace from './getThreadStacktrace'; import getRelevantFrame from './getRelevantFrame'; +import getThreadStacktrace from './getThreadStacktrace'; import trimFilename from './trimFilename'; type ThreadInfo = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadException.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadException.tsx index dfc1ffe60c28f1..7e85d9334a2f25 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadException.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadException.tsx @@ -1,5 +1,5 @@ -import {Thread} from 'app/types/events'; import {Event, ExceptionType} from 'app/types'; +import {Thread} from 'app/types/events'; import {defined} from 'app/utils'; function getThreadException( diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadStacktrace.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadStacktrace.tsx index 52596c578bba7f..90e0474dd1bf2c 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadStacktrace.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getThreadStacktrace.tsx @@ -1,5 +1,5 @@ -import {Thread} from 'app/types/events'; import {Event, ExceptionValue} from 'app/types'; +import {Thread} from 'app/types/events'; import getThreadException from './getThreadException'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/index.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/index.tsx index d74aeb41754ac3..844bce14bcf941 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/index.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/index.tsx @@ -2,18 +2,18 @@ import React from 'react'; import styled from '@emotion/styled'; import partition from 'lodash/partition'; -import {Thread} from 'app/types/events'; -import {Event, EntryData} from 'app/types'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; -import theme from 'app/utils/theme'; import {t} from 'app/locale'; +import {EntryData, Event} from 'app/types'; +import {Thread} from 'app/types/events'; +import theme from 'app/utils/theme'; import filterThreadInfo from './filterThreadInfo'; import getThreadException from './getThreadException'; +import Header from './header'; import Option from './option'; import SelectedOption from './selectedOption'; -import Header from './header'; type Props = { threads: Array<Thread>; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/option.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/option.tsx index 085a33a8800b24..17391ce7821cc7 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/option.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/option.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Color} from 'app/utils/theme'; -import {t, tct} from 'app/locale'; -import Tooltip from 'app/components/tooltip'; import TextOverflow from 'app/components/textOverflow'; -import {EntryData} from 'app/types'; +import Tooltip from 'app/components/tooltip'; import {IconFire} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {EntryData} from 'app/types'; +import {Color} from 'app/utils/theme'; import {Grid, GridCell} from './styles'; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/selectedOption.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/selectedOption.tsx index 6c10f7bd7a85ab..d9f9de0674fbf0 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/selectedOption.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/selectedOption.tsx @@ -2,8 +2,8 @@ import React from 'react'; import styled from '@emotion/styled'; import TextOverflow from 'app/components/textOverflow'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import {tct, t} from 'app/locale'; type Props = { id: number; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/styles.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/styles.tsx index e5481f14719898..f4dd9e0a790035 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/styles.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/styles.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; -import space from 'app/styles/space'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; const Grid = styled('div')` font-size: ${p => p.theme.fontSizeSmall}; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/togglableAddress.tsx b/src/sentry/static/sentry/app/components/events/interfaces/togglableAddress.tsx index 840aeefae9333d..649de20455f24a 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/togglableAddress.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/togglableAddress.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; +import {formatAddress, parseAddress} from 'app/components/events/interfaces/utils'; import Tooltip from 'app/components/tooltip'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; import {IconFilter} from 'app/icons'; -import {formatAddress, parseAddress} from 'app/components/events/interfaces/utils'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {Theme} from 'app/utils/theme'; type Props = { diff --git a/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx b/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx index 6b35dbe54bb91d..65e91cdf0a8ce7 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/utils.jsx @@ -1,7 +1,7 @@ +import * as Sentry from '@sentry/react'; import isEmpty from 'lodash/isEmpty'; import isString from 'lodash/isString'; import * as queryString from 'query-string'; -import * as Sentry from '@sentry/react'; import {FILTER_MASK} from 'app/constants'; import {defined} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/components/events/meta/annotatedText/chunk.tsx b/src/sentry/static/sentry/app/components/events/meta/annotatedText/chunk.tsx index acb009e1cdec29..c30579cfb4313b 100644 --- a/src/sentry/static/sentry/app/components/events/meta/annotatedText/chunk.tsx +++ b/src/sentry/static/sentry/app/components/events/meta/annotatedText/chunk.tsx @@ -3,8 +3,8 @@ import React from 'react'; import Tooltip from 'app/components/tooltip'; import {ChunkType} from 'app/types'; -import {getTooltipText} from './utils'; import Redaction from './redaction'; +import {getTooltipText} from './utils'; type Props = { chunk: ChunkType; diff --git a/src/sentry/static/sentry/app/components/events/meta/annotatedText/index.tsx b/src/sentry/static/sentry/app/components/events/meta/annotatedText/index.tsx index 954afe78b497c5..f5e84d1fca41e6 100644 --- a/src/sentry/static/sentry/app/components/events/meta/annotatedText/index.tsx +++ b/src/sentry/static/sentry/app/components/events/meta/annotatedText/index.tsx @@ -2,17 +2,17 @@ import React from 'react'; import styled from '@emotion/styled'; import capitalize from 'lodash/capitalize'; -import {IconWarning} from 'app/icons'; +import List from 'app/components/list'; +import ListItem from 'app/components/list/listItem'; import Tooltip from 'app/components/tooltip'; +import {IconWarning} from 'app/icons'; import {t} from 'app/locale'; -import {Meta, MetaError} from 'app/types'; import space from 'app/styles/space'; -import List from 'app/components/list'; -import ListItem from 'app/components/list/listItem'; +import {Meta, MetaError} from 'app/types'; +import Chunks from './chunks'; import {getTooltipText} from './utils'; import ValueElement from './valueElement'; -import Chunks from './chunks'; type Props = { value: React.ReactNode; diff --git a/src/sentry/static/sentry/app/components/events/meta/metaData.tsx b/src/sentry/static/sentry/app/components/events/meta/metaData.tsx index 170f5fcc72996b..48d30a6bb44929 100644 --- a/src/sentry/static/sentry/app/components/events/meta/metaData.tsx +++ b/src/sentry/static/sentry/app/components/events/meta/metaData.tsx @@ -1,8 +1,8 @@ import React from 'react'; import isNil from 'lodash/isNil'; -import {getMeta} from 'app/components/events/meta/metaProxy'; import ErrorBoundary from 'app/components/errorBoundary'; +import {getMeta} from 'app/components/events/meta/metaProxy'; import {Meta} from 'app/types'; type Props<Values, K extends Extract<keyof Values, string>> = { diff --git a/src/sentry/static/sentry/app/components/events/opsBreakdown.tsx b/src/sentry/static/sentry/app/components/events/opsBreakdown.tsx index 9a9a286bb8c2a7..2e865605b80d0f 100644 --- a/src/sentry/static/sentry/app/components/events/opsBreakdown.tsx +++ b/src/sentry/static/sentry/app/components/events/opsBreakdown.tsx @@ -2,17 +2,17 @@ import React from 'react'; import styled from '@emotion/styled'; import isFinite from 'lodash/isFinite'; -import {Event, SentryTransactionEvent} from 'app/types'; +import {SectionHeading} from 'app/components/charts/styles'; import { - SpanEntry, RawSpanType, + SpanEntry, TraceContextType, } from 'app/components/events/interfaces/spans/types'; -import QuestionTooltip from 'app/components/questionTooltip'; -import {SectionHeading} from 'app/components/charts/styles'; import {pickSpanBarColour} from 'app/components/events/interfaces/spans/utils'; +import QuestionTooltip from 'app/components/questionTooltip'; import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Event, SentryTransactionEvent} from 'app/types'; type StartTimestamp = number; type EndTimestamp = number; diff --git a/src/sentry/static/sentry/app/components/events/packageData.tsx b/src/sentry/static/sentry/app/components/events/packageData.tsx index 36421802d401d0..c2b82e747b1a40 100644 --- a/src/sentry/static/sentry/app/components/events/packageData.tsx +++ b/src/sentry/static/sentry/app/components/events/packageData.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import {Event} from 'app/types'; -import {t} from 'app/locale'; import ClippedBox from 'app/components/clippedBox'; import ErrorBoundary from 'app/components/errorBoundary'; import EventDataSection from 'app/components/events/eventDataSection'; import KeyValueList from 'app/components/events/interfaces/keyValueList/keyValueList'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {Event} from 'app/types'; type Props = { event: Event; diff --git a/src/sentry/static/sentry/app/components/events/realUserMonitoring.tsx b/src/sentry/static/sentry/app/components/events/realUserMonitoring.tsx index 15713ff9b1d895..fcef829bfc13de 100644 --- a/src/sentry/static/sentry/app/components/events/realUserMonitoring.tsx +++ b/src/sentry/static/sentry/app/components/events/realUserMonitoring.tsx @@ -1,19 +1,19 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Event} from 'app/types'; -import {IconSize} from 'app/utils/theme'; -import {t} from 'app/locale'; import {SectionHeading} from 'app/components/charts/styles'; import {Panel} from 'app/components/panels'; -import space from 'app/styles/space'; import Tooltip from 'app/components/tooltip'; import {IconFire, IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Event} from 'app/types'; +import {formattedValue} from 'app/utils/measurements/index'; +import {IconSize} from 'app/utils/theme'; import { - WEB_VITAL_DETAILS, LONG_WEB_VITAL_NAMES, + WEB_VITAL_DETAILS, } from 'app/views/performance/transactionVitals/constants'; -import {formattedValue} from 'app/utils/measurements/index'; type Props = { event: Event; diff --git a/src/sentry/static/sentry/app/components/events/rootSpanStatus.tsx b/src/sentry/static/sentry/app/components/events/rootSpanStatus.tsx index 2e97e818bc3efa..5be4792562a91b 100644 --- a/src/sentry/static/sentry/app/components/events/rootSpanStatus.tsx +++ b/src/sentry/static/sentry/app/components/events/rootSpanStatus.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Event, SentryTransactionEvent} from 'app/types'; -import {TraceContextType} from 'app/components/events/interfaces/spans/types'; import {SectionHeading} from 'app/components/charts/styles'; +import {TraceContextType} from 'app/components/events/interfaces/spans/types'; import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Event, SentryTransactionEvent} from 'app/types'; type Props = { event: Event; diff --git a/src/sentry/static/sentry/app/components/events/rrwebIntegration.tsx b/src/sentry/static/sentry/app/components/events/rrwebIntegration.tsx index a05e9c6b99f51c..8acaac5fecdb36 100644 --- a/src/sentry/static/sentry/app/components/events/rrwebIntegration.tsx +++ b/src/sentry/static/sentry/app/components/events/rrwebIntegration.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import EventDataSection from 'app/components/events/eventDataSection'; import AsyncComponent from 'app/components/asyncComponent'; +import EventDataSection from 'app/components/events/eventDataSection'; import LazyLoad from 'app/components/lazyLoad'; -import space from 'app/styles/space'; -import {Event, Organization, Project, EventAttachment} from 'app/types'; import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Event, EventAttachment, Organization, Project} from 'app/types'; type Props = { event: Event; diff --git a/src/sentry/static/sentry/app/components/events/rrwebReplayer/rrWebReplayer.tsx b/src/sentry/static/sentry/app/components/events/rrwebReplayer/rrWebReplayer.tsx index 4992e2604d64d5..6aefb494091b7c 100644 --- a/src/sentry/static/sentry/app/components/events/rrwebReplayer/rrWebReplayer.tsx +++ b/src/sentry/static/sentry/app/components/events/rrwebReplayer/rrWebReplayer.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import rrwebPlayer from 'rrweb-player'; import * as Sentry from '@sentry/react'; +import rrwebPlayer from 'rrweb-player'; import {Panel} from 'app/components/panels'; diff --git a/src/sentry/static/sentry/app/components/events/sdkUpdates/getSuggestion.tsx b/src/sentry/static/sentry/app/components/events/sdkUpdates/getSuggestion.tsx index 3577e93786550e..0fa440ee61f7bf 100644 --- a/src/sentry/static/sentry/app/components/events/sdkUpdates/getSuggestion.tsx +++ b/src/sentry/static/sentry/app/components/events/sdkUpdates/getSuggestion.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; +import ExternalLink from 'app/components/links/externalLink'; import {t, tct} from 'app/locale'; -import {Event} from 'app/types'; import space from 'app/styles/space'; -import ExternalLink from 'app/components/links/externalLink'; +import {Event} from 'app/types'; type Props = { event: Event; diff --git a/src/sentry/static/sentry/app/components/events/sdkUpdates/index.tsx b/src/sentry/static/sentry/app/components/events/sdkUpdates/index.tsx index 0db171ae2a9b95..3d347e1e528a28 100644 --- a/src/sentry/static/sentry/app/components/events/sdkUpdates/index.tsx +++ b/src/sentry/static/sentry/app/components/events/sdkUpdates/index.tsx @@ -1,9 +1,9 @@ import React from 'react'; import Alert from 'app/components/alert'; +import EventDataSection from 'app/components/events/eventDataSection'; import {IconUpgrade} from 'app/icons'; import {tct} from 'app/locale'; -import EventDataSection from 'app/components/events/eventDataSection'; import {Event} from 'app/types'; import getSuggestion from './getSuggestion'; diff --git a/src/sentry/static/sentry/app/components/events/userFeedback.tsx b/src/sentry/static/sentry/app/components/events/userFeedback.tsx index 74c385d6a97380..f2f135283d211c 100644 --- a/src/sentry/static/sentry/app/components/events/userFeedback.tsx +++ b/src/sentry/static/sentry/app/components/events/userFeedback.tsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {UserReport} from 'app/types'; -import SentryTypes from 'app/sentryTypes'; -import {nl2br, escape} from 'app/utils'; -import {t} from 'app/locale'; import ActivityAuthor from 'app/components/activity/author'; import ActivityItem from 'app/components/activity/item'; import Clipboard from 'app/components/clipboard'; -import {IconCopy} from 'app/icons'; import Link from 'app/components/links/link'; +import {IconCopy} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {UserReport} from 'app/types'; +import {escape, nl2br} from 'app/utils'; type Props = { report: UserReport; diff --git a/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx b/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx index a07b9fea1bb07a..1370afd79d6be9 100644 --- a/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx +++ b/src/sentry/static/sentry/app/components/eventsTable/eventsTable.jsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; +import EventsTableRow from 'app/components/eventsTable/eventsTableRow'; import {t} from 'app/locale'; import CustomPropTypes from 'app/sentryTypes'; -import EventsTableRow from 'app/components/eventsTable/eventsTableRow'; class EventsTable extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx b/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx index 6aacab9e038895..82893b06daf56e 100644 --- a/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx +++ b/src/sentry/static/sentry/app/components/eventsTable/eventsTableRow.jsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import AttachmentUrl from 'app/utils/attachmentUrl'; import UserAvatar from 'app/components/avatar/userAvatar'; import DateTime from 'app/components/dateTime'; import DeviceName from 'app/components/deviceName'; import FileSize from 'app/components/fileSize'; import GlobalSelectionLink from 'app/components/globalSelectionLink'; import SentryTypes from 'app/sentryTypes'; +import AttachmentUrl from 'app/utils/attachmentUrl'; import withOrganization from 'app/utils/withOrganization'; class EventsTableRow extends React.Component { diff --git a/src/sentry/static/sentry/app/components/featureBadge.tsx b/src/sentry/static/sentry/app/components/featureBadge.tsx index 7f0a341bfdc21e..c85208f8828842 100644 --- a/src/sentry/static/sentry/app/components/featureBadge.tsx +++ b/src/sentry/static/sentry/app/components/featureBadge.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; +import CircleIndicator from 'app/components/circleIndicator'; import Tag from 'app/components/tagDeprecated'; import Tooltip from 'app/components/tooltip'; -import space from 'app/styles/space'; import {t} from 'app/locale'; +import space from 'app/styles/space'; import theme from 'app/utils/theme'; -import CircleIndicator from 'app/components/circleIndicator'; type BadgeProps = { type: 'alpha' | 'beta' | 'new'; diff --git a/src/sentry/static/sentry/app/components/fileChange.tsx b/src/sentry/static/sentry/app/components/fileChange.tsx index bc01173b99f55c..2483f12605d08e 100644 --- a/src/sentry/static/sentry/app/components/fileChange.tsx +++ b/src/sentry/static/sentry/app/components/fileChange.tsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {ListGroupItem} from 'app/components/listGroup'; -import space from 'app/styles/space'; -import {CommitAuthor, AvatarUser} from 'app/types'; import AvatarList from 'app/components/avatar/avatarList'; import FileIcon from 'app/components/fileIcon'; +import {ListGroupItem} from 'app/components/listGroup'; import TextOverflow from 'app/components/textOverflow'; +import space from 'app/styles/space'; +import {AvatarUser, CommitAuthor} from 'app/types'; type Props = { filename: string; diff --git a/src/sentry/static/sentry/app/components/fileSize.tsx b/src/sentry/static/sentry/app/components/fileSize.tsx index a65df276842cb5..1d2d6712e5b1f4 100644 --- a/src/sentry/static/sentry/app/components/fileSize.tsx +++ b/src/sentry/static/sentry/app/components/fileSize.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {formatBytes} from 'app/utils'; import getDynamicText from 'app/utils/getDynamicText'; diff --git a/src/sentry/static/sentry/app/components/flowLayout.tsx b/src/sentry/static/sentry/app/components/flowLayout.tsx index eea9bf7cd2b36e..54c5ce3e20c84f 100644 --- a/src/sentry/static/sentry/app/components/flowLayout.tsx +++ b/src/sentry/static/sentry/app/components/flowLayout.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; type Props = { /** diff --git a/src/sentry/static/sentry/app/components/footer.tsx b/src/sentry/static/sentry/app/components/footer.tsx index 16f47eaa5f7a21..4e5d2443d4123f 100644 --- a/src/sentry/static/sentry/app/components/footer.tsx +++ b/src/sentry/static/sentry/app/components/footer.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import ConfigStore from 'app/stores/configStore'; +import Hook from 'app/components/hook'; import ExternalLink from 'app/components/links/externalLink'; import {IconSentry} from 'app/icons'; -import Hook from 'app/components/hook'; -import getDynamicText from 'app/utils/getDynamicText'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; +import getDynamicText from 'app/utils/getDynamicText'; type Props = { className?: string; diff --git a/src/sentry/static/sentry/app/components/forms/apiForm.tsx b/src/sentry/static/sentry/app/components/forms/apiForm.tsx index 7c5bf50c4c1464..d6e93eef4d7079 100644 --- a/src/sentry/static/sentry/app/components/forms/apiForm.tsx +++ b/src/sentry/static/sentry/app/components/forms/apiForm.tsx @@ -1,14 +1,14 @@ import PropTypes from 'prop-types'; -import {APIRequestMethod, Client} from 'app/api'; import { + addErrorMessage, addLoadingMessage, clearIndicators, - addErrorMessage, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; +import {APIRequestMethod, Client} from 'app/api'; import Form from 'app/components/forms/form'; import FormState from 'app/components/forms/state'; +import {t} from 'app/locale'; type Props = Form['props'] & { onSubmit?: (data: object) => void; diff --git a/src/sentry/static/sentry/app/components/forms/booleanField.tsx b/src/sentry/static/sentry/app/components/forms/booleanField.tsx index c9c26cdc6bbbf3..dcfcd69dcc4754 100644 --- a/src/sentry/static/sentry/app/components/forms/booleanField.tsx +++ b/src/sentry/static/sentry/app/components/forms/booleanField.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {defined} from 'app/utils'; import InputField from 'app/components/forms/inputField'; import Tooltip from 'app/components/tooltip'; import {IconQuestion} from 'app/icons'; +import {defined} from 'app/utils'; type Props = InputField['props']; diff --git a/src/sentry/static/sentry/app/components/forms/form.tsx b/src/sentry/static/sentry/app/components/forms/form.tsx index 48c03e5d017cfb..39dda76c805988 100644 --- a/src/sentry/static/sentry/app/components/forms/form.tsx +++ b/src/sentry/static/sentry/app/components/forms/form.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import isEqual from 'lodash/isEqual'; import styled from '@emotion/styled'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; import FormState from 'app/components/forms/state'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/forms/formField.tsx b/src/sentry/static/sentry/app/components/forms/formField.tsx index 08184f66696e8f..ac9852e06aa8d6 100644 --- a/src/sentry/static/sentry/app/components/forms/formField.tsx +++ b/src/sentry/static/sentry/app/components/forms/formField.tsx @@ -1,12 +1,12 @@ -import classNames from 'classnames'; -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; -import {defined} from 'app/utils'; -import QuestionTooltip from 'app/components/questionTooltip'; import {Context} from 'app/components/forms/form'; +import QuestionTooltip from 'app/components/questionTooltip'; import {Meta} from 'app/types'; +import {defined} from 'app/utils'; type Value = string | number | boolean; diff --git a/src/sentry/static/sentry/app/components/forms/genericField.tsx b/src/sentry/static/sentry/app/components/forms/genericField.tsx index 8bf92b82cd94ea..8925980a15dc39 100644 --- a/src/sentry/static/sentry/app/components/forms/genericField.tsx +++ b/src/sentry/static/sentry/app/components/forms/genericField.tsx @@ -1,7 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {defined} from 'app/utils'; import BooleanField from 'app/components/forms/booleanField'; import EmailField from 'app/components/forms/emailField'; import FormField from 'app/components/forms/formField'; @@ -9,11 +8,12 @@ import NumberField from 'app/components/forms/numberField'; import PasswordField from 'app/components/forms/passwordField'; import RangeField from 'app/components/forms/rangeField'; import SelectAsyncField from 'app/components/forms/selectAsyncField'; -import SelectField from 'app/components/forms/selectField'; import SelectCreatableField from 'app/components/forms/selectCreatableField'; -import TextField from 'app/components/forms/textField'; -import TextareaField from 'app/components/forms/textareaField'; +import SelectField from 'app/components/forms/selectField'; import FormState from 'app/components/forms/state'; +import TextareaField from 'app/components/forms/textareaField'; +import TextField from 'app/components/forms/textField'; +import {defined} from 'app/utils'; type FieldType = | 'secret' diff --git a/src/sentry/static/sentry/app/components/forms/index.tsx b/src/sentry/static/sentry/app/components/forms/index.tsx index 3fc3ebcc859faf..74f806efcd9ddd 100644 --- a/src/sentry/static/sentry/app/components/forms/index.tsx +++ b/src/sentry/static/sentry/app/components/forms/index.tsx @@ -1,19 +1,19 @@ export {default as ApiForm} from './apiForm'; export {default as BooleanField} from './booleanField'; -export {default as EmailField} from './emailField'; export {default as DateTimeField} from './dateTimeField'; +export {default as EmailField} from './emailField'; export {default as Form} from './form'; -export {default as FormState} from './state'; export {default as GenericField} from './genericField'; export {default as MultipleCheckboxField} from './multipleCheckboxField'; +export {default as MultiSelectField} from './multiSelectField'; export {default as NumberField} from './numberField'; export {default as PasswordField} from './passwordField'; export {default as RadioBooleanField} from './radioBooleanField'; export {default as RangeField} from './rangeField'; export {default as SelectAsyncField} from './selectAsyncField'; -export {default as SelectField} from './selectField'; export {default as SelectCreatableField} from './selectCreatableField'; -export {default as TextField} from './textField'; -export {default as TextareaField} from './textareaField'; +export {default as SelectField} from './selectField'; export {default as Select2Field} from './selectField'; -export {default as MultiSelectField} from './multiSelectField'; +export {default as FormState} from './state'; +export {default as TextareaField} from './textareaField'; +export {default as TextField} from './textField'; diff --git a/src/sentry/static/sentry/app/components/forms/inputField.tsx b/src/sentry/static/sentry/app/components/forms/inputField.tsx index 9d28370ac2509d..c611967069a19b 100644 --- a/src/sentry/static/sentry/app/components/forms/inputField.tsx +++ b/src/sentry/static/sentry/app/components/forms/inputField.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import FormField from 'app/components/forms/formField'; diff --git a/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.tsx b/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.tsx index 3ddb3034ca901f..21693b4053064c 100644 --- a/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.tsx +++ b/src/sentry/static/sentry/app/components/forms/multipleCheckboxField.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import FormField from 'app/components/forms/formField'; import Tooltip from 'app/components/tooltip'; diff --git a/src/sentry/static/sentry/app/components/forms/passwordField.tsx b/src/sentry/static/sentry/app/components/forms/passwordField.tsx index 09811f59910865..cbebcbdb8994cd 100644 --- a/src/sentry/static/sentry/app/components/forms/passwordField.tsx +++ b/src/sentry/static/sentry/app/components/forms/passwordField.tsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; +import {Context} from 'app/components/forms/form'; import InputField from 'app/components/forms/inputField'; import FormState from 'app/components/forms/state'; -import {Context} from 'app/components/forms/form'; type Props = InputField['props'] & { hasSavedValue?: boolean; diff --git a/src/sentry/static/sentry/app/components/forms/radioBooleanField.tsx b/src/sentry/static/sentry/app/components/forms/radioBooleanField.tsx index c0c77e0499a577..f9485aa02340d7 100644 --- a/src/sentry/static/sentry/app/components/forms/radioBooleanField.tsx +++ b/src/sentry/static/sentry/app/components/forms/radioBooleanField.tsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {defined} from 'app/utils'; import InputField from 'app/components/forms/inputField'; +import {defined} from 'app/utils'; type Props = { yesLabel: string; diff --git a/src/sentry/static/sentry/app/components/forms/rangeField.tsx b/src/sentry/static/sentry/app/components/forms/rangeField.tsx index 28eb2159e3bb98..be7e7a5d4f6d25 100644 --- a/src/sentry/static/sentry/app/components/forms/rangeField.tsx +++ b/src/sentry/static/sentry/app/components/forms/rangeField.tsx @@ -1,6 +1,6 @@ +import ReactDOM from 'react-dom'; import $ from 'jquery'; import PropTypes from 'prop-types'; -import ReactDOM from 'react-dom'; import InputField from 'app/components/forms/inputField'; diff --git a/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx b/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx index e4aee2b4438b42..e242417d1d36f5 100644 --- a/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectAsyncControl.jsx @@ -1,10 +1,10 @@ +import React from 'react'; import debounce from 'lodash/debounce'; import PropTypes from 'prop-types'; -import React from 'react'; -import {t} from 'app/locale'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; +import {t} from 'app/locale'; import handleXhrErrorResponse from 'app/utils/handleXhrErrorResponse'; import SelectControl from './selectControl'; diff --git a/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx b/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx index ca85e34fd4038a..566b56175842c1 100644 --- a/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectAsyncField.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import SelectAsyncControl from './selectAsyncControl'; import SelectField from './selectField'; diff --git a/src/sentry/static/sentry/app/components/forms/selectControl.jsx b/src/sentry/static/sentry/app/components/forms/selectControl.jsx index f9e50911e3f693..07029a92590072 100644 --- a/src/sentry/static/sentry/app/components/forms/selectControl.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectControl.jsx @@ -1,13 +1,13 @@ import React from 'react'; import ReactSelect, {components as selectComponents} from 'react-select'; import Async from 'react-select/async'; -import Creatable from 'react-select/creatable'; import AsyncCreatable from 'react-select/async-creatable'; +import Creatable from 'react-select/creatable'; -import space from 'app/styles/space'; -import theme from 'app/utils/theme'; import {IconChevron, IconClose} from 'app/icons'; +import space from 'app/styles/space'; import convertFromSelect2Choices from 'app/utils/convertFromSelect2Choices'; +import theme from 'app/utils/theme'; import SelectControlLegacy from './selectControlLegacy'; diff --git a/src/sentry/static/sentry/app/components/forms/selectControlLegacy.tsx b/src/sentry/static/sentry/app/components/forms/selectControlLegacy.tsx index 34eac3c397a499..937c1f846e4b0b 100644 --- a/src/sentry/static/sentry/app/components/forms/selectControlLegacy.tsx +++ b/src/sentry/static/sentry/app/components/forms/selectControlLegacy.tsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import ReactSelect, {Async, Creatable, AsyncCreatable} from 'react-select-legacy'; -import styled from '@emotion/styled'; +import ReactSelect, {Async, AsyncCreatable, Creatable} from 'react-select-legacy'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {IconChevron} from 'app/icons'; -import convertFromSelect2Choices from 'app/utils/convertFromSelect2Choices'; import space from 'app/styles/space'; import {callIfFunction} from 'app/utils/callIfFunction'; +import convertFromSelect2Choices from 'app/utils/convertFromSelect2Choices'; /** * The library has `value` defined as `PropTypes.object`, but this diff --git a/src/sentry/static/sentry/app/components/forms/selectCreatableField.jsx b/src/sentry/static/sentry/app/components/forms/selectCreatableField.jsx index ee11983eb3f959..25247eb7553cbf 100644 --- a/src/sentry/static/sentry/app/components/forms/selectCreatableField.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectCreatableField.jsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {StyledForm} from 'app/components/forms/form'; -import {defined} from 'app/utils'; import SelectControl from 'app/components/forms/selectControl'; import SelectField from 'app/components/forms/selectField'; +import {defined} from 'app/utils'; import convertFromSelect2Choices from 'app/utils/convertFromSelect2Choices'; /** diff --git a/src/sentry/static/sentry/app/components/forms/selectField.jsx b/src/sentry/static/sentry/app/components/forms/selectField.jsx index 34025ebf2a4d1b..7f2b460644c754 100644 --- a/src/sentry/static/sentry/app/components/forms/selectField.jsx +++ b/src/sentry/static/sentry/app/components/forms/selectField.jsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {defined} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/components/globalModal.tsx b/src/sentry/static/sentry/app/components/globalModal.tsx index 52f8ce7cbaf0da..601a65c35011d2 100644 --- a/src/sentry/static/sentry/app/components/globalModal.tsx +++ b/src/sentry/static/sentry/app/components/globalModal.tsx @@ -1,11 +1,11 @@ -import {ClassNames} from '@emotion/core'; -import {browserHistory} from 'react-router'; -import Modal from 'react-bootstrap/lib/Modal'; import React from 'react'; -import Reflux from 'reflux'; +import Modal from 'react-bootstrap/lib/Modal'; +import {browserHistory} from 'react-router'; +import {ClassNames} from '@emotion/core'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import {closeModal, ModalRenderProps, ModalOptions} from 'app/actionCreators/modal'; +import {closeModal, ModalOptions, ModalRenderProps} from 'app/actionCreators/modal'; import Confirm from 'app/components/confirm'; import ModalStore from 'app/stores/modalStore'; diff --git a/src/sentry/static/sentry/app/components/globalSelectionLink.tsx b/src/sentry/static/sentry/app/components/globalSelectionLink.tsx index ba14cb61b2f740..2f48d7f3eb7521 100644 --- a/src/sentry/static/sentry/app/components/globalSelectionLink.tsx +++ b/src/sentry/static/sentry/app/components/globalSelectionLink.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import {LocationDescriptor} from 'history'; import {Link as RouterLink} from 'react-router'; +import {LocationDescriptor} from 'history'; +import PropTypes from 'prop-types'; import * as qs from 'query-string'; import {extractSelectionParameters} from 'app/components/organizations/globalSelectionHeader/utils'; diff --git a/src/sentry/static/sentry/app/components/gridEditable/index.tsx b/src/sentry/static/sentry/app/components/gridEditable/index.tsx index 1ece91d68ad6ac..147ab62f928db5 100644 --- a/src/sentry/static/sentry/app/components/gridEditable/index.tsx +++ b/src/sentry/static/sentry/app/components/gridEditable/index.tsx @@ -1,33 +1,33 @@ import React from 'react'; import {Location} from 'history'; -import {t} from 'app/locale'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import LoadingIndicator from 'app/components/loadingIndicator'; import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; import { - GridColumn, - GridColumnHeader, - GridColumnOrder, - GridColumnSortBy, - ObjectKey, -} from './types'; -import { - Header, - HeaderTitle, - HeaderButtonContainer, Body, Grid, - GridRow, - GridHead, - GridHeadCell, - GridHeadCellStatic, GridBody, GridBodyCell, GridBodyCellStatus, + GridHead, + GridHeadCell, + GridHeadCellStatic, GridResizer, + GridRow, + Header, + HeaderButtonContainer, + HeaderTitle, } from './styles'; +import { + GridColumn, + GridColumnHeader, + GridColumnOrder, + GridColumnSortBy, + ObjectKey, +} from './types'; import {COL_WIDTH_MINIMUM, COL_WIDTH_UNDEFINED, ColResizeMetadata} from './utils'; type GridEditableProps<DataRow, ColumnKey> = { diff --git a/src/sentry/static/sentry/app/components/gridEditable/sortLink.tsx b/src/sentry/static/sentry/app/components/gridEditable/sortLink.tsx index c9d9f0f686df23..28cc4116db212a 100644 --- a/src/sentry/static/sentry/app/components/gridEditable/sortLink.tsx +++ b/src/sentry/static/sentry/app/components/gridEditable/sortLink.tsx @@ -3,8 +3,8 @@ import styled from '@emotion/styled'; import {LocationDescriptorObject} from 'history'; import omit from 'lodash/omit'; -import {IconArrow} from 'app/icons'; import Link from 'app/components/links/link'; +import {IconArrow} from 'app/icons'; export type Alignments = 'left' | 'right' | undefined; export type Directions = 'desc' | 'asc' | undefined; diff --git a/src/sentry/static/sentry/app/components/group/externalIssueActions.tsx b/src/sentry/static/sentry/app/components/group/externalIssueActions.tsx index 68c55c02f13f59..cbcc161e93365c 100644 --- a/src/sentry/static/sentry/app/components/group/externalIssueActions.tsx +++ b/src/sentry/static/sentry/app/components/group/externalIssueActions.tsx @@ -2,16 +2,16 @@ import React from 'react'; import Modal from 'react-bootstrap/lib/Modal'; import styled from '@emotion/styled'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import AsyncComponent from 'app/components/asyncComponent'; -import IssueSyncListElement from 'app/components/issueSyncListElement'; import ExternalIssueForm from 'app/components/group/externalIssueForm'; -import IntegrationItem from 'app/views/organizationIntegrations/integrationItem'; +import IssueSyncListElement from 'app/components/issueSyncListElement'; import NavTabs from 'app/components/navTabs'; import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; import {Group, GroupIntegration} from 'app/types'; +import IntegrationItem from 'app/views/organizationIntegrations/integrationItem'; type Props = AsyncComponent['props'] & { configurations: GroupIntegration[]; diff --git a/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx b/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx index 50bc08b97f650c..ea7f62c2ec8c1c 100644 --- a/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx +++ b/src/sentry/static/sentry/app/components/group/externalIssueForm.tsx @@ -1,16 +1,13 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import * as queryString from 'query-string'; import * as Sentry from '@sentry/react'; import debounce from 'lodash/debounce'; +import PropTypes from 'prop-types'; +import * as queryString from 'query-string'; import {addSuccessMessage} from 'app/actionCreators/indicator'; import AsyncComponent from 'app/components/asyncComponent'; -import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; -import Form from 'app/views/settings/components/forms/form'; -import {FieldValue} from 'app/views/settings/components/forms/model'; -import SentryTypes from 'app/sentryTypes'; import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import { Group, Integration, @@ -18,6 +15,9 @@ import { IntegrationIssueConfig, IssueConfigField, } from 'app/types'; +import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; +import Form from 'app/views/settings/components/forms/form'; +import {FieldValue} from 'app/views/settings/components/forms/model'; const MESSAGES_BY_ACTION = { link: t('Successfully linked issue.'), diff --git a/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx b/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx index 7b6de373ae0bd0..4e96437f409bee 100644 --- a/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx +++ b/src/sentry/static/sentry/app/components/group/externalIssuesList.tsx @@ -1,30 +1,30 @@ import React from 'react'; import styled from '@emotion/styled'; -import { - Group, - Project, - Organization, - PlatformExternalIssue, - Event, - SentryAppComponent, - SentryAppInstallation, - GroupIntegration, -} from 'app/types'; -import {t} from 'app/locale'; import AlertLink from 'app/components/alertLink'; import AsyncComponent from 'app/components/asyncComponent'; import ErrorBoundary from 'app/components/errorBoundary'; import ExternalIssueActions from 'app/components/group/externalIssueActions'; -import ExternalIssueStore from 'app/stores/externalIssueStore'; +import PluginActions from 'app/components/group/pluginActions'; +import SentryAppExternalIssueActions from 'app/components/group/sentryAppExternalIssueActions'; import IssueSyncListElement from 'app/components/issueSyncListElement'; import Placeholder from 'app/components/placeholder'; -import PluginActions from 'app/components/group/pluginActions'; import {IconGeneric} from 'app/icons'; +import {t} from 'app/locale'; +import ExternalIssueStore from 'app/stores/externalIssueStore'; import SentryAppComponentsStore from 'app/stores/sentryAppComponentsStore'; -import SentryAppExternalIssueActions from 'app/components/group/sentryAppExternalIssueActions'; import SentryAppInstallationStore from 'app/stores/sentryAppInstallationsStore'; import space from 'app/styles/space'; +import { + Event, + Group, + GroupIntegration, + Organization, + PlatformExternalIssue, + Project, + SentryAppComponent, + SentryAppInstallation, +} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; import SidebarSection from './sidebarSection'; diff --git a/src/sentry/static/sentry/app/components/group/inboxBadges/commentsLink.tsx b/src/sentry/static/sentry/app/components/group/inboxBadges/commentsLink.tsx index 52cfd2cc4a23bc..9e7c21ca749b4c 100644 --- a/src/sentry/static/sentry/app/components/group/inboxBadges/commentsLink.tsx +++ b/src/sentry/static/sentry/app/components/group/inboxBadges/commentsLink.tsx @@ -1,8 +1,8 @@ import React from 'react'; +import Tag from 'app/components/tag'; import {IconChat} from 'app/icons'; import {SubscriptionDetails} from 'app/types'; -import Tag from 'app/components/tag'; /** * Used in new inbox diff --git a/src/sentry/static/sentry/app/components/group/inboxBadges/inboxReason.tsx b/src/sentry/static/sentry/app/components/group/inboxBadges/inboxReason.tsx index 2ed3e6a679e752..21431cdb812653 100644 --- a/src/sentry/static/sentry/app/components/group/inboxBadges/inboxReason.tsx +++ b/src/sentry/static/sentry/app/components/group/inboxBadges/inboxReason.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import moment from 'moment'; import styled from '@emotion/styled'; +import moment from 'moment'; -import {t} from 'app/locale'; +import DateTime from 'app/components/dateTime'; +import Tag from 'app/components/tag'; import {IconSound, IconSwitch, IconSync, IconWarning} from 'app/icons'; +import {t} from 'app/locale'; import {InboxDetails} from 'app/types'; -import Tag from 'app/components/tag'; -import DateTime from 'app/components/dateTime'; const GroupInboxReason = { NEW: 0, diff --git a/src/sentry/static/sentry/app/components/group/inboxBadges/timesTag.tsx b/src/sentry/static/sentry/app/components/group/inboxBadges/timesTag.tsx index 507fd48ad9db28..4c0dd7ddb5b5c1 100644 --- a/src/sentry/static/sentry/app/components/group/inboxBadges/timesTag.tsx +++ b/src/sentry/static/sentry/app/components/group/inboxBadges/timesTag.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {IconClock} from 'app/icons'; -import TimeSince from 'app/components/timeSince'; import Tag from 'app/components/tag'; +import TimeSince from 'app/components/timeSince'; +import {IconClock} from 'app/icons'; +import {t} from 'app/locale'; /** * Used in new inbox diff --git a/src/sentry/static/sentry/app/components/group/inboxBadges/unhandledTag.tsx b/src/sentry/static/sentry/app/components/group/inboxBadges/unhandledTag.tsx index f1d4eee1185f3a..d5c9058bb6410d 100644 --- a/src/sentry/static/sentry/app/components/group/inboxBadges/unhandledTag.tsx +++ b/src/sentry/static/sentry/app/components/group/inboxBadges/unhandledTag.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {t} from 'app/locale'; -import Tag from 'app/components/tag'; import Feature from 'app/components/acl/feature'; +import Tag from 'app/components/tag'; import {IconSubtract} from 'app/icons'; +import {t} from 'app/locale'; /** * Used in new inbox diff --git a/src/sentry/static/sentry/app/components/group/participants.tsx b/src/sentry/static/sentry/app/components/group/participants.tsx index 1de5d768483eae..8e4bc424339158 100644 --- a/src/sentry/static/sentry/app/components/group/participants.tsx +++ b/src/sentry/static/sentry/app/components/group/participants.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Group} from 'app/types'; -import {tn} from 'app/locale'; import UserAvatar from 'app/components/avatar/userAvatar'; +import {tn} from 'app/locale'; import space from 'app/styles/space'; +import {Group} from 'app/types'; import SidebarSection from './sidebarSection'; diff --git a/src/sentry/static/sentry/app/components/group/pluginActions.tsx b/src/sentry/static/sentry/app/components/group/pluginActions.tsx index 99389dfbde7166..29c0585c0ea7f8 100644 --- a/src/sentry/static/sentry/app/components/group/pluginActions.tsx +++ b/src/sentry/static/sentry/app/components/group/pluginActions.tsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import Modal from 'react-bootstrap/lib/Modal'; +import PropTypes from 'prop-types'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; +import IssueSyncListElement from 'app/components/issueSyncListElement'; import NavTabs from 'app/components/navTabs'; -import plugins from 'app/plugins'; import {t, tct} from 'app/locale'; +import plugins from 'app/plugins'; import SentryTypes from 'app/sentryTypes'; -import IssueSyncListElement from 'app/components/issueSyncListElement'; +import {Group, Organization, Plugin, Project} from 'app/types'; +import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; -import {Organization, Group, Project, Plugin} from 'app/types'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/components/group/releaseChart.tsx b/src/sentry/static/sentry/app/components/group/releaseChart.tsx index 0fca70002491a2..8ff4e398698da5 100644 --- a/src/sentry/static/sentry/app/components/group/releaseChart.tsx +++ b/src/sentry/static/sentry/app/components/group/releaseChart.tsx @@ -2,10 +2,10 @@ import React from 'react'; import MiniBarChart from 'app/components/charts/miniBarChart'; import {t} from 'app/locale'; -import theme from 'app/utils/theme'; -import {formatVersion} from 'app/utils/formatters'; +import {Group, Release, TimeseriesValue} from 'app/types'; import {Series} from 'app/types/echarts'; -import {Group, TimeseriesValue, Release} from 'app/types'; +import {formatVersion} from 'app/utils/formatters'; +import theme from 'app/utils/theme'; import SidebarSection from './sidebarSection'; diff --git a/src/sentry/static/sentry/app/components/group/releaseStats.tsx b/src/sentry/static/sentry/app/components/group/releaseStats.tsx index 339e01f06209f6..16266dd00d7323 100644 --- a/src/sentry/static/sentry/app/components/group/releaseStats.tsx +++ b/src/sentry/static/sentry/app/components/group/releaseStats.tsx @@ -1,11 +1,11 @@ import React from 'react'; import GroupReleaseChart from 'app/components/group/releaseChart'; -import Placeholder from 'app/components/placeholder'; import SeenInfo from 'app/components/group/seenInfo'; -import getDynamicText from 'app/utils/getDynamicText'; +import Placeholder from 'app/components/placeholder'; import {t} from 'app/locale'; import {Environment, Group, Organization, Project} from 'app/types'; +import getDynamicText from 'app/utils/getDynamicText'; import SidebarSection from './sidebarSection'; diff --git a/src/sentry/static/sentry/app/components/group/seenInfo.tsx b/src/sentry/static/sentry/app/components/group/seenInfo.tsx index 0c025f033af0da..8522cd4fdd8806 100644 --- a/src/sentry/static/sentry/app/components/group/seenInfo.tsx +++ b/src/sentry/static/sentry/app/components/group/seenInfo.tsx @@ -4,15 +4,15 @@ import PropTypes from 'prop-types'; import DateTime from 'app/components/dateTime'; import TimeSince from 'app/components/timeSince'; +import Tooltip from 'app/components/tooltip'; import Version from 'app/components/version'; import VersionHoverCard from 'app/components/versionHoverCard'; -import space from 'app/styles/space'; import {IconInfo} from 'app/icons'; -import Tooltip from 'app/components/tooltip'; -import {defined, toTitleCase} from 'app/utils'; import {t} from 'app/locale'; -import {Release} from 'app/types'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; +import {Release} from 'app/types'; +import {defined, toTitleCase} from 'app/utils'; type RelaxedDateType = React.ComponentProps<typeof TimeSince>['date']; diff --git a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueActions.tsx b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueActions.tsx index 6e1b11f92f0248..f59e0bd95f7bfd 100644 --- a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueActions.tsx +++ b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueActions.tsx @@ -1,28 +1,28 @@ import React, {ReactElement} from 'react'; -import PropTypes from 'prop-types'; import Modal from 'react-bootstrap/lib/Modal'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import {deleteExternalIssue} from 'app/actionCreators/platformExternalIssues'; import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; -import {IconAdd, IconClose} from 'app/icons'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; -import {IntegrationLink} from 'app/components/issueSyncListElement'; -import {SentryAppIcon} from 'app/components/sentryAppIcon'; import SentryAppExternalIssueForm from 'app/components/group/sentryAppExternalIssueForm'; +import {IntegrationLink} from 'app/components/issueSyncListElement'; import NavTabs from 'app/components/navTabs'; +import {SentryAppIcon} from 'app/components/sentryAppIcon'; +import {IconAdd, IconClose} from 'app/icons'; import {t, tct} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; -import {deleteExternalIssue} from 'app/actionCreators/platformExternalIssues'; -import {recordInteraction} from 'app/utils/recordSentryAppInteraction'; import { + Event, Group, PlatformExternalIssue, - Event, SentryAppComponent, SentryAppInstallation, } from 'app/types'; +import {recordInteraction} from 'app/utils/recordSentryAppInteraction'; +import withApi from 'app/utils/withApi'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx index d22a9ddde25372..ae3a3f61c7551b 100644 --- a/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx +++ b/src/sentry/static/sentry/app/components/group/sentryAppExternalIssueForm.tsx @@ -1,22 +1,22 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import debounce from 'lodash/debounce'; import {createFilter} from 'react-select'; +import debounce from 'lodash/debounce'; +import PropTypes from 'prop-types'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; -import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; -import Form from 'app/views/settings/components/forms/form'; -import SentryTypes from 'app/sentryTypes'; +import {Client} from 'app/api'; import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import ExternalIssueStore from 'app/stores/externalIssueStore'; +import {Event, Group, PlatformExternalIssue, SentryAppInstallation} from 'app/types'; import getStacktraceBody from 'app/utils/getStacktraceBody'; +import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; +import {replaceAtArrayIndex} from 'app/utils/replaceAtArrayIndex'; import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; -import {Group, PlatformExternalIssue, Event, SentryAppInstallation} from 'app/types'; -import {Field, FieldValue} from 'app/views/settings/components/forms/type'; +import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; +import Form from 'app/views/settings/components/forms/form'; import FormModel from 'app/views/settings/components/forms/model'; -import {replaceAtArrayIndex} from 'app/utils/replaceAtArrayIndex'; +import {Field, FieldValue} from 'app/views/settings/components/forms/type'; //0 is a valid choice but empty string, undefined, and null are not const hasValue = value => !!value || value === 0; diff --git a/src/sentry/static/sentry/app/components/group/sidebar.tsx b/src/sentry/static/sentry/app/components/group/sidebar.tsx index b8b50704583db7..a597ab5f33b359 100644 --- a/src/sentry/static/sentry/app/components/group/sidebar.tsx +++ b/src/sentry/static/sentry/app/components/group/sidebar.tsx @@ -1,32 +1,32 @@ import React from 'react'; +import styled from '@emotion/styled'; import isEqual from 'lodash/isEqual'; import isObject from 'lodash/isObject'; import keyBy from 'lodash/keyBy'; import pickBy from 'lodash/pickBy'; -import styled from '@emotion/styled'; -import {Client} from 'app/api'; import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; +import GuideAnchor from 'app/components/assistant/guideAnchor'; import ErrorBoundary from 'app/components/errorBoundary'; import ExternalIssueList from 'app/components/group/externalIssuesList'; import GroupParticipants from 'app/components/group/participants'; import GroupReleaseStats from 'app/components/group/releaseStats'; +import SuggestedOwners from 'app/components/group/suggestedOwners/suggestedOwners'; import GroupTagDistributionMeter from 'app/components/group/tagDistributionMeter'; -import GuideAnchor from 'app/components/assistant/guideAnchor'; import LoadingError from 'app/components/loadingError'; import Placeholder from 'app/components/placeholder'; -import SuggestedOwners from 'app/components/group/suggestedOwners/suggestedOwners'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import withApi from 'app/utils/withApi'; import { - Event, Environment, + Event, Group, Organization, Project, TagWithTopValues, } from 'app/types'; +import withApi from 'app/utils/withApi'; import SidebarSection from './sidebarSection'; diff --git a/src/sentry/static/sentry/app/components/group/suggestedOwnerHovercard.tsx b/src/sentry/static/sentry/app/components/group/suggestedOwnerHovercard.tsx index ff977370f572b6..88c07b0ce7b6d3 100644 --- a/src/sentry/static/sentry/app/components/group/suggestedOwnerHovercard.tsx +++ b/src/sentry/static/sentry/app/components/group/suggestedOwnerHovercard.tsx @@ -1,19 +1,19 @@ import React from 'react'; -import moment from 'moment'; import styled from '@emotion/styled'; +import moment from 'moment'; -import {Actor, Commit} from 'app/types'; -import {t, tct} from 'app/locale'; import {openInviteMembersModal} from 'app/actionCreators/modal'; -import ActorAvatar from 'app/components/avatar/actorAvatar'; import Alert from 'app/components/alert'; +import ActorAvatar from 'app/components/avatar/actorAvatar'; import Button from 'app/components/button'; import Hovercard from 'app/components/hovercard'; -import {IconCommit, IconWarning} from 'app/icons'; import Link from 'app/components/links/link'; +import {IconCommit, IconWarning} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import theme from 'app/utils/theme'; +import {Actor, Commit} from 'app/types'; import {defined} from 'app/utils'; +import theme from 'app/utils/theme'; type Props = { /** diff --git a/src/sentry/static/sentry/app/components/group/suggestedOwners/ownershipRules.tsx b/src/sentry/static/sentry/app/components/group/suggestedOwners/ownershipRules.tsx index f7c08ffd5ebd76..727df7b56d8d8d 100644 --- a/src/sentry/static/sentry/app/components/group/suggestedOwners/ownershipRules.tsx +++ b/src/sentry/static/sentry/app/components/group/suggestedOwners/ownershipRules.tsx @@ -1,15 +1,15 @@ import React from 'react'; -import styled from '@emotion/styled'; import {ClassNames} from '@emotion/core'; +import styled from '@emotion/styled'; -import {IconQuestion} from 'app/icons'; import {openCreateOwnershipRule} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; -import Button from 'app/components/button'; import GuideAnchor from 'app/components/assistant/guideAnchor'; +import Button from 'app/components/button'; import Hovercard from 'app/components/hovercard'; +import {IconQuestion} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {Project, Organization} from 'app/types'; +import {Organization, Project} from 'app/types'; import SidebarSection from '../sidebarSection'; diff --git a/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedAssignees.tsx b/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedAssignees.tsx index eddb92df5725fe..5be2d7623721c7 100644 --- a/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedAssignees.tsx +++ b/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedAssignees.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {t} from 'app/locale'; import ActorAvatar from 'app/components/avatar/actorAvatar'; import SuggestedOwnerHovercard from 'app/components/group/suggestedOwnerHovercard'; -import {Actor, Commit} from 'app/types'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Actor, Commit} from 'app/types'; import SidebarSection from '../sidebarSection'; diff --git a/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedOwners.tsx b/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedOwners.tsx index fb5625c533bf31..28716c8e1bb6f9 100644 --- a/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedOwners.tsx +++ b/src/sentry/static/sentry/app/components/group/suggestedOwners/suggestedOwners.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import {assignToUser, assignToActor} from 'app/actionCreators/group'; +import {assignToActor, assignToUser} from 'app/actionCreators/group'; +import {Client} from 'app/api'; +import Access from 'app/components/acl/access'; +import {Actor, Committer, Event, Group, Organization, Project} from 'app/types'; import withApi from 'app/utils/withApi'; import withCommitters from 'app/utils/withCommitters'; import withOrganization from 'app/utils/withOrganization'; -import Access from 'app/components/acl/access'; -import {Organization, Group, Event, Actor, Committer, Project} from 'app/types'; -import {Client} from 'app/api'; import {findMatchedRules, Rules} from './findMatchedRules'; -import {SuggestedAssignees} from './suggestedAssignees'; import {OwnershipRules} from './ownershipRules'; +import {SuggestedAssignees} from './suggestedAssignees'; type OwnerList = React.ComponentProps<typeof SuggestedAssignees>['owners']; diff --git a/src/sentry/static/sentry/app/components/group/tagDistributionMeter.tsx b/src/sentry/static/sentry/app/components/group/tagDistributionMeter.tsx index 06ffde3e5f45a1..80d424ebff58b1 100644 --- a/src/sentry/static/sentry/app/components/group/tagDistributionMeter.tsx +++ b/src/sentry/static/sentry/app/components/group/tagDistributionMeter.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {Group, Organization, TagWithTopValues} from 'app/types'; -import {IOSDeviceList} from 'app/types/iOSDeviceList'; import {deviceNameMapper, loadDeviceListModule} from 'app/components/deviceName'; import TagDistributionMeter from 'app/components/tagDistributionMeter'; +import {Group, Organization, TagWithTopValues} from 'app/types'; +import {IOSDeviceList} from 'app/types/iOSDeviceList'; type Props = { group: Group; diff --git a/src/sentry/static/sentry/app/components/group/times.tsx b/src/sentry/static/sentry/app/components/group/times.tsx index 37aad771357a19..04e574fbe994ad 100644 --- a/src/sentry/static/sentry/app/components/group/times.tsx +++ b/src/sentry/static/sentry/app/components/group/times.tsx @@ -2,11 +2,11 @@ import React from 'react'; import styled from '@emotion/styled'; import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {IconClock} from 'app/icons'; -import space from 'app/styles/space'; import TimeSince from 'app/components/timeSince'; +import {IconClock} from 'app/icons'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; /** * Renders the first & last seen times for a group or event with diff --git a/src/sentry/static/sentry/app/components/helpSearch.tsx b/src/sentry/static/sentry/app/components/helpSearch.tsx index 6d08db71fa8b0a..7a64b1076cbfb3 100644 --- a/src/sentry/static/sentry/app/components/helpSearch.tsx +++ b/src/sentry/static/sentry/app/components/helpSearch.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tn} from 'app/locale'; import Search from 'app/components/search'; -import HelpSource from 'app/components/search/sources/helpSource'; import SearchResult from 'app/components/search/searchResult'; import SearchResultWrapper from 'app/components/search/searchResultWrapper'; -import space from 'app/styles/space'; +import HelpSource from 'app/components/search/sources/helpSource'; import {IconWindow} from 'app/icons'; +import {t, tn} from 'app/locale'; +import space from 'app/styles/space'; type HelpResult = Parameters< React.ComponentProps<typeof HelpSource>['children'] diff --git a/src/sentry/static/sentry/app/components/hook.tsx b/src/sentry/static/sentry/app/components/hook.tsx index 7b4a71ce6d9c11..d81e1ca53c2c5e 100644 --- a/src/sentry/static/sentry/app/components/hook.tsx +++ b/src/sentry/static/sentry/app/components/hook.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import {HookName, Hooks} from 'app/types/hooks'; import HookStore from 'app/stores/hookStore'; +import {HookName, Hooks} from 'app/types/hooks'; type Props<H extends HookName> = { /** diff --git a/src/sentry/static/sentry/app/components/hookOrDefault.tsx b/src/sentry/static/sentry/app/components/hookOrDefault.tsx index d103f3f60dd807..0db146ac5cc76e 100644 --- a/src/sentry/static/sentry/app/components/hookOrDefault.tsx +++ b/src/sentry/static/sentry/app/components/hookOrDefault.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; import HookStore from 'app/stores/hookStore'; -import {Hooks, HookName} from 'app/types/hooks'; +import {HookName, Hooks} from 'app/types/hooks'; type Params<H extends HookName> = { /** diff --git a/src/sentry/static/sentry/app/components/hovercard.tsx b/src/sentry/static/sentry/app/components/hovercard.tsx index 5d1eb1a8a8ee32..494e0ae9a66b4b 100644 --- a/src/sentry/static/sentry/app/components/hovercard.tsx +++ b/src/sentry/static/sentry/app/components/hovercard.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; -import classNames from 'classnames'; -import {Manager, Reference, Popper, PopperProps} from 'react-popper'; -import styled from '@emotion/styled'; +import {Manager, Popper, PopperProps, Reference} from 'react-popper'; import {keyframes} from '@emotion/core'; +import styled from '@emotion/styled'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; import {fadeIn} from 'app/styles/animations'; import space from 'app/styles/space'; @@ -312,5 +312,5 @@ const HovercardArrow = styled('span')<HovercardArrowProps>` } `; -export {Hovercard, Body}; +export {Body, Hovercard}; export default Hovercard; diff --git a/src/sentry/static/sentry/app/components/idBadge/baseBadge.tsx b/src/sentry/static/sentry/app/components/idBadge/baseBadge.tsx index 38b11c5debbbe2..86a09a065f1008 100644 --- a/src/sentry/static/sentry/app/components/idBadge/baseBadge.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/baseBadge.tsx @@ -2,9 +2,9 @@ import React from 'react'; import styled from '@emotion/styled'; import Avatar from 'app/components/avatar'; -import space from 'app/styles/space'; import overflowEllipsis from 'app/styles/overflowEllipsis'; -import {Team, Organization, AvatarProject} from 'app/types'; +import space from 'app/styles/space'; +import {AvatarProject, Organization, Team} from 'app/types'; type Props = { displayName: React.ReactNode; diff --git a/src/sentry/static/sentry/app/components/idBadge/getBadge.tsx b/src/sentry/static/sentry/app/components/idBadge/getBadge.tsx index 26746ba3a445ef..d169e9a8d90cab 100644 --- a/src/sentry/static/sentry/app/components/idBadge/getBadge.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/getBadge.tsx @@ -2,10 +2,10 @@ import React from 'react'; import BaseBadge from 'app/components/idBadge/baseBadge'; import MemberBadge from 'app/components/idBadge/memberBadge'; -import UserBadge from 'app/components/idBadge/userBadge'; -import TeamBadge from 'app/components/idBadge/teamBadge/badge'; -import ProjectBadge from 'app/components/idBadge/projectBadge'; import OrganizationBadge from 'app/components/idBadge/organizationBadge'; +import ProjectBadge from 'app/components/idBadge/projectBadge'; +import TeamBadge from 'app/components/idBadge/teamBadge/badge'; +import UserBadge from 'app/components/idBadge/userBadge'; import {Member, User} from 'app/types'; type BaseBadgeProps = React.ComponentProps<typeof BaseBadge>; diff --git a/src/sentry/static/sentry/app/components/idBadge/memberBadge.tsx b/src/sentry/static/sentry/app/components/idBadge/memberBadge.tsx index 3a52b8c8396d4c..0956d06d6c5f62 100644 --- a/src/sentry/static/sentry/app/components/idBadge/memberBadge.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/memberBadge.tsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; import omit from 'lodash/omit'; +import PropTypes from 'prop-types'; -import {Member, AvatarUser} from 'app/types'; import UserAvatar from 'app/components/avatar/userAvatar'; import Link from 'app/components/links/link'; +import SentryTypes from 'app/sentryTypes'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; -import SentryTypes from 'app/sentryTypes'; +import {AvatarUser, Member} from 'app/types'; type Props = { member: Member; diff --git a/src/sentry/static/sentry/app/components/idBadge/organizationBadge.tsx b/src/sentry/static/sentry/app/components/idBadge/organizationBadge.tsx index b9f65b36191210..60c4c538e14d92 100644 --- a/src/sentry/static/sentry/app/components/idBadge/organizationBadge.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/organizationBadge.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import BaseBadge from 'app/components/idBadge/baseBadge'; import BadgeDisplayName from 'app/components/idBadge/badgeDisplayName'; +import BaseBadge from 'app/components/idBadge/baseBadge'; type BaseBadgeProps = React.ComponentProps<typeof BaseBadge>; type Organization = NonNullable<BaseBadgeProps['organization']>; diff --git a/src/sentry/static/sentry/app/components/idBadge/projectBadge.tsx b/src/sentry/static/sentry/app/components/idBadge/projectBadge.tsx index 5da879a082b460..c1b1610903b755 100644 --- a/src/sentry/static/sentry/app/components/idBadge/projectBadge.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/projectBadge.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import BaseBadge from 'app/components/idBadge/baseBadge'; import BadgeDisplayName from 'app/components/idBadge/badgeDisplayName'; +import BaseBadge from 'app/components/idBadge/baseBadge'; type BaseBadgeProps = React.ComponentProps<typeof BaseBadge>; type Project = NonNullable<BaseBadgeProps['project']>; diff --git a/src/sentry/static/sentry/app/components/idBadge/teamBadge/badge.tsx b/src/sentry/static/sentry/app/components/idBadge/teamBadge/badge.tsx index 81dcf5804cd887..426cade1808645 100644 --- a/src/sentry/static/sentry/app/components/idBadge/teamBadge/badge.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/teamBadge/badge.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import BaseBadge from 'app/components/idBadge/baseBadge'; import BadgeDisplayName from 'app/components/idBadge/badgeDisplayName'; +import BaseBadge from 'app/components/idBadge/baseBadge'; type BaseBadgeProps = React.ComponentProps<typeof BaseBadge>; type Team = NonNullable<BaseBadgeProps['team']>; diff --git a/src/sentry/static/sentry/app/components/idBadge/teamBadge/index.tsx b/src/sentry/static/sentry/app/components/idBadge/teamBadge/index.tsx index eea5bda83929fc..dc3e3f98d315aa 100644 --- a/src/sentry/static/sentry/app/components/idBadge/teamBadge/index.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/teamBadge/index.tsx @@ -1,6 +1,6 @@ -import isEqual from 'lodash/isEqual'; -import createReactClass from 'create-react-class'; import React from 'react'; +import createReactClass from 'create-react-class'; +import isEqual from 'lodash/isEqual'; import Reflux from 'reflux'; import SentryTypes from 'app/sentryTypes'; diff --git a/src/sentry/static/sentry/app/components/idBadge/userBadge.tsx b/src/sentry/static/sentry/app/components/idBadge/userBadge.tsx index ee9e13ec74ebbd..a0de320bd6bb1a 100644 --- a/src/sentry/static/sentry/app/components/idBadge/userBadge.tsx +++ b/src/sentry/static/sentry/app/components/idBadge/userBadge.tsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {AvatarUser} from 'app/types'; import UserAvatar from 'app/components/avatar/userAvatar'; +import SentryTypes from 'app/sentryTypes'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; -import SentryTypes from 'app/sentryTypes'; +import {AvatarUser} from 'app/types'; type Props = { avatarSize?: UserAvatar['props']['size']; diff --git a/src/sentry/static/sentry/app/components/inactivePlugins.tsx b/src/sentry/static/sentry/app/components/inactivePlugins.tsx index 70283a63a81068..b2fe94f12620d1 100644 --- a/src/sentry/static/sentry/app/components/inactivePlugins.tsx +++ b/src/sentry/static/sentry/app/components/inactivePlugins.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Plugin} from 'app/types'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import TextOverflow from 'app/components/textOverflow'; import {t} from 'app/locale'; import PluginIcon from 'app/plugins/components/pluginIcon'; -import TextOverflow from 'app/components/textOverflow'; import space from 'app/styles/space'; +import {Plugin} from 'app/types'; type Props = { plugins: Plugin[]; diff --git a/src/sentry/static/sentry/app/components/indicators.tsx b/src/sentry/static/sentry/app/components/indicators.tsx index d2db5c15064d45..61aa755fe881bd 100644 --- a/src/sentry/static/sentry/app/components/indicators.tsx +++ b/src/sentry/static/sentry/app/components/indicators.tsx @@ -1,14 +1,14 @@ -import {AnimatePresence} from 'framer-motion'; +import React from 'react'; +import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; import {ThemeProvider} from 'emotion-theming'; +import {AnimatePresence} from 'framer-motion'; import PropTypes from 'prop-types'; -import React from 'react'; import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; -import styled from '@emotion/styled'; -import {removeIndicator, Indicator} from 'app/actionCreators/indicator'; -import IndicatorStore from 'app/stores/indicatorStore'; +import {Indicator, removeIndicator} from 'app/actionCreators/indicator'; import ToastIndicator from 'app/components/alerts/toastIndicator'; +import IndicatorStore from 'app/stores/indicatorStore'; import theme from 'app/utils/theme'; const Toasts = styled('div')` diff --git a/src/sentry/static/sentry/app/components/inlineSvg.tsx b/src/sentry/static/sentry/app/components/inlineSvg.tsx index e05bcdaa80edb2..dedcc9e0469774 100644 --- a/src/sentry/static/sentry/app/components/inlineSvg.tsx +++ b/src/sentry/static/sentry/app/components/inlineSvg.tsx @@ -1,8 +1,8 @@ -import pickBy from 'lodash/pickBy'; -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; +import pickBy from 'lodash/pickBy'; +import PropTypes from 'prop-types'; type Props = { src: string; diff --git a/src/sentry/static/sentry/app/components/inputInline.tsx b/src/sentry/static/sentry/app/components/inputInline.tsx index cf8ca1eb896132..0b1bc56682914e 100644 --- a/src/sentry/static/sentry/app/components/inputInline.tsx +++ b/src/sentry/static/sentry/app/components/inputInline.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {callIfFunction} from 'app/utils/callIfFunction'; import {IconEdit} from 'app/icons'; import space from 'app/styles/space'; +import {callIfFunction} from 'app/utils/callIfFunction'; type Props = { name: string; diff --git a/src/sentry/static/sentry/app/components/internalStatChart.jsx b/src/sentry/static/sentry/app/components/internalStatChart.jsx index b4f2f617ae21ad..bc4e47068f840c 100644 --- a/src/sentry/static/sentry/app/components/internalStatChart.jsx +++ b/src/sentry/static/sentry/app/components/internalStatChart.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import MiniBarChart from 'app/components/charts/miniBarChart'; import LoadingError from 'app/components/loadingError'; diff --git a/src/sentry/static/sentry/app/components/issueDiff/index.tsx b/src/sentry/static/sentry/app/components/issueDiff/index.tsx index da0abe1928258a..2ce5376f98e960 100644 --- a/src/sentry/static/sentry/app/components/issueDiff/index.tsx +++ b/src/sentry/static/sentry/app/components/issueDiff/index.tsx @@ -2,17 +2,17 @@ import React from 'react'; import isPropValid from '@emotion/is-prop-valid'; import styled from '@emotion/styled'; -import {Client} from 'app/api'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; +import {Client} from 'app/api'; +import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import LoadingIndicator from 'app/components/loadingIndicator'; -import getStacktraceBody from 'app/utils/getStacktraceBody'; import SplitDiff from 'app/components/splitDiff'; -import ButtonBar from 'app/components/buttonBar'; -import Button from 'app/components/button'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import {Project} from 'app/types'; +import getStacktraceBody from 'app/utils/getStacktraceBody'; +import withApi from 'app/utils/withApi'; import renderGroupingInfo from './renderGroupingInfo'; diff --git a/src/sentry/static/sentry/app/components/issueLink.tsx b/src/sentry/static/sentry/app/components/issueLink.tsx index 1deef3678717c3..ad6a0b11e55a14 100644 --- a/src/sentry/static/sentry/app/components/issueLink.tsx +++ b/src/sentry/static/sentry/app/components/issueLink.tsx @@ -1,15 +1,15 @@ -import {Link} from 'react-router'; import React from 'react'; -import classNames from 'classnames'; +import {Link} from 'react-router'; import styled from '@emotion/styled'; +import classNames from 'classnames'; -import {t} from 'app/locale'; import Count from 'app/components/count'; +import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; import EventAnnotation from 'app/components/events/eventAnnotation'; import EventMessage from 'app/components/events/eventMessage'; -import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; import Hovercard from 'app/components/hovercard'; import TimeSince from 'app/components/timeSince'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; import {Group} from 'app/types'; diff --git a/src/sentry/static/sentry/app/components/issueList.jsx b/src/sentry/static/sentry/app/components/issueList.jsx index 5116326842a42e..3fc00778c53599 100644 --- a/src/sentry/static/sentry/app/components/issueList.jsx +++ b/src/sentry/static/sentry/app/components/issueList.jsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; -import {Panel, PanelBody} from 'app/components/panels'; -import withApi from 'app/utils/withApi'; import CompactIssue from 'app/components/issues/compactIssue'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {IconSearch} from 'app/icons'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; import Pagination from 'app/components/pagination'; -import space from 'app/styles/space'; +import {Panel, PanelBody} from 'app/components/panels'; +import {IconSearch} from 'app/icons'; import {t} from 'app/locale'; +import space from 'app/styles/space'; +import withApi from 'app/utils/withApi'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; const IssueList = createReactClass({ displayName: 'IssueList', diff --git a/src/sentry/static/sentry/app/components/issueSyncListElement.tsx b/src/sentry/static/sentry/app/components/issueSyncListElement.tsx index 2e90ca97cbdfe9..518d41d265380e 100644 --- a/src/sentry/static/sentry/app/components/issueSyncListElement.tsx +++ b/src/sentry/static/sentry/app/components/issueSyncListElement.tsx @@ -1,12 +1,12 @@ -import {ClassNames} from '@emotion/core'; -import PropTypes from 'prop-types'; import React from 'react'; +import {ClassNames} from '@emotion/core'; import styled from '@emotion/styled'; import capitalize from 'lodash/capitalize'; +import PropTypes from 'prop-types'; +import Hovercard from 'app/components/hovercard'; import {IconAdd, IconClose} from 'app/icons'; import space from 'app/styles/space'; -import Hovercard from 'app/components/hovercard'; import {callIfFunction} from 'app/utils/callIfFunction'; import {getIntegrationIcon} from 'app/utils/integrationUtil'; diff --git a/src/sentry/static/sentry/app/components/issues/compactIssue.jsx b/src/sentry/static/sentry/app/components/issues/compactIssue.jsx index 33ae8fe3c2e33d..800e6609154afd 100644 --- a/src/sentry/static/sentry/app/components/issues/compactIssue.jsx +++ b/src/sentry/static/sentry/app/components/issues/compactIssue.jsx @@ -1,25 +1,25 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; -import {PanelItem} from 'app/components/panels'; import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; -import {IconChat, IconCheckmark, IconEllipsis, IconMute, IconStar} from 'app/icons'; -import {t} from 'app/locale'; import DropdownLink from 'app/components/dropdownLink'; +import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; import ErrorLevel from 'app/components/events/errorLevel'; -import GroupChart from 'app/components/stream/groupChart'; -import GroupStore from 'app/stores/groupStore'; +import SnoozeAction from 'app/components/issues/snoozeAction'; import Link from 'app/components/links/link'; +import {PanelItem} from 'app/components/panels'; +import GroupChart from 'app/components/stream/groupChart'; +import {IconChat, IconCheckmark, IconEllipsis, IconMute, IconStar} from 'app/icons'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import SnoozeAction from 'app/components/issues/snoozeAction'; +import GroupStore from 'app/stores/groupStore'; import space from 'app/styles/space'; +import {getMessage} from 'app/utils/events'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; -import {getMessage} from 'app/utils/events'; -import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; class CompactIssueHeader extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/issues/groupList.tsx b/src/sentry/static/sentry/app/components/issues/groupList.tsx index e8f9e523b31740..7d0fd4ae65f908 100644 --- a/src/sentry/static/sentry/app/components/issues/groupList.tsx +++ b/src/sentry/static/sentry/app/components/issues/groupList.tsx @@ -1,24 +1,24 @@ -import isEqual from 'lodash/isEqual'; -import PropTypes from 'prop-types'; import React from 'react'; import {browserHistory} from 'react-router'; -import * as qs from 'query-string'; import * as Sentry from '@sentry/react'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; +import * as qs from 'query-string'; -import {Client} from 'app/api'; -import {Panel, PanelBody} from 'app/components/panels'; import {fetchOrgMembers, indexMembersByProject} from 'app/actionCreators/members'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import EmptyStateWarning from 'app/components/emptyStateWarning'; -import GroupStore from 'app/stores/groupStore'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import StreamGroup from 'app/components/stream/group'; -import StreamManager from 'app/utils/streamManager'; -import withApi from 'app/utils/withApi'; import Pagination from 'app/components/pagination'; +import {Panel, PanelBody} from 'app/components/panels'; +import StreamGroup from 'app/components/stream/group'; +import {t} from 'app/locale'; +import GroupStore from 'app/stores/groupStore'; import {Group} from 'app/types'; import {callIfFunction} from 'app/utils/callIfFunction'; +import StreamManager from 'app/utils/streamManager'; +import withApi from 'app/utils/withApi'; import GroupListHeader from './groupListHeader'; diff --git a/src/sentry/static/sentry/app/components/issues/groupListHeader.tsx b/src/sentry/static/sentry/app/components/issues/groupListHeader.tsx index 1cd911ea5a1e5d..9298d3d7af4230 100644 --- a/src/sentry/static/sentry/app/components/issues/groupListHeader.tsx +++ b/src/sentry/static/sentry/app/components/issues/groupListHeader.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {Flex, Box} from 'reflexbox'; +import {Box, Flex} from 'reflexbox'; // eslint-disable-line no-restricted-imports -import {t} from 'app/locale'; import {PanelHeader} from 'app/components/panels'; +import {t} from 'app/locale'; type Props = { withChart: boolean; diff --git a/src/sentry/static/sentry/app/components/issues/snoozeAction.tsx b/src/sentry/static/sentry/app/components/issues/snoozeAction.tsx index 360d9a06b7faa0..ffd746a4354298 100644 --- a/src/sentry/static/sentry/app/components/issues/snoozeAction.tsx +++ b/src/sentry/static/sentry/app/components/issues/snoozeAction.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import Modal from 'react-bootstrap/lib/Modal'; +import PropTypes from 'prop-types'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/lastCommit.tsx b/src/sentry/static/sentry/app/components/lastCommit.tsx index 6ef59e63d42d97..a0ec27e272af47 100644 --- a/src/sentry/static/sentry/app/components/lastCommit.tsx +++ b/src/sentry/static/sentry/app/components/lastCommit.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {AvatarUser, Commit} from 'app/types'; import UserAvatar from 'app/components/avatar/userAvatar'; import TimeSince from 'app/components/timeSince'; import {t} from 'app/locale'; +import {AvatarUser, Commit} from 'app/types'; type Props = { commit: Commit; diff --git a/src/sentry/static/sentry/app/components/layouts/thirds.tsx b/src/sentry/static/sentry/app/components/layouts/thirds.tsx index 3556b10e167693..534e929417cb55 100644 --- a/src/sentry/static/sentry/app/components/layouts/thirds.tsx +++ b/src/sentry/static/sentry/app/components/layouts/thirds.tsx @@ -1,8 +1,8 @@ import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; import NavTabs from 'app/components/navTabs'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; /** * Base container for 66/33 containers. diff --git a/src/sentry/static/sentry/app/components/lazyLoad.jsx b/src/sentry/static/sentry/app/components/lazyLoad.jsx index 12ecd045d6c7b1..59b7845fe8501b 100644 --- a/src/sentry/static/sentry/app/components/lazyLoad.jsx +++ b/src/sentry/static/sentry/app/components/lazyLoad.jsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; -import {isWebpackChunkLoadingError} from 'app/utils'; -import {t} from 'app/locale'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; +import {isWebpackChunkLoadingError} from 'app/utils'; import retryableImport from 'app/utils/retryableImport'; class LazyLoad extends React.Component { diff --git a/src/sentry/static/sentry/app/components/letterAvatar.tsx b/src/sentry/static/sentry/app/components/letterAvatar.tsx index 6d1d8eed63808a..948603504698be 100644 --- a/src/sentry/static/sentry/app/components/letterAvatar.tsx +++ b/src/sentry/static/sentry/app/components/letterAvatar.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {imageStyle} from 'app/components/avatar/styles'; diff --git a/src/sentry/static/sentry/app/components/lightWeightNoProjectMessage.tsx b/src/sentry/static/sentry/app/components/lightWeightNoProjectMessage.tsx index 383b28942e8ab7..a2654c5616fee1 100644 --- a/src/sentry/static/sentry/app/components/lightWeightNoProjectMessage.tsx +++ b/src/sentry/static/sentry/app/components/lightWeightNoProjectMessage.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {LightWeightOrganization, Organization, Project} from 'app/types'; import NoProjectMessage from 'app/components/noProjectMessage'; +import {LightWeightOrganization, Organization, Project} from 'app/types'; import withProjects from 'app/utils/withProjects'; type Props = { diff --git a/src/sentry/static/sentry/app/components/links/link.tsx b/src/sentry/static/sentry/app/components/links/link.tsx index 675245435b46c1..28aaba67a593f1 100644 --- a/src/sentry/static/sentry/app/components/links/link.tsx +++ b/src/sentry/static/sentry/app/components/links/link.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {Link as RouterLink} from 'react-router'; -import {Location, LocationDescriptor} from 'history'; -import styled from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import {Location, LocationDescriptor} from 'history'; +import PropTypes from 'prop-types'; type AnchorProps = React.HTMLProps<HTMLAnchorElement>; diff --git a/src/sentry/static/sentry/app/components/links/listLink.tsx b/src/sentry/static/sentry/app/components/links/listLink.tsx index a116f53d5201c6..1be474031d57a8 100644 --- a/src/sentry/static/sentry/app/components/links/listLink.tsx +++ b/src/sentry/static/sentry/app/components/links/listLink.tsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import omit from 'lodash/omit'; import {Link} from 'react-router'; import classNames from 'classnames'; import {LocationDescriptor} from 'history'; +import omit from 'lodash/omit'; +import PropTypes from 'prop-types'; type DefaultProps = { index: boolean; diff --git a/src/sentry/static/sentry/app/components/loading/loadingContainer.tsx b/src/sentry/static/sentry/app/components/loading/loadingContainer.tsx index ec85306fa4f5fd..b4e9d80cff6252 100644 --- a/src/sentry/static/sentry/app/components/loading/loadingContainer.tsx +++ b/src/sentry/static/sentry/app/components/loading/loadingContainer.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import LoadingIndicator from 'app/components/loadingIndicator'; import theme from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/loadingError.tsx b/src/sentry/static/sentry/app/components/loadingError.tsx index 894e25dd82c0c3..205af1a2c1263f 100644 --- a/src/sentry/static/sentry/app/components/loadingError.tsx +++ b/src/sentry/static/sentry/app/components/loadingError.tsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {IconInfo} from 'app/icons'; -import {t} from 'app/locale'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; import {Panel} from 'app/components/panels'; +import {IconInfo} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; type DefaultProps = { diff --git a/src/sentry/static/sentry/app/components/loadingIndicator.tsx b/src/sentry/static/sentry/app/components/loadingIndicator.tsx index e0939ccbce9de6..12a15079b9cbac 100644 --- a/src/sentry/static/sentry/app/components/loadingIndicator.tsx +++ b/src/sentry/static/sentry/app/components/loadingIndicator.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; import {withProfiler} from '@sentry/react'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; type Props = { overlay?: boolean; diff --git a/src/sentry/static/sentry/app/components/menuItem.tsx b/src/sentry/static/sentry/app/components/menuItem.tsx index 240f10fbe8954d..7a23cc70e991e9 100644 --- a/src/sentry/static/sentry/app/components/menuItem.tsx +++ b/src/sentry/static/sentry/app/components/menuItem.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import omit from 'lodash/omit'; import styled from '@emotion/styled'; +import omit from 'lodash/omit'; +import PropTypes from 'prop-types'; import Link from 'app/components/links/link'; -import {callIfFunction} from 'app/utils/callIfFunction'; import space from 'app/styles/space'; +import {callIfFunction} from 'app/utils/callIfFunction'; import {Theme} from 'app/utils/theme'; type MenuItemProps = { diff --git a/src/sentry/static/sentry/app/components/modals/commandPalette.tsx b/src/sentry/static/sentry/app/components/modals/commandPalette.tsx index 520ecca3094806..298e24129dd26e 100644 --- a/src/sentry/static/sentry/app/components/modals/commandPalette.tsx +++ b/src/sentry/static/sentry/app/components/modals/commandPalette.tsx @@ -1,14 +1,14 @@ -import {ClassNames, css} from '@emotion/core'; import React from 'react'; -import styled from '@emotion/styled'; import {ModalBody} from 'react-bootstrap'; +import {ClassNames, css} from '@emotion/core'; +import styled from '@emotion/styled'; -import Input from 'app/views/settings/components/forms/controls/input'; -import {analytics} from 'app/utils/analytics'; -import {t} from 'app/locale'; import Search from 'app/components/search'; -import theme from 'app/utils/theme'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {analytics} from 'app/utils/analytics'; +import theme from 'app/utils/theme'; +import Input from 'app/views/settings/components/forms/controls/input'; type Props = { Body: typeof ModalBody; diff --git a/src/sentry/static/sentry/app/components/modals/createOwnershipRuleModal.jsx b/src/sentry/static/sentry/app/components/modals/createOwnershipRuleModal.jsx index 234b4276879d7f..f731cdc03aa44b 100644 --- a/src/sentry/static/sentry/app/components/modals/createOwnershipRuleModal.jsx +++ b/src/sentry/static/sentry/app/components/modals/createOwnershipRuleModal.jsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {css} from '@emotion/core'; +import PropTypes from 'prop-types'; import {t} from 'app/locale'; -import ProjectOwnershipModal from 'app/views/settings/project/projectOwnership/modal'; import SentryTypes from 'app/sentryTypes'; import theme from 'app/utils/theme'; +import ProjectOwnershipModal from 'app/views/settings/project/projectOwnership/modal'; class CreateOwnershipRuleModal extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/modals/createTeamModal.tsx b/src/sentry/static/sentry/app/components/modals/createTeamModal.tsx index f52ee02db4e930..b8930a9e66bcc1 100644 --- a/src/sentry/static/sentry/app/components/modals/createTeamModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/createTeamModal.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import {Client} from 'app/api'; +import {ModalRenderProps} from 'app/actionCreators/modal'; import {createTeam} from 'app/actionCreators/teams'; +import {Client} from 'app/api'; +import CreateTeamForm from 'app/components/teams/createTeamForm'; import {t} from 'app/locale'; import {Organization, Team} from 'app/types'; -import {ModalRenderProps} from 'app/actionCreators/modal'; -import CreateTeamForm from 'app/components/teams/createTeamForm'; import withApi from 'app/utils/withApi'; type Props = { diff --git a/src/sentry/static/sentry/app/components/modals/debugFileSourceModal.jsx b/src/sentry/static/sentry/app/components/modals/debugFileSourceModal.jsx index 22c76c54ec6fef..56ccecaa93a468 100644 --- a/src/sentry/static/sentry/app/components/modals/debugFileSourceModal.jsx +++ b/src/sentry/static/sentry/app/components/modals/debugFileSourceModal.jsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {t, tct} from 'app/locale'; -import SentryTypes from 'app/sentryTypes'; +import ExternalLink from 'app/components/links/externalLink'; import { AWS_REGIONS, - DEBUG_SOURCE_LAYOUTS, DEBUG_SOURCE_CASINGS, + DEBUG_SOURCE_LAYOUTS, getDebugSourceName, } from 'app/data/debugFileSources'; -import ExternalLink from 'app/components/links/externalLink'; -import Form from 'app/views/settings/components/forms/form'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; +import Form from 'app/views/settings/components/forms/form'; function objectToChoices(obj) { return Object.entries(obj).map(([key, value]) => [key, t(value)]); diff --git a/src/sentry/static/sentry/app/components/modals/diffModal.tsx b/src/sentry/static/sentry/app/components/modals/diffModal.tsx index 75655d8d85720f..bca8cd1434c94c 100644 --- a/src/sentry/static/sentry/app/components/modals/diffModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/diffModal.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {css} from '@emotion/core'; -import IssueDiff from 'app/components/issueDiff'; import {ModalRenderProps} from 'app/actionCreators/modal'; +import IssueDiff from 'app/components/issueDiff'; type Props = ModalRenderProps & React.ComponentProps<typeof IssueDiff>; diff --git a/src/sentry/static/sentry/app/components/modals/featureTourModal.tsx b/src/sentry/static/sentry/app/components/modals/featureTourModal.tsx index 8d2be43bf7ee4c..f1234440b54c69 100644 --- a/src/sentry/static/sentry/app/components/modals/featureTourModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/featureTourModal.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import {openModal, ModalRenderProps} from 'app/actionCreators/modal'; +import {ModalRenderProps, openModal} from 'app/actionCreators/modal'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; -import {t} from 'app/locale'; import {IconClose} from 'app/icons'; -import {callIfFunction} from 'app/utils/callIfFunction'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {callIfFunction} from 'app/utils/callIfFunction'; export type TourStep = { title: string; diff --git a/src/sentry/static/sentry/app/components/modals/helpSearchModal.tsx b/src/sentry/static/sentry/app/components/modals/helpSearchModal.tsx index 6d739290b72f7b..aeb1759bd97447 100644 --- a/src/sentry/static/sentry/app/components/modals/helpSearchModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/helpSearchModal.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import styled from '@emotion/styled'; import {ClassNames, css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import theme from 'app/utils/theme'; import {ModalRenderProps} from 'app/actionCreators/modal'; import HelpSearch from 'app/components/helpSearch'; import Hook from 'app/components/hook'; -import {Organization} from 'app/types'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Organization} from 'app/types'; +import theme from 'app/utils/theme'; type Props = ModalRenderProps & { organization: Organization; diff --git a/src/sentry/static/sentry/app/components/modals/inviteMembersModal/index.tsx b/src/sentry/static/sentry/app/components/modals/inviteMembersModal/index.tsx index 66709a7e81e50e..7268923e6e0c61 100644 --- a/src/sentry/static/sentry/app/components/modals/inviteMembersModal/index.tsx +++ b/src/sentry/static/sentry/app/components/modals/inviteMembersModal/index.tsx @@ -1,25 +1,25 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {t, tn, tct} from 'app/locale'; -import {MEMBER_ROLES} from 'app/constants'; import {ModalRenderProps} from 'app/actionCreators/modal'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {uniqueId} from 'app/utils/guid'; -import {IconCheckmark, IconWarning, IconAdd} from 'app/icons'; +import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; import HookOrDefault from 'app/components/hookOrDefault'; +import LoadingIndicator from 'app/components/loadingIndicator'; import QuestionTooltip from 'app/components/questionTooltip'; +import {MEMBER_ROLES} from 'app/constants'; +import {IconAdd, IconCheckmark, IconWarning} from 'app/icons'; +import {t, tct, tn} from 'app/locale'; import space from 'app/styles/space'; -import AsyncComponent from 'app/components/asyncComponent'; import {Organization, Team} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {uniqueId} from 'app/utils/guid'; import withLatestContext from 'app/utils/withLatestContext'; import withTeams from 'app/utils/withTeams'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import {InviteRow, InviteStatus, NormalizedInvite} from './types'; import InviteRowControl from './inviteRowControl'; +import {InviteRow, InviteStatus, NormalizedInvite} from './types'; type Props = AsyncComponent['props'] & ModalRenderProps & { diff --git a/src/sentry/static/sentry/app/components/modals/inviteMembersModal/inviteRowControl.tsx b/src/sentry/static/sentry/app/components/modals/inviteMembersModal/inviteRowControl.tsx index 4dfcd5c7774041..5f76b663cfa562 100644 --- a/src/sentry/static/sentry/app/components/modals/inviteMembersModal/inviteRowControl.tsx +++ b/src/sentry/static/sentry/app/components/modals/inviteMembersModal/inviteRowControl.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import {t} from 'app/locale'; -import {Team, MemberRole} from 'app/types'; import Button from 'app/components/button'; import SelectControl from 'app/components/forms/selectControl'; import RoleSelectControl from 'app/components/roleSelectControl'; import {IconClose} from 'app/icons/iconClose'; +import {t} from 'app/locale'; +import {MemberRole, Team} from 'app/types'; import renderEmailValue from './renderEmailValue'; import {InviteStatus} from './types'; diff --git a/src/sentry/static/sentry/app/components/modals/inviteMembersModal/renderEmailValue.tsx b/src/sentry/static/sentry/app/components/modals/inviteMembersModal/renderEmailValue.tsx index 9a7e1320156a16..c36b1dfec0c138 100644 --- a/src/sentry/static/sentry/app/components/modals/inviteMembersModal/renderEmailValue.tsx +++ b/src/sentry/static/sentry/app/components/modals/inviteMembersModal/renderEmailValue.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import styled from '@emotion/styled'; -import {css} from '@emotion/core'; import {Value} from 'react-select-legacy'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import Tooltip from 'app/components/tooltip'; import {IconCheckmark, IconWarning} from 'app/icons'; import space from 'app/styles/space'; -import Tooltip from 'app/components/tooltip'; -import LoadingIndicator from 'app/components/loadingIndicator'; import {InviteStatus} from './types'; diff --git a/src/sentry/static/sentry/app/components/modals/recoveryOptionsModal.jsx b/src/sentry/static/sentry/app/components/modals/recoveryOptionsModal.jsx index e85ad952f3b773..6f273b1f9a0f74 100644 --- a/src/sentry/static/sentry/app/components/modals/recoveryOptionsModal.jsx +++ b/src/sentry/static/sentry/app/components/modals/recoveryOptionsModal.jsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import Alert from 'app/components/alert'; import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import TextBlock from 'app/views/settings/components/text/textBlock'; class RecoveryOptionsModal extends AsyncComponent { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/modals/redirectToProject.tsx b/src/sentry/static/sentry/app/components/modals/redirectToProject.tsx index b8a46c477fec78..f83685bc396248 100644 --- a/src/sentry/static/sentry/app/components/modals/redirectToProject.tsx +++ b/src/sentry/static/sentry/app/components/modals/redirectToProject.tsx @@ -1,12 +1,12 @@ -import * as ReactRouter from 'react-router'; import React from 'react'; +import * as ReactRouter from 'react-router'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; +import {ModalRenderProps} from 'app/actionCreators/modal'; import Button from 'app/components/button'; import Text from 'app/components/text'; +import {t, tct} from 'app/locale'; import recreateRoute from 'app/utils/recreateRoute'; -import {ModalRenderProps} from 'app/actionCreators/modal'; type Props = ModalRenderProps & ReactRouter.WithRouterProps & { diff --git a/src/sentry/static/sentry/app/components/modals/sentryAppDetailsModal.tsx b/src/sentry/static/sentry/app/components/modals/sentryAppDetailsModal.tsx index 2e2f92b8cdb185..c8f4dbf57c5258 100644 --- a/src/sentry/static/sentry/app/components/modals/sentryAppDetailsModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/sentryAppDetailsModal.tsx @@ -2,22 +2,22 @@ import React from 'react'; import styled from '@emotion/styled'; import Access from 'app/components/acl/access'; +import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; +import CircleIndicator from 'app/components/circleIndicator'; +import Tag from 'app/components/tagDeprecated'; +import {IconFlag} from 'app/icons'; +import {t, tct} from 'app/locale'; import PluginIcon from 'app/plugins/components/pluginIcon'; import space from 'app/styles/space'; -import {t, tct} from 'app/locale'; -import AsyncComponent from 'app/components/asyncComponent'; -import marked, {singleLineRenderer} from 'app/utils/marked'; -import {IconFlag} from 'app/icons'; -import Tag from 'app/components/tagDeprecated'; +import {IntegrationFeature, Organization, SentryApp} from 'app/types'; import {toPermissions} from 'app/utils/consolidatedScopes'; -import CircleIndicator from 'app/components/circleIndicator'; -import {IntegrationFeature, SentryApp, Organization} from 'app/types'; -import {recordInteraction} from 'app/utils/recordSentryAppInteraction'; import { - trackIntegrationEvent, getIntegrationFeatureGate, + trackIntegrationEvent, } from 'app/utils/integrationUtil'; +import marked, {singleLineRenderer} from 'app/utils/marked'; +import {recordInteraction} from 'app/utils/recordSentryAppInteraction'; type Props = { closeModal: () => void; diff --git a/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx b/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx index badc69f43af968..0e70a3a1319228 100644 --- a/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/sentryAppPublishRequestModal.tsx @@ -1,17 +1,17 @@ +import React from 'react'; import {Body, Header} from 'react-bootstrap/lib/Modal'; import styled from '@emotion/styled'; -import PropTypes from 'prop-types'; -import React from 'react'; import intersection from 'lodash/intersection'; +import PropTypes from 'prop-types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {SentryApp, Scope} from 'app/types'; +import {PermissionChoice, SENTRY_APP_PERMISSIONS} from 'app/constants'; import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Scope, SentryApp} from 'app/types'; import Form from 'app/views/settings/components/forms/form'; -import FormModel from 'app/views/settings/components/forms/model'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import space from 'app/styles/space'; -import {SENTRY_APP_PERMISSIONS, PermissionChoice} from 'app/constants'; +import FormModel from 'app/views/settings/components/forms/model'; /** * Given an array of scopes, return the choices the user has picked for each option diff --git a/src/sentry/static/sentry/app/components/modals/sudoModal.tsx b/src/sentry/static/sentry/app/components/modals/sudoModal.tsx index 34e4c84f381c0e..cdf3bb08fcb3c9 100644 --- a/src/sentry/static/sentry/app/components/modals/sudoModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/sudoModal.tsx @@ -1,21 +1,21 @@ -import {withRouter} from 'react-router'; import React from 'react'; +import {withRouter} from 'react-router'; import {WithRouterProps} from 'react-router/lib/withRouter'; import styled from '@emotion/styled'; import {ModalRenderProps} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import Alert from 'app/components/alert'; -import withApi from 'app/utils/withApi'; import Button from 'app/components/button'; +import U2fContainer from 'app/components/u2f/u2fContainer'; +import {IconFlag} from 'app/icons'; +import {t} from 'app/locale'; import ConfigStore from 'app/stores/configStore'; +import space from 'app/styles/space'; +import withApi from 'app/utils/withApi'; import Form from 'app/views/settings/components/forms/form'; import InputField from 'app/views/settings/components/forms/inputField'; -import {IconFlag} from 'app/icons'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import U2fContainer from 'app/components/u2f/u2fContainer'; -import space from 'app/styles/space'; -import {Client} from 'app/api'; type OnTapProps = NonNullable<React.ComponentProps<typeof U2fContainer>['onTap']>; diff --git a/src/sentry/static/sentry/app/components/modals/teamAccessRequestModal.tsx b/src/sentry/static/sentry/app/components/modals/teamAccessRequestModal.tsx index 337af8e35602ce..b5c619ee4a9a46 100644 --- a/src/sentry/static/sentry/app/components/modals/teamAccessRequestModal.tsx +++ b/src/sentry/static/sentry/app/components/modals/teamAccessRequestModal.tsx @@ -2,10 +2,10 @@ import React from 'react'; import styled from '@emotion/styled'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {Client} from 'app/api'; import {ModalRenderProps, TeamAccessRequestModalOptions} from 'app/actionCreators/modal'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import Button from 'app/components/button'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; diff --git a/src/sentry/static/sentry/app/components/mutedBox.tsx b/src/sentry/static/sentry/app/components/mutedBox.tsx index 553d62ad58a87e..b0e59e6973be69 100644 --- a/src/sentry/static/sentry/app/components/mutedBox.tsx +++ b/src/sentry/static/sentry/app/components/mutedBox.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {BannerContainer, BannerSummary} from 'app/components/events/styles'; import DateTime from 'app/components/dateTime'; import Duration from 'app/components/duration'; +import {BannerContainer, BannerSummary} from 'app/components/events/styles'; import {IconMute} from 'app/icons'; import {t} from 'app/locale'; import {ResolutionStatusDetails} from 'app/types'; diff --git a/src/sentry/static/sentry/app/components/narrowLayout.tsx b/src/sentry/static/sentry/app/components/narrowLayout.tsx index cab90d09c5feee..653c236d1fdc98 100644 --- a/src/sentry/static/sentry/app/components/narrowLayout.tsx +++ b/src/sentry/static/sentry/app/components/narrowLayout.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import {logout} from 'app/actionCreators/account'; import {Client} from 'app/api'; import {IconSentry} from 'app/icons'; +import {t} from 'app/locale'; type Props = { showLogout?: boolean; diff --git a/src/sentry/static/sentry/app/components/navTabs.tsx b/src/sentry/static/sentry/app/components/navTabs.tsx index 25df6c8e0f3f38..b22784db61c639 100644 --- a/src/sentry/static/sentry/app/components/navTabs.tsx +++ b/src/sentry/static/sentry/app/components/navTabs.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import PropTypes from 'prop-types'; import classnames from 'classnames'; +import PropTypes from 'prop-types'; type Props = { underlined?: boolean; diff --git a/src/sentry/static/sentry/app/components/navigationButtonGroup.tsx b/src/sentry/static/sentry/app/components/navigationButtonGroup.tsx index 52ebf638ded923..41e2dcd8254cea 100644 --- a/src/sentry/static/sentry/app/components/navigationButtonGroup.tsx +++ b/src/sentry/static/sentry/app/components/navigationButtonGroup.tsx @@ -1,10 +1,10 @@ import React from 'react'; import {Location} from 'history'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; -import {IconPrevious, IconNext} from 'app/icons'; +import {IconNext, IconPrevious} from 'app/icons'; +import {t} from 'app/locale'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/components/noProjectMessage.tsx b/src/sentry/static/sentry/app/components/noProjectMessage.tsx index f896cf047ddaf2..7ee7f1a2b403da 100644 --- a/src/sentry/static/sentry/app/components/noProjectMessage.tsx +++ b/src/sentry/static/sentry/app/components/noProjectMessage.tsx @@ -2,14 +2,14 @@ import React from 'react'; import styled from '@emotion/styled'; import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {LightWeightOrganization, Organization, Project} from 'app/types'; import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import PageHeading from 'app/components/pageHeading'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import space from 'app/styles/space'; import ConfigStore from 'app/stores/configStore'; -import ButtonBar from 'app/components/buttonBar'; +import space from 'app/styles/space'; +import {LightWeightOrganization, Organization, Project} from 'app/types'; /* TODO: replace with I/O when finished */ import img from '../../images/spot/hair-on-fire.svg'; diff --git a/src/sentry/static/sentry/app/components/onboardingWizard/progressHeader.tsx b/src/sentry/static/sentry/app/components/onboardingWizard/progressHeader.tsx index 7b87787666396f..2ac246c4ffabbb 100644 --- a/src/sentry/static/sentry/app/components/onboardingWizard/progressHeader.tsx +++ b/src/sentry/static/sentry/app/components/onboardingWizard/progressHeader.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {OnboardingTaskStatus, OnboardingTaskDescriptor} from 'app/types'; -import {t} from 'app/locale'; -import theme from 'app/utils/theme'; import ProgressRing from 'app/components/progressRing'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {OnboardingTaskDescriptor, OnboardingTaskStatus} from 'app/types'; +import theme from 'app/utils/theme'; type Props = { allTasks: OnboardingTaskDescriptor[]; diff --git a/src/sentry/static/sentry/app/components/onboardingWizard/sidebar.tsx b/src/sentry/static/sentry/app/components/onboardingWizard/sidebar.tsx index 62292a7c18a9b3..ca2eb678cf5674 100644 --- a/src/sentry/static/sentry/app/components/onboardingWizard/sidebar.tsx +++ b/src/sentry/static/sentry/app/components/onboardingWizard/sidebar.tsx @@ -1,24 +1,24 @@ import React from 'react'; import styled from '@emotion/styled'; -import {motion, AnimatePresence} from 'framer-motion'; +import {AnimatePresence, motion} from 'framer-motion'; -import withApi from 'app/utils/withApi'; -import withOrganization from 'app/utils/withOrganization'; -import {Client} from 'app/api'; -import {Organization, OnboardingTask, OnboardingTaskKey} from 'app/types'; import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; -import {IconLightning, IconLock, IconCheckmark} from 'app/icons'; -import Tooltip from 'app/components/tooltip'; +import {Client} from 'app/api'; import SidebarPanel from 'app/components/sidebar/sidebarPanel'; import {CommonSidebarProps} from 'app/components/sidebar/types'; +import Tooltip from 'app/components/tooltip'; +import {IconCheckmark, IconLightning, IconLock} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {OnboardingTask, OnboardingTaskKey, Organization} from 'app/types'; import testableTransition from 'app/utils/testableTransition'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; -import {findUpcomingTasks, findCompleteTasks, findActiveTasks, taskIsDone} from './utils'; -import {getMergedTasks} from './taskConfig'; -import Task from './task'; import ProgressHeader from './progressHeader'; +import Task from './task'; +import {getMergedTasks} from './taskConfig'; +import {findActiveTasks, findCompleteTasks, findUpcomingTasks, taskIsDone} from './utils'; type Props = Pick<CommonSidebarProps, 'orientation' | 'collapsed'> & { api: Client; diff --git a/src/sentry/static/sentry/app/components/onboardingWizard/skipConfirm.tsx b/src/sentry/static/sentry/app/components/onboardingWizard/skipConfirm.tsx index d05c327754f4d0..0e05a438968cf4 100644 --- a/src/sentry/static/sentry/app/components/onboardingWizard/skipConfirm.tsx +++ b/src/sentry/static/sentry/app/components/onboardingWizard/skipConfirm.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import Button from 'app/components/button'; -import space from 'app/styles/space'; -import {fadeIn} from 'app/styles/animations'; import ButtonBar from 'app/components/buttonBar'; import HookOrDefault from 'app/components/hookOrDefault'; +import {t} from 'app/locale'; +import {fadeIn} from 'app/styles/animations'; +import space from 'app/styles/space'; type Props = { children: (opts: {skip: (e: React.MouseEvent) => void}) => React.ReactNode; diff --git a/src/sentry/static/sentry/app/components/onboardingWizard/task.tsx b/src/sentry/static/sentry/app/components/onboardingWizard/task.tsx index a0df03b1c8c60c..46497bf930556c 100644 --- a/src/sentry/static/sentry/app/components/onboardingWizard/task.tsx +++ b/src/sentry/static/sentry/app/components/onboardingWizard/task.tsx @@ -1,25 +1,25 @@ import React from 'react'; -import styled from '@emotion/styled'; import * as ReactRouter from 'react-router'; +import styled from '@emotion/styled'; import {motion} from 'framer-motion'; import moment from 'moment'; -import {tct, t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import withOrganization from 'app/utils/withOrganization'; -import space from 'app/styles/space'; -import {OnboardingTask, Organization, OnboardingTaskKey, AvatarUser} from 'app/types'; import {navigateTo} from 'app/actionCreators/navigation'; -import Card from 'app/components/card'; -import Tooltip from 'app/components/tooltip'; -import Button from 'app/components/button'; -import {IconLock, IconCheckmark, IconClose, IconEvent} from 'app/icons'; import Avatar from 'app/components/avatar'; +import Button from 'app/components/button'; +import Card from 'app/components/card'; import LetterAvatar from 'app/components/letterAvatar'; +import Tooltip from 'app/components/tooltip'; +import {IconCheckmark, IconClose, IconEvent, IconLock} from 'app/icons'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {AvatarUser, OnboardingTask, OnboardingTaskKey, Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import testableTransition from 'app/utils/testableTransition'; +import withOrganization from 'app/utils/withOrganization'; -import {taskIsDone} from './utils'; import SkipConfirm from './skipConfirm'; +import {taskIsDone} from './utils'; const recordAnalytics = ( task: OnboardingTask, diff --git a/src/sentry/static/sentry/app/components/onboardingWizard/taskConfig.tsx b/src/sentry/static/sentry/app/components/onboardingWizard/taskConfig.tsx index 1cae2d1fcbd8f9..b3570f7aee16a0 100644 --- a/src/sentry/static/sentry/app/components/onboardingWizard/taskConfig.tsx +++ b/src/sentry/static/sentry/app/components/onboardingWizard/taskConfig.tsx @@ -1,24 +1,24 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import {openInviteMembersModal} from 'app/actionCreators/modal'; +import {Client} from 'app/api'; +import {taskIsDone} from 'app/components/onboardingWizard/utils'; import {sourceMaps} from 'app/data/platformCategories'; +import {t} from 'app/locale'; +import pulsingIndicatorStyles from 'app/styles/pulsingIndicator'; +import space from 'app/styles/space'; import { - Organization, + OnboardingSupplementComponentProps, + OnboardingTask, OnboardingTaskDescriptor, OnboardingTaskKey, - OnboardingTask, + Organization, Project, - OnboardingSupplementComponentProps, } from 'app/types'; +import EventWaiter from 'app/utils/eventWaiter'; import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; import withProjects from 'app/utils/withProjects'; -import EventWaiter from 'app/utils/eventWaiter'; -import {taskIsDone} from 'app/components/onboardingWizard/utils'; -import pulsingIndicatorStyles from 'app/styles/pulsingIndicator'; -import space from 'app/styles/space'; function hasPlatformWithSourceMaps(organization: Organization): boolean { const projects = organization?.projects; diff --git a/src/sentry/static/sentry/app/components/organizations/backToIssues.tsx b/src/sentry/static/sentry/app/components/organizations/backToIssues.tsx index 097dd2c5b0c324..4ffbf4dedb9ee1 100644 --- a/src/sentry/static/sentry/app/components/organizations/backToIssues.tsx +++ b/src/sentry/static/sentry/app/components/organizations/backToIssues.tsx @@ -1,5 +1,5 @@ -import styled from '@emotion/styled'; import {Link} from 'react-router'; +import styled from '@emotion/styled'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/globalSelectionHeader.tsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/globalSelectionHeader.tsx index 65425c6628476b..2aaaa91c1b29e5 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/globalSelectionHeader.tsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/globalSelectionHeader.tsx @@ -1,20 +1,9 @@ -import {WithRouterProps} from 'react-router/lib/withRouter'; -import PropTypes from 'prop-types'; import React from 'react'; -import debounce from 'lodash/debounce'; +import {WithRouterProps} from 'react-router/lib/withRouter'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; +import PropTypes from 'prop-types'; -import {DEFAULT_STATS_PERIOD} from 'app/constants'; -import { - GlobalSelection, - Environment, - Organization, - MinimalProject, - Project, -} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import {t} from 'app/locale'; import { updateDateTime, updateEnvironments, @@ -23,14 +12,25 @@ import { import BackToIssues from 'app/components/organizations/backToIssues'; import HeaderItemPosition from 'app/components/organizations/headerItemPosition'; import HeaderSeparator from 'app/components/organizations/headerSeparator'; -import {IconArrow} from 'app/icons'; import MultipleEnvironmentSelector from 'app/components/organizations/multipleEnvironmentSelector'; import MultipleProjectSelector from 'app/components/organizations/multipleProjectSelector'; -import Projects from 'app/utils/projects'; -import SentryTypes from 'app/sentryTypes'; import TimeRangeSelector from 'app/components/organizations/timeRangeSelector'; import Tooltip from 'app/components/tooltip'; +import {DEFAULT_STATS_PERIOD} from 'app/constants'; +import {IconArrow} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {PageContent} from 'app/styles/organization'; import space from 'app/styles/space'; +import { + Environment, + GlobalSelection, + MinimalProject, + Organization, + Project, +} from 'app/types'; +import {callIfFunction} from 'app/utils/callIfFunction'; +import Projects from 'app/utils/projects'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import Header from './header'; diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.tsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.tsx index ec9d0a3f199574..43dc1c6f54c45f 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.tsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/index.tsx @@ -1,9 +1,9 @@ -import * as ReactRouter from 'react-router'; import React from 'react'; +import * as ReactRouter from 'react-router'; import partition from 'lodash/partition'; -import {Organization, Project} from 'app/types'; import ConfigStore from 'app/stores/configStore'; +import {Organization, Project} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; import withProjectsSpecified from 'app/utils/withProjectsSpecified'; diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/initializeGlobalSelectionHeader.tsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/initializeGlobalSelectionHeader.tsx index 04c9b4ebb0c147..49d2a312fbb784 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/initializeGlobalSelectionHeader.tsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/initializeGlobalSelectionHeader.tsx @@ -2,16 +2,16 @@ import React from 'react'; import * as ReactRouter from 'react-router'; import isEqual from 'lodash/isEqual'; -import {DATE_TIME_KEYS} from 'app/constants/globalSelectionHeader'; import { initializeUrlState, - updateProjects, - updateEnvironments, updateDateTime, + updateEnvironments, + updateProjects, } from 'app/actionCreators/globalSelection'; +import {DATE_TIME_KEYS} from 'app/constants/globalSelectionHeader'; -import {getStateFromQuery} from './utils'; import GlobalSelectionHeader from './globalSelectionHeader'; +import {getStateFromQuery} from './utils'; const getDateObjectFromQuery = query => Object.fromEntries( diff --git a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.tsx b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.tsx index 81324623882a14..5d20a8f5be753f 100644 --- a/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.tsx +++ b/src/sentry/static/sentry/app/components/organizations/globalSelectionHeader/utils.tsx @@ -3,8 +3,8 @@ import identity from 'lodash/identity'; import pick from 'lodash/pick'; import pickBy from 'lodash/pickBy'; -import {GlobalSelection} from 'app/types'; import {DATE_TIME_KEYS, URL_PARAM} from 'app/constants/globalSelectionHeader'; +import {GlobalSelection} from 'app/types'; import {defined} from 'app/utils'; import {getUtcToLocalDateObject} from 'app/utils/dates'; diff --git a/src/sentry/static/sentry/app/components/organizations/headerItem.tsx b/src/sentry/static/sentry/app/components/organizations/headerItem.tsx index a7c7864cf20f4d..d61d0350cbbc18 100644 --- a/src/sentry/static/sentry/app/components/organizations/headerItem.tsx +++ b/src/sentry/static/sentry/app/components/organizations/headerItem.tsx @@ -1,14 +1,14 @@ -import {Link} from 'react-router'; import React from 'react'; -import PropTypes from 'prop-types'; +import {Link} from 'react-router'; import isPropValid from '@emotion/is-prop-valid'; import styled from '@emotion/styled'; import omit from 'lodash/omit'; +import PropTypes from 'prop-types'; -import {IconClose, IconLock, IconChevron, IconInfo, IconSettings} from 'app/icons'; import Tooltip from 'app/components/tooltip'; -import space from 'app/styles/space'; +import {IconChevron, IconClose, IconInfo, IconLock, IconSettings} from 'app/icons'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; type DefaultProps = { allowClear: boolean; diff --git a/src/sentry/static/sentry/app/components/organizations/headerItemPosition.tsx b/src/sentry/static/sentry/app/components/organizations/headerItemPosition.tsx index a1f95e40eb953e..8e9206b7a3b666 100644 --- a/src/sentry/static/sentry/app/components/organizations/headerItemPosition.tsx +++ b/src/sentry/static/sentry/app/components/organizations/headerItemPosition.tsx @@ -1,9 +1,9 @@ import {css} from '@emotion/core'; import styled from '@emotion/styled'; -import {Theme} from 'app/utils/theme'; import {AutoCompleteRoot} from 'app/components/dropdownAutoComplete/menu'; import {TimeRangeRoot} from 'app/components/organizations/timeRangeSelector/index'; +import {Theme} from 'app/utils/theme'; type Props = { isSpacer?: boolean; diff --git a/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.tsx b/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.tsx index 7ce17416e3b48c..e2791b1030aea9 100644 --- a/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.tsx +++ b/src/sentry/static/sentry/app/components/organizations/multipleEnvironmentSelector.tsx @@ -1,26 +1,26 @@ -import {ClassNames} from '@emotion/core'; -import PropTypes from 'prop-types'; import React from 'react'; +import {ClassNames} from '@emotion/core'; import styled from '@emotion/styled'; import uniq from 'lodash/uniq'; +import PropTypes from 'prop-types'; -import {analytics} from 'app/utils/analytics'; -import ConfigStore from 'app/stores/configStore'; -import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; -import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; +import {MenuFooterChildProps} from 'app/components/dropdownAutoComplete/menu'; +import {Item} from 'app/components/dropdownAutoComplete/types'; import GlobalSelectionHeaderRow from 'app/components/globalSelectionHeaderRow'; -import HeaderItem from 'app/components/organizations/headerItem'; import Highlight from 'app/components/highlight'; +import HeaderItem from 'app/components/organizations/headerItem'; import MultipleSelectorSubmitRow from 'app/components/organizations/multipleSelectorSubmitRow'; -import theme from 'app/utils/theme'; -import withApi from 'app/utils/withApi'; +import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; import {IconWindow} from 'app/icons'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import {Organization, Project} from 'app/types'; -import {Client} from 'app/api'; -import {MenuFooterChildProps} from 'app/components/dropdownAutoComplete/menu'; -import {Item} from 'app/components/dropdownAutoComplete/types'; +import {analytics} from 'app/utils/analytics'; +import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; +import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; type DefaultProps = { /** diff --git a/src/sentry/static/sentry/app/components/organizations/multipleProjectSelector.jsx b/src/sentry/static/sentry/app/components/organizations/multipleProjectSelector.jsx index f0ebecba6a8322..7388610238d292 100644 --- a/src/sentry/static/sentry/app/components/organizations/multipleProjectSelector.jsx +++ b/src/sentry/static/sentry/app/components/organizations/multipleProjectSelector.jsx @@ -1,21 +1,21 @@ -import {ClassNames} from '@emotion/core'; -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; import {Link} from 'react-router'; +import {ClassNames} from '@emotion/core'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import SentryTypes from 'app/sentryTypes'; -import {analytics} from 'app/utils/analytics'; -import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; -import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; -import {t, tct} from 'app/locale'; import Button from 'app/components/button'; -import Tooltip from 'app/components/tooltip'; import HeaderItem from 'app/components/organizations/headerItem'; -import {growIn} from 'app/styles/animations'; -import space from 'app/styles/space'; import PlatformList from 'app/components/platformList'; +import Tooltip from 'app/components/tooltip'; +import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; import {IconProject} from 'app/icons'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {growIn} from 'app/styles/animations'; +import space from 'app/styles/space'; +import {analytics} from 'app/utils/analytics'; +import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; import ProjectSelector from './projectSelector'; diff --git a/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx b/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx index f81890b9877489..fde32127ecb691 100644 --- a/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx +++ b/src/sentry/static/sentry/app/components/organizations/multipleSelectorSubmitRow.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import Button from 'app/components/button'; +import {t} from 'app/locale'; import {growIn} from 'app/styles/animations'; import space from 'app/styles/space'; -import {t} from 'app/locale'; type Props = { onSubmit: () => void; diff --git a/src/sentry/static/sentry/app/components/organizations/projectSelector/index.tsx b/src/sentry/static/sentry/app/components/organizations/projectSelector/index.tsx index 6ed0d2482546b3..960263c4abaad5 100644 --- a/src/sentry/static/sentry/app/components/organizations/projectSelector/index.tsx +++ b/src/sentry/static/sentry/app/components/organizations/projectSelector/index.tsx @@ -2,13 +2,13 @@ import React from 'react'; import styled from '@emotion/styled'; import sortBy from 'lodash/sortBy'; +import Button from 'app/components/button'; +import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; +import {IconAdd} from 'app/icons'; import {t} from 'app/locale'; import space from 'app/styles/space'; import {Organization, Project} from 'app/types'; -import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; -import Button from 'app/components/button'; import theme from 'app/utils/theme'; -import {IconAdd} from 'app/icons'; import SelectorItem from './selectorItem'; diff --git a/src/sentry/static/sentry/app/components/organizations/projectSelector/selectorItem.tsx b/src/sentry/static/sentry/app/components/organizations/projectSelector/selectorItem.tsx index 8c4e7e0b44f2da..96e851584dfb23 100644 --- a/src/sentry/static/sentry/app/components/organizations/projectSelector/selectorItem.tsx +++ b/src/sentry/static/sentry/app/components/organizations/projectSelector/selectorItem.tsx @@ -1,21 +1,21 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {t} from 'app/locale'; import Feature from 'app/components/acl/feature'; import FeatureDisabled from 'app/components/acl/featureDisabled'; -import {Project, Organization} from 'app/types'; -import {analytics} from 'app/utils/analytics'; -import {alertHighlight, pulse} from 'app/styles/animations'; -import BookmarkStar from 'app/components/projects/bookmarkStar'; import GlobalSelectionHeaderRow from 'app/components/globalSelectionHeaderRow'; import Highlight from 'app/components/highlight'; +import Hovercard from 'app/components/hovercard'; import IdBadge from 'app/components/idBadge'; -import space from 'app/styles/space'; -import {IconSettings} from 'app/icons'; import Link from 'app/components/links/link'; -import Hovercard from 'app/components/hovercard'; +import BookmarkStar from 'app/components/projects/bookmarkStar'; +import {IconSettings} from 'app/icons'; +import {t} from 'app/locale'; +import {alertHighlight, pulse} from 'app/styles/animations'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {analytics} from 'app/utils/analytics'; const defaultProps = { multi: false, diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx index 43e01733ee71d8..8c72c0dd0b78a6 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/index.jsx @@ -1,12 +1,18 @@ import 'react-date-range/dist/styles.css'; import 'react-date-range/dist/theme/default.css'; -import {DateRangePicker} from 'react-date-range'; -import PropTypes from 'prop-types'; import React from 'react'; -import moment from 'moment'; +import {DateRangePicker} from 'react-date-range'; import styled from '@emotion/styled'; +import moment from 'moment'; +import PropTypes from 'prop-types'; +import Checkbox from 'app/components/checkbox'; +import TimePicker from 'app/components/organizations/timeRangeSelector/timePicker'; +import {MAX_PICKABLE_DAYS} from 'app/constants'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; import {analytics} from 'app/utils/analytics'; import { getEndOfDay, @@ -14,13 +20,7 @@ import { isValidTime, setDateToTime, } from 'app/utils/dates'; -import {MAX_PICKABLE_DAYS} from 'app/constants'; -import {t} from 'app/locale'; -import Checkbox from 'app/components/checkbox'; -import SentryTypes from 'app/sentryTypes'; -import TimePicker from 'app/components/organizations/timeRangeSelector/timePicker'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; -import space from 'app/styles/space'; import theme from 'app/utils/theme'; class DateRange extends React.Component { diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx index 3577734f44b9d7..8537f1dba14906 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {DEFAULT_RELATIVE_PERIODS} from 'app/constants'; diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItem.tsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItem.tsx index 6536cbd231477b..7e47d920b2277b 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItem.tsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItem.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItems.tsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItems.tsx index ceb369eafd1cb7..05ae77d24b3d82 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItems.tsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateRange/selectorItems.tsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import RelativeSelector from 'app/components/organizations/timeRangeSelector/dateRange/relativeSelector'; import SelectorItem from 'app/components/organizations/timeRangeSelector/dateRange/selectorItem'; +import {t} from 'app/locale'; type Props = { handleSelectRelative: (value: string, e: React.MouseEvent) => void; diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateSummary.tsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateSummary.tsx index 0842bc85d14da6..d93bc00d29d40e 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateSummary.tsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/dateSummary.tsx @@ -5,9 +5,9 @@ import React from 'react'; import styled from '@emotion/styled'; import moment from 'moment'; -import {DEFAULT_DAY_END_TIME, DEFAULT_DAY_START_TIME} from 'app/utils/dates'; import {t} from 'app/locale'; import space from 'app/styles/space'; +import {DEFAULT_DAY_END_TIME, DEFAULT_DAY_START_TIME} from 'app/utils/dates'; type Props = { start: moment.MomentInput; diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/index.jsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/index.jsx index 22080a2803314a..77892313aef807 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/index.jsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/index.jsx @@ -1,11 +1,22 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import moment from 'moment-timezone'; import styled from '@emotion/styled'; +import moment from 'moment-timezone'; +import PropTypes from 'prop-types'; +import DropdownMenu from 'app/components/dropdownMenu'; +import HookOrDefault from 'app/components/hookOrDefault'; +import HeaderItem from 'app/components/organizations/headerItem'; +import MultipleSelectorSubmitRow from 'app/components/organizations/multipleSelectorSubmitRow'; +import DateRange from 'app/components/organizations/timeRangeSelector/dateRange'; +import SelectorItems from 'app/components/organizations/timeRangeSelector/dateRange/selectorItems'; +import DateSummary from 'app/components/organizations/timeRangeSelector/dateSummary'; +import {getRelativeSummary} from 'app/components/organizations/timeRangeSelector/utils'; import {DEFAULT_STATS_PERIOD} from 'app/constants'; -import {analytics} from 'app/utils/analytics'; +import {IconCalendar} from 'app/icons'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; import {defined} from 'app/utils'; +import {analytics} from 'app/utils/analytics'; import { getLocalToSystem, getPeriodAgo, @@ -13,19 +24,8 @@ import { getUtcToSystem, parsePeriodToHours, } from 'app/utils/dates'; -import {getRelativeSummary} from 'app/components/organizations/timeRangeSelector/utils'; -import DateRange from 'app/components/organizations/timeRangeSelector/dateRange'; -import DateSummary from 'app/components/organizations/timeRangeSelector/dateSummary'; -import DropdownMenu from 'app/components/dropdownMenu'; -import HeaderItem from 'app/components/organizations/headerItem'; -import HookOrDefault from 'app/components/hookOrDefault'; -import MultipleSelectorSubmitRow from 'app/components/organizations/multipleSelectorSubmitRow'; -import SelectorItems from 'app/components/organizations/timeRangeSelector/dateRange/selectorItems'; -import SentryTypes from 'app/sentryTypes'; -import space from 'app/styles/space'; import getDynamicText from 'app/utils/getDynamicText'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; -import {IconCalendar} from 'app/icons'; // Strips timezone from local date, creates a new moment date object with timezone // Then returns as a Date object diff --git a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/timePicker.tsx b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/timePicker.tsx index f21ee56396dc4c..725bad2603390a 100644 --- a/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/timePicker.tsx +++ b/src/sentry/static/sentry/app/components/organizations/timeRangeSelector/timePicker.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import classNames from 'classnames'; import styled from '@emotion/styled'; +import classNames from 'classnames'; type Props = { onChangeStart: (event: React.ChangeEvent<HTMLInputElement>) => void; diff --git a/src/sentry/static/sentry/app/components/pageHeading.tsx b/src/sentry/static/sentry/app/components/pageHeading.tsx index 4e0bb7468a115a..d94a2492a2c15b 100644 --- a/src/sentry/static/sentry/app/components/pageHeading.tsx +++ b/src/sentry/static/sentry/app/components/pageHeading.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/pagination.tsx b/src/sentry/static/sentry/app/components/pagination.tsx index e558f9f9d0c54c..0526ab8c3a9456 100644 --- a/src/sentry/static/sentry/app/components/pagination.tsx +++ b/src/sentry/static/sentry/app/components/pagination.tsx @@ -1,15 +1,15 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; import {Query} from 'history'; +import PropTypes from 'prop-types'; -import {IconChevron} from 'app/icons'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; -import parseLinkHeader from 'app/utils/parseLinkHeader'; +import {IconChevron} from 'app/icons'; +import {t} from 'app/locale'; import {callIfFunction} from 'app/utils/callIfFunction'; +import parseLinkHeader from 'app/utils/parseLinkHeader'; const defaultProps = { size: 'small', diff --git a/src/sentry/static/sentry/app/components/panels/index.tsx b/src/sentry/static/sentry/app/components/panels/index.tsx index fc5dce32f7d9a5..07e13ae030cc9c 100644 --- a/src/sentry/static/sentry/app/components/panels/index.tsx +++ b/src/sentry/static/sentry/app/components/panels/index.tsx @@ -1,10 +1,10 @@ import Panel from 'app/components/panels/panel'; -import PanelHeader from 'app/components/panels/panelHeader'; +import PanelAlert from 'app/components/panels/panelAlert'; import PanelBody from 'app/components/panels/panelBody'; import PanelFooter from 'app/components/panels/panelFooter'; +import PanelHeader from 'app/components/panels/panelHeader'; import PanelItem from 'app/components/panels/panelItem'; -import PanelAlert from 'app/components/panels/panelAlert'; export {default as PanelTable, PanelTableHeader} from 'app/components/panels/panelTable'; -export {Panel, PanelHeader, PanelBody, PanelFooter, PanelItem, PanelAlert}; +export {Panel, PanelAlert, PanelBody, PanelFooter, PanelHeader, PanelItem}; diff --git a/src/sentry/static/sentry/app/components/panels/panel.tsx b/src/sentry/static/sentry/app/components/panels/panel.tsx index aa57da0a392736..d809ff41b190bd 100644 --- a/src/sentry/static/sentry/app/components/panels/panel.tsx +++ b/src/sentry/static/sentry/app/components/panels/panel.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import PanelBody from 'app/components/panels/panelBody'; import PanelHeader from 'app/components/panels/panelHeader'; diff --git a/src/sentry/static/sentry/app/components/panels/panelAlert.tsx b/src/sentry/static/sentry/app/components/panels/panelAlert.tsx index f8e86579ca5d4d..02d02d73c378c9 100644 --- a/src/sentry/static/sentry/app/components/panels/panelAlert.tsx +++ b/src/sentry/static/sentry/app/components/panels/panelAlert.tsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import Alert from 'app/components/alert'; -import {IconInfo, IconClose, IconCheckmark, IconFlag} from 'app/icons'; +import {IconCheckmark, IconClose, IconFlag, IconInfo} from 'app/icons'; import space from 'app/styles/space'; type Props = React.ComponentProps<typeof Alert>; diff --git a/src/sentry/static/sentry/app/components/panels/panelBody.tsx b/src/sentry/static/sentry/app/components/panels/panelBody.tsx index d5708e83c1de40..c946d3fa02dc49 100644 --- a/src/sentry/static/sentry/app/components/panels/panelBody.tsx +++ b/src/sentry/static/sentry/app/components/panels/panelBody.tsx @@ -1,7 +1,7 @@ -import {Flex} from 'reflexbox'; -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import {Flex} from 'reflexbox'; // eslint-disable-line no-restricted-imports import space from 'app/styles/space'; import textStyles from 'app/styles/text'; diff --git a/src/sentry/static/sentry/app/components/panels/panelHeader.tsx b/src/sentry/static/sentry/app/components/panels/panelHeader.tsx index d499dff7d52ca1..45b6404d1353b5 100644 --- a/src/sentry/static/sentry/app/components/panels/panelHeader.tsx +++ b/src/sentry/static/sentry/app/components/panels/panelHeader.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/panels/panelItem.tsx b/src/sentry/static/sentry/app/components/panels/panelItem.tsx index 61c357251638bb..e1ee4dd3f33ef2 100644 --- a/src/sentry/static/sentry/app/components/panels/panelItem.tsx +++ b/src/sentry/static/sentry/app/components/panels/panelItem.tsx @@ -1,7 +1,6 @@ -// eslint-disable-next-line no-restricted-imports -import {Flex} from 'reflexbox'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import {Flex} from 'reflexbox'; // eslint-disable-line no-restricted-imports const PanelItem = styled(Flex)` border-bottom: 1px solid ${p => p.theme.innerBorder}; diff --git a/src/sentry/static/sentry/app/components/panels/panelTable.tsx b/src/sentry/static/sentry/app/components/panels/panelTable.tsx index dd42f85a5075a8..5666b8460ce7b8 100644 --- a/src/sentry/static/sentry/app/components/panels/panelTable.tsx +++ b/src/sentry/static/sentry/app/components/panels/panelTable.tsx @@ -2,9 +2,9 @@ import React from 'react'; import isPropValid from '@emotion/is-prop-valid'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import Panel from './panel'; diff --git a/src/sentry/static/sentry/app/components/passwordStrength.tsx b/src/sentry/static/sentry/app/components/passwordStrength.tsx index f804fce41702d7..e80a476355f46f 100644 --- a/src/sentry/static/sentry/app/components/passwordStrength.tsx +++ b/src/sentry/static/sentry/app/components/passwordStrength.tsx @@ -1,13 +1,13 @@ -import throttle from 'lodash/throttle'; import React from 'react'; import ReactDOM from 'react-dom'; -import zxcvbn from 'zxcvbn'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import throttle from 'lodash/throttle'; +import zxcvbn from 'zxcvbn'; import {tct} from 'app/locale'; -import theme from 'app/utils/theme'; import space from 'app/styles/space'; +import theme from 'app/utils/theme'; /** * NOTE: Do not import this component synchronously. The zxcvbn library is diff --git a/src/sentry/static/sentry/app/components/platformPicker.tsx b/src/sentry/static/sentry/app/components/platformPicker.tsx index be0ff59fd9a654..18f2266fa5bf45 100644 --- a/src/sentry/static/sentry/app/components/platformPicker.tsx +++ b/src/sentry/static/sentry/app/components/platformPicker.tsx @@ -1,22 +1,22 @@ -import debounce from 'lodash/debounce'; import React from 'react'; import keydown from 'react-keydown'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; import PlatformIcon from 'platformicons'; -import {analytics} from 'app/utils/analytics'; -import {inputStyles} from 'app/styles/input'; -import {t, tct} from 'app/locale'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import ExternalLink from 'app/components/links/externalLink'; import ListLink from 'app/components/links/listLink'; import NavTabs from 'app/components/navTabs'; import categoryList, {PlatformKey} from 'app/data/platformCategories'; import platforms from 'app/data/platforms'; +import {IconClose, IconProject, IconSearch} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {inputStyles} from 'app/styles/input'; import space from 'app/styles/space'; -import {IconClose, IconSearch, IconProject} from 'app/icons'; import {PlatformIntegration} from 'app/types'; +import {analytics} from 'app/utils/analytics'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; const PLATFORM_CATEGORIES = [...categoryList, {id: 'all', name: t('All')}] as const; diff --git a/src/sentry/static/sentry/app/components/pluginConfig.tsx b/src/sentry/static/sentry/app/components/pluginConfig.tsx index eba0bdc74fbe87..c75a793a8f0d3f 100644 --- a/src/sentry/static/sentry/app/components/pluginConfig.tsx +++ b/src/sentry/static/sentry/app/components/pluginConfig.tsx @@ -1,23 +1,23 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import isEqual from 'lodash/isEqual'; import styled from '@emotion/styled'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import Button from 'app/components/button'; import LoadingIndicator from 'app/components/loadingIndicator'; -import PluginIcon from 'app/plugins/components/pluginIcon'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; +import {t} from 'app/locale'; import plugins from 'app/plugins'; +import PluginIcon from 'app/plugins/components/pluginIcon'; import space from 'app/styles/space'; +import {Organization, Plugin, Project} from 'app/types'; import withApi from 'app/utils/withApi'; -import {Organization, Project, Plugin} from 'app/types'; -import {Client} from 'app/api'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/components/pluginList.tsx b/src/sentry/static/sentry/app/components/pluginList.tsx index 6bc64469346ff8..08df8ee1d2e7ed 100644 --- a/src/sentry/static/sentry/app/components/pluginList.tsx +++ b/src/sentry/static/sentry/app/components/pluginList.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {Organization, Project, Plugin} from 'app/types'; -import {enablePlugin, disablePlugin} from 'app/actionCreators/plugins'; +import {disablePlugin, enablePlugin} from 'app/actionCreators/plugins'; import InactivePlugins from 'app/components/inactivePlugins'; import PluginConfig from 'app/components/pluginConfig'; import {t} from 'app/locale'; +import {Organization, Plugin, Project} from 'app/types'; import {Panel, PanelItem} from './panels'; diff --git a/src/sentry/static/sentry/app/components/previewFeature.tsx b/src/sentry/static/sentry/app/components/previewFeature.tsx index d82d9d6cefb3a0..bcecc1b5561d4b 100644 --- a/src/sentry/static/sentry/app/components/previewFeature.tsx +++ b/src/sentry/static/sentry/app/components/previewFeature.tsx @@ -1,9 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {IconLab} from 'app/icons'; import Alert, {Props as AlertProps} from 'app/components/alert'; +import {IconLab} from 'app/icons'; +import {t} from 'app/locale'; type Props = { type?: AlertProps['type']; diff --git a/src/sentry/static/sentry/app/components/progressRing.tsx b/src/sentry/static/sentry/app/components/progressRing.tsx index 14c41f314e9407..c28cabf6dfe3ef 100644 --- a/src/sentry/static/sentry/app/components/progressRing.tsx +++ b/src/sentry/static/sentry/app/components/progressRing.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled, {SerializedStyles} from '@emotion/styled'; -import {motion, AnimatePresence} from 'framer-motion'; +import {AnimatePresence, motion} from 'framer-motion'; -import theme, {Theme} from 'app/utils/theme'; import testableTransition from 'app/utils/testableTransition'; +import theme, {Theme} from 'app/utils/theme'; type TextProps = { textCss?: Props['textCss']; @@ -166,4 +166,4 @@ const RingBar = styled('circle')<{ export default ProgressRing; // We export components to allow for css selectors -export {RingBar, RingBackground, Text as RingText}; +export {RingBackground, RingBar, Text as RingText}; diff --git a/src/sentry/static/sentry/app/components/projectLabel.tsx b/src/sentry/static/sentry/app/components/projectLabel.tsx index d333fd4b3278de..966a40c6a90a9a 100644 --- a/src/sentry/static/sentry/app/components/projectLabel.tsx +++ b/src/sentry/static/sentry/app/components/projectLabel.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {Project} from 'app/types'; import {Project as ProjectPropType} from 'app/sentryTypes'; +import {Project} from 'app/types'; type Props = React.HTMLProps<HTMLSpanElement> & { project: Project; diff --git a/src/sentry/static/sentry/app/components/projects/bookmarkStar.tsx b/src/sentry/static/sentry/app/components/projects/bookmarkStar.tsx index e9ae056e78a18e..3452ff6c040f56 100644 --- a/src/sentry/static/sentry/app/components/projects/bookmarkStar.tsx +++ b/src/sentry/static/sentry/app/components/projects/bookmarkStar.tsx @@ -1,16 +1,16 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {defined} from 'app/utils'; +import {update} from 'app/actionCreators/projects'; +import {Client} from 'app/api'; import {IconStar} from 'app/icons'; -import SentryTypes from 'app/sentryTypes'; import {t} from 'app/locale'; -import {update} from 'app/actionCreators/projects'; -import withApi from 'app/utils/withApi'; +import SentryTypes from 'app/sentryTypes'; import {Organization, Project} from 'app/types'; -import {Client} from 'app/api'; +import {defined} from 'app/utils'; +import withApi from 'app/utils/withApi'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/components/projects/missingProjectMembership.tsx b/src/sentry/static/sentry/app/components/projects/missingProjectMembership.tsx index fc996e842134b3..fd54456d3c474c 100644 --- a/src/sentry/static/sentry/app/components/projects/missingProjectMembership.tsx +++ b/src/sentry/static/sentry/app/components/projects/missingProjectMembership.tsx @@ -3,14 +3,14 @@ import styled from '@emotion/styled'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {joinTeam} from 'app/actionCreators/teams'; -import {t} from 'app/locale'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {IconFlag} from 'app/icons'; +import {Client} from 'app/api'; import Well from 'app/components/well'; +import {IconFlag} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; import {Organization, Project, Team} from 'app/types'; +import withApi from 'app/utils/withApi'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/components/pullRequestLink.tsx b/src/sentry/static/sentry/app/components/pullRequestLink.tsx index 329bac3090c0b4..686b6befbb4c8f 100644 --- a/src/sentry/static/sentry/app/components/pullRequestLink.tsx +++ b/src/sentry/static/sentry/app/components/pullRequestLink.tsx @@ -2,7 +2,7 @@ import React from 'react'; import ExternalLink from 'app/components/links/externalLink'; import {IconBitbucket, IconGithub, IconGitlab} from 'app/icons'; -import {Repository, PullRequest} from 'app/types'; +import {PullRequest, Repository} from 'app/types'; function renderIcon(repo: Repository) { if (!repo.provider) { diff --git a/src/sentry/static/sentry/app/components/queryCount.tsx b/src/sentry/static/sentry/app/components/queryCount.tsx index e949e53c5f933d..15348d03d82082 100644 --- a/src/sentry/static/sentry/app/components/queryCount.tsx +++ b/src/sentry/static/sentry/app/components/queryCount.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; import {defined} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/components/questionTooltip.tsx b/src/sentry/static/sentry/app/components/questionTooltip.tsx index 495e93e83a71a4..6f7ff8bb427b72 100644 --- a/src/sentry/static/sentry/app/components/questionTooltip.tsx +++ b/src/sentry/static/sentry/app/components/questionTooltip.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {IconSize} from 'app/utils/theme'; import Tooltip from 'app/components/tooltip'; import {IconQuestion} from 'app/icons'; +import {IconSize} from 'app/utils/theme'; type ContainerProps = { className?: string; diff --git a/src/sentry/static/sentry/app/components/radio.tsx b/src/sentry/static/sentry/app/components/radio.tsx index 4b3da7b433a099..921d7f25bb9235 100644 --- a/src/sentry/static/sentry/app/components/radio.tsx +++ b/src/sentry/static/sentry/app/components/radio.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import {growIn} from 'app/styles/animations'; import {Theme} from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/releaseStats.tsx b/src/sentry/static/sentry/app/components/releaseStats.tsx index f6b4f1607891d5..ff1575f59a865d 100644 --- a/src/sentry/static/sentry/app/components/releaseStats.tsx +++ b/src/sentry/static/sentry/app/components/releaseStats.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Release} from 'app/types'; import AvatarList from 'app/components/avatar/avatarList'; import {t, tn} from 'app/locale'; import space from 'app/styles/space'; +import {Release} from 'app/types'; type Props = { release: Release; diff --git a/src/sentry/static/sentry/app/components/repositoryFileSummary.tsx b/src/sentry/static/sentry/app/components/repositoryFileSummary.tsx index 423ecc27236a52..ec9afd613a0359 100644 --- a/src/sentry/static/sentry/app/components/repositoryFileSummary.tsx +++ b/src/sentry/static/sentry/app/components/repositoryFileSummary.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {ListGroup, ListGroupItem} from 'app/components/listGroup'; import FileChange from 'app/components/fileChange'; +import {ListGroup, ListGroupItem} from 'app/components/listGroup'; import {t, tn} from 'app/locale'; import space from 'app/styles/space'; import {FilesByRepository} from 'app/types'; diff --git a/src/sentry/static/sentry/app/components/repositoryProjectPathConfigForm.tsx b/src/sentry/static/sentry/app/components/repositoryProjectPathConfigForm.tsx index b9a806e843cee2..4262d66a4c48a3 100644 --- a/src/sentry/static/sentry/app/components/repositoryProjectPathConfigForm.tsx +++ b/src/sentry/static/sentry/app/components/repositoryProjectPathConfigForm.tsx @@ -3,15 +3,15 @@ import styled from '@emotion/styled'; import pick from 'lodash/pick'; import {t} from 'app/locale'; -import Form from 'app/views/settings/components/forms/form'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; import { - Project, - Organization, Integration, + Organization, + Project, Repository, RepositoryProjectPathConfig, } from 'app/types'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; import {JsonFormObject} from 'app/views/settings/components/forms/type'; type Props = { diff --git a/src/sentry/static/sentry/app/components/repositoryProjectPathConfigRow.tsx b/src/sentry/static/sentry/app/components/repositoryProjectPathConfigRow.tsx index 50a306d29332cf..ecb179f9ac645b 100644 --- a/src/sentry/static/sentry/app/components/repositoryProjectPathConfigRow.tsx +++ b/src/sentry/static/sentry/app/components/repositoryProjectPathConfigRow.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {RepositoryProjectPathConfig, Project} from 'app/types'; -import {t} from 'app/locale'; import Access from 'app/components/acl/access'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; +import IdBadge from 'app/components/idBadge'; +import Tooltip from 'app/components/tooltip'; import {IconDelete, IconEdit} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import Tooltip from 'app/components/tooltip'; -import IdBadge from 'app/components/idBadge'; +import {Project, RepositoryProjectPathConfig} from 'app/types'; type Props = { pathConfig: RepositoryProjectPathConfig; diff --git a/src/sentry/static/sentry/app/components/repositoryRow.tsx b/src/sentry/static/sentry/app/components/repositoryRow.tsx index 449b4f329e3786..3af86ce67724b1 100644 --- a/src/sentry/static/sentry/app/components/repositoryRow.tsx +++ b/src/sentry/static/sentry/app/components/repositoryRow.tsx @@ -1,17 +1,17 @@ import React from 'react'; import styled from '@emotion/styled'; +import {cancelDeleteRepository, deleteRepository} from 'app/actionCreators/integrations'; import {Client} from 'app/api'; -import {PanelItem} from 'app/components/panels'; -import {Repository, RepositoryStatus} from 'app/types'; -import {deleteRepository, cancelDeleteRepository} from 'app/actionCreators/integrations'; -import {t} from 'app/locale'; import Access from 'app/components/acl/access'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; +import {PanelItem} from 'app/components/panels'; +import Tooltip from 'app/components/tooltip'; import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import Tooltip from 'app/components/tooltip'; +import {Repository, RepositoryStatus} from 'app/types'; type DefaultProps = { showProvider?: boolean; diff --git a/src/sentry/static/sentry/app/components/resolutionBox.tsx b/src/sentry/static/sentry/app/components/resolutionBox.tsx index fa0f967cb46338..fdb67db35e991c 100644 --- a/src/sentry/static/sentry/app/components/resolutionBox.tsx +++ b/src/sentry/static/sentry/app/components/resolutionBox.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import UserAvatar from 'app/components/avatar/userAvatar'; -import {BannerContainer, BannerSummary} from 'app/components/events/styles'; import CommitLink from 'app/components/commitLink'; +import {BannerContainer, BannerSummary} from 'app/components/events/styles'; import TimeSince from 'app/components/timeSince'; import Version from 'app/components/version'; import {IconCheckmark} from 'app/icons'; diff --git a/src/sentry/static/sentry/app/components/resourceCard.tsx b/src/sentry/static/sentry/app/components/resourceCard.tsx index ed3df118586e55..f9cdd5261f0b74 100644 --- a/src/sentry/static/sentry/app/components/resourceCard.tsx +++ b/src/sentry/static/sentry/app/components/resourceCard.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {analytics} from 'app/utils/analytics'; import ExternalLink from 'app/components/links/externalLink'; import {Panel} from 'app/components/panels'; import space from 'app/styles/space'; +import {analytics} from 'app/utils/analytics'; type Props = { title: string; diff --git a/src/sentry/static/sentry/app/components/resultGrid.tsx b/src/sentry/static/sentry/app/components/resultGrid.tsx index 9c6087468f216c..787333042661da 100644 --- a/src/sentry/static/sentry/app/components/resultGrid.tsx +++ b/src/sentry/static/sentry/app/components/resultGrid.tsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {browserHistory} from 'react-router'; import {Location} from 'history'; +import PropTypes from 'prop-types'; -import withApi from 'app/utils/withApi'; +import {Client, RequestOptions} from 'app/api'; import DropdownLink from 'app/components/dropdownLink'; import MenuItem from 'app/components/menuItem'; import Pagination from 'app/components/pagination'; import {IconSearch} from 'app/icons'; -import {Client, RequestOptions} from 'app/api'; +import withApi from 'app/utils/withApi'; type Option = [value: string, label: string]; diff --git a/src/sentry/static/sentry/app/components/roleSelectControl.tsx b/src/sentry/static/sentry/app/components/roleSelectControl.tsx index 87c406ce897463..260e6086f269d1 100644 --- a/src/sentry/static/sentry/app/components/roleSelectControl.tsx +++ b/src/sentry/static/sentry/app/components/roleSelectControl.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; import SelectControl from 'app/components/forms/selectControl'; +import space from 'app/styles/space'; import {MemberRole} from 'app/types'; type Props = SelectControl['props'] & { diff --git a/src/sentry/static/sentry/app/components/scoreBar.tsx b/src/sentry/static/sentry/app/components/scoreBar.tsx index 968ac64120f4be..58e20b3a17522a 100644 --- a/src/sentry/static/sentry/app/components/scoreBar.tsx +++ b/src/sentry/static/sentry/app/components/scoreBar.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import theme from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/scoreCard.tsx b/src/sentry/static/sentry/app/components/scoreCard.tsx index d1fc3cea42931e..7419828bd0783e 100644 --- a/src/sentry/static/sentry/app/components/scoreCard.tsx +++ b/src/sentry/static/sentry/app/components/scoreCard.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import QuestionTooltip from 'app/components/questionTooltip'; import {Panel, PanelBody} from 'app/components/panels'; -import {Theme} from 'app/utils/theme'; -import space from 'app/styles/space'; +import QuestionTooltip from 'app/components/questionTooltip'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; +import {Theme} from 'app/utils/theme'; type Props = { title: React.ReactNode; diff --git a/src/sentry/static/sentry/app/components/search/index.jsx b/src/sentry/static/sentry/app/components/search/index.jsx index 1a0e487d2bd2e7..fae98453cfc21e 100644 --- a/src/sentry/static/sentry/app/components/search/index.jsx +++ b/src/sentry/static/sentry/app/components/search/index.jsx @@ -1,24 +1,24 @@ -import debounce from 'lodash/debounce'; -import {withRouter} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {withRouter} from 'react-router'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; +import PropTypes from 'prop-types'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; import {navigateTo} from 'app/actionCreators/navigation'; -import {t} from 'app/locale'; -import ApiSource from 'app/components/search/sources/apiSource'; import AutoComplete from 'app/components/autoComplete'; -import CommandSource from 'app/components/search/sources/commandSource'; -import FormSource from 'app/components/search/sources/formSource'; import LoadingIndicator from 'app/components/loadingIndicator'; -import RouteSource from 'app/components/search/sources/routeSource'; import SearchResult from 'app/components/search/searchResult'; import SearchResultWrapper from 'app/components/search/searchResultWrapper'; import SearchSources from 'app/components/search/sources'; -import replaceRouterParams from 'app/utils/replaceRouterParams'; +import ApiSource from 'app/components/search/sources/apiSource'; +import CommandSource from 'app/components/search/sources/commandSource'; +import FormSource from 'app/components/search/sources/formSource'; +import RouteSource from 'app/components/search/sources/routeSource'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import replaceRouterParams from 'app/utils/replaceRouterParams'; // "Omni" search class Search extends React.Component { diff --git a/src/sentry/static/sentry/app/components/search/searchResult.jsx b/src/sentry/static/sentry/app/components/search/searchResult.jsx index 5704a496001cde..b37dd0e063a614 100644 --- a/src/sentry/static/sentry/app/components/search/searchResult.jsx +++ b/src/sentry/static/sentry/app/components/search/searchResult.jsx @@ -1,14 +1,14 @@ -import {withRouter} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {withRouter} from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import IdBadge from 'app/components/idBadge'; import {IconInput, IconLink, IconSettings} from 'app/icons'; import PluginIcon from 'app/plugins/components/pluginIcon'; -import SettingsSearch from 'app/views/settings/components/settingsSearch'; -import highlightFuseMatches from 'app/utils/highlightFuseMatches'; import space from 'app/styles/space'; +import highlightFuseMatches from 'app/utils/highlightFuseMatches'; +import SettingsSearch from 'app/views/settings/components/settingsSearch'; class SearchResult extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/search/searchResultWrapper.tsx b/src/sentry/static/sentry/app/components/search/searchResultWrapper.tsx index c4281ec100557d..c11fcde80d84d2 100644 --- a/src/sentry/static/sentry/app/components/search/searchResultWrapper.tsx +++ b/src/sentry/static/sentry/app/components/search/searchResultWrapper.tsx @@ -1,6 +1,6 @@ -import styled from '@emotion/styled'; -import {css} from '@emotion/core'; import React from 'react'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; type Props = { highlighted?: boolean; diff --git a/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx b/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx index 698cea06f68dad..7336954c712f9d 100644 --- a/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/apiSource.jsx @@ -1,15 +1,15 @@ -import flatten from 'lodash/flatten'; -import debounce from 'lodash/debounce'; -import {withRouter} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {withRouter} from 'react-router'; import * as Sentry from '@sentry/react'; +import debounce from 'lodash/debounce'; +import flatten from 'lodash/flatten'; +import PropTypes from 'prop-types'; import {Client} from 'app/api'; -import {createFuzzySearch} from 'app/utils/createFuzzySearch'; -import {singleLineRenderer as markedSingleLine} from 'app/utils/marked'; import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {createFuzzySearch} from 'app/utils/createFuzzySearch'; +import {singleLineRenderer as markedSingleLine} from 'app/utils/marked'; import withLatestContext from 'app/utils/withLatestContext'; import {documentIntegrationList} from 'app/views/organizationIntegrations/constants'; diff --git a/src/sentry/static/sentry/app/components/search/sources/commandSource.jsx b/src/sentry/static/sentry/app/components/search/sources/commandSource.jsx index 7a7ff05144b480..eecadaed488a91 100644 --- a/src/sentry/static/sentry/app/components/search/sources/commandSource.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/commandSource.jsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {createFuzzySearch} from 'app/utils/createFuzzySearch'; -import {openSudo, openHelpSearchModal} from 'app/actionCreators/modal'; -import {toggleLocaleDebug} from 'app/locale'; +import {openHelpSearchModal, openSudo} from 'app/actionCreators/modal'; import Access from 'app/components/acl/access'; +import {toggleLocaleDebug} from 'app/locale'; import ConfigStore from 'app/stores/configStore'; +import {createFuzzySearch} from 'app/utils/createFuzzySearch'; const ACTIONS = [ { diff --git a/src/sentry/static/sentry/app/components/search/sources/formSource.jsx b/src/sentry/static/sentry/app/components/search/sources/formSource.jsx index c353b889a8a8ad..189de4c0086035 100644 --- a/src/sentry/static/sentry/app/components/search/sources/formSource.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/formSource.jsx @@ -1,12 +1,12 @@ +import React from 'react'; import {withRouter} from 'react-router'; +import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; -import React from 'react'; import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import {loadSearchMap} from 'app/actionCreators/formSearch'; -import {createFuzzySearch} from 'app/utils/createFuzzySearch'; import FormSearchStore from 'app/stores/formSearchStore'; +import {createFuzzySearch} from 'app/utils/createFuzzySearch'; import replaceRouterParams from 'app/utils/replaceRouterParams'; class FormSource extends React.Component { diff --git a/src/sentry/static/sentry/app/components/search/sources/helpSource.tsx b/src/sentry/static/sentry/app/components/search/sources/helpSource.tsx index c5a0ce5f859cee..989b9725b59aa7 100644 --- a/src/sentry/static/sentry/app/components/search/sources/helpSource.tsx +++ b/src/sentry/static/sentry/app/components/search/sources/helpSource.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import debounce from 'lodash/debounce'; -import dompurify from 'dompurify'; import {withRouter, WithRouterProps} from 'react-router'; import { + Result as SearchResult, SentryGlobalSearch, standardSDKSlug, - Result as SearchResult, } from '@sentry-internal/global-search'; +import dompurify from 'dompurify'; +import debounce from 'lodash/debounce'; -import withLatestContext from 'app/utils/withLatestContext'; import {Organization, Project} from 'app/types'; import parseHtmlMarks from 'app/utils/parseHtmlMarks'; +import withLatestContext from 'app/utils/withLatestContext'; type MarkedText = ReturnType<typeof parseHtmlMarks>; diff --git a/src/sentry/static/sentry/app/components/search/sources/index.jsx b/src/sentry/static/sentry/app/components/search/sources/index.jsx index 07f2d85495378a..abe08e579915aa 100644 --- a/src/sentry/static/sentry/app/components/search/sources/index.jsx +++ b/src/sentry/static/sentry/app/components/search/sources/index.jsx @@ -1,6 +1,6 @@ +import React from 'react'; import flatten from 'lodash/flatten'; import PropTypes from 'prop-types'; -import React from 'react'; class SearchSources extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/search/sources/routeSource.tsx b/src/sentry/static/sentry/app/components/search/sources/routeSource.tsx index 259202c1039ca2..70be0c540e61a9 100644 --- a/src/sentry/static/sentry/app/components/search/sources/routeSource.tsx +++ b/src/sentry/static/sentry/app/components/search/sources/routeSource.tsx @@ -1,16 +1,16 @@ -import flattenDepth from 'lodash/flattenDepth'; import React from 'react'; -import {FuseOptions, FuseResultWithMatches} from 'fuse.js'; import {WithRouterProps} from 'react-router'; +import {FuseOptions, FuseResultWithMatches} from 'fuse.js'; +import flattenDepth from 'lodash/flattenDepth'; +import {Organization, Project} from 'app/types'; import {createFuzzySearch} from 'app/utils/createFuzzySearch'; +import replaceRouterParams from 'app/utils/replaceRouterParams'; +import withLatestContext from 'app/utils/withLatestContext'; import accountSettingsNavigation from 'app/views/settings/account/navigationConfiguration'; import organizationSettingsNavigation from 'app/views/settings/organization/navigationConfiguration'; import projectSettingsNavigation from 'app/views/settings/project/navigationConfiguration'; -import replaceRouterParams from 'app/utils/replaceRouterParams'; -import withLatestContext from 'app/utils/withLatestContext'; import {NavigationItem} from 'app/views/settings/types'; -import {Organization, Project} from 'app/types'; type Config = | typeof accountSettingsNavigation diff --git a/src/sentry/static/sentry/app/components/searchBar.tsx b/src/sentry/static/sentry/app/components/searchBar.tsx index b25e1f238be33b..d4cdee217b5a25 100644 --- a/src/sentry/static/sentry/app/components/searchBar.tsx +++ b/src/sentry/static/sentry/app/components/searchBar.tsx @@ -2,11 +2,11 @@ import React from 'react'; import styled from '@emotion/styled'; import classNames from 'classnames'; -import {t} from 'app/locale'; -import {IconClose} from 'app/icons/iconClose'; -import {callIfFunction} from 'app/utils/callIfFunction'; import Button from 'app/components/button'; import {IconSearch} from 'app/icons'; +import {IconClose} from 'app/icons/iconClose'; +import {t} from 'app/locale'; +import {callIfFunction} from 'app/utils/callIfFunction'; type DefaultProps = { query: string; diff --git a/src/sentry/static/sentry/app/components/seenByList.tsx b/src/sentry/static/sentry/app/components/seenByList.tsx index 7cb94243c43507..7b3732ca554fff 100644 --- a/src/sentry/static/sentry/app/components/seenByList.tsx +++ b/src/sentry/static/sentry/app/components/seenByList.tsx @@ -1,16 +1,16 @@ import React from 'react'; +import styled from '@emotion/styled'; import classNames from 'classnames'; import moment from 'moment'; -import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {AvatarUser, User} from 'app/types'; -import {IconShow} from 'app/icons'; -import {userDisplayName} from 'app/utils/formatters'; import AvatarList from 'app/components/avatar/avatarList'; -import ConfigStore from 'app/stores/configStore'; import Tooltip from 'app/components/tooltip'; +import {IconShow} from 'app/icons'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; +import {AvatarUser, User} from 'app/types'; +import {userDisplayName} from 'app/utils/formatters'; type Props = { // Avatar size diff --git a/src/sentry/static/sentry/app/components/selectMembers/index.tsx b/src/sentry/static/sentry/app/components/selectMembers/index.tsx index 142bf52a10405b..1184e26e990a14 100644 --- a/src/sentry/static/sentry/app/components/selectMembers/index.tsx +++ b/src/sentry/static/sentry/app/components/selectMembers/index.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import debounce from 'lodash/debounce'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; -import {Client} from 'app/api'; -import {IconAdd} from 'app/icons'; -import {Member, Organization, Project, Team, User} from 'app/types'; import {addTeamToProject} from 'app/actionCreators/projects'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import Button from 'app/components/button'; +import SelectControl from 'app/components/forms/selectControl'; import IdBadge from 'app/components/idBadge'; +import Tooltip from 'app/components/tooltip'; +import {IconAdd} from 'app/icons'; +import {t} from 'app/locale'; import MemberListStore from 'app/stores/memberListStore'; import ProjectsStore from 'app/stores/projectsStore'; -import SelectControl from 'app/components/forms/selectControl'; import TeamStore from 'app/stores/teamStore'; -import Tooltip from 'app/components/tooltip'; +import {Member, Organization, Project, Team, User} from 'app/types'; +import {callIfFunction} from 'app/utils/callIfFunction'; import withApi from 'app/utils/withApi'; const getSearchKeyForUser = (user: User) => diff --git a/src/sentry/static/sentry/app/components/selectMembers/valueComponent.tsx b/src/sentry/static/sentry/app/components/selectMembers/valueComponent.tsx index 5e741abae8a845..9bcda91b69a0f2 100644 --- a/src/sentry/static/sentry/app/components/selectMembers/valueComponent.tsx +++ b/src/sentry/static/sentry/app/components/selectMembers/valueComponent.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {Actor} from 'app/types'; import ActorAvatar from 'app/components/avatar/actorAvatar'; +import {Actor} from 'app/types'; type Value = { actor: Actor; diff --git a/src/sentry/static/sentry/app/components/sentryAppIcon.tsx b/src/sentry/static/sentry/app/components/sentryAppIcon.tsx index c8f4fa03e3334c..5eda94fc662585 100644 --- a/src/sentry/static/sentry/app/components/sentryAppIcon.tsx +++ b/src/sentry/static/sentry/app/components/sentryAppIcon.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import {SentryAppComponent} from 'app/types'; import { IconClickup, IconClubhouse, + IconGeneric, + IconLinear, IconRookout, IconTeamwork, - IconLinear, - IconGeneric, } from 'app/icons'; +import {SentryAppComponent} from 'app/types'; type Props = { slug: SentryAppComponent['sentryApp']['slug']; diff --git a/src/sentry/static/sentry/app/components/setupWizard.jsx b/src/sentry/static/sentry/app/components/setupWizard.jsx index 45c1ec658be550..d1b00d997467a7 100644 --- a/src/sentry/static/sentry/app/components/setupWizard.jsx +++ b/src/sentry/static/sentry/app/components/setupWizard.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {Client} from 'app/api'; import LoadingIndicator from 'app/components/loadingIndicator'; diff --git a/src/sentry/static/sentry/app/components/shareIssue.tsx b/src/sentry/static/sentry/app/components/shareIssue.tsx index 7884cbad310bfc..cf8fe44c70c762 100644 --- a/src/sentry/static/sentry/app/components/shareIssue.tsx +++ b/src/sentry/static/sentry/app/components/shareIssue.tsx @@ -1,10 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {IconCopy, IconRefresh} from 'app/icons'; -import space from 'app/styles/space'; import AutoSelectText from 'app/components/autoSelectText'; import Button from 'app/components/button'; import Clipboard from 'app/components/clipboard'; @@ -12,7 +9,10 @@ import Confirm from 'app/components/confirm'; import DropdownLink from 'app/components/dropdownLink'; import LoadingIndicator from 'app/components/loadingIndicator'; import Switch from 'app/components/switch'; +import {IconCopy, IconRefresh} from 'app/icons'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; type ContainerProps = { shareUrl: string; diff --git a/src/sentry/static/sentry/app/components/shortId.tsx b/src/sentry/static/sentry/app/components/shortId.tsx index 10e5df7627bcd1..38dbb89a162a08 100644 --- a/src/sentry/static/sentry/app/components/shortId.tsx +++ b/src/sentry/static/sentry/app/components/shortId.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import AutoSelectText from 'app/components/autoSelectText'; diff --git a/src/sentry/static/sentry/app/components/sidebar/broadcasts.tsx b/src/sentry/static/sentry/app/components/sidebar/broadcasts.tsx index b1c6bcf90ab470..fae24cc234839c 100644 --- a/src/sentry/static/sentry/app/components/sidebar/broadcasts.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/broadcasts.tsx @@ -1,16 +1,16 @@ import React from 'react'; import {getAllBroadcasts, markBroadcastsAsSeen} from 'app/actionCreators/broadcasts'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import LoadingIndicator from 'app/components/loadingIndicator'; import SidebarItem from 'app/components/sidebar/sidebarItem'; import SidebarPanel from 'app/components/sidebar/sidebarPanel'; import SidebarPanelEmpty from 'app/components/sidebar/sidebarPanelEmpty'; import SidebarPanelItem from 'app/components/sidebar/sidebarPanelItem'; import {IconBroadcast} from 'app/icons'; +import {t} from 'app/locale'; +import {Broadcast, Organization} from 'app/types'; import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; -import {Organization, Broadcast} from 'app/types'; import {CommonSidebarProps} from './types'; diff --git a/src/sentry/static/sentry/app/components/sidebar/help.tsx b/src/sentry/static/sentry/app/components/sidebar/help.tsx index bfdc636e840a67..780bd8d1100dfb 100644 --- a/src/sentry/static/sentry/app/components/sidebar/help.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/help.tsx @@ -2,15 +2,15 @@ import React from 'react'; import styled from '@emotion/styled'; import {openHelpSearchModal} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; import DropdownMenu from 'app/components/dropdownMenu'; -import SidebarItem from 'app/components/sidebar/sidebarItem'; import Hook from 'app/components/hook'; +import SidebarItem from 'app/components/sidebar/sidebarItem'; import {IconQuestion} from 'app/icons'; +import {t} from 'app/locale'; import {Organization} from 'app/types'; -import SidebarMenuItem from './sidebarMenuItem'; import SidebarDropdownMenu from './sidebarDropdownMenu.styled'; +import SidebarMenuItem from './sidebarMenuItem'; import {CommonSidebarProps} from './types'; type Props = Pick<CommonSidebarProps, 'collapsed' | 'hidePanel' | 'orientation'> & { diff --git a/src/sentry/static/sentry/app/components/sidebar/index.tsx b/src/sentry/static/sentry/app/components/sidebar/index.tsx index c4d1a37c2f6fc1..7830949dd28208 100644 --- a/src/sentry/static/sentry/app/components/sidebar/index.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/index.tsx @@ -1,13 +1,16 @@ -import {css} from '@emotion/core'; -import {browserHistory} from 'react-router'; -import {Location} from 'history'; import React from 'react'; -import Reflux from 'reflux'; +import {browserHistory} from 'react-router'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import createReactClass from 'create-react-class'; +import {Location} from 'history'; import isEqual from 'lodash/isEqual'; import * as queryString from 'query-string'; -import styled from '@emotion/styled'; +import Reflux from 'reflux'; +import {hideSidebar, showSidebar} from 'app/actionCreators/preferences'; +import Feature from 'app/components/acl/feature'; +import {extractSelectionParameters} from 'app/components/organizations/globalSelectionHeader/utils'; import { IconActivity, IconChevron, @@ -24,27 +27,24 @@ import { IconSupport, IconTelescope, } from 'app/icons'; -import {extractSelectionParameters} from 'app/components/organizations/globalSelectionHeader/utils'; -import {hideSidebar, showSidebar} from 'app/actionCreators/preferences'; import {t} from 'app/locale'; import ConfigStore from 'app/stores/configStore'; -import Feature from 'app/components/acl/feature'; import HookStore from 'app/stores/hookStore'; import PreferencesStore from 'app/stores/preferencesStore'; -import {getDiscoverLandingUrl} from 'app/utils/discover/urls'; import space from 'app/styles/space'; +import {Organization} from 'app/types'; +import {getDiscoverLandingUrl} from 'app/utils/discover/urls'; import theme from 'app/utils/theme'; import withOrganization from 'app/utils/withOrganization'; -import {Organization} from 'app/types'; -import {getSidebarPanelContainer} from './sidebarPanel'; import Broadcasts from './broadcasts'; +import SidebarHelp from './help'; import OnboardingStatus from './onboardingStatus'; import ServiceIncidents from './serviceIncidents'; import SidebarDropdown from './sidebarDropdown'; -import SidebarHelp from './help'; import SidebarItem from './sidebarItem'; -import {SidebarPanelKey, SidebarOrientation} from './types'; +import {getSidebarPanelContainer} from './sidebarPanel'; +import {SidebarOrientation, SidebarPanelKey} from './types'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/components/sidebar/onboardingStatus.tsx b/src/sentry/static/sentry/app/components/sidebar/onboardingStatus.tsx index d9c6a1695b2599..8e13c6f357c5c4 100644 --- a/src/sentry/static/sentry/app/components/sidebar/onboardingStatus.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/onboardingStatus.tsx @@ -1,19 +1,19 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {getMergedTasks} from 'app/components/onboardingWizard/taskConfig'; -import {tct, t} from 'app/locale'; import OnboardingSidebar from 'app/components/onboardingWizard/sidebar'; -import {Organization, OnboardingTaskStatus} from 'app/types'; -import space from 'app/styles/space'; -import theme, {Theme} from 'app/utils/theme'; +import {getMergedTasks} from 'app/components/onboardingWizard/taskConfig'; import ProgressRing, { RingBackground, RingBar, RingText, } from 'app/components/progressRing'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {OnboardingTaskStatus, Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import theme, {Theme} from 'app/utils/theme'; import {CommonSidebarProps} from './types'; diff --git a/src/sentry/static/sentry/app/components/sidebar/serviceIncidents.tsx b/src/sentry/static/sentry/app/components/sidebar/serviceIncidents.tsx index 0e275df7adf02c..cd9fb6f60e1d96 100644 --- a/src/sentry/static/sentry/app/components/sidebar/serviceIncidents.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/serviceIncidents.tsx @@ -2,17 +2,17 @@ import React from 'react'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; -import {t} from 'app/locale'; +import {loadIncidents} from 'app/actionCreators/serviceIncidents'; import Button from 'app/components/button'; import {IconWarning} from 'app/icons'; -import {loadIncidents} from 'app/actionCreators/serviceIncidents'; -import {SentryServiceStatus} from 'app/types'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {SentryServiceStatus} from 'app/types'; -import {CommonSidebarProps} from './types'; -import SidebarPanelEmpty from './sidebarPanelEmpty'; import SidebarItem from './sidebarItem'; import SidebarPanel from './sidebarPanel'; +import SidebarPanelEmpty from './sidebarPanelEmpty'; +import {CommonSidebarProps} from './types'; type Props = CommonSidebarProps; diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.tsx index ccf93eca796b73..28a6ccf2ed1764 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/index.tsx @@ -2,10 +2,8 @@ import React from 'react'; import styled from '@emotion/styled'; import {logout} from 'app/actionCreators/account'; -import {t} from 'app/locale'; -import {IconChevron, IconSentry} from 'app/icons'; +import {Client} from 'app/api'; import Avatar from 'app/components/avatar'; -import ConfigStore from 'app/stores/configStore'; import DropdownMenu from 'app/components/dropdownMenu'; import Hook from 'app/components/hook'; import IdBadge from 'app/components/idBadge'; @@ -14,14 +12,17 @@ import SidebarDropdownMenu from 'app/components/sidebar/sidebarDropdownMenu.styl import SidebarMenuItem, {menuItemStyles} from 'app/components/sidebar/sidebarMenuItem'; import SidebarOrgSummary from 'app/components/sidebar/sidebarOrgSummary'; import TextOverflow from 'app/components/textOverflow'; -import withApi from 'app/utils/withApi'; -import {Organization, User, Config} from 'app/types'; -import {Client} from 'app/api'; +import {IconChevron, IconSentry} from 'app/icons'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; +import {Config, Organization, User} from 'app/types'; +import withApi from 'app/utils/withApi'; import {CommonSidebarProps} from '../types'; -import SwitchOrganization from './switchOrganization'; + import Divider from './divider.styled'; +import SwitchOrganization from './switchOrganization'; type Props = Pick<CommonSidebarProps, 'orientation' | 'collapsed'> & { api: Client; diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.tsx index 4f256fc0f3ad82..3016e6854a5ec1 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarDropdown/switchOrganization.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import DropdownMenu from 'app/components/dropdownMenu'; -import {IconAdd, IconChevron} from 'app/icons'; -import withOrganizations from 'app/utils/withOrganizations'; -import SidebarOrgSummary from 'app/components/sidebar/sidebarOrgSummary'; -import SidebarMenuItem from 'app/components/sidebar/sidebarMenuItem'; import SidebarDropdownMenu from 'app/components/sidebar/sidebarDropdownMenu.styled'; -import {OrganizationSummary} from 'app/types'; +import SidebarMenuItem from 'app/components/sidebar/sidebarMenuItem'; +import SidebarOrgSummary from 'app/components/sidebar/sidebarOrgSummary'; +import {IconAdd, IconChevron} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {OrganizationSummary} from 'app/types'; +import withOrganizations from 'app/utils/withOrganizations'; import Divider from './divider.styled'; diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarItem.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarItem.tsx index d4b45de3873946..2226bedc76fbc8 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarItem.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarItem.tsx @@ -1,15 +1,15 @@ -import * as ReactRouter from 'react-router'; import React from 'react'; -import styled from '@emotion/styled'; +import * as ReactRouter from 'react-router'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import FeatureBadge from 'app/components/featureBadge'; import HookOrDefault from 'app/components/hookOrDefault'; -import Tooltip from 'app/components/tooltip'; -import TextOverflow from 'app/components/textOverflow'; -import {Theme} from 'app/utils/theme'; import Link from 'app/components/links/link'; +import TextOverflow from 'app/components/textOverflow'; +import Tooltip from 'app/components/tooltip'; import localStorage from 'app/utils/localStorage'; +import {Theme} from 'app/utils/theme'; import {SidebarOrientation} from './types'; diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItem.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItem.tsx index a97bf769724a92..4e7f00a3d28c18 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItem.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItem.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import {Theme} from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItemLink.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItemLink.tsx index b69fc9b8db1c93..47376a3789e74b 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItemLink.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarMenuItemLink.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import Link from 'app/components/links/link'; import ExternalLink from 'app/components/links/externalLink'; +import Link from 'app/components/links/link'; type Props = { // SidebarMenuItemLink content (accepted via string or components / DOM nodes) diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarOrgSummary.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarOrgSummary.tsx index 52c35621d2d3c8..4ac089d8f87d49 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarOrgSummary.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarOrgSummary.tsx @@ -2,9 +2,9 @@ import React from 'react'; import styled from '@emotion/styled'; import OrganizationAvatar from 'app/components/avatar/organizationAvatar'; +import {tn} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import {Organization, OrganizationSummary} from 'app/types'; -import {tn} from 'app/locale'; type Props = { organization: OrganizationSummary; diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarPanel.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarPanel.tsx index 389bb752b50591..02ac69fc632e83 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarPanel.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarPanel.tsx @@ -1,12 +1,12 @@ -import ReactDOM from 'react-dom'; import React from 'react'; -import styled from '@emotion/styled'; +import ReactDOM from 'react-dom'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {Theme} from 'app/utils/theme'; -import space from 'app/styles/space'; import {IconClose} from 'app/icons'; import {slideInLeft} from 'app/styles/animations'; +import space from 'app/styles/space'; +import {Theme} from 'app/utils/theme'; import {CommonSidebarProps} from './types'; diff --git a/src/sentry/static/sentry/app/components/sidebar/sidebarPanelItem.tsx b/src/sentry/static/sentry/app/components/sidebar/sidebarPanelItem.tsx index a430192f690c12..03b6eea4072ed6 100644 --- a/src/sentry/static/sentry/app/components/sidebar/sidebarPanelItem.tsx +++ b/src/sentry/static/sentry/app/components/sidebar/sidebarPanelItem.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {t} from '../../locale'; import ExternalLink from '../links/externalLink'; diff --git a/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx b/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx index ebc60fe723c213..a0159efd9ab1ad 100644 --- a/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx +++ b/src/sentry/static/sentry/app/components/smartSearchBar/index.tsx @@ -1,50 +1,50 @@ -import {ClassNames} from '@emotion/core'; -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; -import debounce from 'lodash/debounce'; +import {browserHistory} from 'react-router'; +import {ClassNames} from '@emotion/core'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import createReactClass from 'create-react-class'; +import debounce from 'lodash/debounce'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import {defined} from 'app/utils'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; -import {t} from 'app/locale'; -import Button from 'app/components/button'; -import ButtonBar from 'app/components/buttonBar'; -import CreateSavedSearchButton from 'app/views/issueList/createSavedSearchButton'; -import DropdownLink from 'app/components/dropdownLink'; -import {IconEllipsis, IconSearch, IconSliders, IconClose, IconPin} from 'app/icons'; -import MemberListStore from 'app/stores/memberListStore'; -import space from 'app/styles/space'; -import theme from 'app/utils/theme'; -import withApi from 'app/utils/withApi'; -import withOrganization from 'app/utils/withOrganization'; -import {Client} from 'app/api'; -import {LightWeightOrganization, SavedSearch, Tag, SavedSearchType} from 'app/types'; import { fetchRecentSearches, pinSearch, saveRecentSearch, unpinSearch, } from 'app/actionCreators/savedSearches'; +import {Client} from 'app/api'; +import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; +import DropdownLink from 'app/components/dropdownLink'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import { DEFAULT_DEBOUNCE_DURATION, MAX_AUTOCOMPLETE_RELEASES, NEGATION_OPERATOR, } from 'app/constants'; +import {IconClose, IconEllipsis, IconPin, IconSearch, IconSliders} from 'app/icons'; +import {t} from 'app/locale'; +import MemberListStore from 'app/stores/memberListStore'; +import space from 'app/styles/space'; +import {LightWeightOrganization, SavedSearch, SavedSearchType, Tag} from 'app/types'; +import {defined} from 'app/utils'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {callIfFunction} from 'app/utils/callIfFunction'; +import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; +import CreateSavedSearchButton from 'app/views/issueList/createSavedSearchButton'; import SearchDropdown from './searchDropdown'; -import {SearchItem, SearchGroup, ItemType} from './types'; +import {ItemType, SearchGroup, SearchItem} from './types'; import { addSpace, - removeSpace, createSearchGroups, filterSearchGroupsByIndex, + removeSpace, } from './utils'; const DROPDOWN_BLUR_DURATION = 200; diff --git a/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.tsx b/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.tsx index a075f4cf0669a0..ac0b320303bbf7 100644 --- a/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.tsx +++ b/src/sentry/static/sentry/app/components/smartSearchBar/searchDropdown.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/components/smartSearchBar/utils.tsx b/src/sentry/static/sentry/app/components/smartSearchBar/utils.tsx index 8726eba2de0f70..ba40d7d40cc8bf 100644 --- a/src/sentry/static/sentry/app/components/smartSearchBar/utils.tsx +++ b/src/sentry/static/sentry/app/components/smartSearchBar/utils.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {t} from 'app/locale'; import {IconClock, IconStar, IconTag, IconToggle, IconUser} from 'app/icons'; +import {t} from 'app/locale'; import {ItemType, SearchGroup, SearchItem} from './types'; diff --git a/src/sentry/static/sentry/app/components/splitDiff.tsx b/src/sentry/static/sentry/app/components/splitDiff.tsx index b7665cba364d19..1872f7087d2aef 100644 --- a/src/sentry/static/sentry/app/components/splitDiff.tsx +++ b/src/sentry/static/sentry/app/components/splitDiff.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; -import {diffChars, diffWords, diffLines, Change} from 'diff'; +import {Change, diffChars, diffLines, diffWords} from 'diff'; +import PropTypes from 'prop-types'; const diffFnMap = { chars: diffChars, diff --git a/src/sentry/static/sentry/app/components/spreadLayout.tsx b/src/sentry/static/sentry/app/components/spreadLayout.tsx index 0d9e4cd4ea98ee..ad19ab8a91a906 100644 --- a/src/sentry/static/sentry/app/components/spreadLayout.tsx +++ b/src/sentry/static/sentry/app/components/spreadLayout.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import classNames from 'classnames'; +import PropTypes from 'prop-types'; type Props = React.HTMLAttributes<HTMLDivElement> & { responsive?: boolean; diff --git a/src/sentry/static/sentry/app/components/stacktracePreview.tsx b/src/sentry/static/sentry/app/components/stacktracePreview.tsx index b1974677cf48f0..7a0da6ad42efb2 100644 --- a/src/sentry/static/sentry/app/components/stacktracePreview.tsx +++ b/src/sentry/static/sentry/app/components/stacktracePreview.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Event, Organization, PlatformType} from 'app/types'; import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; -import Hovercard, {Body} from 'app/components/hovercard'; import {isStacktraceNewestFirst} from 'app/components/events/interfaces/stacktrace'; import StacktraceContent from 'app/components/events/interfaces/stacktraceContent'; +import Hovercard, {Body} from 'app/components/hovercard'; +import {Event, Organization, PlatformType} from 'app/types'; +import withApi from 'app/utils/withApi'; type Props = { issueId: string; diff --git a/src/sentry/static/sentry/app/components/stream/group.tsx b/src/sentry/static/sentry/app/components/stream/group.tsx index 392adf449fc6c3..253864ce308ffa 100644 --- a/src/sentry/static/sentry/app/components/stream/group.tsx +++ b/src/sentry/static/sentry/app/components/stream/group.tsx @@ -1,36 +1,36 @@ -import $ from 'jquery'; -// eslint-disable-next-line no-restricted-imports -import {Flex, Box} from 'reflexbox'; import React from 'react'; import styled from '@emotion/styled'; import classNames from 'classnames'; +import $ from 'jquery'; +// eslint-disable-next-line no-restricted-imports +import {Box, Flex} from 'reflexbox'; -import {GlobalSelection, Group, NewQuery, Organization, User} from 'app/types'; -import {PanelItem} from 'app/components/panels'; -import {valueIsEqual} from 'app/utils'; import AssigneeSelector from 'app/components/assigneeSelector'; +import GuideAnchor from 'app/components/assistant/guideAnchor'; import Count from 'app/components/count'; import DropdownMenu from 'app/components/dropdownMenu'; import EventOrGroupExtraDetails from 'app/components/eventOrGroupExtraDetails'; import EventOrGroupHeader from 'app/components/eventOrGroupHeader'; +import InboxReason from 'app/components/group/inboxBadges/inboxReason'; +import TimesTag from 'app/components/group/inboxBadges/timesTag'; +import Link from 'app/components/links/link'; +import MenuItem from 'app/components/menuItem'; +import {getRelativeSummary} from 'app/components/organizations/timeRangeSelector/utils'; +import {PanelItem} from 'app/components/panels'; import GroupChart from 'app/components/stream/groupChart'; import GroupCheckBox from 'app/components/stream/groupCheckBox'; +import {DEFAULT_STATS_PERIOD} from 'app/constants'; +import {t} from 'app/locale'; import GroupStore from 'app/stores/groupStore'; -import GuideAnchor from 'app/components/assistant/guideAnchor'; -import MenuItem from 'app/components/menuItem'; import SelectedGroupStore from 'app/stores/selectedGroupStore'; import space from 'app/styles/space'; -import {getRelativeSummary} from 'app/components/organizations/timeRangeSelector/utils'; -import {DEFAULT_STATS_PERIOD} from 'app/constants'; -import withGlobalSelection from 'app/utils/withGlobalSelection'; -import withOrganization from 'app/utils/withOrganization'; +import {GlobalSelection, Group, NewQuery, Organization, User} from 'app/types'; +import {valueIsEqual} from 'app/utils'; +import {callIfFunction} from 'app/utils/callIfFunction'; import EventView from 'app/utils/discover/eventView'; -import {t} from 'app/locale'; -import Link from 'app/components/links/link'; import {queryToObj} from 'app/utils/stream'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import TimesTag from 'app/components/group/inboxBadges/timesTag'; -import InboxReason from 'app/components/group/inboxBadges/inboxReason'; +import withGlobalSelection from 'app/utils/withGlobalSelection'; +import withOrganization from 'app/utils/withOrganization'; const DiscoveryExclusionFields: string[] = [ 'query', diff --git a/src/sentry/static/sentry/app/components/stream/groupChart.tsx b/src/sentry/static/sentry/app/components/stream/groupChart.tsx index b9d8a90b2ee4c1..0c3565866d3493 100644 --- a/src/sentry/static/sentry/app/components/stream/groupChart.tsx +++ b/src/sentry/static/sentry/app/components/stream/groupChart.tsx @@ -1,10 +1,10 @@ -import LazyLoad from 'react-lazyload'; import React from 'react'; +import LazyLoad from 'react-lazyload'; -import {Series} from 'app/types/echarts'; -import {Group, TimeseriesValue} from 'app/types'; -import {t} from 'app/locale'; import MiniBarChart from 'app/components/charts/miniBarChart'; +import {t} from 'app/locale'; +import {Group, TimeseriesValue} from 'app/types'; +import {Series} from 'app/types/echarts'; import theme from 'app/utils/theme'; type Props = { diff --git a/src/sentry/static/sentry/app/components/stream/groupCheckBox.tsx b/src/sentry/static/sentry/app/components/stream/groupCheckBox.tsx index f6607eb8200720..89fa6f25f1a8e7 100644 --- a/src/sentry/static/sentry/app/components/stream/groupCheckBox.tsx +++ b/src/sentry/static/sentry/app/components/stream/groupCheckBox.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; -import {t} from 'app/locale'; import Checkbox from 'app/components/checkbox'; +import {t} from 'app/locale'; import SelectedGroupStore from 'app/stores/selectedGroupStore'; type Props = { diff --git a/src/sentry/static/sentry/app/components/stream/processingIssueHint.tsx b/src/sentry/static/sentry/app/components/stream/processingIssueHint.tsx index a4fb7c02165e7c..1827016d656475 100644 --- a/src/sentry/static/sentry/app/components/stream/processingIssueHint.tsx +++ b/src/sentry/static/sentry/app/components/stream/processingIssueHint.tsx @@ -3,11 +3,11 @@ import styled from '@emotion/styled'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; -import {ProcessingIssue} from 'app/types'; -import {IconWarning, IconSettings} from 'app/icons'; import TimeSince from 'app/components/timeSince'; -import {t, tn, tct} from 'app/locale'; +import {IconSettings, IconWarning} from 'app/icons'; +import {t, tct, tn} from 'app/locale'; import space from 'app/styles/space'; +import {ProcessingIssue} from 'app/types'; type Props = { showProject: boolean; diff --git a/src/sentry/static/sentry/app/components/stream/processingIssueList.tsx b/src/sentry/static/sentry/app/components/stream/processingIssueList.tsx index 82e51759cea221..5dc4f131dbcfc3 100644 --- a/src/sentry/static/sentry/app/components/stream/processingIssueList.tsx +++ b/src/sentry/static/sentry/app/components/stream/processingIssueList.tsx @@ -2,11 +2,11 @@ import React from 'react'; import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; -import {Client} from 'app/api'; -import {Organization, ProcessingIssue} from 'app/types'; import {fetchProcessingIssues} from 'app/actionCreators/processingIssues'; +import {Client} from 'app/api'; import ProcessingIssueHint from 'app/components/stream/processingIssueHint'; import SentryTypes from 'app/sentryTypes'; +import {Organization, ProcessingIssue} from 'app/types'; const defaultProps = { showProject: false, diff --git a/src/sentry/static/sentry/app/components/subscribeButton.tsx b/src/sentry/static/sentry/app/components/subscribeButton.tsx index ebe21d3cca2320..6cf31b90278af4 100644 --- a/src/sentry/static/sentry/app/components/subscribeButton.tsx +++ b/src/sentry/static/sentry/app/components/subscribeButton.tsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import Button from 'app/components/button'; -import {t} from 'app/locale'; import {IconBell} from 'app/icons'; +import {t} from 'app/locale'; type Props = { onClick: (e: React.MouseEvent) => void; diff --git a/src/sentry/static/sentry/app/components/switch.tsx b/src/sentry/static/sentry/app/components/switch.tsx index 52ecdeaa5f3981..e235ee19f5acd6 100644 --- a/src/sentry/static/sentry/app/components/switch.tsx +++ b/src/sentry/static/sentry/app/components/switch.tsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; type Props = { forwardRef?: React.Ref<HTMLButtonElement>; diff --git a/src/sentry/static/sentry/app/components/tag.tsx b/src/sentry/static/sentry/app/components/tag.tsx index 1a06599bd63b16..704fe34fe5c3f1 100644 --- a/src/sentry/static/sentry/app/components/tag.tsx +++ b/src/sentry/static/sentry/app/components/tag.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {defined} from 'app/utils'; -import theme, {Theme, Color} from 'app/utils/theme'; -import space from 'app/styles/space'; -import {IconClose, IconOpen} from 'app/icons'; import Button from 'app/components/button'; -import Tooltip from 'app/components/tooltip'; import ExternalLink from 'app/components/links/externalLink'; import Link from 'app/components/links/link'; +import Tooltip from 'app/components/tooltip'; +import {IconClose, IconOpen} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {defined} from 'app/utils'; +import theme, {Color, Theme} from 'app/utils/theme'; const TAG_HEIGHT = '20px'; diff --git a/src/sentry/static/sentry/app/components/tagDeprecated.tsx b/src/sentry/static/sentry/app/components/tagDeprecated.tsx index 6f7faf2c57c64e..494416ee2cfc63 100644 --- a/src/sentry/static/sentry/app/components/tagDeprecated.tsx +++ b/src/sentry/static/sentry/app/components/tagDeprecated.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Theme} from 'app/utils/theme'; import space from 'app/styles/space'; +import {Theme} from 'app/utils/theme'; type Props = React.HTMLAttributes<HTMLDivElement> & { priority?: keyof Theme['badge'] | keyof Theme['alert']; diff --git a/src/sentry/static/sentry/app/components/tagDistributionMeter.tsx b/src/sentry/static/sentry/app/components/tagDistributionMeter.tsx index 7da25acd47c640..fbba6c9174ccd7 100644 --- a/src/sentry/static/sentry/app/components/tagDistributionMeter.tsx +++ b/src/sentry/static/sentry/app/components/tagDistributionMeter.tsx @@ -1,17 +1,17 @@ import React from 'react'; import {Link} from 'react-router'; +import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; import {LocationDescriptor} from 'history'; import PropTypes from 'prop-types'; -import styled from '@emotion/styled'; -import isPropValid from '@emotion/is-prop-valid'; import {TagSegment} from 'app/actionCreators/events'; +import Tooltip from 'app/components/tooltip'; +import Version from 'app/components/version'; import {t} from 'app/locale'; -import space from 'app/styles/space'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {percent} from 'app/utils'; -import Tooltip from 'app/components/tooltip'; -import Version from 'app/components/version'; type DefaultProps = { isLoading: boolean; diff --git a/src/sentry/static/sentry/app/components/tagsTable.tsx b/src/sentry/static/sentry/app/components/tagsTable.tsx index 37da8c935517be..f1e1cf0cd5a6a2 100644 --- a/src/sentry/static/sentry/app/components/tagsTable.tsx +++ b/src/sentry/static/sentry/app/components/tagsTable.tsx @@ -5,11 +5,11 @@ import {LocationDescriptor} from 'history'; import {SectionHeading} from 'app/components/charts/styles'; import Link from 'app/components/links/link'; import Tooltip from 'app/components/tooltip'; +import Version from 'app/components/version'; import {t} from 'app/locale'; -import space from 'app/styles/space'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {Event, EventTag} from 'app/types'; -import Version from 'app/components/version'; type Props = { event: Event; diff --git a/src/sentry/static/sentry/app/components/teams/createTeamForm.tsx b/src/sentry/static/sentry/app/components/teams/createTeamForm.tsx index b585ae50bf405b..4e8cac483255d5 100644 --- a/src/sentry/static/sentry/app/components/teams/createTeamForm.tsx +++ b/src/sentry/static/sentry/app/components/teams/createTeamForm.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import {callIfFunction} from 'app/utils/callIfFunction'; import {t} from 'app/locale'; import {Organization} from 'app/types'; +import {callIfFunction} from 'app/utils/callIfFunction'; +import slugify from 'app/utils/slugify'; import Form from 'app/views/settings/components/forms/form'; import TextField from 'app/views/settings/components/forms/textField'; -import slugify from 'app/utils/slugify'; type Payload = { slug: string; diff --git a/src/sentry/static/sentry/app/components/text.tsx b/src/sentry/static/sentry/app/components/text.tsx index 63acd8d55a6760..bf19a87234e4e7 100644 --- a/src/sentry/static/sentry/app/components/text.tsx +++ b/src/sentry/static/sentry/app/components/text.tsx @@ -1,8 +1,8 @@ import styled from '@emotion/styled'; +import Panel from 'app/components/panels/panel'; import space from 'app/styles/space'; import textStyles from 'app/styles/text'; -import Panel from 'app/components/panels/panel'; const Text = styled('div')` ${textStyles}; diff --git a/src/sentry/static/sentry/app/components/textOverflow.tsx b/src/sentry/static/sentry/app/components/textOverflow.tsx index ee2d0266533a3f..42b9cbadc12323 100644 --- a/src/sentry/static/sentry/app/components/textOverflow.tsx +++ b/src/sentry/static/sentry/app/components/textOverflow.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import overflowEllipsisLeft from 'app/styles/overflowEllipsisLeft'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import overflowEllipsisLeft from 'app/styles/overflowEllipsisLeft'; type Props = { children: React.ReactNode; diff --git a/src/sentry/static/sentry/app/components/timeSince.tsx b/src/sentry/static/sentry/app/components/timeSince.tsx index 9511ce58c7cf33..96f245c19fa070 100644 --- a/src/sentry/static/sentry/app/components/timeSince.tsx +++ b/src/sentry/static/sentry/app/components/timeSince.tsx @@ -1,13 +1,13 @@ +import React from 'react'; import isNumber from 'lodash/isNumber'; import isString from 'lodash/isString'; -import PropTypes from 'prop-types'; -import React from 'react'; import moment from 'moment-timezone'; +import PropTypes from 'prop-types'; -import ConfigStore from 'app/stores/configStore'; import {t} from 'app/locale'; -import getDynamicText from 'app/utils/getDynamicText'; +import ConfigStore from 'app/stores/configStore'; import {getDuration} from 'app/utils/formatters'; +import getDynamicText from 'app/utils/getDynamicText'; import Tooltip from './tooltip'; diff --git a/src/sentry/static/sentry/app/components/tooltip.tsx b/src/sentry/static/sentry/app/components/tooltip.tsx index ff06ed16b125d6..8942f7efffe36e 100644 --- a/src/sentry/static/sentry/app/components/tooltip.tsx +++ b/src/sentry/static/sentry/app/components/tooltip.tsx @@ -1,13 +1,13 @@ -import {Manager, Reference, Popper} from 'react-popper'; -import * as PopperJS from 'popper.js'; -import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; +import {Manager, Popper, Reference} from 'react-popper'; import styled, {SerializedStyles} from '@emotion/styled'; import memoize from 'lodash/memoize'; +import * as PopperJS from 'popper.js'; +import PropTypes from 'prop-types'; -import {domId} from 'app/utils/domId'; import {IS_ACCEPTANCE_TEST} from 'app/constants'; +import {domId} from 'app/utils/domId'; const IS_HOVERABLE_DELAY = 50; // used if isHoverable is true (for hiding AND showing) diff --git a/src/sentry/static/sentry/app/components/u2f/u2fContainer.tsx b/src/sentry/static/sentry/app/components/u2f/u2fContainer.tsx index 45bb13a122eb03..94e545935cd836 100644 --- a/src/sentry/static/sentry/app/components/u2f/u2fContainer.tsx +++ b/src/sentry/static/sentry/app/components/u2f/u2fContainer.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import withApi from 'app/utils/withApi'; import {Client} from 'app/api'; import {Authenticator} from 'app/types'; +import withApi from 'app/utils/withApi'; import U2fSign from './u2fsign'; diff --git a/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx b/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx index 48eb5c62095ed2..c16b88a1d342ea 100644 --- a/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx +++ b/src/sentry/static/sentry/app/components/u2f/u2finterface.jsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import u2f from 'u2f-api'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; +import u2f from 'u2f-api'; -import ConfigStore from 'app/stores/configStore'; import {t, tct} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; class U2fInterface extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/components/u2f/u2fsign.jsx b/src/sentry/static/sentry/app/components/u2f/u2fsign.jsx index 653a4a4a5e5492..6cce4ff54547c9 100644 --- a/src/sentry/static/sentry/app/components/u2f/u2fsign.jsx +++ b/src/sentry/static/sentry/app/components/u2f/u2fsign.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/components/userMisery.tsx b/src/sentry/static/sentry/app/components/userMisery.tsx index f324454943ab51..c1aec04550734e 100644 --- a/src/sentry/static/sentry/app/components/userMisery.tsx +++ b/src/sentry/static/sentry/app/components/userMisery.tsx @@ -1,9 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {tct} from 'app/locale'; import ScoreBar from 'app/components/scoreBar'; import Tooltip from 'app/components/tooltip'; +import {tct} from 'app/locale'; import theme from 'app/utils/theme'; type Props = { diff --git a/src/sentry/static/sentry/app/components/version.tsx b/src/sentry/static/sentry/app/components/version.tsx index f9ac4427760ce1..322213f61027e3 100644 --- a/src/sentry/static/sentry/app/components/version.tsx +++ b/src/sentry/static/sentry/app/components/version.tsx @@ -1,22 +1,22 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import {css} from '@emotion/core'; -import styled from '@emotion/styled'; import {withRouter} from 'react-router'; import {WithRouterProps} from 'react-router/lib/withRouter'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Organization} from 'app/types'; -import SentryTypes from 'app/sentryTypes'; +import Clipboard from 'app/components/clipboard'; import GlobalSelectionLink from 'app/components/globalSelectionLink'; import Link from 'app/components/links/link'; import Tooltip from 'app/components/tooltip'; import {IconCopy} from 'app/icons'; -import Clipboard from 'app/components/clipboard'; +import SentryTypes from 'app/sentryTypes'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; +import {Organization} from 'app/types'; import {formatVersion} from 'app/utils/formatters'; -import withOrganization from 'app/utils/withOrganization'; import theme from 'app/utils/theme'; +import withOrganization from 'app/utils/withOrganization'; type Props = { /** diff --git a/src/sentry/static/sentry/app/components/versionHoverCard.tsx b/src/sentry/static/sentry/app/components/versionHoverCard.tsx index d5e953253288d5..7a446827fd7cee 100644 --- a/src/sentry/static/sentry/app/components/versionHoverCard.tsx +++ b/src/sentry/static/sentry/app/components/versionHoverCard.tsx @@ -1,24 +1,24 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import AvatarList from 'app/components/avatar/avatarList'; import Button from 'app/components/button'; +import Clipboard from 'app/components/clipboard'; import Hovercard from 'app/components/hovercard'; import LastCommit from 'app/components/lastCommit'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; import RepoLabel from 'app/components/repoLabel'; import TimeSince from 'app/components/timeSince'; +import Version from 'app/components/version'; +import {IconCopy} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Deploy, Release, Repository} from 'app/types'; import withApi from 'app/utils/withApi'; import withRelease from 'app/utils/withRelease'; import withRepositories from 'app/utils/withRepositories'; -import Clipboard from 'app/components/clipboard'; -import {IconCopy} from 'app/icons'; -import Version from 'app/components/version'; -import {Client} from 'app/api'; -import {Deploy, Release, Repository} from 'app/types'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx b/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx index 4abcf98057beea..f98d6f3c623c35 100644 --- a/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx +++ b/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx @@ -1,7 +1,7 @@ -import timezones from 'app/data/timezones'; import languages from 'app/data/languages'; -import {JsonFormObject} from 'app/views/settings/components/forms/type'; +import timezones from 'app/data/timezones'; import {t} from 'app/locale'; +import {JsonFormObject} from 'app/views/settings/components/forms/type'; // Export route to make these forms searchable by label/help export const route = '/settings/account/details/'; diff --git a/src/sentry/static/sentry/app/data/forms/apiApplication.tsx b/src/sentry/static/sentry/app/data/forms/apiApplication.tsx index b8330f44386723..d6d3ff7c8c4261 100644 --- a/src/sentry/static/sentry/app/data/forms/apiApplication.tsx +++ b/src/sentry/static/sentry/app/data/forms/apiApplication.tsx @@ -1,4 +1,4 @@ -import {extractMultilineFields, convertMultilineFieldValue} from 'app/utils'; +import {convertMultilineFieldValue, extractMultilineFields} from 'app/utils'; import getDynamicText from 'app/utils/getDynamicText'; import {JsonFormObject} from 'app/views/settings/components/forms/type'; diff --git a/src/sentry/static/sentry/app/data/forms/inboundFilters.tsx b/src/sentry/static/sentry/app/data/forms/inboundFilters.tsx index 38d0addc9368d9..30464d960774f6 100644 --- a/src/sentry/static/sentry/app/data/forms/inboundFilters.tsx +++ b/src/sentry/static/sentry/app/data/forms/inboundFilters.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {t, tct} from 'app/locale'; import ExternalLink from 'app/components/links/externalLink'; -import {JsonFormObject, Field} from 'app/views/settings/components/forms/type'; +import {t, tct} from 'app/locale'; +import {Field, JsonFormObject} from 'app/views/settings/components/forms/type'; // Export route to make these forms searchable by label/help export const route = '/settings/:orgId/projects/:projectId/filters/'; diff --git a/src/sentry/static/sentry/app/data/forms/organizationGeneralSettings.tsx b/src/sentry/static/sentry/app/data/forms/organizationGeneralSettings.tsx index ef3f21e3652a03..d8429638c1fc10 100644 --- a/src/sentry/static/sentry/app/data/forms/organizationGeneralSettings.tsx +++ b/src/sentry/static/sentry/app/data/forms/organizationGeneralSettings.tsx @@ -1,7 +1,7 @@ import {t} from 'app/locale'; +import {MemberRole} from 'app/types'; import slugify from 'app/utils/slugify'; import {JsonFormObject} from 'app/views/settings/components/forms/type'; -import {MemberRole} from 'app/types'; // Export route to make these forms searchable by label/help export const route = '/settings/:orgId/'; diff --git a/src/sentry/static/sentry/app/data/forms/organizationSecurityAndPrivacyGroups.tsx b/src/sentry/static/sentry/app/data/forms/organizationSecurityAndPrivacyGroups.tsx index 269b51fba68203..5e9be77b349b6e 100644 --- a/src/sentry/static/sentry/app/data/forms/organizationSecurityAndPrivacyGroups.tsx +++ b/src/sentry/static/sentry/app/data/forms/organizationSecurityAndPrivacyGroups.tsx @@ -1,8 +1,8 @@ -import {extractMultilineFields, convertMultilineFieldValue} from 'app/utils'; import {t} from 'app/locale'; +import {convertMultilineFieldValue, extractMultilineFields} from 'app/utils'; import { - getStoreCrashReportsValues, formatStoreCrashReports, + getStoreCrashReportsValues, SettingScope, } from 'app/utils/crashReports'; import {JsonFormObject} from 'app/views/settings/components/forms/type'; diff --git a/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx b/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx index 71fe21cc3d85b4..f98800bd8679b4 100644 --- a/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx +++ b/src/sentry/static/sentry/app/data/forms/projectDebugFiles.jsx @@ -1,13 +1,13 @@ -import isObject from 'lodash/isObject'; +import React from 'react'; import forEach from 'lodash/forEach'; +import isObject from 'lodash/isObject'; import set from 'lodash/set'; -import React from 'react'; -import {t} from 'app/locale'; import {openDebugFileSourceModal} from 'app/actionCreators/modal'; import Feature from 'app/components/acl/feature'; import FeatureDisabled from 'app/components/acl/featureDisabled'; import {DEBUG_SOURCE_TYPES} from 'app/data/debugFileSources'; +import {t} from 'app/locale'; import TextBlock from 'app/views/settings/components/text/textBlock'; // Export route to make these forms searchable by label/help diff --git a/src/sentry/static/sentry/app/data/forms/projectGeneralSettings.tsx b/src/sentry/static/sentry/app/data/forms/projectGeneralSettings.tsx index 90c55e685475ea..95ae0159c84462 100644 --- a/src/sentry/static/sentry/app/data/forms/projectGeneralSettings.tsx +++ b/src/sentry/static/sentry/app/data/forms/projectGeneralSettings.tsx @@ -2,12 +2,12 @@ import React from 'react'; import styled from '@emotion/styled'; import PlatformIcon from 'platformicons'; -import {extractMultilineFields, convertMultilineFieldValue} from 'app/utils'; +import platforms from 'app/data/platforms'; import {t, tct, tn} from 'app/locale'; +import space from 'app/styles/space'; +import {convertMultilineFieldValue, extractMultilineFields} from 'app/utils'; import getDynamicText from 'app/utils/getDynamicText'; -import platforms from 'app/data/platforms'; import slugify from 'app/utils/slugify'; -import space from 'app/styles/space'; import {Field} from 'app/views/settings/components/forms/type'; // Export route to make these forms searchable by label/help diff --git a/src/sentry/static/sentry/app/data/forms/projectIssueGrouping.tsx b/src/sentry/static/sentry/app/data/forms/projectIssueGrouping.tsx index 9a98e0176d771f..733b64435a9363 100644 --- a/src/sentry/static/sentry/app/data/forms/projectIssueGrouping.tsx +++ b/src/sentry/static/sentry/app/data/forms/projectIssueGrouping.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; +import {GroupingConfigItem} from 'app/components/events/groupingInfo'; +import ExternalLink from 'app/components/links/externalLink'; import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; import marked from 'app/utils/marked'; -import ExternalLink from 'app/components/links/externalLink'; -import {GroupingConfigItem} from 'app/components/events/groupingInfo'; import {Field} from 'app/views/settings/components/forms/type'; // Export route to make these forms searchable by label/help diff --git a/src/sentry/static/sentry/app/data/forms/projectSecurityAndPrivacyGroups.tsx b/src/sentry/static/sentry/app/data/forms/projectSecurityAndPrivacyGroups.tsx index 75b64faed1dc40..cbad05b7ae3a74 100644 --- a/src/sentry/static/sentry/app/data/forms/projectSecurityAndPrivacyGroups.tsx +++ b/src/sentry/static/sentry/app/data/forms/projectSecurityAndPrivacyGroups.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import {extractMultilineFields, convertMultilineFieldValue} from 'app/utils'; +import Link from 'app/components/links/link'; +import {t, tct} from 'app/locale'; +import {convertMultilineFieldValue, extractMultilineFields} from 'app/utils'; import { - getStoreCrashReportsValues, formatStoreCrashReports, + getStoreCrashReportsValues, SettingScope, } from 'app/utils/crashReports'; -import Link from 'app/components/links/link'; -import {t, tct} from 'app/locale'; import {JsonFormObject} from 'app/views/settings/components/forms/type'; // Export route to make these forms searchable by label/help diff --git a/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx b/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx index 58fd6500450507..f84443a9dfd3a3 100644 --- a/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx +++ b/src/sentry/static/sentry/app/data/forms/sentryApplication.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {extractMultilineFields} from 'app/utils'; +import ExternalLink from 'app/components/links/externalLink'; import {tct} from 'app/locale'; +import {extractMultilineFields} from 'app/utils'; import {Field} from 'app/views/settings/components/forms/type'; -import ExternalLink from 'app/components/links/externalLink'; const getPublicFormFields = (): Field[] => [ { diff --git a/src/sentry/static/sentry/app/data/platforms.tsx b/src/sentry/static/sentry/app/data/platforms.tsx index 27620ebcce814d..75d67a37829e7c 100644 --- a/src/sentry/static/sentry/app/data/platforms.tsx +++ b/src/sentry/static/sentry/app/data/platforms.tsx @@ -1,7 +1,8 @@ /* eslint import/no-unresolved:0 import/order:0 */ -import {PlatformIntegration} from 'app/types'; import {platforms} from 'integration-docs-platforms'; + import {t} from 'app/locale'; +import {PlatformIntegration} from 'app/types'; import {tracing} from './platformCategories'; diff --git a/src/sentry/static/sentry/app/icons/iconBusiness.tsx b/src/sentry/static/sentry/app/icons/iconBusiness.tsx index f5c589c6b8939f..8a60ecab20295b 100644 --- a/src/sentry/static/sentry/app/icons/iconBusiness.tsx +++ b/src/sentry/static/sentry/app/icons/iconBusiness.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import styled from '@emotion/styled'; import {keyframes} from '@emotion/core'; +import styled from '@emotion/styled'; import SvgIcon from './svgIcon'; diff --git a/src/sentry/static/sentry/app/icons/iconFire.tsx b/src/sentry/static/sentry/app/icons/iconFire.tsx index 6864b17ef44a18..b95b60eef72fd5 100644 --- a/src/sentry/static/sentry/app/icons/iconFire.tsx +++ b/src/sentry/static/sentry/app/icons/iconFire.tsx @@ -20,4 +20,4 @@ const IconFire = React.forwardRef(function IconFire( IconFire.displayName = 'IconFire'; -export {IconFire, FIRE_SVG_PATH}; +export {FIRE_SVG_PATH, IconFire}; diff --git a/src/sentry/static/sentry/app/icons/iconGraph.tsx b/src/sentry/static/sentry/app/icons/iconGraph.tsx index db3e02c28336b8..4925dbe65f45a9 100644 --- a/src/sentry/static/sentry/app/icons/iconGraph.tsx +++ b/src/sentry/static/sentry/app/icons/iconGraph.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import SvgIcon from './svgIcon'; -import {IconGraphLine} from './iconGraphLine'; -import {IconGraphCircle} from './iconGraphCircle'; import {IconGraphBar} from './iconGraphBar'; +import {IconGraphCircle} from './iconGraphCircle'; +import {IconGraphLine} from './iconGraphLine'; +import SvgIcon from './svgIcon'; type Props = React.ComponentProps<typeof SvgIcon> & { type?: 'line' | 'circle' | 'bar'; diff --git a/src/sentry/static/sentry/app/icons/index.tsx b/src/sentry/static/sentry/app/icons/index.tsx index a0eedc2bbfb625..8f69c50cc8687e 100644 --- a/src/sentry/static/sentry/app/icons/index.tsx +++ b/src/sentry/static/sentry/app/icons/index.tsx @@ -4,6 +4,7 @@ export {IconAnchor} from './iconAnchor'; export {IconArrow} from './iconArrow'; export {IconAsana} from './iconAsana'; export {IconAttachment} from './iconAttachment'; +export {IconBell} from './iconBell'; export {IconBitbucket} from './iconBitbucket'; export {IconBookmark} from './iconBookmark'; export {IconBroadcast} from './iconBroadcast'; @@ -18,11 +19,11 @@ export {IconClock} from './iconClock'; export {IconClose} from './iconClose'; export {IconClubhouse} from './iconClubhouse'; export {IconCommit} from './iconCommit'; +export {IconCopy} from './iconCopy'; export {IconDashboard} from './iconDashboard'; export {IconDelete} from './iconDelete'; export {IconDocs} from './iconDocs'; export {IconDownload} from './iconDownload'; -export {IconCopy} from './iconCopy'; export {IconEdit} from './iconEdit'; export {IconEllipsis} from './iconEllipsis'; export {IconEvent} from './iconEvent'; @@ -54,13 +55,14 @@ export {IconMail} from './iconMail'; export {IconMarkdown} from './iconMarkdown'; export {IconMegaphone} from './iconMegaphone'; export {IconMenu} from './iconMenu'; +export {IconMobile} from './iconMobile'; export {IconMute} from './iconMute'; export {IconNext} from './iconNext'; export {IconNot} from './iconNot'; export {IconOpen} from './iconOpen'; export {IconPause} from './iconPause'; -export {IconPlay} from './iconPlay'; export {IconPin} from './iconPin'; +export {IconPlay} from './iconPlay'; export {IconPrevious} from './iconPrevious'; export {IconPrint} from './iconPrint'; export {IconProject} from './iconProject'; @@ -83,10 +85,12 @@ export {IconStar} from './iconStar'; export {IconStats} from './iconStats'; export {IconSubtract} from './iconSubtract'; export {IconSupport} from './iconSupport'; +export {IconSwitch} from './iconSwitch'; export {IconSync} from './iconSync'; export {IconTag} from './iconTag'; export {IconTeamwork} from './iconTeamwork'; export {IconTelescope} from './iconTelescope'; +export {IconTerminal} from './iconTerminal'; export {IconToggle} from './iconToggle'; export {IconTrello} from './iconTrello'; export {IconUpgrade} from './iconUpgrade'; @@ -96,7 +100,3 @@ export {IconVercel} from './iconVercel'; export {IconVsts} from './iconVsts'; export {IconWarning} from './iconWarning'; export {IconWindow} from './iconWindow'; -export {IconTerminal} from './iconTerminal'; -export {IconSwitch} from './iconSwitch'; -export {IconMobile} from './iconMobile'; -export {IconBell} from './iconBell'; diff --git a/src/sentry/static/sentry/app/icons/svgIcon.tsx b/src/sentry/static/sentry/app/icons/svgIcon.tsx index aafe0a7f618b1a..46790ec615a17c 100644 --- a/src/sentry/static/sentry/app/icons/svgIcon.tsx +++ b/src/sentry/static/sentry/app/icons/svgIcon.tsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import theme, {IconSize, Color} from 'app/utils/theme'; +import theme, {Color, IconSize} from 'app/utils/theme'; type Props = React.SVGAttributes<SVGElement> & { color?: Color; diff --git a/src/sentry/static/sentry/app/locale.tsx b/src/sentry/static/sentry/app/locale.tsx index 40935060847688..503029647d8604 100644 --- a/src/sentry/static/sentry/app/locale.tsx +++ b/src/sentry/static/sentry/app/locale.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import {css} from '@emotion/core'; import Jed from 'jed'; -import {sprintf} from 'sprintf-js'; -import isString from 'lodash/isString'; import isArray from 'lodash/isArray'; import isObject from 'lodash/isObject'; -import {css} from '@emotion/core'; +import isString from 'lodash/isString'; +import {sprintf} from 'sprintf-js'; import {getTranslations} from 'app/translations'; @@ -361,4 +361,4 @@ export function gettextComponentTemplate(template: string, components: Component /** * Shorthand versions should primarily be used. */ -export {gettext as t, ngettext as tn, gettextComponentTemplate as tct}; +export {gettext as t, gettextComponentTemplate as tct, ngettext as tn}; diff --git a/src/sentry/static/sentry/app/main.tsx b/src/sentry/static/sentry/app/main.tsx index 505b9e657cf2e5..0be2189a4feb5b 100644 --- a/src/sentry/static/sentry/app/main.tsx +++ b/src/sentry/static/sentry/app/main.tsx @@ -1,14 +1,14 @@ +import React from 'react'; +import {browserHistory, Router} from 'react-router'; import {CacheProvider} from '@emotion/core'; // This is needed to set "speedy" = false (for percy) -import {ThemeProvider} from 'emotion-theming'; import {cache} from 'emotion'; // eslint-disable-line emotion/no-vanilla -import React from 'react'; -import {Router, browserHistory} from 'react-router'; +import {ThemeProvider} from 'emotion-theming'; -import {Config} from 'app/types'; import {loadPreferencesState} from 'app/actionCreators/preferences'; +import routes from 'app/routes'; import ConfigStore from 'app/stores/configStore'; import GlobalStyles from 'app/styles/global'; -import routes from 'app/routes'; +import {Config} from 'app/types'; import theme, {darkTheme, Theme} from 'app/utils/theme'; import withConfig from 'app/utils/withConfig'; diff --git a/src/sentry/static/sentry/app/plugins/basePlugin.tsx b/src/sentry/static/sentry/app/plugins/basePlugin.tsx index d0dda08ad27b9a..3bae11a2a5d664 100644 --- a/src/sentry/static/sentry/app/plugins/basePlugin.tsx +++ b/src/sentry/static/sentry/app/plugins/basePlugin.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Settings from 'app/plugins/components/settings'; -import {Plugin, Project, Organization} from 'app/types'; +import {Organization, Plugin, Project} from 'app/types'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/plugins/components/issueActions.tsx b/src/sentry/static/sentry/app/plugins/components/issueActions.tsx index 85f57797efae61..c1655281e7cf7b 100644 --- a/src/sentry/static/sentry/app/plugins/components/issueActions.tsx +++ b/src/sentry/static/sentry/app/plugins/components/issueActions.tsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {Form, FormState} from 'app/components/forms'; import GroupActions from 'app/actions/groupActions'; +import PluginComponentBase from 'app/components/bases/pluginComponentBase'; +import {Form, FormState} from 'app/components/forms'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import PluginComponentBase from 'app/components/bases/pluginComponentBase'; import {t} from 'app/locale'; -import {Organization, Project, Plugin, Group} from 'app/types'; +import {Group, Organization, Plugin, Project} from 'app/types'; type Field = { has_autocomplete?: boolean; diff --git a/src/sentry/static/sentry/app/plugins/components/pluginIcon.tsx b/src/sentry/static/sentry/app/plugins/components/pluginIcon.tsx index f8536efc96ac74..0103517594e152 100644 --- a/src/sentry/static/sentry/app/plugins/components/pluginIcon.tsx +++ b/src/sentry/static/sentry/app/plugins/components/pluginIcon.tsx @@ -1,18 +1,18 @@ -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import placeholder from 'app/../images/logos/logo-default.svg'; -import sentry from 'app/../images/logos/logo-sentry.svg'; import amixr from 'app/../images/logos/logo-amixr.svg'; import asana from 'app/../images/logos/logo-asana.svg'; import asayer from 'app/../images/logos/logo-asayer.svg'; import aws from 'app/../images/logos/logo-aws.svg'; +import vsts from 'app/../images/logos/logo-azure.svg'; import bitbucket from 'app/../images/logos/logo-bitbucket.svg'; import bitbucketserver from 'app/../images/logos/logo-bitbucket-server.svg'; import campfire from 'app/../images/logos/logo-campfire.svg'; import clickup from 'app/../images/logos/logo-clickup.svg'; import clubhouse from 'app/../images/logos/logo-clubhouse.svg'; import datadog from 'app/../images/logos/logo-datadog.svg'; +import placeholder from 'app/../images/logos/logo-default.svg'; import flowdock from 'app/../images/logos/logo-flowdock.svg'; import fullstory from 'app/../images/logos/logo-fullstory.svg'; import github from 'app/../images/logos/logo-github.svg'; @@ -35,17 +35,17 @@ import redmine from 'app/../images/logos/logo-redmine.svg'; import rocketchat from 'app/../images/logos/logo-rocketchat.svg'; import rookout from 'app/../images/logos/logo-rookout.svg'; import segment from 'app/../images/logos/logo-segment.svg'; +import sentry from 'app/../images/logos/logo-sentry.svg'; import slack from 'app/../images/logos/logo-slack.svg'; import split from 'app/../images/logos/logo-split.svg'; import taiga from 'app/../images/logos/logo-taiga.svg'; import teamwork from 'app/../images/logos/logo-teamwork.svg'; import trello from 'app/../images/logos/logo-trello.svg'; import twilio from 'app/../images/logos/logo-twilio.svg'; -import visualstudio from 'app/../images/logos/logo-visualstudio.svg'; -import vsts from 'app/../images/logos/logo-azure.svg'; -import youtrack from 'app/../images/logos/logo-youtrack.svg'; import vercel from 'app/../images/logos/logo-vercel.svg'; import victorops from 'app/../images/logos/logo-victorops.svg'; +import visualstudio from 'app/../images/logos/logo-visualstudio.svg'; +import youtrack from 'app/../images/logos/logo-youtrack.svg'; import zulip from 'app/../images/logos/logo-zulip.svg'; // Map of plugin id -> logo filename diff --git a/src/sentry/static/sentry/app/plugins/components/settings.tsx b/src/sentry/static/sentry/app/plugins/components/settings.tsx index a207a7fd175aeb..c8cdfed1f2592f 100644 --- a/src/sentry/static/sentry/app/plugins/components/settings.tsx +++ b/src/sentry/static/sentry/app/plugins/components/settings.tsx @@ -1,15 +1,15 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import isEqual from 'lodash/isEqual'; import styled from '@emotion/styled'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; +import PluginComponentBase from 'app/components/bases/pluginComponentBase'; import {Form, FormState} from 'app/components/forms'; -import {parseRepo} from 'app/utils'; -import {t, tct} from 'app/locale'; import LoadingIndicator from 'app/components/loadingIndicator'; -import PluginComponentBase from 'app/components/bases/pluginComponentBase'; -import {trackIntegrationEvent, SingleIntegrationEvent} from 'app/utils/integrationUtil'; -import {Organization, Project, Plugin} from 'app/types'; +import {t, tct} from 'app/locale'; +import {Organization, Plugin, Project} from 'app/types'; +import {parseRepo} from 'app/utils'; +import {SingleIntegrationEvent, trackIntegrationEvent} from 'app/utils/integrationUtil'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/plugins/defaultIssuePlugin.tsx b/src/sentry/static/sentry/app/plugins/defaultIssuePlugin.tsx index 601229501c77b6..3a8e47d9b416ce 100644 --- a/src/sentry/static/sentry/app/plugins/defaultIssuePlugin.tsx +++ b/src/sentry/static/sentry/app/plugins/defaultIssuePlugin.tsx @@ -2,7 +2,7 @@ import React from 'react'; import BasePlugin from 'app/plugins/basePlugin'; import IssueActions from 'app/plugins/components/issueActions'; -import {Plugin, Group, Project, Organization} from 'app/types'; +import {Group, Organization, Plugin, Project} from 'app/types'; type Props = { plugin: Plugin; diff --git a/src/sentry/static/sentry/app/plugins/index.tsx b/src/sentry/static/sentry/app/plugins/index.tsx index 8ca64ba0202eef..10c1569c43e05a 100644 --- a/src/sentry/static/sentry/app/plugins/index.tsx +++ b/src/sentry/static/sentry/app/plugins/index.tsx @@ -1,10 +1,10 @@ -import Registry from 'app/plugins/registry'; import BasePlugin from 'app/plugins/basePlugin'; import DefaultIssuePlugin from 'app/plugins/defaultIssuePlugin'; +import Registry from 'app/plugins/registry'; -import SessionStackPlugin from './sessionstack'; import SessionStackContextType from './sessionstack/contexts/sessionstack'; import Jira from './jira'; +import SessionStackPlugin from './sessionstack'; const contexts: Record<string, React.ElementType> = {}; const registry = new Registry(); @@ -18,7 +18,7 @@ contexts.sessionstack = SessionStackContextType; // Jira registry.add('jira', Jira); -export {BasePlugin, registry, DefaultIssuePlugin}; +export {BasePlugin, DefaultIssuePlugin, registry}; const add: typeof registry.add = registry.add.bind(registry); const get: typeof registry.get = registry.get.bind(registry); diff --git a/src/sentry/static/sentry/app/plugins/jira/components/settings.tsx b/src/sentry/static/sentry/app/plugins/jira/components/settings.tsx index dcf2239daaca8f..9790a04581f0ea 100644 --- a/src/sentry/static/sentry/app/plugins/jira/components/settings.tsx +++ b/src/sentry/static/sentry/app/plugins/jira/components/settings.tsx @@ -2,8 +2,8 @@ import React from 'react'; import isEqual from 'lodash/isEqual'; import {Form, FormState} from 'app/components/forms'; -import DefaultSettings from 'app/plugins/components/settings'; import LoadingIndicator from 'app/components/loadingIndicator'; +import DefaultSettings from 'app/plugins/components/settings'; type Field = Parameters<typeof DefaultSettings.prototype.renderField>[0]['config']; diff --git a/src/sentry/static/sentry/app/plugins/jira/index.tsx b/src/sentry/static/sentry/app/plugins/jira/index.tsx index b87358deec7092..985a247c9ea3dd 100644 --- a/src/sentry/static/sentry/app/plugins/jira/index.tsx +++ b/src/sentry/static/sentry/app/plugins/jira/index.tsx @@ -3,8 +3,8 @@ import React from 'react'; import BasePlugin from 'app/plugins/basePlugin'; import DefaultIssuePlugin from 'app/plugins/defaultIssuePlugin'; -import Settings from './components/settings'; import IssueActions from './components/issueActions'; +import Settings from './components/settings'; class Jira extends DefaultIssuePlugin { displayName = 'Jira'; diff --git a/src/sentry/static/sentry/app/plugins/registry.tsx b/src/sentry/static/sentry/app/plugins/registry.tsx index f0aeac21dac868..5cb4d14f9b4a9e 100644 --- a/src/sentry/static/sentry/app/plugins/registry.tsx +++ b/src/sentry/static/sentry/app/plugins/registry.tsx @@ -1,9 +1,9 @@ /*eslint no-console:0*/ -import {DefaultPlugin} from 'app/plugins/defaultPlugin'; import {DefaultIssuePlugin} from 'app/plugins/defaultIssuePlugin'; +import {DefaultPlugin} from 'app/plugins/defaultPlugin'; import SessionStackPlugin from 'app/plugins/sessionstack'; -import {defined} from 'app/utils'; import {Plugin} from 'app/types'; +import {defined} from 'app/utils'; type PluginComponent = | typeof DefaultIssuePlugin diff --git a/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.tsx b/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.tsx index 08ecc0ec1345fd..48009a6a9d5d77 100644 --- a/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.tsx +++ b/src/sentry/static/sentry/app/plugins/sessionstack/components/settings.tsx @@ -2,8 +2,8 @@ import React from 'react'; import isEqual from 'lodash/isEqual'; import {Form, FormState} from 'app/components/forms'; -import DefaultSettings from 'app/plugins/components/settings'; import LoadingIndicator from 'app/components/loadingIndicator'; +import DefaultSettings from 'app/plugins/components/settings'; type Props = DefaultSettings['props']; diff --git a/src/sentry/static/sentry/app/plugins/sessionstack/contexts/sessionstack.tsx b/src/sentry/static/sentry/app/plugins/sessionstack/contexts/sessionstack.tsx index 5b6094ed9c1b36..817abddfe14b8e 100644 --- a/src/sentry/static/sentry/app/plugins/sessionstack/contexts/sessionstack.tsx +++ b/src/sentry/static/sentry/app/plugins/sessionstack/contexts/sessionstack.tsx @@ -1,6 +1,6 @@ -import $ from 'jquery'; import React from 'react'; import ReactDOM from 'react-dom'; +import $ from 'jquery'; import PropTypes from 'prop-types'; const ASPECT_RATIO = 16 / 9; diff --git a/src/sentry/static/sentry/app/routes.jsx b/src/sentry/static/sentry/app/routes.jsx index d444c3c2a65435..9b0624fa583e83 100644 --- a/src/sentry/static/sentry/app/routes.jsx +++ b/src/sentry/static/sentry/app/routes.jsx @@ -1,26 +1,26 @@ -import {Redirect, Route, IndexRoute, IndexRedirect} from 'react-router'; import React from 'react'; +import {IndexRedirect, IndexRoute, Redirect, Route} from 'react-router'; -import {t} from 'app/locale'; +import LazyLoad from 'app/components/lazyLoad'; import {EXPERIMENTAL_SPA} from 'app/constants'; +import {t} from 'app/locale'; +import HookStore from 'app/stores/hookStore'; +import errorHandler from 'app/utils/errorHandler'; import App from 'app/views/app'; import AuthLayout from 'app/views/auth/layout'; -import HookStore from 'app/stores/hookStore'; import IssueListContainer from 'app/views/issueList/container'; import IssueListOverview from 'app/views/issueList/overview'; -import LazyLoad from 'app/components/lazyLoad'; import OrganizationContext from 'app/views/organizationContext'; import OrganizationDetails, { LightWeightOrganizationDetails, } from 'app/views/organizationDetails'; +import {TAB} from 'app/views/organizationGroupDetails/header'; import OrganizationRoot from 'app/views/organizationRoot'; import ProjectEventRedirect from 'app/views/projectEventRedirect'; +import redirectDeprecatedProjectRoute from 'app/views/projects/redirectDeprecatedProjectRoute'; import RouteNotFound from 'app/views/routeNotFound'; import SettingsProjectProvider from 'app/views/settings/components/settingsProjectProvider'; import SettingsWrapper from 'app/views/settings/components/settingsWrapper'; -import errorHandler from 'app/utils/errorHandler'; -import redirectDeprecatedProjectRoute from 'app/views/projects/redirectDeprecatedProjectRoute'; -import {TAB} from 'app/views/organizationGroupDetails/header'; function appendTrailingSlash(nextState, replace) { const lastChar = nextState.location.pathname.slice(-1); diff --git a/src/sentry/static/sentry/app/stores/alertStore.tsx b/src/sentry/static/sentry/app/stores/alertStore.tsx index 642e351f56abda..254f9f0c1d7d43 100644 --- a/src/sentry/static/sentry/app/stores/alertStore.tsx +++ b/src/sentry/static/sentry/app/stores/alertStore.tsx @@ -1,8 +1,8 @@ import Reflux from 'reflux'; import AlertActions from 'app/actions/alertActions'; -import localStorage from 'app/utils/localStorage'; import {defined} from 'app/utils'; +import localStorage from 'app/utils/localStorage'; type Alert = { message: string; diff --git a/src/sentry/static/sentry/app/stores/configStore.tsx b/src/sentry/static/sentry/app/stores/configStore.tsx index 13fcb4d16e1eb1..b859e504359341 100644 --- a/src/sentry/static/sentry/app/stores/configStore.tsx +++ b/src/sentry/static/sentry/app/stores/configStore.tsx @@ -1,6 +1,6 @@ import moment from 'moment-timezone'; -import Reflux from 'reflux'; import * as qs from 'query-string'; +import Reflux from 'reflux'; import {setLocale} from 'app/locale'; import {Config} from 'app/types'; diff --git a/src/sentry/static/sentry/app/stores/eventStore.tsx b/src/sentry/static/sentry/app/stores/eventStore.tsx index f7a7a28444e85e..52d1d857a87eb2 100644 --- a/src/sentry/static/sentry/app/stores/eventStore.tsx +++ b/src/sentry/static/sentry/app/stores/eventStore.tsx @@ -1,6 +1,6 @@ -import Reflux from 'reflux'; -import isArray from 'lodash/isArray'; import extend from 'lodash/extend'; +import isArray from 'lodash/isArray'; +import Reflux from 'reflux'; import {Event} from 'app/types'; diff --git a/src/sentry/static/sentry/app/stores/globalSelectionStore.tsx b/src/sentry/static/sentry/app/stores/globalSelectionStore.tsx index a8700bc0302615..996f847969b0e2 100644 --- a/src/sentry/static/sentry/app/stores/globalSelectionStore.tsx +++ b/src/sentry/static/sentry/app/stores/globalSelectionStore.tsx @@ -1,12 +1,12 @@ -import Reflux from 'reflux'; import isEqual from 'lodash/isEqual'; +import Reflux from 'reflux'; -import {GlobalSelection, Organization} from 'app/types'; -import {LOCAL_STORAGE_KEY} from 'app/constants/globalSelectionHeader'; -import {getDefaultSelection} from 'app/components/organizations/globalSelectionHeader/utils'; -import {isEqualWithDates} from 'app/utils/isEqualWithDates'; import GlobalSelectionActions from 'app/actions/globalSelectionActions'; +import {getDefaultSelection} from 'app/components/organizations/globalSelectionHeader/utils'; +import {LOCAL_STORAGE_KEY} from 'app/constants/globalSelectionHeader'; import OrganizationsStore from 'app/stores/organizationsStore'; +import {GlobalSelection, Organization} from 'app/types'; +import {isEqualWithDates} from 'app/utils/isEqualWithDates'; import localStorage from 'app/utils/localStorage'; type UpdateData = { diff --git a/src/sentry/static/sentry/app/stores/groupStore.tsx b/src/sentry/static/sentry/app/stores/groupStore.tsx index 753393e1ff0214..fe52ea952fc017 100644 --- a/src/sentry/static/sentry/app/stores/groupStore.tsx +++ b/src/sentry/static/sentry/app/stores/groupStore.tsx @@ -2,10 +2,10 @@ import isArray from 'lodash/isArray'; import isUndefined from 'lodash/isUndefined'; import Reflux from 'reflux'; -import {Activity, Group} from 'app/types'; import GroupActions from 'app/actions/groupActions'; -import IndicatorStore from 'app/stores/indicatorStore'; import {t} from 'app/locale'; +import IndicatorStore from 'app/stores/indicatorStore'; +import {Activity, Group} from 'app/types'; function showAlert(msg, type) { IndicatorStore.addMessage(msg, type, { diff --git a/src/sentry/static/sentry/app/stores/groupingStore.tsx b/src/sentry/static/sentry/app/stores/groupingStore.tsx index 9bfdfe9f85b548..458ab2e691b571 100644 --- a/src/sentry/static/sentry/app/stores/groupingStore.tsx +++ b/src/sentry/static/sentry/app/stores/groupingStore.tsx @@ -1,14 +1,14 @@ -import Reflux from 'reflux'; import pick from 'lodash/pick'; +import Reflux from 'reflux'; -import {Group, Project, Organization, Event} from 'app/types'; -import {Client} from 'app/api'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; import GroupingActions from 'app/actions/groupingActions'; +import {Client} from 'app/api'; +import {Event, Group, Organization, Project} from 'app/types'; // Between 0-100 const MIN_SCORE = 0.6; diff --git a/src/sentry/static/sentry/app/stores/guideStore.tsx b/src/sentry/static/sentry/app/stores/guideStore.tsx index 85227197f66d1b..2d50c98e7299e2 100644 --- a/src/sentry/static/sentry/app/stores/guideStore.tsx +++ b/src/sentry/static/sentry/app/stores/guideStore.tsx @@ -1,13 +1,13 @@ import {browserHistory} from 'react-router'; import Reflux from 'reflux'; -import {Client} from 'app/api'; -import {Guide, GuidesServerData, GuidesContent} from 'app/components/assistant/types'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import ConfigStore from 'app/stores/configStore'; -import getGuidesContent from 'app/components/assistant/getGuidesContent'; import GuideActions from 'app/actions/guideActions'; import OrganizationsActions from 'app/actions/organizationsActions'; +import {Client} from 'app/api'; +import getGuidesContent from 'app/components/assistant/getGuidesContent'; +import {Guide, GuidesContent, GuidesServerData} from 'app/components/assistant/types'; +import ConfigStore from 'app/stores/configStore'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; const guidesContent: GuidesContent = getGuidesContent(); diff --git a/src/sentry/static/sentry/app/stores/hookStore.tsx b/src/sentry/static/sentry/app/stores/hookStore.tsx index 5dbe770dcfb9e7..7c6d2df2d72e5d 100644 --- a/src/sentry/static/sentry/app/stores/hookStore.tsx +++ b/src/sentry/static/sentry/app/stores/hookStore.tsx @@ -1,8 +1,8 @@ -import Reflux from 'reflux'; -import isUndefined from 'lodash/isUndefined'; import * as Sentry from '@sentry/react'; +import isUndefined from 'lodash/isUndefined'; +import Reflux from 'reflux'; -import {Hooks, HookName} from 'app/types/hooks'; +import {HookName, Hooks} from 'app/types/hooks'; /** * See types/hooks for hook usage reference. diff --git a/src/sentry/static/sentry/app/stores/indicatorStore.tsx b/src/sentry/static/sentry/app/stores/indicatorStore.tsx index 6f3fa3a2b6f12b..7c8a0500883358 100644 --- a/src/sentry/static/sentry/app/stores/indicatorStore.tsx +++ b/src/sentry/static/sentry/app/stores/indicatorStore.tsx @@ -1,8 +1,8 @@ import Reflux from 'reflux'; -import {t} from 'app/locale'; import {Indicator} from 'app/actionCreators/indicator'; import IndicatorActions from 'app/actions/indicatorActions'; +import {t} from 'app/locale'; type IndicatorStoreInterface = { init: () => void; diff --git a/src/sentry/static/sentry/app/stores/latestContextStore.tsx b/src/sentry/static/sentry/app/stores/latestContextStore.tsx index 483255cb24ac16..75f34396bf4003 100644 --- a/src/sentry/static/sentry/app/stores/latestContextStore.tsx +++ b/src/sentry/static/sentry/app/stores/latestContextStore.tsx @@ -1,9 +1,9 @@ import Reflux from 'reflux'; -import ProjectActions from 'app/actions/projectActions'; +import NavigationActions from 'app/actions/navigationActions'; import OrganizationActions from 'app/actions/organizationActions'; import OrganizationsActions from 'app/actions/organizationsActions'; -import NavigationActions from 'app/actions/navigationActions'; +import ProjectActions from 'app/actions/projectActions'; import {LightWeightOrganization, Organization, Project} from 'app/types'; type OrgTypes = LightWeightOrganization | Organization | null; diff --git a/src/sentry/static/sentry/app/stores/modalStore.tsx b/src/sentry/static/sentry/app/stores/modalStore.tsx index e8d9ca55d79cdf..34e17b8cf872cb 100644 --- a/src/sentry/static/sentry/app/stores/modalStore.tsx +++ b/src/sentry/static/sentry/app/stores/modalStore.tsx @@ -1,7 +1,7 @@ import Reflux from 'reflux'; +import {ModalOptions, ModalRenderProps} from 'app/actionCreators/modal'; import ModalActions from 'app/actions/modalActions'; -import {ModalRenderProps, ModalOptions} from 'app/actionCreators/modal'; type Renderer = (renderProps: ModalRenderProps) => React.ReactNode; diff --git a/src/sentry/static/sentry/app/stores/organizationEnvironmentsStore.tsx b/src/sentry/static/sentry/app/stores/organizationEnvironmentsStore.tsx index 3643d14a018a5c..edad7b518e32ae 100644 --- a/src/sentry/static/sentry/app/stores/organizationEnvironmentsStore.tsx +++ b/src/sentry/static/sentry/app/stores/organizationEnvironmentsStore.tsx @@ -1,8 +1,8 @@ import Reflux from 'reflux'; import EnvironmentActions from 'app/actions/environmentActions'; -import {getDisplayName, getUrlRoutingName} from 'app/utils/environment'; import {Environment} from 'app/types'; +import {getDisplayName, getUrlRoutingName} from 'app/utils/environment'; type EnhancedEnvironment = Environment & { displayName: string; diff --git a/src/sentry/static/sentry/app/stores/organizationStore.tsx b/src/sentry/static/sentry/app/stores/organizationStore.tsx index 1d08c2b0ad955a..224baace55a0b5 100644 --- a/src/sentry/static/sentry/app/stores/organizationStore.tsx +++ b/src/sentry/static/sentry/app/stores/organizationStore.tsx @@ -3,9 +3,9 @@ import Reflux from 'reflux'; import OrganizationActions from 'app/actions/organizationActions'; import ProjectActions from 'app/actions/projectActions'; import TeamActions from 'app/actions/teamActions'; -import RequestError from 'app/utils/requestError/requestError'; import {ORGANIZATION_FETCH_ERROR_TYPES} from 'app/constants'; import {Organization, Project, Team} from 'app/types'; +import RequestError from 'app/utils/requestError/requestError'; type UpdateOptions = { replace?: boolean; diff --git a/src/sentry/static/sentry/app/stores/organizationsStore.tsx b/src/sentry/static/sentry/app/stores/organizationsStore.tsx index 08c6034b74a73f..f731942888665c 100644 --- a/src/sentry/static/sentry/app/stores/organizationsStore.tsx +++ b/src/sentry/static/sentry/app/stores/organizationsStore.tsx @@ -1,7 +1,7 @@ import Reflux from 'reflux'; -import {Organization} from 'app/types'; import OrganizationsActions from 'app/actions/organizationsActions'; +import {Organization} from 'app/types'; type OrganizationsStoreInterface = { state: Organization[]; diff --git a/src/sentry/static/sentry/app/stores/projectsStatsStore.tsx b/src/sentry/static/sentry/app/stores/projectsStatsStore.tsx index 5c02b62ad55c53..d69d10606ef734 100644 --- a/src/sentry/static/sentry/app/stores/projectsStatsStore.tsx +++ b/src/sentry/static/sentry/app/stores/projectsStatsStore.tsx @@ -1,7 +1,7 @@ import Reflux from 'reflux'; -import {Project} from 'app/types'; import ProjectActions from 'app/actions/projectActions'; +import {Project} from 'app/types'; type ProjectsStatsStoreInterface = { itemsBySlug: Record<string, Project>; diff --git a/src/sentry/static/sentry/app/stores/projectsStore.tsx b/src/sentry/static/sentry/app/stores/projectsStore.tsx index efb2523e2c00f9..170cb1fb714486 100644 --- a/src/sentry/static/sentry/app/stores/projectsStore.tsx +++ b/src/sentry/static/sentry/app/stores/projectsStore.tsx @@ -1,8 +1,8 @@ import Reflux from 'reflux'; -import {Project, Team} from 'app/types'; import ProjectActions from 'app/actions/projectActions'; import TeamActions from 'app/actions/teamActions'; +import {Project, Team} from 'app/types'; type State = { projects: Project[]; diff --git a/src/sentry/static/sentry/app/stores/releaseStore.tsx b/src/sentry/static/sentry/app/stores/releaseStore.tsx index 0960f78021d8de..4b57828c6a314f 100644 --- a/src/sentry/static/sentry/app/stores/releaseStore.tsx +++ b/src/sentry/static/sentry/app/stores/releaseStore.tsx @@ -1,7 +1,7 @@ import Reflux from 'reflux'; -import ReleaseActions from 'app/actions/releaseActions'; import OrganizationActions from 'app/actions/organizationActions'; +import ReleaseActions from 'app/actions/releaseActions'; import {Deploy, Organization, Release} from 'app/types'; type StoreRelease = Map<string, Release>; diff --git a/src/sentry/static/sentry/app/stores/savedSearchesStore.tsx b/src/sentry/static/sentry/app/stores/savedSearchesStore.tsx index 488180cb88fdeb..f381e533cc831f 100644 --- a/src/sentry/static/sentry/app/stores/savedSearchesStore.tsx +++ b/src/sentry/static/sentry/app/stores/savedSearchesStore.tsx @@ -1,8 +1,8 @@ import findIndex from 'lodash/findIndex'; import Reflux from 'reflux'; -import {SavedSearch, SavedSearchType} from 'app/types'; import SavedSearchesActions from 'app/actions/savedSearchesActions'; +import {SavedSearch, SavedSearchType} from 'app/types'; type State = { savedSearches: SavedSearch[]; diff --git a/src/sentry/static/sentry/app/stores/settingsBreadcrumbStore.tsx b/src/sentry/static/sentry/app/stores/settingsBreadcrumbStore.tsx index 6be9d0a0f8582f..12a4a46a8de371 100644 --- a/src/sentry/static/sentry/app/stores/settingsBreadcrumbStore.tsx +++ b/src/sentry/static/sentry/app/stores/settingsBreadcrumbStore.tsx @@ -1,5 +1,5 @@ -import Reflux from 'reflux'; import {PlainRoute} from 'react-router'; +import Reflux from 'reflux'; import SettingsBreadcrumbActions from 'app/actions/settingsBreadcrumbActions'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; diff --git a/src/sentry/static/sentry/app/stores/tagStore.tsx b/src/sentry/static/sentry/app/stores/tagStore.tsx index 9eeb2dca83c57e..9ca8eae33e1807 100644 --- a/src/sentry/static/sentry/app/stores/tagStore.tsx +++ b/src/sentry/static/sentry/app/stores/tagStore.tsx @@ -1,7 +1,7 @@ import Reflux from 'reflux'; -import {Tag, TagCollection} from 'app/types'; import TagActions from 'app/actions/tagActions'; +import {Tag, TagCollection} from 'app/types'; // This list is only used on issues. Events/discover // have their own field list that exists elsewhere. diff --git a/src/sentry/static/sentry/app/stores/teamStore.tsx b/src/sentry/static/sentry/app/stores/teamStore.tsx index a20572f90b579a..b2322950b1345d 100644 --- a/src/sentry/static/sentry/app/stores/teamStore.tsx +++ b/src/sentry/static/sentry/app/stores/teamStore.tsx @@ -1,7 +1,7 @@ import Reflux from 'reflux'; -import {Team} from 'app/types'; import TeamActions from 'app/actions/teamActions'; +import {Team} from 'app/types'; type TeamStoreInterface = { initialized: boolean; diff --git a/src/sentry/static/sentry/app/styled.tsx b/src/sentry/static/sentry/app/styled.tsx index 9995d8d1dcc921..a63f88f0963c0e 100644 --- a/src/sentry/static/sentry/app/styled.tsx +++ b/src/sentry/static/sentry/app/styled.tsx @@ -13,8 +13,8 @@ * See https://github.com/microsoft/TypeScript/issues/34920 */ -import styled from '@original-emotion/styled'; import * as React from 'react'; +import styled from '@original-emotion/styled'; // TODO(BYK): Figure out why ESLint cannot resolve this // probably need to include `.d.ts` extension // in some resolver config. diff --git a/src/sentry/static/sentry/app/styles/global.tsx b/src/sentry/static/sentry/app/styles/global.tsx index 9aceb5339ab187..e06626b6082485 100644 --- a/src/sentry/static/sentry/app/styles/global.tsx +++ b/src/sentry/static/sentry/app/styles/global.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import {Global, css} from '@emotion/core'; +import {css, Global} from '@emotion/core'; import {IS_ACCEPTANCE_TEST} from 'app/constants'; import {Theme} from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/types/echarts.tsx b/src/sentry/static/sentry/app/types/echarts.tsx index cab8bcc621548e..48484ed14f1cbc 100644 --- a/src/sentry/static/sentry/app/types/echarts.tsx +++ b/src/sentry/static/sentry/app/types/echarts.tsx @@ -1,4 +1,4 @@ -import {ECharts, EChartOption} from 'echarts'; +import {EChartOption, ECharts} from 'echarts'; import ReactEchartsCore from 'echarts-for-react/lib/core'; export type SeriesDataUnit = { diff --git a/src/sentry/static/sentry/app/types/events.ts b/src/sentry/static/sentry/app/types/events.ts index 494eb968ddefb1..c56631882c6e1f 100644 --- a/src/sentry/static/sentry/app/types/events.ts +++ b/src/sentry/static/sentry/app/types/events.ts @@ -1,4 +1,4 @@ -import {StacktraceType, RawStacktrace} from './stacktrace'; +import {RawStacktrace, StacktraceType} from './stacktrace'; export interface Thread { id: number; diff --git a/src/sentry/static/sentry/app/types/hooks.ts b/src/sentry/static/sentry/app/types/hooks.ts index 4396b221756714..e2de3092dca4c5 100644 --- a/src/sentry/static/sentry/app/types/hooks.ts +++ b/src/sentry/static/sentry/app/types/hooks.ts @@ -1,11 +1,11 @@ import {Route} from 'react-router'; -import {NavigationSection} from 'app/views/settings/types'; -import {User, Organization, Project, IntegrationProvider} from 'app/types'; -import {ExperimentKey} from 'app/types/experiments'; import FeatureDisabled from 'app/components/acl/featureDisabled'; import SidebarItem from 'app/components/sidebar/sidebarItem'; +import {IntegrationProvider, Organization, Project, User} from 'app/types'; +import {ExperimentKey} from 'app/types/experiments'; import {StepProps} from 'app/views/onboarding/types'; +import {NavigationSection} from 'app/views/settings/types'; // XXX(epurkhiser): A Note about `_`. // diff --git a/src/sentry/static/sentry/app/types/index.tsx b/src/sentry/static/sentry/app/types/index.tsx index cae02b31d4670b..1edca0eaf5882f 100644 --- a/src/sentry/static/sentry/app/types/index.tsx +++ b/src/sentry/static/sentry/app/types/index.tsx @@ -1,19 +1,19 @@ +import {Props as AlertProps} from 'app/components/alert'; import {SpanEntry, TraceContextType} from 'app/components/events/interfaces/spans/types'; +import {SymbolicatorStatus} from 'app/components/events/interfaces/types'; import {API_ACCESS_SCOPES} from 'app/constants'; -import {Field} from 'app/views/settings/components/forms/type'; import {PlatformKey} from 'app/data/platformCategories'; import {OrgExperiments, UserExperiments} from 'app/types/experiments'; +import {WIDGET_DISPLAY} from 'app/views/dashboards/constants'; +import {Query as DiscoverQuery} from 'app/views/discover/types'; import { INSTALLED, NOT_INSTALLED, PENDING, } from 'app/views/organizationIntegrations/constants'; -import {WIDGET_DISPLAY} from 'app/views/dashboards/constants'; -import {Props as AlertProps} from 'app/components/alert'; -import {Query as DiscoverQuery} from 'app/views/discover/types'; -import {SymbolicatorStatus} from 'app/components/events/interfaces/types'; +import {Field} from 'app/views/settings/components/forms/type'; -import {StacktraceType, RawStacktrace, Mechanism} from './stacktrace'; +import {Mechanism, RawStacktrace, StacktraceType} from './stacktrace'; declare global { interface Window { diff --git a/src/sentry/static/sentry/app/types/react-router.d.ts b/src/sentry/static/sentry/app/types/react-router.d.ts index 9eefd10d587932..235f989a6c37c6 100644 --- a/src/sentry/static/sentry/app/types/react-router.d.ts +++ b/src/sentry/static/sentry/app/types/react-router.d.ts @@ -1,8 +1,8 @@ import {ComponentClass, ComponentType, StatelessComponent} from 'react'; -import {WithRouterProps} from 'react-router/lib/withRouter'; +import {PlainRoute} from 'react-router/lib/Route'; import {InjectedRouter, Params} from 'react-router/lib/Router'; +import {WithRouterProps} from 'react-router/lib/withRouter'; import {Location} from 'history'; -import {PlainRoute} from 'react-router/lib/Route'; declare module 'react-router' { interface InjectedRouter<P = Params, Q = any> { diff --git a/src/sentry/static/sentry/app/utils.tsx b/src/sentry/static/sentry/app/utils.tsx index 00f1d2bffe5ce2..371d6fc06c3a28 100644 --- a/src/sentry/static/sentry/app/utils.tsx +++ b/src/sentry/static/sentry/app/utils.tsx @@ -4,7 +4,7 @@ import isObject from 'lodash/isObject'; import isString from 'lodash/isString'; import isUndefined from 'lodash/isUndefined'; -import {Project, EventTag} from 'app/types'; +import {EventTag, Project} from 'app/types'; import {appendTagCondition} from 'app/utils/queryString'; function arrayIsEqual(arr?: any[], other?: any[], deep?: boolean): boolean { diff --git a/src/sentry/static/sentry/app/utils/ajaxCsrfSetup.tsx b/src/sentry/static/sentry/app/utils/ajaxCsrfSetup.tsx index f3b0d7c52c3ea2..26562fd2ee3921 100644 --- a/src/sentry/static/sentry/app/utils/ajaxCsrfSetup.tsx +++ b/src/sentry/static/sentry/app/utils/ajaxCsrfSetup.tsx @@ -1,5 +1,5 @@ -import getCookie from 'app/utils/getCookie'; import {CSRF_COOKIE_NAME} from 'app/constants'; +import getCookie from 'app/utils/getCookie'; function csrfSafeMethod(method?: string) { // these HTTP methods do not require CSRF protection diff --git a/src/sentry/static/sentry/app/utils/attachmentUrl.tsx b/src/sentry/static/sentry/app/utils/attachmentUrl.tsx index 1cec51e0cb0397..b656452f83c25b 100644 --- a/src/sentry/static/sentry/app/utils/attachmentUrl.tsx +++ b/src/sentry/static/sentry/app/utils/attachmentUrl.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {Organization, EventAttachment} from 'app/types'; -import withOrganization from 'app/utils/withOrganization'; import Role from 'app/components/acl/role'; +import {EventAttachment, Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx b/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx index 0310b44343a277..c728177dfb8146 100644 --- a/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx +++ b/src/sentry/static/sentry/app/utils/consolidatedScopes.tsx @@ -1,5 +1,5 @@ -import invertBy from 'lodash/invertBy'; import groupBy from 'lodash/groupBy'; +import invertBy from 'lodash/invertBy'; import pick from 'lodash/pick'; import {Permissions} from 'app/types'; diff --git a/src/sentry/static/sentry/app/utils/dates.tsx b/src/sentry/static/sentry/app/utils/dates.tsx index 0ff128fd3edb81..5bbbc8face3230 100644 --- a/src/sentry/static/sentry/app/utils/dates.tsx +++ b/src/sentry/static/sentry/app/utils/dates.tsx @@ -1,7 +1,7 @@ import moment from 'moment'; -import ConfigStore from 'app/stores/configStore'; import {parseStatsPeriod} from 'app/components/organizations/globalSelectionHeader/getParams'; +import ConfigStore from 'app/stores/configStore'; import {DateString} from 'app/types'; // TODO(billy): Move to TimeRangeSelector specific utils diff --git a/src/sentry/static/sentry/app/utils/discover/arrayValue.tsx b/src/sentry/static/sentry/app/utils/discover/arrayValue.tsx index f0a7a38a637cba..5f76f74eff06b2 100644 --- a/src/sentry/static/sentry/app/utils/discover/arrayValue.tsx +++ b/src/sentry/static/sentry/app/utils/discover/arrayValue.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; -import {t} from 'app/locale'; type Props = { value: string[]; diff --git a/src/sentry/static/sentry/app/utils/discover/charts.tsx b/src/sentry/static/sentry/app/utils/discover/charts.tsx index b219a24e899b15..b0bc5ba21a1b36 100644 --- a/src/sentry/static/sentry/app/utils/discover/charts.tsx +++ b/src/sentry/static/sentry/app/utils/discover/charts.tsx @@ -1,15 +1,15 @@ +import {t} from 'app/locale'; +import {aggregateOutputType} from 'app/utils/discover/fields'; import { - WEEK, DAY, + formatAbbreviatedNumber, + formatPercentage, + getDuration, HOUR, MINUTE, SECOND, - getDuration, - formatAbbreviatedNumber, - formatPercentage, + WEEK, } from 'app/utils/formatters'; -import {t} from 'app/locale'; -import {aggregateOutputType} from 'app/utils/discover/fields'; /** * Formatter for chart tooltips that handle a variety of discover result values diff --git a/src/sentry/static/sentry/app/utils/discover/discoverQuery.tsx b/src/sentry/static/sentry/app/utils/discover/discoverQuery.tsx index 9b5719ba9816d8..2808d768087d0f 100644 --- a/src/sentry/static/sentry/app/utils/discover/discoverQuery.tsx +++ b/src/sentry/static/sentry/app/utils/discover/discoverQuery.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import withApi from 'app/utils/withApi'; import {MetaType} from 'app/utils/discover/eventView'; +import withApi from 'app/utils/withApi'; import GenericDiscoverQuery, {DiscoverQueryProps} from './genericDiscoverQuery'; diff --git a/src/sentry/static/sentry/app/utils/discover/eventView.tsx b/src/sentry/static/sentry/app/utils/discover/eventView.tsx index 9359f62abebe7f..d32319cd6c211f 100644 --- a/src/sentry/static/sentry/app/utils/discover/eventView.tsx +++ b/src/sentry/static/sentry/app/utils/discover/eventView.tsx @@ -1,38 +1,39 @@ import {Location, Query} from 'history'; -import isString from 'lodash/isString'; import cloneDeep from 'lodash/cloneDeep'; -import pick from 'lodash/pick'; import isEqual from 'lodash/isEqual'; +import isString from 'lodash/isString'; import omit from 'lodash/omit'; +import pick from 'lodash/pick'; import uniqBy from 'lodash/uniqBy'; import moment from 'moment'; -import {DEFAULT_PER_PAGE} from 'app/constants'; import {EventQuery} from 'app/actionCreators/events'; -import {GlobalSelection, SavedQuery, NewQuery, SelectValue, User} from 'app/types'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; +import {DEFAULT_PER_PAGE} from 'app/constants'; +import {GlobalSelection, NewQuery, SavedQuery, SelectValue, User} from 'app/types'; +import {decodeList, decodeScalar} from 'app/utils/queryString'; import {TableColumn, TableColumnSort} from 'app/views/eventsV2/table/types'; import {decodeColumnOrder} from 'app/views/eventsV2/utils'; -import {decodeScalar, decodeList} from 'app/utils/queryString'; +import {statsPeriodToDays} from '../dates'; + +import {getSortField} from './fieldRenderers'; import { - Sort, - Field, Column, ColumnType, - isAggregateField, - getAggregateAlias, + Field, generateFieldAsString, + getAggregateAlias, + isAggregateField, + Sort, } from './fields'; -import {getSortField} from './fieldRenderers'; import { CHART_AXIS_OPTIONS, - DisplayModes, - DISPLAY_MODE_OPTIONS, DISPLAY_MODE_FALLBACK_OPTIONS, + DISPLAY_MODE_OPTIONS, + DisplayModes, } from './types'; -import {statsPeriodToDays} from '../dates'; // Metadata mapping for discover results. export type MetaType = Record<string, ColumnType>; diff --git a/src/sentry/static/sentry/app/utils/discover/fieldRenderers.tsx b/src/sentry/static/sentry/app/utils/discover/fieldRenderers.tsx index 4e453b6310be88..dfffccc739232a 100644 --- a/src/sentry/static/sentry/app/utils/discover/fieldRenderers.tsx +++ b/src/sentry/static/sentry/app/utils/discover/fieldRenderers.tsx @@ -1,25 +1,26 @@ import React from 'react'; +import styled from '@emotion/styled'; import {Location} from 'history'; import partial from 'lodash/partial'; -import styled from '@emotion/styled'; -import {Organization} from 'app/types'; -import {t} from 'app/locale'; import Count from 'app/components/count'; import Duration from 'app/components/duration'; import ProjectBadge from 'app/components/idBadge/projectBadge'; import UserBadge from 'app/components/idBadge/userBadge'; import UserMisery from 'app/components/userMisery'; import Version from 'app/components/version'; +import {t} from 'app/locale'; +import {Organization} from 'app/types'; import {defined} from 'app/utils'; -import getDynamicText from 'app/utils/getDynamicText'; +import {AGGREGATIONS, getAggregateAlias} from 'app/utils/discover/fields'; +import {getShortEventId} from 'app/utils/events'; import {formatFloat, formatPercentage} from 'app/utils/formatters'; -import {getAggregateAlias, AGGREGATIONS} from 'app/utils/discover/fields'; +import getDynamicText from 'app/utils/getDynamicText'; import Projects from 'app/utils/projects'; -import {getShortEventId} from 'app/utils/events'; -import KeyTransactionField from './keyTransactionField'; import ArrayValue from './arrayValue'; +import {EventData, MetaType} from './eventView'; +import KeyTransactionField from './keyTransactionField'; import { BarContainer, Container, @@ -29,7 +30,6 @@ import { StyledShortId, VersionContainer, } from './styles'; -import {MetaType, EventData} from './eventView'; /** * Types, functions and definitions for rendering fields in discover results. diff --git a/src/sentry/static/sentry/app/utils/discover/genericDiscoverQuery.tsx b/src/sentry/static/sentry/app/utils/discover/genericDiscoverQuery.tsx index 90cca749d52c6c..168f22b921d528 100644 --- a/src/sentry/static/sentry/app/utils/discover/genericDiscoverQuery.tsx +++ b/src/sentry/static/sentry/app/utils/discover/genericDiscoverQuery.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {Location} from 'history'; +import {EventQuery} from 'app/actionCreators/events'; import {Client} from 'app/api'; import EventView, { isAPIPayloadSimilar, LocationQuery, } from 'app/utils/discover/eventView'; -import {EventQuery} from 'app/actionCreators/events'; export type GenericChildrenProps<T> = { isLoading: boolean; diff --git a/src/sentry/static/sentry/app/utils/discover/keyTransactionField.tsx b/src/sentry/static/sentry/app/utils/discover/keyTransactionField.tsx index b785b50bee1c1c..905bd165ebd388 100644 --- a/src/sentry/static/sentry/app/utils/discover/keyTransactionField.tsx +++ b/src/sentry/static/sentry/app/utils/discover/keyTransactionField.tsx @@ -4,7 +4,7 @@ import styled from '@emotion/styled'; import {toggleKeyTransaction} from 'app/actionCreators/performance'; import {Client} from 'app/api'; import {IconStar} from 'app/icons'; -import {Project, Organization} from 'app/types'; +import {Organization, Project} from 'app/types'; import withApi from 'app/utils/withApi'; import withProjects from 'app/utils/withProjects'; diff --git a/src/sentry/static/sentry/app/utils/discover/traceHoverCard.tsx b/src/sentry/static/sentry/app/utils/discover/traceHoverCard.tsx index 083af91fac94d9..8da9ad623eaa53 100644 --- a/src/sentry/static/sentry/app/utils/discover/traceHoverCard.tsx +++ b/src/sentry/static/sentry/app/utils/discover/traceHoverCard.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import {Location, LocationDescriptor} from 'history'; import styled from '@emotion/styled'; +import {Location, LocationDescriptor} from 'history'; -import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; import {Client} from 'app/api'; +import Clipboard from 'app/components/clipboard'; import Hovercard from 'app/components/hovercard'; +import LoadingError from 'app/components/loadingError'; +import LoadingIndicator from 'app/components/loadingIndicator'; import Version from 'app/components/version'; -import space from 'app/styles/space'; -import Clipboard from 'app/components/clipboard'; import {IconCopy} from 'app/icons'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import LoadingError from 'app/components/loadingError'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import withApi from 'app/utils/withApi'; -import EventView from './eventView'; import DiscoverQuery, {TableData} from './discoverQuery'; +import EventView from './eventView'; type ChildrenProps = {to: LocationDescriptor}; diff --git a/src/sentry/static/sentry/app/utils/eventWaiter.tsx b/src/sentry/static/sentry/app/utils/eventWaiter.tsx index 6b7207930edfbf..19eb0683071032 100644 --- a/src/sentry/static/sentry/app/utils/eventWaiter.tsx +++ b/src/sentry/static/sentry/app/utils/eventWaiter.tsx @@ -1,9 +1,9 @@ import React from 'react'; import * as Sentry from '@sentry/react'; -import {analytics} from 'app/utils/analytics'; import {Client} from 'app/api'; -import {Organization, Project, Group} from 'app/types'; +import {Group, Organization, Project} from 'app/types'; +import {analytics} from 'app/utils/analytics'; import withApi from 'app/utils/withApi'; const DEFAULT_POLL_INTERVAL = 5000; diff --git a/src/sentry/static/sentry/app/utils/events.tsx b/src/sentry/static/sentry/app/utils/events.tsx index d5bd67672bd5b4..44c5598ecca9a8 100644 --- a/src/sentry/static/sentry/app/utils/events.tsx +++ b/src/sentry/static/sentry/app/utils/events.tsx @@ -1,5 +1,5 @@ -import {isNativePlatform} from 'app/utils/platform'; import {Event, Group, GroupTombstone, Organization} from 'app/types'; +import {isNativePlatform} from 'app/utils/platform'; function isTombstone(maybe: Group | Event | GroupTombstone): maybe is GroupTombstone { return !maybe.hasOwnProperty('type'); diff --git a/src/sentry/static/sentry/app/utils/fetchSentryAppInstallations.tsx b/src/sentry/static/sentry/app/utils/fetchSentryAppInstallations.tsx index 49a115fdb22c38..26355c418c1724 100644 --- a/src/sentry/static/sentry/app/utils/fetchSentryAppInstallations.tsx +++ b/src/sentry/static/sentry/app/utils/fetchSentryAppInstallations.tsx @@ -1,5 +1,5 @@ -import SentryAppInstallationStore from 'app/stores/sentryAppInstallationsStore'; import {Client} from 'app/api'; +import SentryAppInstallationStore from 'app/stores/sentryAppInstallationsStore'; import {SentryAppInstallation} from 'app/types'; const fetchSentryAppInstallations = async (api: Client, orgSlug: string) => { diff --git a/src/sentry/static/sentry/app/utils/integrationUtil.tsx b/src/sentry/static/sentry/app/utils/integrationUtil.tsx index 8b3b94017eeaf2..cbdff82c1fe90d 100644 --- a/src/sentry/static/sentry/app/utils/integrationUtil.tsx +++ b/src/sentry/static/sentry/app/utils/integrationUtil.tsx @@ -1,7 +1,15 @@ -import capitalize from 'lodash/capitalize'; import React from 'react'; +import capitalize from 'lodash/capitalize'; import * as qs from 'query-string'; +import { + IconBitbucket, + IconGeneric, + IconGithub, + IconGitlab, + IconJira, + IconVsts, +} from 'app/icons'; import HookStore from 'app/stores/hookStore'; import { AppOrProviderOrPlugin, @@ -20,14 +28,6 @@ import { import {Hooks} from 'app/types/hooks'; import {trackAnalyticsEvent} from 'app/utils/analytics'; import {uniqueId} from 'app/utils/guid'; -import { - IconBitbucket, - IconGeneric, - IconGithub, - IconGitlab, - IconJira, - IconVsts, -} from 'app/icons'; const INTEGRATIONS_ANALYTICS_SESSION_KEY = 'INTEGRATION_ANALYTICS_SESSION' as const; diff --git a/src/sentry/static/sentry/app/utils/marked.tsx b/src/sentry/static/sentry/app/utils/marked.tsx index 079e9098a4b1c8..5c73ad5644bf0d 100644 --- a/src/sentry/static/sentry/app/utils/marked.tsx +++ b/src/sentry/static/sentry/app/utils/marked.tsx @@ -1,5 +1,5 @@ -import marked from 'marked'; // eslint-disable-line no-restricted-imports import dompurify from 'dompurify'; +import marked from 'marked'; // eslint-disable-line no-restricted-imports import {IS_ACCEPTANCE_TEST, NODE_ENV} from 'app/constants'; diff --git a/src/sentry/static/sentry/app/utils/measurements/index.tsx b/src/sentry/static/sentry/app/utils/measurements/index.tsx index c62021eba695bb..45721f781d4060 100644 --- a/src/sentry/static/sentry/app/utils/measurements/index.tsx +++ b/src/sentry/static/sentry/app/utils/measurements/index.tsx @@ -1,5 +1,5 @@ -import {Vital} from 'app/views/performance/transactionVitals/types'; import {getDuration} from 'app/utils/formatters'; +import {Vital} from 'app/views/performance/transactionVitals/types'; export function formattedValue(record: Vital | undefined, value: number): string { if (record && record.type === 'duration') { diff --git a/src/sentry/static/sentry/app/utils/projects.tsx b/src/sentry/static/sentry/app/utils/projects.tsx index 7df834ca167602..e7438018c8d869 100644 --- a/src/sentry/static/sentry/app/utils/projects.tsx +++ b/src/sentry/static/sentry/app/utils/projects.tsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import memoize from 'lodash/memoize'; import partition from 'lodash/partition'; import uniqBy from 'lodash/uniqBy'; +import PropTypes from 'prop-types'; -import {Client} from 'app/api'; -import {Project, AvatarProject} from 'app/types'; -import {defined} from 'app/utils'; import ProjectActions from 'app/actions/projectActions'; -import ProjectsStore from 'app/stores/projectsStore'; -import RequestError from 'app/utils/requestError/requestError'; +import {Client} from 'app/api'; import SentryTypes from 'app/sentryTypes'; +import ProjectsStore from 'app/stores/projectsStore'; +import {AvatarProject, Project} from 'app/types'; +import {defined} from 'app/utils'; import parseLinkHeader from 'app/utils/parseLinkHeader'; +import RequestError from 'app/utils/requestError/requestError'; import withApi from 'app/utils/withApi'; import withProjects from 'app/utils/withProjects'; diff --git a/src/sentry/static/sentry/app/utils/queryString.tsx b/src/sentry/static/sentry/app/utils/queryString.tsx index d2a796106e96a1..14f101bbebe401 100644 --- a/src/sentry/static/sentry/app/utils/queryString.tsx +++ b/src/sentry/static/sentry/app/utils/queryString.tsx @@ -1,6 +1,6 @@ -import * as queryString from 'query-string'; -import parseurl from 'parseurl'; import isString from 'lodash/isString'; +import parseurl from 'parseurl'; +import * as queryString from 'query-string'; import {escapeDoubleQuotes} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/utils/recreateRoute.tsx b/src/sentry/static/sentry/app/utils/recreateRoute.tsx index 32e1edbd1fae34..b664ec064717f9 100644 --- a/src/sentry/static/sentry/app/utils/recreateRoute.tsx +++ b/src/sentry/static/sentry/app/utils/recreateRoute.tsx @@ -1,5 +1,5 @@ -import {Location} from 'history'; import {PlainRoute} from 'react-router/lib/Route'; +import {Location} from 'history'; import findLastIndex from 'lodash/findLastIndex'; import replaceRouterParams from 'app/utils/replaceRouterParams'; diff --git a/src/sentry/static/sentry/app/utils/redirect.tsx b/src/sentry/static/sentry/app/utils/redirect.tsx index 59497375acdb0f..46e71c20ecbd2a 100644 --- a/src/sentry/static/sentry/app/utils/redirect.tsx +++ b/src/sentry/static/sentry/app/utils/redirect.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import {LocationDescriptor} from 'history'; import * as ReactRouter from 'react-router'; +import {LocationDescriptor} from 'history'; +import PropTypes from 'prop-types'; type Props = { router: ReactRouter.InjectedRouter; diff --git a/src/sentry/static/sentry/app/utils/withCommitters.tsx b/src/sentry/static/sentry/app/utils/withCommitters.tsx index 4963cf0a203272..554277fd8e14b1 100644 --- a/src/sentry/static/sentry/app/utils/withCommitters.tsx +++ b/src/sentry/static/sentry/app/utils/withCommitters.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import {Client} from 'app/api'; -import {Organization, Project, Event, Group, Committer, AvatarProject} from 'app/types'; import {getCommitters} from 'app/actionCreators/committers'; +import {Client} from 'app/api'; import CommitterStore from 'app/stores/committerStore'; +import {AvatarProject, Committer, Event, Group, Organization, Project} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; type DependentProps = { diff --git a/src/sentry/static/sentry/app/utils/withConfig.tsx b/src/sentry/static/sentry/app/utils/withConfig.tsx index b8cf680ec31dd2..74769dbba14012 100644 --- a/src/sentry/static/sentry/app/utils/withConfig.tsx +++ b/src/sentry/static/sentry/app/utils/withConfig.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; +import ConfigStore from 'app/stores/configStore'; import {Config} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; -import ConfigStore from 'app/stores/configStore'; type InjectedConfigProps = { config: Config; diff --git a/src/sentry/static/sentry/app/utils/withExperiment.tsx b/src/sentry/static/sentry/app/utils/withExperiment.tsx index ea4aba7819dc2b..dc5b176c44fd76 100644 --- a/src/sentry/static/sentry/app/utils/withExperiment.tsx +++ b/src/sentry/static/sentry/app/utils/withExperiment.tsx @@ -1,18 +1,18 @@ import React from 'react'; +import {experimentConfig, unassignedValue} from 'app/data/experimentConfig'; import ConfigStore from 'app/stores/configStore'; import {Organization} from 'app/types'; -import {experimentConfig, unassignedValue} from 'app/data/experimentConfig'; -import getDisplayName from 'app/utils/getDisplayName'; -import {logExperiment} from 'app/utils/analytics'; import { - Experiments, - ExperimentKey, ExperimentAssignment, + ExperimentKey, + Experiments, ExperimentType, OrgExperiments, UserExperiments, } from 'app/types/experiments'; +import {logExperiment} from 'app/utils/analytics'; +import getDisplayName from 'app/utils/getDisplayName'; type Options<E extends ExperimentKey, L extends boolean> = { /** diff --git a/src/sentry/static/sentry/app/utils/withGlobalSelection.tsx b/src/sentry/static/sentry/app/utils/withGlobalSelection.tsx index 1e913a71280577..94979a5aa135fe 100644 --- a/src/sentry/static/sentry/app/utils/withGlobalSelection.tsx +++ b/src/sentry/static/sentry/app/utils/withGlobalSelection.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; import GlobalSelectionStore from 'app/stores/globalSelectionStore'; -import getDisplayName from 'app/utils/getDisplayName'; import {GlobalSelection} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type InjectedGlobalSelectionProps = { selection?: GlobalSelection; diff --git a/src/sentry/static/sentry/app/utils/withIssueTags.tsx b/src/sentry/static/sentry/app/utils/withIssueTags.tsx index 11ed1b74170b20..dc78887e205059 100644 --- a/src/sentry/static/sentry/app/utils/withIssueTags.tsx +++ b/src/sentry/static/sentry/app/utils/withIssueTags.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; import assign from 'lodash/assign'; +import Reflux from 'reflux'; -import getDisplayName from 'app/utils/getDisplayName'; import MemberListStore from 'app/stores/memberListStore'; import TagStore from 'app/stores/tagStore'; -import {User, TagCollection} from 'app/types'; +import {TagCollection, User} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type InjectedTagsProps = { tags: TagCollection; diff --git a/src/sentry/static/sentry/app/utils/withLatestContext.tsx b/src/sentry/static/sentry/app/utils/withLatestContext.tsx index 709a83f37195ea..c0481d0ba4ce0d 100644 --- a/src/sentry/static/sentry/app/utils/withLatestContext.tsx +++ b/src/sentry/static/sentry/app/utils/withLatestContext.tsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; +import SentryTypes from 'app/sentryTypes'; import ConfigStore from 'app/stores/configStore'; import LatestContextStore from 'app/stores/latestContextStore'; -import SentryTypes from 'app/sentryTypes'; +import {Organization, OrganizationSummary, Project} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; import withOrganizations from 'app/utils/withOrganizations'; -import {Project, Organization, OrganizationSummary} from 'app/types'; type InjectedLatestContextProps = { organizations?: OrganizationSummary[]; diff --git a/src/sentry/static/sentry/app/utils/withOrganization.tsx b/src/sentry/static/sentry/app/utils/withOrganization.tsx index 97ea5ea695bc06..7d7e2985e3ebea 100644 --- a/src/sentry/static/sentry/app/utils/withOrganization.tsx +++ b/src/sentry/static/sentry/app/utils/withOrganization.tsx @@ -1,8 +1,8 @@ import React from 'react'; import SentryTypes from 'app/sentryTypes'; +import {LightWeightOrganization, Organization} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; -import {Organization, LightWeightOrganization} from 'app/types'; type InjectedOrganizationProps = { organization?: Organization | LightWeightOrganization; diff --git a/src/sentry/static/sentry/app/utils/withOrganizations.tsx b/src/sentry/static/sentry/app/utils/withOrganizations.tsx index dff59329807c9e..db105d61558d7a 100644 --- a/src/sentry/static/sentry/app/utils/withOrganizations.tsx +++ b/src/sentry/static/sentry/app/utils/withOrganizations.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import getDisplayName from 'app/utils/getDisplayName'; import OrganizationsStore from 'app/stores/organizationsStore'; import {OrganizationSummary} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type InjectedOrganizationsProps = { organizationsLoading?: boolean; diff --git a/src/sentry/static/sentry/app/utils/withPlugins.tsx b/src/sentry/static/sentry/app/utils/withPlugins.tsx index 66ee328e73b8ae..72032186b5cdd7 100644 --- a/src/sentry/static/sentry/app/utils/withPlugins.tsx +++ b/src/sentry/static/sentry/app/utils/withPlugins.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import {defined} from 'app/utils'; -import {Organization, Project, Plugin} from 'app/types'; import {fetchPlugins} from 'app/actionCreators/plugins'; -import getDisplayName from 'app/utils/getDisplayName'; -import PluginsStore from 'app/stores/pluginsStore'; import SentryTypes from 'app/sentryTypes'; +import PluginsStore from 'app/stores/pluginsStore'; +import {Organization, Plugin, Project} from 'app/types'; +import {defined} from 'app/utils'; +import getDisplayName from 'app/utils/getDisplayName'; import withOrganization from 'app/utils/withOrganization'; import withProject from 'app/utils/withProject'; diff --git a/src/sentry/static/sentry/app/utils/withProject.tsx b/src/sentry/static/sentry/app/utils/withProject.tsx index 279924d9307a8f..a8f77fb6b32eef 100644 --- a/src/sentry/static/sentry/app/utils/withProject.tsx +++ b/src/sentry/static/sentry/app/utils/withProject.tsx @@ -1,8 +1,8 @@ import React from 'react'; import SentryTypes from 'app/sentryTypes'; -import getDisplayName from 'app/utils/getDisplayName'; import {Project} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type InjectedProjectProps = { project: Project; diff --git a/src/sentry/static/sentry/app/utils/withProjects.tsx b/src/sentry/static/sentry/app/utils/withProjects.tsx index fb2990905bfe04..8e53739740fde8 100644 --- a/src/sentry/static/sentry/app/utils/withProjects.tsx +++ b/src/sentry/static/sentry/app/utils/withProjects.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import getDisplayName from 'app/utils/getDisplayName'; -import ProjectsStore from 'app/stores/projectsStore'; import SentryTypes from 'app/sentryTypes'; +import ProjectsStore from 'app/stores/projectsStore'; import {Project} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type InjectedProjectsProps = { projects: Project[]; diff --git a/src/sentry/static/sentry/app/utils/withProjectsSpecified.tsx b/src/sentry/static/sentry/app/utils/withProjectsSpecified.tsx index 1f01656d941add..6a10697345ef61 100644 --- a/src/sentry/static/sentry/app/utils/withProjectsSpecified.tsx +++ b/src/sentry/static/sentry/app/utils/withProjectsSpecified.tsx @@ -1,11 +1,11 @@ /* eslint-disable react/prop-types */ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import getDisplayName from 'app/utils/getDisplayName'; import ProjectsStore from 'app/stores/projectsStore'; import {Project} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type Props = { projects?: Project[]; diff --git a/src/sentry/static/sentry/app/utils/withRelease.tsx b/src/sentry/static/sentry/app/utils/withRelease.tsx index 00f1dbbb149df1..eab28c775c05d5 100644 --- a/src/sentry/static/sentry/app/utils/withRelease.tsx +++ b/src/sentry/static/sentry/app/utils/withRelease.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; +import {getProjectRelease, getReleaseDeploys} from 'app/actionCreators/release'; import {Client} from 'app/api'; +import ReleaseStore from 'app/stores/releaseStore'; import {Deploy, Release} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; -import ReleaseStore from 'app/stores/releaseStore'; -import {getProjectRelease, getReleaseDeploys} from 'app/actionCreators/release'; type DependentProps = { api: Client; diff --git a/src/sentry/static/sentry/app/utils/withRepositories.tsx b/src/sentry/static/sentry/app/utils/withRepositories.tsx index 49b4378d77bd13..b8067f2ae8df21 100644 --- a/src/sentry/static/sentry/app/utils/withRepositories.tsx +++ b/src/sentry/static/sentry/app/utils/withRepositories.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import {Client} from 'app/api'; -import {Repository} from 'app/types'; -import RepositoryActions from 'app/actions/repositoryActions'; import {getRepositories} from 'app/actionCreators/repositories'; +import RepositoryActions from 'app/actions/repositoryActions'; +import {Client} from 'app/api'; import RepositoryStore from 'app/stores/repositoryStore'; +import {Repository} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; type DependentProps = { diff --git a/src/sentry/static/sentry/app/utils/withSavedSearches.tsx b/src/sentry/static/sentry/app/utils/withSavedSearches.tsx index e634c0508e9ee3..20b956198e94ef 100644 --- a/src/sentry/static/sentry/app/utils/withSavedSearches.tsx +++ b/src/sentry/static/sentry/app/utils/withSavedSearches.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import {RouteComponentProps} from 'react-router/lib/Router'; +import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; import SavedSearchesStore from 'app/stores/savedSearchesStore'; -import getDisplayName from 'app/utils/getDisplayName'; import {SavedSearch} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type InjectedSavedSearchesProps = { savedSearches: SavedSearch[]; diff --git a/src/sentry/static/sentry/app/utils/withSentryAppComponents.tsx b/src/sentry/static/sentry/app/utils/withSentryAppComponents.tsx index 0f21378dc77610..1c774b8fbc21a6 100644 --- a/src/sentry/static/sentry/app/utils/withSentryAppComponents.tsx +++ b/src/sentry/static/sentry/app/utils/withSentryAppComponents.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import getDisplayName from 'app/utils/getDisplayName'; import SentryAppComponentsStore from 'app/stores/sentryAppComponentsStore'; +import getDisplayName from 'app/utils/getDisplayName'; // TODO(ts): Update when component type is defined type Component = {}; diff --git a/src/sentry/static/sentry/app/utils/withTags.tsx b/src/sentry/static/sentry/app/utils/withTags.tsx index fb5d84db79e566..e9ea0d3de14772 100644 --- a/src/sentry/static/sentry/app/utils/withTags.tsx +++ b/src/sentry/static/sentry/app/utils/withTags.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; -import getDisplayName from 'app/utils/getDisplayName'; import TagStore from 'app/stores/tagStore'; import {TagCollection} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; type InjectedTagsProps = { tags: TagCollection; diff --git a/src/sentry/static/sentry/app/utils/withTeams.tsx b/src/sentry/static/sentry/app/utils/withTeams.tsx index 2b68d9fe0f5c7f..2e2712aba65db9 100644 --- a/src/sentry/static/sentry/app/utils/withTeams.tsx +++ b/src/sentry/static/sentry/app/utils/withTeams.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; +import TeamStore from 'app/stores/teamStore'; import {Team} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; -import TeamStore from 'app/stores/teamStore'; type InjectedTeamsProps = { teams: Team[]; diff --git a/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx b/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx index 036cc1f4129094..e63ba9bc020578 100644 --- a/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx +++ b/src/sentry/static/sentry/app/utils/withTeamsForUser.tsx @@ -1,10 +1,10 @@ import React from 'react'; import {Client} from 'app/api'; +import ConfigStore from 'app/stores/configStore'; import {Organization, Project, Team, TeamWithProjects} from 'app/types'; import getDisplayName from 'app/utils/getDisplayName'; import getProjectsByTeams from 'app/utils/getProjectsByTeams'; -import ConfigStore from 'app/stores/configStore'; import {metric} from './analytics'; diff --git a/src/sentry/static/sentry/app/views/acceptOrganizationInvite.tsx b/src/sentry/static/sentry/app/views/acceptOrganizationInvite.tsx index 6cf3a006f06f16..ec56738ca462e1 100644 --- a/src/sentry/static/sentry/app/views/acceptOrganizationInvite.tsx +++ b/src/sentry/static/sentry/app/views/acceptOrganizationInvite.tsx @@ -1,20 +1,20 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; -import {urlEncode} from '@sentry/utils'; import React, {MouseEvent} from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import {urlEncode} from '@sentry/utils'; import {logout} from 'app/actionCreators/account'; -import {t, tct} from 'app/locale'; import Alert from 'app/components/alert'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import ConfigStore from 'app/stores/configStore'; import ExternalLink from 'app/components/links/externalLink'; import Link from 'app/components/links/link'; import NarrowLayout from 'app/components/narrowLayout'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import {t, tct} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; type InviteDetails = { orgSlug: string; diff --git a/src/sentry/static/sentry/app/views/acceptProjectTransfer.tsx b/src/sentry/static/sentry/app/views/acceptProjectTransfer.tsx index 469d233b725b13..b922c58b580305 100644 --- a/src/sentry/static/sentry/app/views/acceptProjectTransfer.tsx +++ b/src/sentry/static/sentry/app/views/acceptProjectTransfer.tsx @@ -2,13 +2,13 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import NarrowLayout from 'app/components/narrowLayout'; +import {t, tct} from 'app/locale'; +import {Organization, Project} from 'app/types'; import AsyncView from 'app/views/asyncView'; import Form from 'app/views/settings/components/forms/form'; -import NarrowLayout from 'app/components/narrowLayout'; import SelectField from 'app/views/settings/components/forms/selectField'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import {t, tct} from 'app/locale'; -import {Organization, Project} from 'app/types'; type Props = RouteComponentProps<{}, {}>; diff --git a/src/sentry/static/sentry/app/views/admin/adminEnvironment.tsx b/src/sentry/static/sentry/app/views/admin/adminEnvironment.tsx index 6f735dc6f7baa2..5a817ad5aa6a5c 100644 --- a/src/sentry/static/sentry/app/views/admin/adminEnvironment.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminEnvironment.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import moment from 'moment'; import styled from '@emotion/styled'; +import moment from 'moment'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import ConfigStore from 'app/stores/configStore'; import {IconQuestion} from 'app/icons'; +import {t, tct} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; +import AsyncView from 'app/views/asyncView'; type Data = { environment: { diff --git a/src/sentry/static/sentry/app/views/admin/adminLayout.tsx b/src/sentry/static/sentry/app/views/admin/adminLayout.tsx index 96cf3f594455b1..1b5c85def0ee22 100644 --- a/src/sentry/static/sentry/app/views/admin/adminLayout.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminLayout.tsx @@ -1,9 +1,9 @@ -import DocumentTitle from 'react-document-title'; import React from 'react'; +import DocumentTitle from 'react-document-title'; import styled from '@emotion/styled'; -import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; import space from 'app/styles/space'; +import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; const AdminLayout: React.FC = ({children}) => ( <DocumentTitle title="Sentry Admin"> diff --git a/src/sentry/static/sentry/app/views/admin/adminMail.tsx b/src/sentry/static/sentry/app/views/admin/adminMail.tsx index 6c2fde46b3212d..3443664e7f3c15 100644 --- a/src/sentry/static/sentry/app/views/admin/adminMail.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminMail.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import Button from 'app/components/button'; import {t} from 'app/locale'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; type Data = { mailHost: string; diff --git a/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.tsx b/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.tsx index 2b711fa844da6f..c550e940b5c27c 100644 --- a/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminOverview/apiChart.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {Client} from 'app/api'; -import {TimeseriesValue} from 'app/types'; +import MiniBarChart from 'app/components/charts/miniBarChart'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import MiniBarChart from 'app/components/charts/miniBarChart'; -import withApi from 'app/utils/withApi'; +import {TimeseriesValue} from 'app/types'; import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; const initialState = { error: false, diff --git a/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx b/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx index 19d0943810b55f..b76567a09d6352 100644 --- a/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminOverview/eventChart.jsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import MiniBarChart from 'app/components/charts/miniBarChart'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; class EventChart extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/admin/adminOverview/index.tsx b/src/sentry/static/sentry/app/views/admin/adminOverview/index.tsx index c3b17351476748..9b8049874cd381 100644 --- a/src/sentry/static/sentry/app/views/admin/adminOverview/index.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminOverview/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; import DocumentTitle from 'react-document-title'; -import {Panel, PanelHeader, PanelBody} from 'app/components/panels'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t} from 'app/locale'; import ApiChart from './apiChart'; diff --git a/src/sentry/static/sentry/app/views/admin/adminPackages.tsx b/src/sentry/static/sentry/app/views/admin/adminPackages.tsx index 9f5f17a5fa8f0f..7e6ce3f25184bf 100644 --- a/src/sentry/static/sentry/app/views/admin/adminPackages.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminPackages.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import AsyncView from 'app/views/asyncView'; import {t} from 'app/locale'; +import AsyncView from 'app/views/asyncView'; type Data = { extensions: [key: string, value: string][]; diff --git a/src/sentry/static/sentry/app/views/admin/adminQueue.tsx b/src/sentry/static/sentry/app/views/admin/adminQueue.tsx index 92833c72a02fbf..9bfd2705d30b1d 100644 --- a/src/sentry/static/sentry/app/views/admin/adminQueue.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminQueue.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import AsyncView from 'app/views/asyncView'; -import {Panel, PanelHeader, PanelBody} from 'app/components/panels'; -import InternalStatChart from 'app/components/internalStatChart'; import {SelectField} from 'app/components/forms'; +import InternalStatChart from 'app/components/internalStatChart'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import AsyncView from 'app/views/asyncView'; const TIME_WINDOWS = ['1h', '1d', '1w'] as const; diff --git a/src/sentry/static/sentry/app/views/admin/adminQuotas.tsx b/src/sentry/static/sentry/app/views/admin/adminQuotas.tsx index b6f5c3cd779276..89358a7aabb320 100644 --- a/src/sentry/static/sentry/app/views/admin/adminQuotas.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminQuotas.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import AsyncView from 'app/views/asyncView'; import {TextField} from 'app/components/forms'; import InternalStatChart from 'app/components/internalStatChart'; +import AsyncView from 'app/views/asyncView'; type Config = { backend: string; diff --git a/src/sentry/static/sentry/app/views/admin/adminRelays.tsx b/src/sentry/static/sentry/app/views/admin/adminRelays.tsx index 08546998406f0c..796d92f8e3b9d6 100644 --- a/src/sentry/static/sentry/app/views/admin/adminRelays.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminRelays.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import moment from 'moment'; import {RouteComponentProps} from 'react-router/lib/Router'; +import moment from 'moment'; +import {Client} from 'app/api'; +import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; +import ResultGrid from 'app/components/resultGrid'; import {t} from 'app/locale'; import withApi from 'app/utils/withApi'; -import ResultGrid from 'app/components/resultGrid'; -import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; -import {Client} from 'app/api'; const prettyDate = (x: string) => moment(x).format('ll LTS'); diff --git a/src/sentry/static/sentry/app/views/admin/adminSettings.tsx b/src/sentry/static/sentry/app/views/admin/adminSettings.tsx index c81f1159e7b14f..8acf6c1f7efcbd 100644 --- a/src/sentry/static/sentry/app/views/admin/adminSettings.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminSettings.tsx @@ -1,9 +1,9 @@ import React from 'react'; import isUndefined from 'lodash/isUndefined'; -import AsyncView from 'app/views/asyncView'; -import {t} from 'app/locale'; import {ApiForm} from 'app/components/forms'; +import {t} from 'app/locale'; +import AsyncView from 'app/views/asyncView'; import {getOption, getOptionField} from './options'; diff --git a/src/sentry/static/sentry/app/views/admin/adminUserEdit.jsx b/src/sentry/static/sentry/app/views/admin/adminUserEdit.jsx index 161994e374fede..bb543d4cb9d3ef 100644 --- a/src/sentry/static/sentry/app/views/admin/adminUserEdit.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminUserEdit.jsx @@ -1,19 +1,19 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {openModal} from 'app/actionCreators/modal'; +import Button from 'app/components/button'; import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; +import RadioGroup from 'app/views/settings/components/forms/controls/radioGroup'; import Form from 'app/views/settings/components/forms/form'; -import FormModel from 'app/views/settings/components/forms/model'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import RadioGroup from 'app/views/settings/components/forms/controls/radioGroup'; -import SentryTypes from 'app/sentryTypes'; -import space from 'app/styles/space'; +import FormModel from 'app/views/settings/components/forms/model'; const userEditForm = { title: 'User details', diff --git a/src/sentry/static/sentry/app/views/admin/adminUsers.jsx b/src/sentry/static/sentry/app/views/admin/adminUsers.jsx index 79854eb2f9ca06..bb87664d2651df 100644 --- a/src/sentry/static/sentry/app/views/admin/adminUsers.jsx +++ b/src/sentry/static/sentry/app/views/admin/adminUsers.jsx @@ -2,9 +2,9 @@ import React from 'react'; import moment from 'moment'; -import {t} from 'app/locale'; import Link from 'app/components/links/link'; import ResultGrid from 'app/components/resultGrid'; +import {t} from 'app/locale'; export const prettyDate = function (x) { return moment(x).format('ll'); diff --git a/src/sentry/static/sentry/app/views/admin/adminWarnings.tsx b/src/sentry/static/sentry/app/views/admin/adminWarnings.tsx index 37cd5d32b1f8a0..c91bdc9d7655b7 100644 --- a/src/sentry/static/sentry/app/views/admin/adminWarnings.tsx +++ b/src/sentry/static/sentry/app/views/admin/adminWarnings.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import AsyncView from 'app/views/asyncView'; import {t} from 'app/locale'; +import AsyncView from 'app/views/asyncView'; type Data = { groups: [groupName: string, grouppedWarnings: string[]][]; diff --git a/src/sentry/static/sentry/app/views/admin/installWizard/index.tsx b/src/sentry/static/sentry/app/views/admin/installWizard/index.tsx index a70a0eca8726df..0153b86f55853f 100644 --- a/src/sentry/static/sentry/app/views/admin/installWizard/index.tsx +++ b/src/sentry/static/sentry/app/views/admin/installWizard/index.tsx @@ -3,16 +3,16 @@ import DocumentTitle from 'react-document-title'; import {css} from '@emotion/core'; import styled from '@emotion/styled'; -import AsyncView from 'app/views/asyncView'; -import {t} from 'app/locale'; -import ConfigStore from 'app/stores/configStore'; -import {ApiForm} from 'app/components/forms'; import sentryPattern from 'app/../images/pattern/sentry-pattern.png'; -import space from 'app/styles/space'; import Alert from 'app/components/alert'; +import {ApiForm} from 'app/components/forms'; import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; +import space from 'app/styles/space'; +import AsyncView from 'app/views/asyncView'; -import {getOptionDefault, getOptionField, getForm} from '../options'; +import {getForm, getOptionDefault, getOptionField} from '../options'; type Props = { onConfigured: () => void; diff --git a/src/sentry/static/sentry/app/views/admin/options.tsx b/src/sentry/static/sentry/app/views/admin/options.tsx index f297cc630d97a4..1829bb209335bd 100644 --- a/src/sentry/static/sentry/app/views/admin/options.tsx +++ b/src/sentry/static/sentry/app/views/admin/options.tsx @@ -1,14 +1,14 @@ import React from 'react'; import keyBy from 'lodash/keyBy'; -import ConfigStore from 'app/stores/configStore'; -import {t, tct} from 'app/locale'; import { - EmailField, - TextField, BooleanField, + EmailField, RadioBooleanField, + TextField, } from 'app/components/forms'; +import {t, tct} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; type Section = { key: string; diff --git a/src/sentry/static/sentry/app/views/alerts/builder/builderBreadCrumbs.tsx b/src/sentry/static/sentry/app/views/alerts/builder/builderBreadCrumbs.tsx index cd9b30507bd6c5..88a0f46f08e0ad 100644 --- a/src/sentry/static/sentry/app/views/alerts/builder/builderBreadCrumbs.tsx +++ b/src/sentry/static/sentry/app/views/alerts/builder/builderBreadCrumbs.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; +import Breadcrumbs from 'app/components/breadcrumbs'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import Breadcrumbs from 'app/components/breadcrumbs'; type Props = { hasMetricAlerts: boolean; diff --git a/src/sentry/static/sentry/app/views/alerts/builder/projectProvider.tsx b/src/sentry/static/sentry/app/views/alerts/builder/projectProvider.tsx index a671a2280cb128..46fceb6e5a19a7 100644 --- a/src/sentry/static/sentry/app/views/alerts/builder/projectProvider.tsx +++ b/src/sentry/static/sentry/app/views/alerts/builder/projectProvider.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import {Client} from 'app/api'; -import {Organization, Project} from 'app/types'; -import {t} from 'app/locale'; import {fetchOrgMembers} from 'app/actionCreators/members'; +import {Client} from 'app/api'; import Alert from 'app/components/alert'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; +import {Organization, Project} from 'app/types'; import Projects from 'app/utils/projects'; import withApi from 'app/utils/withApi'; diff --git a/src/sentry/static/sentry/app/views/alerts/details/activity/activity.tsx b/src/sentry/static/sentry/app/views/alerts/details/activity/activity.tsx index e3ff96d52e63e7..cb6059c5672ffe 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/activity/activity.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/activity/activity.tsx @@ -1,22 +1,23 @@ import React from 'react'; +import styled from '@emotion/styled'; import groupBy from 'lodash/groupBy'; import moment from 'moment'; -import styled from '@emotion/styled'; import {Client} from 'app/api'; -import {User} from 'app/types'; -import {NoteType} from 'app/types/alerts'; -import {t} from 'app/locale'; import ActivityItem from 'app/components/activity/item'; -import ErrorBoundary from 'app/components/errorBoundary'; -import LoadingError from 'app/components/loadingError'; import Note from 'app/components/activity/note'; -import {CreateError} from 'app/components/activity/note/types'; import NoteInputWithStorage from 'app/components/activity/note/inputWithStorage'; +import {CreateError} from 'app/components/activity/note/types'; +import ErrorBoundary from 'app/components/errorBoundary'; +import LoadingError from 'app/components/loadingError'; import TimeSince from 'app/components/timeSince'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {User} from 'app/types'; +import {NoteType} from 'app/types/alerts'; + +import {ActivityType, Incident, IncidentActivityType} from '../../types'; -import {Incident, IncidentActivityType, ActivityType} from '../../types'; import ActivityPlaceholder from './activityPlaceholder'; import DateDivider from './dateDivider'; import StatusItem from './statusItem'; diff --git a/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx b/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx index 8f849303ba8ce2..28c244955b1990 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/activity/activityPlaceholder.tsx @@ -1,6 +1,6 @@ -import {withTheme} from 'emotion-theming'; import React from 'react'; import styled from '@emotion/styled'; +import {withTheme} from 'emotion-theming'; import ActivityItem from 'app/components/activity/item'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/alerts/details/activity/index.tsx b/src/sentry/static/sentry/app/views/alerts/details/activity/index.tsx index 42ee090d847a17..a51c5876855beb 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/activity/index.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/activity/index.tsx @@ -1,19 +1,19 @@ -import {Params} from 'react-router/lib/Router'; import React from 'react'; +import {Params} from 'react-router/lib/Router'; -import {Client} from 'app/api'; import { createIncidentNote, deleteIncidentNote, fetchIncidentActivities, updateIncidentNote, } from 'app/actionCreators/incident'; -import {replaceAtArrayIndex} from 'app/utils/replaceAtArrayIndex'; -import {NoteType} from 'app/types/alerts'; +import {Client} from 'app/api'; import {CreateError} from 'app/components/activity/note/types'; import {DEFAULT_ERROR_JSON} from 'app/constants'; -import {uniqueId} from 'app/utils/guid'; import ConfigStore from 'app/stores/configStore'; +import {NoteType} from 'app/types/alerts'; +import {uniqueId} from 'app/utils/guid'; +import {replaceAtArrayIndex} from 'app/utils/replaceAtArrayIndex'; import withApi from 'app/utils/withApi'; import { @@ -23,6 +23,7 @@ import { IncidentActivityType, IncidentStatus, } from '../../types'; + import Activity from './activity'; type Activities = Array<ActivityType | ActivityType>; diff --git a/src/sentry/static/sentry/app/views/alerts/details/activity/statusItem.tsx b/src/sentry/static/sentry/app/views/alerts/details/activity/statusItem.tsx index e747b923bfb500..0b4c517662145c 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/activity/statusItem.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/activity/statusItem.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; import ActivityItem from 'app/components/activity/item'; +import {t, tct} from 'app/locale'; import getDynamicText from 'app/utils/getDynamicText'; import { + ActivityType, Incident, IncidentActivityType, IncidentStatus, - ActivityType, IncidentStatusMethod, } from '../../types'; diff --git a/src/sentry/static/sentry/app/views/alerts/details/body.tsx b/src/sentry/static/sentry/app/views/alerts/details/body.tsx index bb1f046a351261..2bf4d3352608a5 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/body.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/body.tsx @@ -1,39 +1,40 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {Project} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {defined} from 'app/utils'; -import {t, tct} from 'app/locale'; +import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import {SectionHeading} from 'app/components/charts/styles'; import Duration from 'app/components/duration'; -import Feature from 'app/components/acl/feature'; import Link from 'app/components/links/link'; import NavTabs from 'app/components/navTabs'; +import {Panel, PanelBody, PanelFooter} from 'app/components/panels'; import Placeholder from 'app/components/placeholder'; import SeenByList from 'app/components/seenByList'; import {IconWarning} from 'app/icons'; -import {SectionHeading} from 'app/components/charts/styles'; -import Projects from 'app/utils/projects'; +import {t, tct} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; import space from 'app/styles/space'; +import {Project} from 'app/types'; +import {defined} from 'app/utils'; +import Projects from 'app/utils/projects'; import theme from 'app/utils/theme'; -import {Panel, PanelBody, PanelFooter} from 'app/components/panels'; -import Button from 'app/components/button'; -import {AlertRuleThresholdType} from 'app/views/settings/incidentRules/types'; -import {makeDefaultCta} from 'app/views/settings/incidentRules/presets'; import {DATASET_EVENT_TYPE_FILTERS} from 'app/views/settings/incidentRules/constants'; +import {makeDefaultCta} from 'app/views/settings/incidentRules/presets'; +import {AlertRuleThresholdType} from 'app/views/settings/incidentRules/types'; -import Activity from './activity'; -import Chart from './chart'; import { + AlertRuleStatus, Incident, IncidentStats, - AlertRuleStatus, IncidentStatus, IncidentStatusMethod, } from '../types'; -import {getIncidentMetricPreset, DATA_SOURCE_LABELS} from '../utils'; +import {DATA_SOURCE_LABELS, getIncidentMetricPreset} from '../utils'; + +import Activity from './activity'; +import Chart from './chart'; type Props = { incident?: Incident; diff --git a/src/sentry/static/sentry/app/views/alerts/details/chart.tsx b/src/sentry/static/sentry/app/views/alerts/details/chart.tsx index 20e32b37f94d33..dda3b7b6f38065 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/chart.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/chart.tsx @@ -1,13 +1,13 @@ import React from 'react'; import moment from 'moment'; +import MarkLine from 'app/components/charts/components/markLine'; +import MarkPoint from 'app/components/charts/components/markPoint'; +import LineChart, {LineChartSeries} from 'app/components/charts/lineChart'; import {t} from 'app/locale'; import space from 'app/styles/space'; import theme from 'app/utils/theme'; import {Trigger} from 'app/views/settings/incidentRules/types'; -import LineChart, {LineChartSeries} from 'app/components/charts/lineChart'; -import MarkPoint from 'app/components/charts/components/markPoint'; -import MarkLine from 'app/components/charts/components/markLine'; import closedSymbol from './closedSymbol'; import startedSymbol from './startedSymbol'; diff --git a/src/sentry/static/sentry/app/views/alerts/details/header.tsx b/src/sentry/static/sentry/app/views/alerts/details/header.tsx index 5664eeb8abe1b6..d8608589d7e067 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/header.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/header.tsx @@ -1,31 +1,31 @@ -import {Params} from 'react-router/lib/Router'; import React from 'react'; -import moment from 'moment'; -import styled from '@emotion/styled'; +import {Params} from 'react-router/lib/Router'; import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; +import moment from 'moment'; -import {PageHeader} from 'app/styles/organization'; -import {t} from 'app/locale'; +import Breadcrumbs from 'app/components/breadcrumbs'; import Count from 'app/components/count'; +import DropdownControl from 'app/components/dropdownControl'; import Duration from 'app/components/duration'; +import ProjectBadge from 'app/components/idBadge/projectBadge'; import LoadingError from 'app/components/loadingError'; import MenuItem from 'app/components/menuItem'; import PageHeading from 'app/components/pageHeading'; import Placeholder from 'app/components/placeholder'; -import ProjectBadge from 'app/components/idBadge/projectBadge'; -import Projects from 'app/utils/projects'; import SubscribeButton from 'app/components/subscribeButton'; -import getDynamicText from 'app/utils/getDynamicText'; -import space from 'app/styles/space'; import {IconCheckmark} from 'app/icons'; -import Breadcrumbs from 'app/components/breadcrumbs'; -import {Dataset} from 'app/views/settings/incidentRules/types'; -import DropdownControl from 'app/components/dropdownControl'; +import {t} from 'app/locale'; +import {PageHeader} from 'app/styles/organization'; +import space from 'app/styles/space'; import {use24Hours} from 'app/utils/dates'; +import getDynamicText from 'app/utils/getDynamicText'; +import Projects from 'app/utils/projects'; +import {Dataset} from 'app/views/settings/incidentRules/types'; +import Status from '../status'; import {Incident, IncidentStats} from '../types'; import {isOpen} from '../utils'; -import Status from '../status'; type Props = { className?: string; diff --git a/src/sentry/static/sentry/app/views/alerts/details/index.tsx b/src/sentry/static/sentry/app/views/alerts/details/index.tsx index ccf443f1328387..9c4b279e1d7d12 100644 --- a/src/sentry/static/sentry/app/views/alerts/details/index.tsx +++ b/src/sentry/static/sentry/app/views/alerts/details/index.tsx @@ -1,12 +1,12 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Client} from 'app/api'; -import {Organization} from 'app/types'; +import {markIncidentAsSeen} from 'app/actionCreators/incident'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {fetchOrgMembers} from 'app/actionCreators/members'; -import {markIncidentAsSeen} from 'app/actionCreators/incident'; +import {Client} from 'app/api'; import {t} from 'app/locale'; +import {Organization} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; import withApi from 'app/utils/withApi'; @@ -14,10 +14,11 @@ import {Incident, IncidentStats, IncidentStatus} from '../types'; import { fetchIncident, fetchIncidentStats, - updateSubscription, - updateStatus, isOpen, + updateStatus, + updateSubscription, } from '../utils'; + import DetailsBody from './body'; import DetailsHeader from './header'; diff --git a/src/sentry/static/sentry/app/views/alerts/index.tsx b/src/sentry/static/sentry/app/views/alerts/index.tsx index db59bf0d12732e..47c90b79dd89a4 100644 --- a/src/sentry/static/sentry/app/views/alerts/index.tsx +++ b/src/sentry/static/sentry/app/views/alerts/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; +import Feature from 'app/components/acl/feature'; import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; -import Feature from 'app/components/acl/feature'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/alerts/list/header.tsx b/src/sentry/static/sentry/app/views/alerts/list/header.tsx index 4cd58389e79384..f6eb57978e09c6 100644 --- a/src/sentry/static/sentry/app/views/alerts/list/header.tsx +++ b/src/sentry/static/sentry/app/views/alerts/list/header.tsx @@ -1,19 +1,19 @@ import React from 'react'; -import styled from '@emotion/styled'; import {InjectedRouter} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; -import {IconSettings} from 'app/icons'; -import {Organization} from 'app/types'; import {navigateTo} from 'app/actionCreators/navigation'; -import {t} from 'app/locale'; import Feature from 'app/components/acl/feature'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; -import NavTabs from 'app/components/navTabs'; +import CreateAlertButton from 'app/components/createAlertButton'; import * as Layout from 'app/components/layouts/thirds'; -import space from 'app/styles/space'; import Link from 'app/components/links/link'; -import CreateAlertButton from 'app/components/createAlertButton'; +import NavTabs from 'app/components/navTabs'; +import {IconSettings} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization} from 'app/types'; type Props = { router: InjectedRouter; diff --git a/src/sentry/static/sentry/app/views/alerts/list/index.tsx b/src/sentry/static/sentry/app/views/alerts/list/index.tsx index af36a726ce320d..31653047c087c9 100644 --- a/src/sentry/static/sentry/app/views/alerts/list/index.tsx +++ b/src/sentry/static/sentry/app/views/alerts/list/index.tsx @@ -1,37 +1,38 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; import flatten from 'lodash/flatten'; import omit from 'lodash/omit'; -import styled from '@emotion/styled'; -import {IconCheckmark} from 'app/icons'; -import {Organization, Project} from 'app/types'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import {t, tct} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import AsyncComponent from 'app/components/asyncComponent'; +import {promptsUpdate} from 'app/actionCreators/prompts'; import Feature from 'app/components/acl/feature'; +import Alert from 'app/components/alert'; +import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import CreateAlertButton from 'app/components/createAlertButton'; +import * as Layout from 'app/components/layouts/thirds'; import ExternalLink from 'app/components/links/externalLink'; import LoadingIndicator from 'app/components/loadingIndicator'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import Pagination from 'app/components/pagination'; -import * as Layout from 'app/components/layouts/thirds'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import Projects from 'app/utils/projects'; +import {IconCheckmark} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import Projects from 'app/utils/projects'; import withOrganization from 'app/utils/withOrganization'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import {promptsUpdate} from 'app/actionCreators/prompts'; -import Alert from 'app/components/alert'; -import CreateAlertButton from 'app/components/createAlertButton'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; import {Incident} from '../types'; + import AlertHeader from './header'; -import {TableLayout, TitleAndSparkLine} from './styles'; -import AlertListRow from './row'; import Onboarding from './onboarding'; +import AlertListRow from './row'; +import {TableLayout, TitleAndSparkLine} from './styles'; const DEFAULT_QUERY_STATUS = 'open'; diff --git a/src/sentry/static/sentry/app/views/alerts/list/onboarding.tsx b/src/sentry/static/sentry/app/views/alerts/list/onboarding.tsx index 8470b899a824c7..100f915f9f73bb 100644 --- a/src/sentry/static/sentry/app/views/alerts/list/onboarding.tsx +++ b/src/sentry/static/sentry/app/views/alerts/list/onboarding.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; +import emptyStateImg from 'app/../images/spot/alerts-empty-state.svg'; import ButtonBar from 'app/components/buttonBar'; import OnboardingPanel from 'app/components/onboardingPanel'; -import emptyStateImg from 'app/../images/spot/alerts-empty-state.svg'; +import {t} from 'app/locale'; type Props = { actions: React.ReactNode; diff --git a/src/sentry/static/sentry/app/views/alerts/list/row.tsx b/src/sentry/static/sentry/app/views/alerts/list/row.tsx index ae2f78a76dd21e..fe49f71006e221 100644 --- a/src/sentry/static/sentry/app/views/alerts/list/row.tsx +++ b/src/sentry/static/sentry/app/views/alerts/list/row.tsx @@ -1,28 +1,29 @@ import React from 'react'; +import styled from '@emotion/styled'; import memoize from 'lodash/memoize'; import moment from 'moment'; -import styled from '@emotion/styled'; -import {IconWarning} from 'app/icons'; -import {PanelItem} from 'app/components/panels'; -import {Project} from 'app/types'; -import {t, tct} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; import Duration from 'app/components/duration'; import ErrorBoundary from 'app/components/errorBoundary'; import IdBadge from 'app/components/idBadge'; import Link from 'app/components/links/link'; -import theme from 'app/utils/theme'; +import {PanelItem} from 'app/components/panels'; import TimeSince from 'app/components/timeSince'; import Tooltip from 'app/components/tooltip'; -import getDynamicText from 'app/utils/getDynamicText'; +import {IconWarning} from 'app/icons'; +import {t, tct} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; +import {Project} from 'app/types'; +import getDynamicText from 'app/utils/getDynamicText'; +import theme from 'app/utils/theme'; import {Incident, IncidentStats, IncidentStatus} from '../types'; import {getIncidentMetricPreset} from '../utils'; -import {TableLayout, TitleAndSparkLine} from './styles'; + import SparkLine from './sparkLine'; +import {TableLayout, TitleAndSparkLine} from './styles'; type Props = { incident: Incident; diff --git a/src/sentry/static/sentry/app/views/alerts/list/sparkLine.tsx b/src/sentry/static/sentry/app/views/alerts/list/sparkLine.tsx index dc994d64d48571..4cc4b5c4d5047d 100644 --- a/src/sentry/static/sentry/app/views/alerts/list/sparkLine.tsx +++ b/src/sentry/static/sentry/app/views/alerts/list/sparkLine.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {IncidentStats} from 'app/views/alerts/types'; import Placeholder from 'app/components/placeholder'; import theme from 'app/utils/theme'; +import {IncidentStats} from 'app/views/alerts/types'; // Height of sparkline const SPARKLINE_HEIGHT = 38; diff --git a/src/sentry/static/sentry/app/views/alerts/rules/index.tsx b/src/sentry/static/sentry/app/views/alerts/rules/index.tsx index 0a3dd5f7e20930..5083c14babddbf 100644 --- a/src/sentry/static/sentry/app/views/alerts/rules/index.tsx +++ b/src/sentry/static/sentry/app/views/alerts/rules/index.tsx @@ -1,27 +1,28 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import flatten from 'lodash/flatten'; -import {t, tct} from 'app/locale'; -import {IconCheckmark, IconArrow} from 'app/icons'; -import {Organization, Project} from 'app/types'; -import {IssueAlertRule} from 'app/types/alerts'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {PanelTable, PanelTableHeader} from 'app/components/panels'; +import {addErrorMessage} from 'app/actionCreators/indicator'; import AsyncComponent from 'app/components/asyncComponent'; +import * as Layout from 'app/components/layouts/thirds'; import ExternalLink from 'app/components/links/externalLink'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import Link from 'app/components/links/link'; -import * as Layout from 'app/components/layouts/thirds'; -import Pagination from 'app/components/pagination'; -import Projects from 'app/utils/projects'; import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import {addErrorMessage} from 'app/actionCreators/indicator'; +import Pagination from 'app/components/pagination'; +import {PanelTable, PanelTableHeader} from 'app/components/panels'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {IconArrow, IconCheckmark} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {IssueAlertRule} from 'app/types/alerts'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import Projects from 'app/utils/projects'; import AlertHeader from '../list/header'; import {isIssueAlert} from '../utils'; + import RuleListRow from './row'; const DEFAULT_SORT: {asc: boolean; field: 'date_added'} = { diff --git a/src/sentry/static/sentry/app/views/alerts/rules/row.tsx b/src/sentry/static/sentry/app/views/alerts/rules/row.tsx index d832ed08feb092..ff7aa154647913 100644 --- a/src/sentry/static/sentry/app/views/alerts/rules/row.tsx +++ b/src/sentry/static/sentry/app/views/alerts/rules/row.tsx @@ -1,13 +1,9 @@ import React from 'react'; -import moment from 'moment'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import memoize from 'lodash/memoize'; +import moment from 'moment'; -import {t, tct} from 'app/locale'; -import {IconDelete, IconSettings} from 'app/icons'; -import {Project} from 'app/types'; -import {IssueAlertRule} from 'app/types/alerts'; import Access from 'app/components/acl/access'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; @@ -15,8 +11,12 @@ import Confirm from 'app/components/confirm'; import ErrorBoundary from 'app/components/errorBoundary'; import IdBadge from 'app/components/idBadge'; import Link from 'app/components/links/link'; +import {IconDelete, IconSettings} from 'app/icons'; +import {t, tct} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; +import {Project} from 'app/types'; +import {IssueAlertRule} from 'app/types/alerts'; import {isIssueAlert} from '../utils'; diff --git a/src/sentry/static/sentry/app/views/alerts/status.tsx b/src/sentry/static/sentry/app/views/alerts/status.tsx index b34f56c60430ab..606f1be29ffcea 100644 --- a/src/sentry/static/sentry/app/views/alerts/status.tsx +++ b/src/sentry/static/sentry/app/views/alerts/status.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; +import {IconCheckmark, IconFire, IconWarning} from 'app/icons'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import {IconCheckmark, IconWarning, IconFire} from 'app/icons'; import {Incident, IncidentStatus} from './types'; diff --git a/src/sentry/static/sentry/app/views/alerts/types.tsx b/src/sentry/static/sentry/app/views/alerts/types.tsx index 52f86c815ac8fa..703d2fdda547e4 100644 --- a/src/sentry/static/sentry/app/views/alerts/types.tsx +++ b/src/sentry/static/sentry/app/views/alerts/types.tsx @@ -1,5 +1,5 @@ +import {Repository, User} from 'app/types'; import {IncidentRule} from 'app/views/settings/incidentRules/types'; -import {User, Repository} from 'app/types'; type Data = [number, {count: number}[]][]; diff --git a/src/sentry/static/sentry/app/views/alerts/utils/getIncidentDiscoverUrl.tsx b/src/sentry/static/sentry/app/views/alerts/utils/getIncidentDiscoverUrl.tsx index c33bcfc064f4d3..2d0d4ed5c1f2f8 100644 --- a/src/sentry/static/sentry/app/views/alerts/utils/getIncidentDiscoverUrl.tsx +++ b/src/sentry/static/sentry/app/views/alerts/utils/getIncidentDiscoverUrl.tsx @@ -1,9 +1,9 @@ import {NewQuery, Project} from 'app/types'; import EventView from 'app/utils/discover/eventView'; import {getAggregateAlias} from 'app/utils/discover/fields'; -import {Dataset} from 'app/views/settings/incidentRules/types'; -import {getStartEndFromStats} from 'app/views/alerts/utils'; import {Incident, IncidentStats} from 'app/views/alerts/types'; +import {getStartEndFromStats} from 'app/views/alerts/utils'; +import {Dataset} from 'app/views/settings/incidentRules/types'; /** * Gets the URL for a discover view of the incident with the following default * parameters: diff --git a/src/sentry/static/sentry/app/views/alerts/utils/index.tsx b/src/sentry/static/sentry/app/views/alerts/utils/index.tsx index 7da38220070abb..707add285e001b 100644 --- a/src/sentry/static/sentry/app/views/alerts/utils/index.tsx +++ b/src/sentry/static/sentry/app/views/alerts/utils/index.tsx @@ -1,17 +1,17 @@ import {Client} from 'app/api'; import {t} from 'app/locale'; -import {Project, NewQuery} from 'app/types'; -import {getAggregateAlias} from 'app/utils/discover/fields'; +import {NewQuery, Project} from 'app/types'; +import {IssueAlertRule} from 'app/types/alerts'; import {getUtcDateString} from 'app/utils/dates'; import EventView from 'app/utils/discover/eventView'; +import {getAggregateAlias} from 'app/utils/discover/fields'; +import {PRESET_AGGREGATES} from 'app/views/settings/incidentRules/presets'; import { Dataset, Datasource, EventTypes, SavedIncidentRule, } from 'app/views/settings/incidentRules/types'; -import {PRESET_AGGREGATES} from 'app/views/settings/incidentRules/presets'; -import {IssueAlertRule} from 'app/types/alerts'; import {Incident, IncidentStats, IncidentStatus} from '../types'; diff --git a/src/sentry/static/sentry/app/views/app/alertMessage.tsx b/src/sentry/static/sentry/app/views/app/alertMessage.tsx index d7a84729edf16c..2d1e89591cc7c1 100644 --- a/src/sentry/static/sentry/app/views/app/alertMessage.tsx +++ b/src/sentry/static/sentry/app/views/app/alertMessage.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import ExternalLink from 'app/components/links/externalLink'; -import Alert from 'app/components/alert'; import AlertActions from 'app/actions/alertActions'; +import Alert from 'app/components/alert'; import Button from 'app/components/button'; +import ExternalLink from 'app/components/links/externalLink'; import {IconCheckmark, IconClose, IconWarning} from 'app/icons'; import {t} from 'app/locale'; +import space from 'app/styles/space'; type AlertType = { /** diff --git a/src/sentry/static/sentry/app/views/app/index.tsx b/src/sentry/static/sentry/app/views/app/index.tsx index 71320724f17a03..482f9c73b6ca67 100644 --- a/src/sentry/static/sentry/app/views/app/index.tsx +++ b/src/sentry/static/sentry/app/views/app/index.tsx @@ -1,33 +1,33 @@ -import $ from 'jquery'; -import {RouteComponentProps} from 'react-router/lib/Router'; +import React from 'react'; +import keydown from 'react-keydown'; import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; +import $ from 'jquery'; import Cookies from 'js-cookie'; -import PropTypes from 'prop-types'; -import React from 'react'; import isEqual from 'lodash/isEqual'; -import keydown from 'react-keydown'; +import PropTypes from 'prop-types'; -import {Client} from 'app/api'; -import {Config} from 'app/types'; -import {DEPLOY_PREVIEW_CONFIG, EXPERIMENTAL_SPA} from 'app/constants'; import { displayDeployPreviewAlert, displayExperimentalSpaAlert, } from 'app/actionCreators/deployPreview'; import {fetchGuides} from 'app/actionCreators/guides'; import {openCommandPalette} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; import AlertActions from 'app/actions/alertActions'; -import ConfigStore from 'app/stores/configStore'; +import {Client} from 'app/api'; import ErrorBoundary from 'app/components/errorBoundary'; import GlobalModal from 'app/components/globalModal'; -import HookStore from 'app/stores/hookStore'; import Indicators from 'app/components/indicators'; import LoadingIndicator from 'app/components/loadingIndicator'; -import NewsletterConsent from 'app/views/newsletterConsent'; +import {DEPLOY_PREVIEW_CONFIG, EXPERIMENTAL_SPA} from 'app/constants'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; +import HookStore from 'app/stores/hookStore'; import OrganizationsStore from 'app/stores/organizationsStore'; +import {Config} from 'app/types'; import withApi from 'app/utils/withApi'; import withConfig from 'app/utils/withConfig'; +import NewsletterConsent from 'app/views/newsletterConsent'; import SystemAlerts from './systemAlerts'; diff --git a/src/sentry/static/sentry/app/views/app/root.tsx b/src/sentry/static/sentry/app/views/app/root.tsx index 3b15077b8a0412..3964a19a492af2 100644 --- a/src/sentry/static/sentry/app/views/app/root.tsx +++ b/src/sentry/static/sentry/app/views/app/root.tsx @@ -1,9 +1,9 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Config} from 'app/types'; import {DEFAULT_APP_ROUTE} from 'app/constants'; +import {Config} from 'app/types'; import replaceRouterParams from 'app/utils/replaceRouterParams'; import withConfig from 'app/utils/withConfig'; diff --git a/src/sentry/static/sentry/app/views/app/systemAlerts.tsx b/src/sentry/static/sentry/app/views/app/systemAlerts.tsx index 3195c18d246bec..34df4d6dac29ea 100644 --- a/src/sentry/static/sentry/app/views/app/systemAlerts.tsx +++ b/src/sentry/static/sentry/app/views/app/systemAlerts.tsx @@ -1,7 +1,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; -import Reflux from 'reflux'; import {ThemeProvider} from 'emotion-theming'; +import Reflux from 'reflux'; import AlertStore from 'app/stores/alertStore'; import theme from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/views/asyncView.tsx b/src/sentry/static/sentry/app/views/asyncView.tsx index c46d2a2f670232..c477fb0592894c 100644 --- a/src/sentry/static/sentry/app/views/asyncView.tsx +++ b/src/sentry/static/sentry/app/views/asyncView.tsx @@ -1,5 +1,5 @@ -import DocumentTitle from 'react-document-title'; import React from 'react'; +import DocumentTitle from 'react-document-title'; import AsyncComponent from 'app/components/asyncComponent'; diff --git a/src/sentry/static/sentry/app/views/auth/layout.jsx b/src/sentry/static/sentry/app/views/auth/layout.jsx index ca701ae67af2ce..14d2dea58aaf8e 100644 --- a/src/sentry/static/sentry/app/views/auth/layout.jsx +++ b/src/sentry/static/sentry/app/views/auth/layout.jsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {IconSentry} from 'app/icons'; import Link from 'app/components/links/link'; import Panel from 'app/components/panels/panel'; +import {IconSentry} from 'app/icons'; import space from 'app/styles/space'; const BODY_CLASSES = ['narrow']; diff --git a/src/sentry/static/sentry/app/views/auth/login.jsx b/src/sentry/static/sentry/app/views/auth/login.jsx index 4a07d5ba667638..ecff37a083f3d7 100644 --- a/src/sentry/static/sentry/app/views/auth/login.jsx +++ b/src/sentry/static/sentry/app/views/auth/login.jsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; import NavTabs from 'app/components/navTabs'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; diff --git a/src/sentry/static/sentry/app/views/auth/loginForm.jsx b/src/sentry/static/sentry/app/views/auth/loginForm.jsx index 3171df242d8c3f..bc9d8480aa15f1 100644 --- a/src/sentry/static/sentry/app/views/auth/loginForm.jsx +++ b/src/sentry/static/sentry/app/views/auth/loginForm.jsx @@ -1,20 +1,20 @@ -import {ClassNames} from '@emotion/core'; -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {ClassNames} from '@emotion/core'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {formFooterClass} from 'app/views/auth/login'; -import {t} from 'app/locale'; import Button from 'app/components/button'; -import ConfigStore from 'app/stores/configStore'; import Form from 'app/components/forms/form'; -import Link from 'app/components/links/link'; import PasswordField from 'app/components/forms/passwordField'; +import TextField from 'app/components/forms/textField'; +import Link from 'app/components/links/link'; import {IconGithub, IconGoogle, IconVsts} from 'app/icons'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import TextField from 'app/components/forms/textField'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; +import {formFooterClass} from 'app/views/auth/login'; // TODO(epurkhiser): The abstraction here would be much nicer if we just // exposed a configuration object telling us what auth providers there are. diff --git a/src/sentry/static/sentry/app/views/auth/registerForm.jsx b/src/sentry/static/sentry/app/views/auth/registerForm.jsx index 5fc98d0a30b64e..0c1ba3bc5c9ecf 100644 --- a/src/sentry/static/sentry/app/views/auth/registerForm.jsx +++ b/src/sentry/static/sentry/app/views/auth/registerForm.jsx @@ -1,18 +1,18 @@ -import {ClassNames} from '@emotion/core'; -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {ClassNames} from '@emotion/core'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {formFooterClass} from 'app/views/auth/login'; -import {t, tct} from 'app/locale'; -import ConfigStore from 'app/stores/configStore'; -import ExternalLink from 'app/components/links/externalLink'; import Form from 'app/components/forms/form'; import PasswordField from 'app/components/forms/passwordField'; import RadioBooleanField from 'app/components/forms/radioBooleanField'; -import SentryTypes from 'app/sentryTypes'; import TextField from 'app/components/forms/textField'; +import ExternalLink from 'app/components/links/externalLink'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import ConfigStore from 'app/stores/configStore'; +import {formFooterClass} from 'app/views/auth/login'; const SubscribeField = () => ( <RadioBooleanField diff --git a/src/sentry/static/sentry/app/views/auth/ssoForm.jsx b/src/sentry/static/sentry/app/views/auth/ssoForm.jsx index 5c0eba64f67f9c..dd2109c41e061a 100644 --- a/src/sentry/static/sentry/app/views/auth/ssoForm.jsx +++ b/src/sentry/static/sentry/app/views/auth/ssoForm.jsx @@ -1,11 +1,11 @@ +import React from 'react'; import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; -import React from 'react'; -import {t, tct} from 'app/locale'; import Form from 'app/components/forms/form'; -import SentryTypes from 'app/sentryTypes'; import TextField from 'app/components/forms/textField'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; const SlugExample = p => ( <code> diff --git a/src/sentry/static/sentry/app/views/dashboards/dashboard.jsx b/src/sentry/static/sentry/app/views/dashboards/dashboard.jsx index 4dd3d053611cd0..281bc8113e0ffa 100644 --- a/src/sentry/static/sentry/app/views/dashboards/dashboard.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/dashboard.jsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/dashboards/data/dashboards/overviewDashboard.jsx b/src/sentry/static/sentry/app/views/dashboards/data/dashboards/overviewDashboard.jsx index b373749c34f080..dc20a424c32f76 100644 --- a/src/sentry/static/sentry/app/views/dashboards/data/dashboards/overviewDashboard.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/data/dashboards/overviewDashboard.jsx @@ -1,7 +1,7 @@ import affectedUsers from '../widgets/affectedUsers'; import errorsByGeo from '../widgets/errorsByGeo'; -import eventsByReleasePercent from '../widgets/eventsByReleasePercent'; import events from '../widgets/events'; +import eventsByReleasePercent from '../widgets/eventsByReleasePercent'; import handledVsUnhandled from '../widgets/handledVsUnhandled'; import topDevicesAndBrowsers from '../widgets/topDevicesAndBrowsers'; diff --git a/src/sentry/static/sentry/app/views/dashboards/data/queries/errorsByGeo.jsx b/src/sentry/static/sentry/app/views/dashboards/data/queries/errorsByGeo.jsx index 72e96a7a30e89f..7245373f99e5c8 100644 --- a/src/sentry/static/sentry/app/views/dashboards/data/queries/errorsByGeo.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/data/queries/errorsByGeo.jsx @@ -1,5 +1,5 @@ -import {OPERATOR} from 'app/views/discover/data'; import {t} from 'app/locale'; +import {OPERATOR} from 'app/views/discover/data'; /** * Top Errors by geo location diff --git a/src/sentry/static/sentry/app/views/dashboards/data/queries/knownUsersAffected.jsx b/src/sentry/static/sentry/app/views/dashboards/data/queries/knownUsersAffected.jsx index f17da69391375b..f2b3c3f1ec433c 100644 --- a/src/sentry/static/sentry/app/views/dashboards/data/queries/knownUsersAffected.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/data/queries/knownUsersAffected.jsx @@ -1,8 +1,8 @@ /** * Known affected users */ -import {OPERATOR} from 'app/views/discover/data'; import {t} from 'app/locale'; +import {OPERATOR} from 'app/views/discover/data'; const knownUsersAffectedQuery = { name: t('Known Users'), diff --git a/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx b/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx index dd60c115603df6..a9bb0f91034607 100644 --- a/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/discoverQuery.jsx @@ -1,16 +1,16 @@ -import PropTypes from 'prop-types'; import React from 'react'; import isEqual from 'lodash/isEqual'; import memoize from 'lodash/memoize'; import omit from 'lodash/omit'; +import PropTypes from 'prop-types'; -import {DEFAULT_STATS_PERIOD} from 'app/constants'; import {getInterval} from 'app/components/charts/utils'; -import {getPeriod} from 'app/utils/getPeriod'; -import {parsePeriodToHours} from 'app/utils/dates'; +import {DEFAULT_STATS_PERIOD} from 'app/constants'; import SentryTypes from 'app/sentryTypes'; -import createQueryBuilder from 'app/views/discover/queryBuilder'; +import {parsePeriodToHours} from 'app/utils/dates'; +import {getPeriod} from 'app/utils/getPeriod'; import withProjects from 'app/utils/withProjects'; +import createQueryBuilder from 'app/views/discover/queryBuilder'; // Note: Limit max releases so that chart is still a bit readable const MAX_RECENT_RELEASES = 20; diff --git a/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx b/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx index 9453d0c45ae152..a5558fb174df05 100644 --- a/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/exploreWidget.jsx @@ -2,16 +2,16 @@ import React from 'react'; import styled from '@emotion/styled'; import omit from 'lodash/omit'; +import Button from 'app/components/button'; +import DropdownMenu from 'app/components/dropdownMenu'; +import {IconChevron, IconOpen, IconStack} from 'app/icons'; import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; import withOrganization from 'app/utils/withOrganization'; -import Button from 'app/components/button'; -import DropdownMenu from 'app/components/dropdownMenu'; -import {IconChevron, IconOpen, IconStack} from 'app/icons'; import { - getDiscoverUrlPathFromDiscoverQuery, getDiscover2UrlPathFromDiscoverQuery, + getDiscoverUrlPathFromDiscoverQuery, } from 'app/views/dashboards/utils/getDiscoverUrlPathFromDiscoverQuery'; import {getEventsUrlPathFromDiscoverQuery} from 'app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery'; diff --git a/src/sentry/static/sentry/app/views/dashboards/index.tsx b/src/sentry/static/sentry/app/views/dashboards/index.tsx index d7394c828160b2..b7cf3e29c5f2d6 100644 --- a/src/sentry/static/sentry/app/views/dashboards/index.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/index.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import {PageContent, PageHeader} from 'app/styles/organization'; -import {t} from 'app/locale'; import Feature from 'app/components/acl/feature'; -import PageHeading from 'app/components/pageHeading'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import withOrganization from 'app/utils/withOrganization'; +import PageHeading from 'app/components/pageHeading'; +import {t} from 'app/locale'; +import {PageContent, PageHeader} from 'app/styles/organization'; import {Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/dashboards/overviewDashboard.tsx b/src/sentry/static/sentry/app/views/dashboards/overviewDashboard.tsx index 1563de735b6652..7852cf63e0e48c 100644 --- a/src/sentry/static/sentry/app/views/dashboards/overviewDashboard.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/overviewDashboard.tsx @@ -2,13 +2,13 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import {Release, Organization} from 'app/types'; +import {Organization, Release} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; import DashboardDetail from 'app/views/dashboardsV2/detail'; -import Dashboard from './dashboard'; import overviewDashboard from './data/dashboards/overviewDashboard'; +import Dashboard from './dashboard'; type Props = RouteComponentProps<{orgId: string}, {}>; diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getChartDataFunc.tsx b/src/sentry/static/sentry/app/views/dashboards/utils/getChartDataFunc.tsx index dd1e1bf4847e29..d097ea711190a1 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getChartDataFunc.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getChartDataFunc.tsx @@ -1,9 +1,10 @@ -import {getChartDataForWidget, getChartDataByDay} from 'app/views/discover/result/utils'; import {Widget} from 'app/types'; +import {getChartDataByDay, getChartDataForWidget} from 'app/views/discover/result/utils'; -import {isTimeSeries} from './isTimeSeries'; import {WIDGET_DISPLAY} from '../constants'; +import {isTimeSeries} from './isTimeSeries'; + /** * Get data function based on widget properties */ diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getData.tsx b/src/sentry/static/sentry/app/views/dashboards/utils/getData.tsx index 75a6f6986f745b..5e1251844af3c1 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getData.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getData.tsx @@ -3,6 +3,7 @@ import {Widget} from 'app/types'; import {SnubaResult} from 'app/views/discover/types'; import {WIDGET_DISPLAY} from '../constants'; + import {getChartDataFunc} from './getChartDataFunc'; import {isTimeSeries} from './isTimeSeries'; diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverConditionsToSearchString.tsx b/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverConditionsToSearchString.tsx index a10b9856d1d37a..69b55c199783d3 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverConditionsToSearchString.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverConditionsToSearchString.tsx @@ -1,9 +1,9 @@ +import {defined} from 'app/utils'; import { NEGATION_OPERATORS, NULL_OPERATORS, WILDCARD_OPERATORS, } from 'app/views/discover/data'; -import {defined} from 'app/utils'; import {Condition} from 'app/views/discover/types'; const checkIsNegation = operator => NEGATION_OPERATORS.includes(operator); diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverUrlPathFromDiscoverQuery.tsx b/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverUrlPathFromDiscoverQuery.tsx index a58791c873510c..fcaea45c815059 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverUrlPathFromDiscoverQuery.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getDiscoverUrlPathFromDiscoverQuery.tsx @@ -1,9 +1,9 @@ import * as qs from 'query-string'; +import {GlobalSelection, Organization} from 'app/types'; import {getExternal, getInternal} from 'app/views/discover/aggregations/utils'; -import {getQueryStringFromQuery} from 'app/views/discover/utils'; import {Query} from 'app/views/discover/types'; -import {GlobalSelection, Organization} from 'app/types'; +import {getQueryStringFromQuery} from 'app/views/discover/utils'; export function getDiscoverUrlPathFromDiscoverQuery({ organization, diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.tsx b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.tsx index db90236f26d719..900b57f60f72d9 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlFromDiscoverQueryWithConditions.tsx @@ -9,9 +9,9 @@ */ import zipWith from 'lodash/zipWith'; -import {OPERATOR} from 'app/views/discover/data'; import {escapeQuotes} from 'app/components/events/interfaces/utils'; -import {Organization, GlobalSelection} from 'app/types'; +import {GlobalSelection, Organization} from 'app/types'; +import {OPERATOR} from 'app/views/discover/data'; import {Condition, Query} from 'app/views/discover/types'; import {getEventsUrlPathFromDiscoverQuery} from './getEventsUrlPathFromDiscoverQuery'; diff --git a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.tsx b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.tsx index 15c4f85beff6cc..3774c89d4a9bc5 100644 --- a/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.tsx +++ b/src/sentry/static/sentry/app/views/dashboards/utils/getEventsUrlPathFromDiscoverQuery.tsx @@ -1,8 +1,8 @@ import pickBy from 'lodash/pickBy'; import * as qs from 'query-string'; +import {GlobalSelection, Organization} from 'app/types'; import {getUtcDateString} from 'app/utils/dates'; -import {Organization, GlobalSelection} from 'app/types'; import {Query} from 'app/views/discover/types'; import {getDiscoverConditionsToSearchString} from './getDiscoverConditionsToSearchString'; diff --git a/src/sentry/static/sentry/app/views/dashboards/widget.jsx b/src/sentry/static/sentry/app/views/dashboards/widget.jsx index 27d687fce00a6c..d1dac954b2ad9c 100644 --- a/src/sentry/static/sentry/app/views/dashboards/widget.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/widget.jsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Panel, PanelBody} from 'app/components/panels'; -import {t} from 'app/locale'; import ErrorBoundary from 'app/components/errorBoundary'; import LoadingMask from 'app/components/loadingMask'; +import {Panel, PanelBody} from 'app/components/panels'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; import withGlobalSelection from 'app/utils/withGlobalSelection'; diff --git a/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx b/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx index 51c382fe59c312..26a271636907ac 100644 --- a/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx +++ b/src/sentry/static/sentry/app/views/dashboards/widgetChart.jsx @@ -1,17 +1,17 @@ -import {withTheme} from 'emotion-theming'; +import React from 'react'; import {ClassNames} from '@emotion/core'; +import {withTheme} from 'emotion-theming'; import isEqual from 'lodash/isEqual'; import PropTypes from 'prop-types'; -import React from 'react'; import ChartZoom from 'app/components/charts/chartZoom'; import ReleaseSeries from 'app/components/charts/releaseSeries'; import SentryTypes from 'app/sentryTypes'; -import {WIDGET_DISPLAY} from './constants'; import {getChartComponent} from './utils/getChartComponent'; import {getData} from './utils/getData'; import {getEventsUrlFromDiscoverQueryWithConditions} from './utils/getEventsUrlFromDiscoverQueryWithConditions'; +import {WIDGET_DISPLAY} from './constants'; /** * Component that decides what Chart to render diff --git a/src/sentry/static/sentry/app/views/dashboardsV2/controls.tsx b/src/sentry/static/sentry/app/views/dashboardsV2/controls.tsx index d105bf237a8fb5..37f44ad696eb25 100644 --- a/src/sentry/static/sentry/app/views/dashboardsV2/controls.tsx +++ b/src/sentry/static/sentry/app/views/dashboardsV2/controls.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import styled from '@emotion/styled'; import {browserHistory} from 'react-router'; +import styled from '@emotion/styled'; -import {Organization} from 'app/types'; -import {t} from 'app/locale'; -import {IconAdd, IconEdit} from 'app/icons'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; import SelectControl from 'app/components/forms/selectControl'; +import {IconAdd, IconEdit} from 'app/icons'; +import {t} from 'app/locale'; +import {Organization} from 'app/types'; import {DashboardListItem, DashboardState} from './types'; diff --git a/src/sentry/static/sentry/app/views/dashboardsV2/detail.tsx b/src/sentry/static/sentry/app/views/dashboardsV2/detail.tsx index 22614f50549d4e..7fbd8142fc3b80 100644 --- a/src/sentry/static/sentry/app/views/dashboardsV2/detail.tsx +++ b/src/sentry/static/sentry/app/views/dashboardsV2/detail.tsx @@ -1,40 +1,40 @@ import React from 'react'; -import isEqual from 'lodash/isEqual'; -import {Location} from 'history'; import {browserHistory} from 'react-router'; import {Params} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import {Location} from 'history'; +import isEqual from 'lodash/isEqual'; -import {Organization} from 'app/types'; -import {t} from 'app/locale'; -import withOrganization from 'app/utils/withOrganization'; -import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import {PageContent} from 'app/styles/organization'; -import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; -import space from 'app/styles/space'; -import AsyncComponent from 'app/components/asyncComponent'; -import NotFound from 'app/components/errors/notFound'; import { createDashboard, - updateDashboard, deleteDashboard, + updateDashboard, } from 'app/actionCreators/dashboards'; import {addSuccessMessage} from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; +import AsyncComponent from 'app/components/asyncComponent'; +import NotFound from 'app/components/errors/notFound'; +import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; +import space from 'app/styles/space'; +import {Organization} from 'app/types'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; +import Controls from './controls'; +import Dashboard from './dashboard'; +import {EMPTY_DASHBOARD, PREBUILT_DASHBOARDS} from './data'; +import Title from './title'; import { DashboardListItem, - OrgDashboardResponse, - OrgDashboard, DashboardState, + OrgDashboard, + OrgDashboardResponse, } from './types'; -import {PREBUILT_DASHBOARDS, EMPTY_DASHBOARD} from './data'; import {cloneDashboard} from './utils'; -import Controls from './controls'; -import Dashboard from './dashboard'; -import Title from './title'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/dashboardsV2/index.tsx b/src/sentry/static/sentry/app/views/dashboardsV2/index.tsx index c93cfb9833514c..8f92c70cddf628 100644 --- a/src/sentry/static/sentry/app/views/dashboardsV2/index.tsx +++ b/src/sentry/static/sentry/app/views/dashboardsV2/index.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {Organization} from 'app/types'; import Feature from 'app/components/acl/feature'; +import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; import DashboardsV1 from 'app/views/dashboards'; diff --git a/src/sentry/static/sentry/app/views/dashboardsV2/title.tsx b/src/sentry/static/sentry/app/views/dashboardsV2/title.tsx index 190cb94c02139b..e8c339be52e154 100644 --- a/src/sentry/static/sentry/app/views/dashboardsV2/title.tsx +++ b/src/sentry/static/sentry/app/views/dashboardsV2/title.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; +import {addErrorMessage} from 'app/actionCreators/indicator'; import InlineInput from 'app/components/inputInline'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {addErrorMessage} from 'app/actionCreators/indicator'; import {DashboardListItem} from './types'; diff --git a/src/sentry/static/sentry/app/views/dataExport/dataDownload.tsx b/src/sentry/static/sentry/app/views/dataExport/dataDownload.tsx index 196b2f973f8cab..8b3e5328c940b7 100644 --- a/src/sentry/static/sentry/app/views/dataExport/dataDownload.tsx +++ b/src/sentry/static/sentry/app/views/dataExport/dataDownload.tsx @@ -1,16 +1,16 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; import Button from 'app/components/button'; -import {IconDownload} from 'app/icons'; import {ExportQueryType} from 'app/components/dataExport'; import DateTime from 'app/components/dateTime'; +import {IconDownload} from 'app/icons'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; import AsyncView from 'app/views/asyncView'; import Layout from 'app/views/auth/layout'; -import space from 'app/styles/space'; -import {t, tct} from 'app/locale'; export enum DownloadStatus { Early = 'EARLY', diff --git a/src/sentry/static/sentry/app/views/discover/aggregations/aggregation.tsx b/src/sentry/static/sentry/app/views/discover/aggregations/aggregation.tsx index 5ad0192191e2ad..5d93c387284cba 100644 --- a/src/sentry/static/sentry/app/views/discover/aggregations/aggregation.tsx +++ b/src/sentry/static/sentry/app/views/discover/aggregations/aggregation.tsx @@ -1,13 +1,14 @@ import React from 'react'; import {Value} from 'react-select-legacy'; -import {t} from 'app/locale'; import SelectControl from 'app/components/forms/selectControl'; +import {t} from 'app/locale'; -import {getInternal, getExternal} from './utils'; -import {Aggregation, DiscoverBaseProps, ReactSelectOption} from '../types'; -import {PlaceholderText} from '../styles'; import {ARRAY_FIELD_PREFIXES} from '../data'; +import {PlaceholderText} from '../styles'; +import {Aggregation, DiscoverBaseProps, ReactSelectOption} from '../types'; + +import {getExternal, getInternal} from './utils'; type AggregationProps = DiscoverBaseProps & { value: Aggregation; diff --git a/src/sentry/static/sentry/app/views/discover/aggregations/index.tsx b/src/sentry/static/sentry/app/views/discover/aggregations/index.tsx index 2f6994ca9818bc..a0bd3ce3a7fa2a 100644 --- a/src/sentry/static/sentry/app/views/discover/aggregations/index.tsx +++ b/src/sentry/static/sentry/app/views/discover/aggregations/index.tsx @@ -1,13 +1,14 @@ import React from 'react'; -import {t} from 'app/locale'; -import {IconClose} from 'app/icons/iconClose'; import Link from 'app/components/links/link'; +import {IconClose} from 'app/icons/iconClose'; +import {t} from 'app/locale'; -import AggregationRow from './aggregation'; -import {PlaceholderText, SelectListItem, AddText, SidebarLabel} from '../styles'; +import {AddText, PlaceholderText, SelectListItem, SidebarLabel} from '../styles'; import {Aggregation, DiscoverBaseProps} from '../types'; +import AggregationRow from './aggregation'; + type AggregationsProps = DiscoverBaseProps & { value: Aggregation[]; onChange: (value: Aggregation[]) => void; diff --git a/src/sentry/static/sentry/app/views/discover/aggregations/utils.tsx b/src/sentry/static/sentry/app/views/discover/aggregations/utils.tsx index 3e444d0993e030..b44dc2738fd786 100644 --- a/src/sentry/static/sentry/app/views/discover/aggregations/utils.tsx +++ b/src/sentry/static/sentry/app/views/discover/aggregations/utils.tsx @@ -1,4 +1,4 @@ -import {Column, Aggregation} from '../types'; +import {Aggregation, Column} from '../types'; /** * Returns true if an aggregation is valid and false if not diff --git a/src/sentry/static/sentry/app/views/discover/conditions/condition.tsx b/src/sentry/static/sentry/app/views/discover/conditions/condition.tsx index 4ded7bcf7a1b15..d5bdfbbddd249d 100644 --- a/src/sentry/static/sentry/app/views/discover/conditions/condition.tsx +++ b/src/sentry/static/sentry/app/views/discover/conditions/condition.tsx @@ -1,15 +1,16 @@ import React from 'react'; -import styled from '@emotion/styled'; import {Value} from 'react-select-legacy'; +import styled from '@emotion/styled'; +import SelectControl from 'app/components/forms/selectControl'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import SelectControl from 'app/components/forms/selectControl'; -import {getInternal, getExternal, isValidCondition, ignoreCase} from './utils'; -import {CONDITION_OPERATORS, ARRAY_FIELD_PREFIXES} from '../data'; +import {ARRAY_FIELD_PREFIXES, CONDITION_OPERATORS} from '../data'; import {PlaceholderText} from '../styles'; -import {DiscoverBaseProps, Condition, ReactSelectOption} from '../types'; +import {Condition, DiscoverBaseProps, ReactSelectOption} from '../types'; + +import {getExternal, getInternal, ignoreCase, isValidCondition} from './utils'; type ConditionProps = DiscoverBaseProps & { value: Condition; diff --git a/src/sentry/static/sentry/app/views/discover/conditions/index.tsx b/src/sentry/static/sentry/app/views/discover/conditions/index.tsx index 4a33e3e339bf6e..3b1a9291f9518d 100644 --- a/src/sentry/static/sentry/app/views/discover/conditions/index.tsx +++ b/src/sentry/static/sentry/app/views/discover/conditions/index.tsx @@ -1,13 +1,14 @@ import React from 'react'; -import {t} from 'app/locale'; -import {IconClose} from 'app/icons/iconClose'; import Link from 'app/components/links/link'; +import {IconClose} from 'app/icons/iconClose'; +import {t} from 'app/locale'; -import ConditionRow from './condition'; -import {PlaceholderText, SelectListItem, AddText, SidebarLabel} from '../styles'; +import {AddText, PlaceholderText, SelectListItem, SidebarLabel} from '../styles'; import {Condition, DiscoverBaseProps} from '../types'; +import ConditionRow from './condition'; + type ConditionsProps = DiscoverBaseProps & { value: Condition[]; onChange: (value: [any, any, any][]) => void; diff --git a/src/sentry/static/sentry/app/views/discover/conditions/utils.tsx b/src/sentry/static/sentry/app/views/discover/conditions/utils.tsx index fede2108e9d2f5..89c411dad07bd5 100644 --- a/src/sentry/static/sentry/app/views/discover/conditions/utils.tsx +++ b/src/sentry/static/sentry/app/views/discover/conditions/utils.tsx @@ -1,7 +1,7 @@ import moment from 'moment'; -import {Column, Condition} from '../types'; import {CONDITION_OPERATORS} from '../data'; +import {Column, Condition} from '../types'; const specialConditions = new Set(['IS NULL', 'IS NOT NULL']); diff --git a/src/sentry/static/sentry/app/views/discover/discover.tsx b/src/sentry/static/sentry/app/views/discover/discover.tsx index 2b58a384a76c9a..f2f64d4e5c00b7 100644 --- a/src/sentry/static/sentry/app/views/discover/discover.tsx +++ b/src/sentry/static/sentry/app/views/discover/discover.tsx @@ -1,46 +1,46 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import moment from 'moment'; +import {updateDateTime, updateProjects} from 'app/actionCreators/globalSelection'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {getUtcDateString} from 'app/utils/dates'; +import PageHeading from 'app/components/pageHeading'; import {t, tct} from 'app/locale'; -import {updateProjects, updateDateTime} from 'app/actionCreators/globalSelection'; import ConfigStore from 'app/stores/configStore'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import PageHeading from 'app/components/pageHeading'; import {Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {getUtcDateString} from 'app/utils/dates'; import localStorage from 'app/utils/localStorage'; +import {isValidAggregation} from './aggregations/utils'; +import {isValidCondition} from './conditions/utils'; +import ResultLoading from './result/loading'; +import EditSavedQuery from './sidebar/editSavedQuery'; +import NewQuery from './sidebar/newQuery'; +import QueryPanel from './sidebar/queryPanel'; +import SavedQueryList from './sidebar/savedQueryList'; +import {trackQuery} from './analytics'; +import Intro from './intro'; +import Result from './result'; +import createResultManager from './resultManager'; import { - DiscoverContainer, - DiscoverGlobalSelectionHeader, Body, BodyContent, + DiscoverContainer, + DiscoverGlobalSelectionHeader, HeadingContainer, + SavedQueryWrapper, Sidebar, SidebarTabs, - SavedQueryWrapper, } from './styles'; +import {SavedQuery} from './types'; import { - getQueryStringFromQuery, - getQueryFromQueryString, deleteSavedQuery, - updateSavedQuery, + getQueryFromQueryString, + getQueryStringFromQuery, queryHasChanged, + updateSavedQuery, } from './utils'; -import {isValidAggregation} from './aggregations/utils'; -import {isValidCondition} from './conditions/utils'; -import {trackQuery} from './analytics'; -import EditSavedQuery from './sidebar/editSavedQuery'; -import Intro from './intro'; -import NewQuery from './sidebar/newQuery'; -import QueryPanel from './sidebar/queryPanel'; -import Result from './result'; -import ResultLoading from './result/loading'; -import SavedQueryList from './sidebar/savedQueryList'; -import createResultManager from './resultManager'; -import {SavedQuery} from './types'; type DefaultProps = { utc: boolean | null; diff --git a/src/sentry/static/sentry/app/views/discover/index.tsx b/src/sentry/static/sentry/app/views/discover/index.tsx index 06376b429c0d7c..dcf1478f14579c 100644 --- a/src/sentry/static/sentry/app/views/discover/index.tsx +++ b/src/sentry/static/sentry/app/views/discover/index.tsx @@ -1,28 +1,28 @@ import React from 'react'; -import {browserHistory, WithRouterProps} from 'react-router'; import DocumentTitle from 'react-document-title'; +import {browserHistory, WithRouterProps} from 'react-router'; -import {getUserTimezone, getUtcToLocalDateObject} from 'app/utils/dates'; -import {t} from 'app/locale'; -import {updateProjects, updateDateTime} from 'app/actionCreators/globalSelection'; -import withGlobalSelection from 'app/utils/withGlobalSelection'; -import withOrganization from 'app/utils/withOrganization'; +import {updateDateTime, updateProjects} from 'app/actionCreators/globalSelection'; import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; +import {t} from 'app/locale'; import {GlobalSelection, Organization} from 'app/types'; +import {getUserTimezone, getUtcToLocalDateObject} from 'app/utils/dates'; import {getDiscoverLandingUrl} from 'app/utils/discover/urls'; import Redirect from 'app/utils/redirect'; +import withGlobalSelection from 'app/utils/withGlobalSelection'; +import withOrganization from 'app/utils/withOrganization'; import Discover from './discover'; import createQueryBuilder from './queryBuilder'; +import {DiscoverWrapper} from './styles'; +import {SavedQuery} from './types'; import { - getQueryFromQueryString, fetchSavedQuery, - parseSavedQuery, + getQueryFromQueryString, getView, + parseSavedQuery, } from './utils'; -import {DiscoverWrapper} from './styles'; -import {SavedQuery} from './types'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/discover/intro.tsx b/src/sentry/static/sentry/app/views/discover/intro.tsx index e803fba032e1da..f6059c19cf65a5 100644 --- a/src/sentry/static/sentry/app/views/discover/intro.tsx +++ b/src/sentry/static/sentry/app/views/discover/intro.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {tct, t} from 'app/locale'; -import ExternalLink from 'app/components/links/externalLink'; import Button from 'app/components/button'; +import ExternalLink from 'app/components/links/externalLink'; import {Panel} from 'app/components/panels'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; type IntroProps = { diff --git a/src/sentry/static/sentry/app/views/discover/missingProjectWarningModal.tsx b/src/sentry/static/sentry/app/views/discover/missingProjectWarningModal.tsx index 0547779ffa53b0..adaf380d88c5a6 100644 --- a/src/sentry/static/sentry/app/views/discover/missingProjectWarningModal.tsx +++ b/src/sentry/static/sentry/app/views/discover/missingProjectWarningModal.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import Modal, {Header, Body, Footer} from 'react-bootstrap/lib/Modal'; +import Modal, {Body, Footer, Header} from 'react-bootstrap/lib/Modal'; -import {Organization} from 'app/types'; import Button from 'app/components/button'; import {t} from 'app/locale'; +import {Organization} from 'app/types'; type MissingProjectWarningModalProps = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx b/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx index 73ee4663f3ad6a..f24ae8b226cce6 100644 --- a/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx +++ b/src/sentry/static/sentry/app/views/discover/queryBuilder.tsx @@ -1,19 +1,19 @@ import React from 'react'; -import uniq from 'lodash/uniq'; import partition from 'lodash/partition'; +import uniq from 'lodash/uniq'; import moment from 'moment-timezone'; +import {openModal} from 'app/actionCreators/modal'; import {Client} from 'app/api'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import {DEFAULT_STATS_PERIOD} from 'app/constants'; import {t} from 'app/locale'; -import {Project, Organization} from 'app/types'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; -import {openModal} from 'app/actionCreators/modal'; import ConfigStore from 'app/stores/configStore'; +import {Organization, Project} from 'app/types'; -import MissingProjectWarningModal from './missingProjectWarningModal'; -import {COLUMNS, PROMOTED_TAGS, SPECIAL_TAGS, HIDDEN_TAGS} from './data'; import {isValidAggregation} from './aggregations/utils'; +import {COLUMNS, HIDDEN_TAGS, PROMOTED_TAGS, SPECIAL_TAGS} from './data'; +import MissingProjectWarningModal from './missingProjectWarningModal'; import {Aggregation, Column, Query, SnubaResult} from './types'; const API_LIMIT = 10000; diff --git a/src/sentry/static/sentry/app/views/discover/result/index.tsx b/src/sentry/static/sentry/app/views/discover/result/index.tsx index 4f701333ec341e..ec3d17880f443f 100644 --- a/src/sentry/static/sentry/app/views/discover/result/index.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/index.tsx @@ -2,40 +2,41 @@ import React from 'react'; import {browserHistory} from 'react-router'; import throttle from 'lodash/throttle'; -import {t} from 'app/locale'; -import getDynamicText from 'app/utils/getDynamicText'; import BarChart from 'app/components/charts/barChart'; import LineChart from 'app/components/charts/lineChart'; import PageHeading from 'app/components/pageHeading'; import {IconEdit} from 'app/icons'; +import {t} from 'app/locale'; +import getDynamicText from 'app/utils/getDynamicText'; +import {NUMBER_OF_SERIES_BY_DAY} from '../data'; import { - getChartData, - getChartDataByDay, - getRowsPageRange, - downloadAsCsv, - getVisualization, -} from './utils'; -import Table from './table'; -import Pagination from './pagination'; -import VisualizationsToggle from './visualizationsToggle'; -import { + ChartNote, + ChartWrapper, HeadingContainer, - ResultSummary, ResultContainer, ResultInnerContainer, - ChartWrapper, - ChartNote, - SavedQueryAction, + ResultSummary, ResultSummaryAndButtons, + SavedQueryAction, } from '../styles'; -import {NUMBER_OF_SERIES_BY_DAY} from '../data'; +import {SavedQuery} from '../types'; import { - queryHasChanged, getQueryFromQueryString, getQueryStringFromQuery, + queryHasChanged, } from '../utils'; -import {SavedQuery} from '../types'; + +import Pagination from './pagination'; +import Table from './table'; +import { + downloadAsCsv, + getChartData, + getChartDataByDay, + getRowsPageRange, + getVisualization, +} from './utils'; +import VisualizationsToggle from './visualizationsToggle'; type ResultProps = { data: any; diff --git a/src/sentry/static/sentry/app/views/discover/result/pagination.tsx b/src/sentry/static/sentry/app/views/discover/result/pagination.tsx index 95f37911ae766f..bfac70b408cc57 100644 --- a/src/sentry/static/sentry/app/views/discover/result/pagination.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/pagination.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {IconChevron} from 'app/icons'; import Button from 'app/components/button'; +import {IconChevron} from 'app/icons'; type PaginationProps = { getNextPage: () => void; diff --git a/src/sentry/static/sentry/app/views/discover/result/table.tsx b/src/sentry/static/sentry/app/views/discover/result/table.tsx index 4ebdf2f0ef9f74..dad12a1eccdc2e 100644 --- a/src/sentry/static/sentry/app/views/discover/result/table.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/table.tsx @@ -1,18 +1,19 @@ import React from 'react'; -import {MultiGrid, AutoSizer} from 'react-virtualized'; +import {AutoSizer, MultiGrid} from 'react-virtualized'; import styled from '@emotion/styled'; -import {Organization} from 'app/types'; -import {t} from 'app/locale'; +import EmptyStateWarning from 'app/components/emptyStateWarning'; import ExternalLink from 'app/components/links/externalLink'; -import Tooltip from 'app/components/tooltip'; import Panel from 'app/components/panels/panel'; -import EmptyStateWarning from 'app/components/emptyStateWarning'; +import Tooltip from 'app/components/tooltip'; +import {t} from 'app/locale'; +import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; -import {getDisplayValue, getDisplayText} from './utils'; import {Query, SnubaResult} from '../types'; +import {getDisplayText, getDisplayValue} from './utils'; + const TABLE_ROW_HEIGHT = 30; const TABLE_ROW_BORDER = 1; const TABLE_ROW_HEIGHT_WITH_BORDER = TABLE_ROW_HEIGHT + TABLE_ROW_BORDER; diff --git a/src/sentry/static/sentry/app/views/discover/result/utils.tsx b/src/sentry/static/sentry/app/views/discover/result/utils.tsx index b0160c2ca4619f..bd642aac4269d4 100644 --- a/src/sentry/static/sentry/app/views/discover/result/utils.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/utils.tsx @@ -1,12 +1,12 @@ -import orderBy from 'lodash/orderBy'; -import Papa from 'papaparse'; import React from 'react'; import styled from '@emotion/styled'; +import orderBy from 'lodash/orderBy'; +import Papa from 'papaparse'; import {formatVersion} from 'app/utils/formatters'; -import {Aggregation, Query, Result, SnubaResult} from '../types'; import {NUMBER_OF_SERIES_BY_DAY} from '../data'; +import {Aggregation, Query, Result, SnubaResult} from '../types'; const CHART_KEY = '__CHART_KEY__'; diff --git a/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx b/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx index ecc91e0ed03d47..016cd5c851b19d 100644 --- a/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx +++ b/src/sentry/static/sentry/app/views/discover/result/visualizationsToggle.tsx @@ -6,10 +6,10 @@ import {IconDownload} from 'app/icons'; import {t} from 'app/locale'; import { + DownloadCsvButton, ResultViewActions, ResultViewButtons, ResultViewDropdownButtons, - DownloadCsvButton, } from '../styles'; type Option = { diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx index ffa41ab6b38930..5aa6619890463c 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/editSavedQuery.tsx @@ -2,19 +2,20 @@ import React from 'react'; import isEqual from 'lodash/isEqual'; import Button from 'app/components/button'; -import {t} from 'app/locale'; import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; -import QueryFields from './queryFields'; -import {parseSavedQuery} from '../utils'; +import {QueryBuilder} from '../queryBuilder'; import { ButtonSpinner, QueryActions, QueryActionsGroup, SavedQueryAction, } from '../styles'; -import {QueryBuilder} from '../queryBuilder'; import {SavedQuery} from '../types'; +import {parseSavedQuery} from '../utils'; + +import QueryFields from './queryFields'; type EditSavedQueryProps = { queryBuilder: QueryBuilder; diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/newQuery.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/newQuery.tsx index 04f2fef7dee7c5..7dbb3f29b57b3b 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/newQuery.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/newQuery.tsx @@ -1,13 +1,12 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {Organization} from 'app/types'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import Button from 'app/components/button'; import {t, tct} from 'app/locale'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; +import {Organization} from 'app/types'; -import QueryFields from './queryFields'; -import {createSavedQuery, generateQueryName} from '../utils'; +import {QueryBuilder} from '../queryBuilder'; import { ButtonSpinner, QueryActions, @@ -15,7 +14,9 @@ import { QueryFieldsContainer, } from '../styles'; import {SavedQuery} from '../types'; -import {QueryBuilder} from '../queryBuilder'; +import {createSavedQuery, generateQueryName} from '../utils'; + +import QueryFields from './queryFields'; type NewQueryProps = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/orderby.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/orderby.tsx index 3a8cd6568b6291..7ed0c92add0ff4 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/orderby.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/orderby.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import SelectControl from 'app/components/forms/selectControl'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import {SidebarLabel} from '../styles'; diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx index 6cee6bfd187d28..4912b82c179d6e 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/queryFields.tsx @@ -1,30 +1,31 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import TextField from 'app/components/forms/textField'; +import Badge from 'app/components/badge'; import NumberField from 'app/components/forms/numberField'; import SelectControl from 'app/components/forms/selectControl'; -import Badge from 'app/components/badge'; +import TextField from 'app/components/forms/textField'; import {IconChevron, IconDocs} from 'app/icons'; +import {t} from 'app/locale'; import getDynamicText from 'app/utils/getDynamicText'; import Aggregations from '../aggregations'; import Conditions from '../conditions'; +import {NON_CONDITIONS_FIELDS} from '../data'; +import {QueryBuilder} from '../queryBuilder'; import { - Fieldset, - PlaceholderText, - SidebarLabel, - DocsSeparator, DiscoverDocs, DocsLabel, DocsLink, + DocsSeparator, + Fieldset, + PlaceholderText, + SidebarLabel, } from '../styles'; -import Orderby from './orderby'; -import {NON_CONDITIONS_FIELDS} from '../data'; +import {ReactSelectOption, SavedQuery} from '../types'; import {getOrderbyFields} from '../utils'; -import {SavedQuery, ReactSelectOption} from '../types'; -import {QueryBuilder} from '../queryBuilder'; + +import Orderby from './orderby'; type QueryFieldsProps = { queryBuilder: QueryBuilder; diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/queryPanel.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/queryPanel.tsx index e0dffbb42829c6..47662a2e25f3bb 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/queryPanel.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/queryPanel.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {IconClose} from 'app/icons/iconClose'; import PageHeading from 'app/components/pageHeading'; +import {IconClose} from 'app/icons/iconClose'; -import {QueryPanelContainer, QueryPanelTitle, QueryPanelCloseLink} from '../styles'; +import {QueryPanelCloseLink, QueryPanelContainer, QueryPanelTitle} from '../styles'; type QueryPanelProps = { title: any; diff --git a/src/sentry/static/sentry/app/views/discover/sidebar/savedQueryList.tsx b/src/sentry/static/sentry/app/views/discover/sidebar/savedQueryList.tsx index b5675b41cf0a19..daaf87f5fdfe24 100644 --- a/src/sentry/static/sentry/app/views/discover/sidebar/savedQueryList.tsx +++ b/src/sentry/static/sentry/app/views/discover/sidebar/savedQueryList.tsx @@ -1,21 +1,21 @@ import React from 'react'; import moment from 'moment'; -import getDynamicText from 'app/utils/getDynamicText'; import LoadingIndicator from 'app/components/loadingIndicator'; import {t, tct} from 'app/locale'; import {Organization} from 'app/types'; +import getDynamicText from 'app/utils/getDynamicText'; -import {fetchSavedQueries} from '../utils'; import { Fieldset, LoadingContainer, + SavedQueryLink, SavedQueryList, SavedQueryListItem, - SavedQueryLink, SavedQueryUpdated, } from '../styles'; import {SavedQuery} from '../types'; +import {fetchSavedQueries} from '../utils'; type SavedQueriesProps = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/discover/styles.tsx b/src/sentry/static/sentry/app/views/discover/styles.tsx index f14c2334121319..59373c67a38d53 100644 --- a/src/sentry/static/sentry/app/views/discover/styles.tsx +++ b/src/sentry/static/sentry/app/views/discover/styles.tsx @@ -1,16 +1,16 @@ -import {keyframes} from '@emotion/core'; import React from 'react'; +import {keyframes} from '@emotion/core'; import styled from '@emotion/styled'; -import {Panel, PanelItem} from 'app/components/panels'; -import {slideInLeft} from 'app/styles/animations'; import Button from 'app/components/button'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import ExternalLink from 'app/components/links/externalLink'; import Link from 'app/components/links/link'; import NavTabs from 'app/components/navTabs'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import {Panel, PanelItem} from 'app/components/panels'; +import {slideInLeft} from 'app/styles/animations'; import space from 'app/styles/space'; import theme from 'app/utils/theme'; -import ExternalLink from 'app/components/links/externalLink'; const HEADER_HEIGHT = 60; diff --git a/src/sentry/static/sentry/app/views/events/chart.jsx b/src/sentry/static/sentry/app/views/events/chart.jsx index 23f1d1818c8182..472471dff8912b 100644 --- a/src/sentry/static/sentry/app/views/events/chart.jsx +++ b/src/sentry/static/sentry/app/views/events/chart.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import SentryTypes from 'app/sentryTypes'; import EventsChart from 'app/components/charts/eventsChart'; +import SentryTypes from 'app/sentryTypes'; import withApi from 'app/utils/withApi'; import withGlobalSelection from 'app/utils/withGlobalSelection'; diff --git a/src/sentry/static/sentry/app/views/events/events.jsx b/src/sentry/static/sentry/app/views/events/events.jsx index 74830983476ac3..f92f5319de422a 100644 --- a/src/sentry/static/sentry/app/views/events/events.jsx +++ b/src/sentry/static/sentry/app/views/events/events.jsx @@ -1,24 +1,24 @@ -import {browserHistory} from 'react-router'; -import isEqual from 'lodash/isEqual'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; -import {Panel} from 'app/components/panels'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import AsyncComponent from 'app/components/asyncComponent'; -import AsyncView from 'app/views/asyncView'; import Feature from 'app/components/acl/feature'; +import AsyncComponent from 'app/components/asyncComponent'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import Pagination from 'app/components/pagination'; +import {Panel} from 'app/components/panels'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import parseLinkHeader from 'app/utils/parseLinkHeader'; import withOrganization from 'app/utils/withOrganization'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; +import AsyncView from 'app/views/asyncView'; -import EventsTable from './eventsTable'; import Chart from './chart'; +import EventsTable from './eventsTable'; const parseRowFromLinks = (links, numRows) => { links = parseLinkHeader(links); diff --git a/src/sentry/static/sentry/app/views/events/eventsTable.jsx b/src/sentry/static/sentry/app/views/events/eventsTable.jsx index 6f2f068b538ddd..af97e518462d12 100644 --- a/src/sentry/static/sentry/app/views/events/eventsTable.jsx +++ b/src/sentry/static/sentry/app/views/events/eventsTable.jsx @@ -1,15 +1,15 @@ -import {withRouter, Link} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {Link, withRouter} from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {PanelBody, Panel, PanelHeader} from 'app/components/panels'; -import {t} from 'app/locale'; import DateTime from 'app/components/dateTime'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import IdBadge from 'app/components/idBadge'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import Placeholder from 'app/components/placeholder'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/events/index.jsx b/src/sentry/static/sentry/app/views/events/index.jsx index f26ba62405c0a6..7211aa55a5e077 100644 --- a/src/sentry/static/sentry/app/views/events/index.jsx +++ b/src/sentry/static/sentry/app/views/events/index.jsx @@ -1,22 +1,22 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; import {loadOrganizationTags} from 'app/actionCreators/tags'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; -import {t} from 'app/locale'; -import FeatureBadge from 'app/components/featureBadge'; import Feature from 'app/components/acl/feature'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import FeatureBadge from 'app/components/featureBadge'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; -import SentryTypes from 'app/sentryTypes'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import PageHeading from 'app/components/pageHeading'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {PageContent, PageHeader} from 'app/styles/organization'; +import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization from 'app/utils/withOrganization'; -import {PageContent, PageHeader} from 'app/styles/organization'; -import space from 'app/styles/space'; import SearchBar from './searchBar'; diff --git a/src/sentry/static/sentry/app/views/events/searchBar.tsx b/src/sentry/static/sentry/app/views/events/searchBar.tsx index d815a63ded3d95..932a9de276f0f7 100644 --- a/src/sentry/static/sentry/app/views/events/searchBar.tsx +++ b/src/sentry/static/sentry/app/views/events/searchBar.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import {ClassNames} from '@emotion/core'; import assign from 'lodash/assign'; import flatten from 'lodash/flatten'; @@ -5,25 +6,24 @@ import isEqual from 'lodash/isEqual'; import memoize from 'lodash/memoize'; import omit from 'lodash/omit'; import PropTypes from 'prop-types'; -import React from 'react'; -import {NEGATION_OPERATOR, SEARCH_WILDCARD} from 'app/constants'; -import {defined} from 'app/utils'; import {fetchTagValues} from 'app/actionCreators/tags'; -import SentryTypes from 'app/sentryTypes'; -import {SavedSearchType, Organization, TagCollection} from 'app/types'; +import {Client} from 'app/api'; import SmartSearchBar from 'app/components/smartSearchBar'; +import {NEGATION_OPERATOR, SEARCH_WILDCARD} from 'app/constants'; +import SentryTypes from 'app/sentryTypes'; +import {Organization, SavedSearchType, TagCollection} from 'app/types'; +import {defined} from 'app/utils'; import { Field, FIELD_TAGS, - TRACING_FIELDS, isAggregateField, isMeasurement, + TRACING_FIELDS, } from 'app/utils/discover/fields'; +import Measurements from 'app/utils/measurements/measurements'; import withApi from 'app/utils/withApi'; import withTags from 'app/utils/withTags'; -import Measurements from 'app/utils/measurements/measurements'; -import {Client} from 'app/api'; const SEARCH_SPECIAL_CHARS_REGEXP = new RegExp( `^${NEGATION_OPERATOR}|\\${SEARCH_WILDCARD}`, diff --git a/src/sentry/static/sentry/app/views/eventsV2/backgroundSpace.tsx b/src/sentry/static/sentry/app/views/eventsV2/backgroundSpace.tsx index cf3ff18b604914..343c97895c600c 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/backgroundSpace.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/backgroundSpace.tsx @@ -1,5 +1,5 @@ -import {css, keyframes} from '@emotion/core'; import React from 'react'; +import {css, keyframes} from '@emotion/core'; import styled from '@emotion/styled'; const gradient1 = css` diff --git a/src/sentry/static/sentry/app/views/eventsV2/banner.tsx b/src/sentry/static/sentry/app/views/eventsV2/banner.tsx index f8e5368181380c..93e341894ab2b5 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/banner.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/banner.tsx @@ -3,21 +3,22 @@ import styled from '@emotion/styled'; import Banner from 'app/components/banner'; import Button from 'app/components/button'; -import {Organization} from 'app/types'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; import FeatureTourModal, { + TourImage, TourStep, TourText, - TourImage, } from 'app/components/modals/featureTourModal'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; -import BackgroundSpace from './backgroundSpace'; +import tourAlert from '../../../images/spot/discover-tour-alert.svg'; import tourExplore from '../../../images/spot/discover-tour-explore.svg'; import tourFilter from '../../../images/spot/discover-tour-filter.svg'; import tourGroup from '../../../images/spot/discover-tour-group.svg'; -import tourAlert from '../../../images/spot/discover-tour-alert.svg'; + +import BackgroundSpace from './backgroundSpace'; const docsUrl = 'https://docs.sentry.io/product/discover-queries/'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/breadcrumb.tsx b/src/sentry/static/sentry/app/views/eventsV2/breadcrumb.tsx index 98e89167a76346..62f102065c808f 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/breadcrumb.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/breadcrumb.tsx @@ -1,10 +1,10 @@ import React from 'react'; import {Location} from 'history'; +import Breadcrumbs, {Crumb} from 'app/components/breadcrumbs'; import {t} from 'app/locale'; import {Event, Organization} from 'app/types'; import EventView from 'app/utils/discover/eventView'; -import Breadcrumbs, {Crumb} from 'app/components/breadcrumbs'; import {getDiscoverLandingUrl} from 'app/utils/discover/urls'; type DefaultProps = { diff --git a/src/sentry/static/sentry/app/views/eventsV2/chartFooter.tsx b/src/sentry/static/sentry/app/views/eventsV2/chartFooter.tsx index 56e8bc109af88c..c54b24966643fb 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/chartFooter.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/chartFooter.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import {t} from 'app/locale'; -import {SelectValue} from 'app/types'; +import OptionSelector from 'app/components/charts/optionSelector'; import { ChartControls, InlineContainer, SectionHeading, SectionValue, } from 'app/components/charts/styles'; -import OptionSelector from 'app/components/charts/optionSelector'; +import {t} from 'app/locale'; +import {SelectValue} from 'app/types'; type Props = { total: number | null; diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/content.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/content.tsx index 5053f502c7a8af..99f330cb8e0ce9 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/content.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/content.tsx @@ -1,40 +1,41 @@ import React from 'react'; import {Params} from 'react-router/lib/Router'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; import PropTypes from 'prop-types'; +import Feature from 'app/components/acl/feature'; +import AsyncComponent from 'app/components/asyncComponent'; +import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; +import NotFound from 'app/components/errors/notFound'; import {BorderlessEventEntries} from 'app/components/events/eventEntries'; +import EventMetadata from 'app/components/events/eventMetadata'; import * as SpanEntryContext from 'app/components/events/interfaces/spans/context'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {getMessage, getTitle} from 'app/utils/events'; -import {Organization, Event, EventTag} from 'app/types'; -import SentryTypes from 'app/sentryTypes'; -import Button from 'app/components/button'; -import Feature from 'app/components/acl/feature'; -import RootSpanStatus from 'app/components/events/rootSpanStatus'; import OpsBreakdown from 'app/components/events/opsBreakdown'; import RealUserMonitoring from 'app/components/events/realUserMonitoring'; -import EventMetadata from 'app/components/events/eventMetadata'; +import RootSpanStatus from 'app/components/events/rootSpanStatus'; +import * as Layout from 'app/components/layouts/thirds'; import LoadingError from 'app/components/loadingError'; -import NotFound from 'app/components/errors/notFound'; -import TagsTable from 'app/components/tagsTable'; -import AsyncComponent from 'app/components/asyncComponent'; +import LoadingIndicator from 'app/components/loadingIndicator'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import Projects from 'app/utils/projects'; +import TagsTable from 'app/components/tagsTable'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; +import {Event, EventTag, Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView from 'app/utils/discover/eventView'; -import {transactionSummaryRouteWithQuery} from 'app/views/performance/transactionSummary/utils'; -import {eventDetailsRoute} from 'app/utils/discover/urls'; -import * as Layout from 'app/components/layouts/thirds'; -import ButtonBar from 'app/components/buttonBar'; import {FIELD_TAGS} from 'app/utils/discover/fields'; -import LoadingIndicator from 'app/components/loadingIndicator'; +import {eventDetailsRoute} from 'app/utils/discover/urls'; +import {getMessage, getTitle} from 'app/utils/events'; +import Projects from 'app/utils/projects'; +import {transactionSummaryRouteWithQuery} from 'app/views/performance/transactionSummary/utils'; +import DiscoverBreadcrumb from '../breadcrumb'; import {generateTitle, getExpandedResults} from '../utils'; + import LinkedIssue from './linkedIssue'; -import DiscoverBreadcrumb from '../breadcrumb'; const slugValidator = function ( props: {[key: string]: any}, diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx index 5c6fdfe9aed809..698d729c70409c 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/index.tsx @@ -1,17 +1,17 @@ -import {Params} from 'react-router/lib/Router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {Params} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import {Location} from 'history'; +import PropTypes from 'prop-types'; -import {Organization} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {t} from 'app/locale'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import withOrganization from 'app/utils/withOrganization'; +import {PageContent} from 'app/styles/organization'; +import {Organization} from 'app/types'; import EventView from 'app/utils/discover/eventView'; +import withOrganization from 'app/utils/withOrganization'; import EventDetailsContent from './content'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/linkedIssue.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/linkedIssue.tsx index bad0aed0ac4d5d..8424b85b1a04b6 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventDetails/linkedIssue.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventDetails/linkedIssue.tsx @@ -2,18 +2,18 @@ import React from 'react'; import styled from '@emotion/styled'; import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import Alert from 'app/components/alert'; import AsyncComponent from 'app/components/asyncComponent'; import {SectionHeading} from 'app/components/charts/styles'; -import {IconWarning} from 'app/icons'; -import GroupChart from 'app/components/stream/groupChart'; +import Times from 'app/components/group/times'; +import ProjectBadge from 'app/components/idBadge/projectBadge'; import Link from 'app/components/links/link'; import Placeholder from 'app/components/placeholder'; -import ProjectBadge from 'app/components/idBadge/projectBadge'; import SeenByList from 'app/components/seenByList'; import ShortId from 'app/components/shortId'; -import Times from 'app/components/group/times'; +import GroupChart from 'app/components/stream/groupChart'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import {Group} from 'app/types'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/eventInputName.tsx b/src/sentry/static/sentry/app/views/eventsV2/eventInputName.tsx index 3a68c5d99c6d8c..e1058ef1459101 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/eventInputName.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/eventInputName.tsx @@ -1,14 +1,14 @@ import React from 'react'; import {browserHistory} from 'react-router'; +import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; +import InlineInput from 'app/components/inputInline'; +import {Title} from 'app/components/layouts/thirds'; import {t} from 'app/locale'; import {Organization, SavedQuery} from 'app/types'; -import withApi from 'app/utils/withApi'; -import {addErrorMessage} from 'app/actionCreators/indicator'; -import InlineInput from 'app/components/inputInline'; import EventView from 'app/utils/discover/eventView'; -import {Title} from 'app/components/layouts/thirds'; +import withApi from 'app/utils/withApi'; import {handleUpdateQueryName} from './savedQuery/utils'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/index.tsx b/src/sentry/static/sentry/app/views/eventsV2/index.tsx index c75453698d8725..bd332ea3d65f9b 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/index.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/index.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import {t} from 'app/locale'; -import {Organization} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import SentryTypes from 'app/sentryTypes'; import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {PageContent} from 'app/styles/organization'; +import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; type Props = { diff --git a/src/sentry/static/sentry/app/views/eventsV2/landing.tsx b/src/sentry/static/sentry/app/views/eventsV2/landing.tsx index 4503759ef60685..00676e866e6a11 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/landing.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/landing.tsx @@ -1,44 +1,44 @@ -import {Params} from 'react-router/lib/Router'; -import PropTypes from 'prop-types'; import React from 'react'; import * as ReactRouter from 'react-router'; -import {stringify} from 'query-string'; -import isEqual from 'lodash/isEqual'; -import pick from 'lodash/pick'; +import {Params} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import {Location} from 'history'; +import isEqual from 'lodash/isEqual'; +import pick from 'lodash/pick'; +import PropTypes from 'prop-types'; +import {stringify} from 'query-string'; -import {Organization, SavedQuery, SelectValue} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; +import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; -import ConfigStore from 'app/stores/configStore'; -import Feature from 'app/components/acl/feature'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; import SearchBar from 'app/components/searchBar'; -import Switch from 'app/components/switch'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import Switch from 'app/components/switch'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import ConfigStore from 'app/stores/configStore'; +import {PageContent} from 'app/styles/organization'; import space from 'app/styles/space'; -import withOrganization from 'app/utils/withOrganization'; +import {Organization, SavedQuery, SelectValue} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView from 'app/utils/discover/eventView'; import {decodeScalar} from 'app/utils/queryString'; import theme from 'app/utils/theme'; +import withOrganization from 'app/utils/withOrganization'; +import Banner from './banner'; import {DEFAULT_EVENT_VIEW} from './data'; +import QueryList from './queryList'; import { getPrebuiltQueries, isBannerHidden, setBannerHidden, - shouldRenderPrebuilt, setRenderPrebuilt, + shouldRenderPrebuilt, } from './utils'; -import QueryList from './queryList'; -import Banner from './banner'; const SORT_OPTIONS: SelectValue<string>[] = [ {label: t('My Queries'), value: 'myqueries'}, diff --git a/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx b/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx index ec9fcd3288f15d..48eaa38157ecfb 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/miniGraph.tsx @@ -1,21 +1,21 @@ import React from 'react'; -import isEqual from 'lodash/isEqual'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; +import isEqual from 'lodash/isEqual'; -import withApi from 'app/utils/withApi'; import {Client} from 'app/api'; -import {Organization} from 'app/types'; -import EventsRequest from 'app/components/charts/eventsRequest'; import AreaChart from 'app/components/charts/areaChart'; +import EventsRequest from 'app/components/charts/eventsRequest'; import {getInterval} from 'app/components/charts/utils'; -import {getUtcToLocalDateObject} from 'app/utils/dates'; -import {axisLabelFormatter} from 'app/utils/discover/charts'; -import LoadingIndicator from 'app/components/loadingIndicator'; import LoadingContainer from 'app/components/loading/loadingContainer'; +import LoadingIndicator from 'app/components/loadingIndicator'; import {IconWarning} from 'app/icons'; -import theme from 'app/utils/theme'; +import {Organization} from 'app/types'; +import {getUtcToLocalDateObject} from 'app/utils/dates'; +import {axisLabelFormatter} from 'app/utils/discover/charts'; import EventView from 'app/utils/discover/eventView'; +import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx b/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx index 1a6f580d03944f..f919b244faa5e7 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/queryList.tsx @@ -1,30 +1,30 @@ -import {browserHistory} from 'react-router'; import React, {MouseEvent} from 'react'; -import classNames from 'classnames'; -import moment from 'moment'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import classNames from 'classnames'; import {Location, Query} from 'history'; +import moment from 'moment'; -import {Client} from 'app/api'; -import {IconEllipsis} from 'app/icons'; -import {Organization, SavedQuery} from 'app/types'; import {resetGlobalSelection} from 'app/actionCreators/globalSelection'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {Client} from 'app/api'; import DropdownMenu from 'app/components/dropdownMenu'; import EmptyStateWarning from 'app/components/emptyStateWarning'; -import EventView from 'app/utils/discover/eventView'; import MenuItem from 'app/components/menuItem'; import Pagination from 'app/components/pagination'; import TimeSince from 'app/components/timeSince'; -import parseLinkHeader from 'app/utils/parseLinkHeader'; +import {IconEllipsis} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, SavedQuery} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import EventView from 'app/utils/discover/eventView'; +import parseLinkHeader from 'app/utils/parseLinkHeader'; import withApi from 'app/utils/withApi'; -import {getPrebuiltQueries} from './utils'; -import {handleDeleteQuery, handleCreateQuery} from './savedQuery/utils'; +import {handleCreateQuery, handleDeleteQuery} from './savedQuery/utils'; import MiniGraph from './miniGraph'; import QueryCard from './querycard'; +import {getPrebuiltQueries} from './utils'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/eventsV2/querycard.tsx b/src/sentry/static/sentry/app/views/eventsV2/querycard.tsx index 5cb3731acd9875..e1805cdfb1dfad 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/querycard.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/querycard.tsx @@ -2,13 +2,13 @@ import React from 'react'; import styled from '@emotion/styled'; import ActivityAvatar from 'app/components/activity/item/avatar'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; +import Card from 'app/components/card'; import Link from 'app/components/links/link'; import {t} from 'app/locale'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; -import {callIfFunction} from 'app/utils/callIfFunction'; import {User} from 'app/types'; -import Card from 'app/components/card'; +import {callIfFunction} from 'app/utils/callIfFunction'; type Props = { title?: string; diff --git a/src/sentry/static/sentry/app/views/eventsV2/results.tsx b/src/sentry/static/sentry/app/views/eventsV2/results.tsx index 71e590969d65d7..636d8fd4942c40 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/results.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/results.tsx @@ -1,46 +1,47 @@ import React from 'react'; -import styled from '@emotion/styled'; import * as ReactRouter from 'react-router'; +import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import {Location} from 'history'; -import omit from 'lodash/omit'; import isEqual from 'lodash/isEqual'; -import * as Sentry from '@sentry/react'; +import omit from 'lodash/omit'; -import {Organization, GlobalSelection} from 'app/types'; -import {t, tct} from 'app/locale'; -import {PageContent} from 'app/styles/organization'; -import {Client} from 'app/api'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import {fetchTotalCount} from 'app/actionCreators/events'; -import {loadOrganizationTags} from 'app/actionCreators/tags'; import {fetchProjectsCount} from 'app/actionCreators/projects'; +import {loadOrganizationTags} from 'app/actionCreators/tags'; +import {Client} from 'app/api'; import Alert from 'app/components/alert'; +import Confirm from 'app/components/confirm'; import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import {IconFlag} from 'app/icons'; +import * as Layout from 'app/components/layouts/thirds'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import Confirm from 'app/components/confirm'; +import {IconFlag} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; import space from 'app/styles/space'; -import SearchBar from 'app/views/events/searchBar'; +import {GlobalSelection, Organization} from 'app/types'; +import {generateQueryWithTag} from 'app/utils'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {generateAggregateFields} from 'app/utils/discover/fields'; -import withApi from 'app/utils/withApi'; -import withOrganization from 'app/utils/withOrganization'; -import withGlobalSelection from 'app/utils/withGlobalSelection'; import EventView, {isAPIPayloadSimilar} from 'app/utils/discover/eventView'; -import {generateQueryWithTag} from 'app/utils'; +import {generateAggregateFields} from 'app/utils/discover/fields'; import localStorage from 'app/utils/localStorage'; import {decodeScalar} from 'app/utils/queryString'; -import * as Layout from 'app/components/layouts/thirds'; +import withApi from 'app/utils/withApi'; +import withGlobalSelection from 'app/utils/withGlobalSelection'; +import withOrganization from 'app/utils/withOrganization'; +import SearchBar from 'app/views/events/searchBar'; + +import {addRoutePerformanceContext} from '../performance/utils'; import {DEFAULT_EVENT_VIEW} from './data'; +import ResultsChart from './resultsChart'; +import ResultsHeader from './resultsHeader'; import Table from './table'; import Tags from './tags'; -import ResultsHeader from './resultsHeader'; -import ResultsChart from './resultsChart'; import {generateTitle} from './utils'; -import {addRoutePerformanceContext} from '../performance/utils'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/eventsV2/resultsChart.tsx b/src/sentry/static/sentry/app/views/eventsV2/resultsChart.tsx index 476382a834f2f3..2abfecd5560929 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/resultsChart.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/resultsChart.tsx @@ -1,18 +1,18 @@ import React from 'react'; -import styled from '@emotion/styled'; import * as ReactRouter from 'react-router'; +import styled from '@emotion/styled'; import {Location} from 'history'; import isEqual from 'lodash/isEqual'; -import {Organization} from 'app/types'; -import {getUtcToLocalDateObject} from 'app/utils/dates'; import {Client} from 'app/api'; import EventsChart from 'app/components/charts/eventsChart'; import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import {Panel} from 'app/components/panels'; -import getDynamicText from 'app/utils/getDynamicText'; +import {Organization} from 'app/types'; +import {getUtcToLocalDateObject} from 'app/utils/dates'; import EventView from 'app/utils/discover/eventView'; -import {TOP_N, DisplayModes} from 'app/utils/discover/types'; +import {DisplayModes, TOP_N} from 'app/utils/discover/types'; +import getDynamicText from 'app/utils/getDynamicText'; import {decodeScalar} from 'app/utils/queryString'; import withApi from 'app/utils/withApi'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/resultsHeader.tsx b/src/sentry/static/sentry/app/views/eventsV2/resultsHeader.tsx index 97e5021f5311e5..adbc6cc6901350 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/resultsHeader.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/resultsHeader.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; -import {Organization, SavedQuery} from 'app/types'; import {fetchSavedQuery} from 'app/actionCreators/discoverSavedQueries'; import {Client} from 'app/api'; +import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; +import * as Layout from 'app/components/layouts/thirds'; import TimeSince from 'app/components/timeSince'; import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; +import {Organization, SavedQuery} from 'app/types'; import EventView from 'app/utils/discover/eventView'; -import * as Layout from 'app/components/layouts/thirds'; -import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; +import withApi from 'app/utils/withApi'; import DiscoverBreadcrumb from './breadcrumb'; import EventInputName from './eventInputName'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/savedQuery/index.tsx b/src/sentry/static/sentry/app/views/eventsV2/savedQuery/index.tsx index 8c95e887672779..5d4564e697ecf6 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/savedQuery/index.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/savedQuery/index.tsx @@ -1,29 +1,29 @@ import React from 'react'; -import styled from '@emotion/styled'; import {browserHistory} from 'react-router'; +import styled from '@emotion/styled'; import {Location} from 'history'; import {Client} from 'app/api'; -import {t} from 'app/locale'; -import {Organization, SavedQuery, Project} from 'app/types'; -import withApi from 'app/utils/withApi'; +import Feature from 'app/components/acl/feature'; +import FeatureDisabled from 'app/components/acl/featureDisabled'; import Button from 'app/components/button'; +import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; import DropdownButton from 'app/components/dropdownButton'; import DropdownControl from 'app/components/dropdownControl'; -import Feature from 'app/components/acl/feature'; -import FeatureDisabled from 'app/components/acl/featureDisabled'; -import Hovercard from 'app/components/hovercard'; import Input from 'app/components/forms/input'; -import space from 'app/styles/space'; +import Hovercard from 'app/components/hovercard'; import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, Project, SavedQuery} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView from 'app/utils/discover/eventView'; -import withProjects from 'app/utils/withProjects'; import {getDiscoverLandingUrl} from 'app/utils/discover/urls'; -import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; +import withApi from 'app/utils/withApi'; +import withProjects from 'app/utils/withProjects'; import {setBannerHidden} from 'app/views/eventsV2/utils'; -import {handleCreateQuery, handleUpdateQuery, handleDeleteQuery} from './utils'; +import {handleCreateQuery, handleDeleteQuery, handleUpdateQuery} from './utils'; type DefaultProps = { disabled: boolean; diff --git a/src/sentry/static/sentry/app/views/eventsV2/savedQuery/utils.tsx b/src/sentry/static/sentry/app/views/eventsV2/savedQuery/utils.tsx index 812e1e689d59e0..0ca612510d1134 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/savedQuery/utils.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/savedQuery/utils.tsx @@ -1,13 +1,13 @@ -import {Client} from 'app/api'; -import {t} from 'app/locale'; -import {Organization, NewQuery, SavedQuery} from 'app/types'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; import { createSavedQuery, deleteSavedQuery, updateSavedQuery, } from 'app/actionCreators/discoverSavedQueries'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; +import {t} from 'app/locale'; +import {NewQuery, Organization, SavedQuery} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView from 'app/utils/discover/eventView'; export function handleCreateQuery( diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/cellAction.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/cellAction.tsx index 5c7c7446e57e55..0ef689989155a5 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/cellAction.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/cellAction.tsx @@ -1,14 +1,14 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import {Manager, Popper, Reference} from 'react-popper'; import styled from '@emotion/styled'; import * as PopperJS from 'popper.js'; -import {Manager, Reference, Popper} from 'react-popper'; -import {t} from 'app/locale'; import {IconEllipsis} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {getAggregateAlias} from 'app/utils/discover/fields'; import {TableDataRow} from 'app/utils/discover/discoverQuery'; +import {getAggregateAlias} from 'app/utils/discover/fields'; import {QueryResults} from 'app/utils/tokenizeSearch'; import {TableColumn} from './types'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx index dff35880aeaebb..44171adc4164b8 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx @@ -5,20 +5,21 @@ import styled from '@emotion/styled'; import Button from 'app/components/button'; import {SectionHeading} from 'app/components/charts/styles'; import { - UserSelectValues, setBodyUserSelect, + UserSelectValues, } from 'app/components/events/interfaces/spans/utils'; import {IconAdd, IconDelete, IconGrabbable} from 'app/icons'; import {t} from 'app/locale'; -import {SelectValue, LightWeightOrganization} from 'app/types'; import space from 'app/styles/space'; -import theme from 'app/utils/theme'; +import {LightWeightOrganization, SelectValue} from 'app/types'; import {Column} from 'app/utils/discover/fields'; +import theme from 'app/utils/theme'; -import {FieldValue} from './types'; -import {QueryField} from './queryField'; import {generateFieldOptions} from '../utils'; +import {QueryField} from './queryField'; +import {FieldValue} from './types'; + type Props = { // Input columns columns: Column[]; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/columnEditModal.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/columnEditModal.tsx index f8c0f214eaffca..ee0c15f7fcf187 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/columnEditModal.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/columnEditModal.tsx @@ -2,17 +2,17 @@ import React from 'react'; import {css} from '@emotion/core'; import styled from '@emotion/styled'; +import {ModalRenderProps} from 'app/actionCreators/modal'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; import ExternalLink from 'app/components/links/externalLink'; import {DISCOVER2_DOCS_URL} from 'app/constants'; -import {ModalRenderProps} from 'app/actionCreators/modal'; import {t, tct} from 'app/locale'; -import {LightWeightOrganization} from 'app/types'; import space from 'app/styles/space'; -import theme from 'app/utils/theme'; -import {Column} from 'app/utils/discover/fields'; +import {LightWeightOrganization} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {Column} from 'app/utils/discover/fields'; +import theme from 'app/utils/theme'; import ColumnEditCollection from './columnEditCollection'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/headerCell.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/headerCell.tsx index c4dad7fdca312a..106a0d93a2c0f1 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/headerCell.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/headerCell.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {ColumnValueType, getAggregateAlias} from 'app/utils/discover/fields'; import {Alignments} from 'app/components/gridEditable/sortLink'; import {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; +import {ColumnValueType, getAggregateAlias} from 'app/utils/discover/fields'; import {TableColumn} from './types'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx index 3308dc8b986955..fc24417c904043 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/index.tsx @@ -1,17 +1,17 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; import {Client} from 'app/api'; +import Pagination from 'app/components/pagination'; import {t} from 'app/locale'; import {Organization, TagCollection} from 'app/types'; import {metric} from 'app/utils/analytics'; +import {TableData} from 'app/utils/discover/discoverQuery'; +import EventView, {isAPIPayloadSimilar} from 'app/utils/discover/eventView'; +import Measurements from 'app/utils/measurements/measurements'; import withApi from 'app/utils/withApi'; import withTags from 'app/utils/withTags'; -import Measurements from 'app/utils/measurements/measurements'; -import Pagination from 'app/components/pagination'; -import EventView, {isAPIPayloadSimilar} from 'app/utils/discover/eventView'; -import {TableData} from 'app/utils/discover/discoverQuery'; import TableView from './tableView'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx index a9653e760ad97a..92c14e1a9831a5 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx @@ -1,24 +1,24 @@ import React, {CSSProperties} from 'react'; -import styled from '@emotion/styled'; -import cloneDeep from 'lodash/cloneDeep'; // eslint import checks can't find types in the flow code. // eslint-disable-next-line import/named -import {components, SingleValueProps, OptionProps} from 'react-select'; +import {components, OptionProps, SingleValueProps} from 'react-select'; +import styled from '@emotion/styled'; +import cloneDeep from 'lodash/cloneDeep'; -import Input from 'app/views/settings/components/forms/controls/input'; +import Badge from 'app/components/badge'; import SelectControl from 'app/components/forms/selectControl'; -import {SelectValue} from 'app/types'; import {t} from 'app/locale'; -import Badge from 'app/components/badge'; import space from 'app/styles/space'; +import {SelectValue} from 'app/types'; import { - ColumnType, AggregateParameter, + ColumnType, QueryFieldValue, ValidateColumnTypes, } from 'app/utils/discover/fields'; +import Input from 'app/views/settings/components/forms/controls/input'; -import {FieldValueKind, FieldValue, FieldValueColumns} from './types'; +import {FieldValue, FieldValueColumns, FieldValueKind} from './types'; type FieldOptions = Record<string, SelectValue<FieldValue>>; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/tableActions.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/tableActions.tsx index 338d8fa46eac5a..aed2b0ff19cee3 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/tableActions.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/tableActions.tsx @@ -1,18 +1,18 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {Location} from 'history'; +import PropTypes from 'prop-types'; -import {OrganizationSummary} from 'app/types'; -import DataExport, {ExportQueryType} from 'app/components/dataExport'; -import Button from 'app/components/button'; import Feature from 'app/components/acl/feature'; import FeatureDisabled from 'app/components/acl/featureDisabled'; -import {IconDownload, IconStack, IconTag} from 'app/icons'; +import Button from 'app/components/button'; +import DataExport, {ExportQueryType} from 'app/components/dataExport'; import Hovercard from 'app/components/hovercard'; +import {IconDownload, IconStack, IconTag} from 'app/icons'; import {t} from 'app/locale'; +import {OrganizationSummary} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import EventView from 'app/utils/discover/eventView'; import {TableData} from 'app/utils/discover/discoverQuery'; +import EventView from 'app/utils/discover/eventView'; import {downloadAsCsv} from '../utils'; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx index 35062c721b8927..a05f64810d600e 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/tableView.tsx @@ -1,39 +1,40 @@ import React from 'react'; -import styled from '@emotion/styled'; import {browserHistory} from 'react-router'; +import styled from '@emotion/styled'; import {Location, LocationDescriptorObject} from 'history'; -import {Organization, Project} from 'app/types'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {openModal} from 'app/actionCreators/modal'; import GridEditable, { - COL_WIDTH_UNDEFINED, COL_WIDTH_MINIMUM, + COL_WIDTH_UNDEFINED, } from 'app/components/gridEditable'; import SortLink from 'app/components/gridEditable/sortLink'; -import {IconStack} from 'app/icons'; -import {t} from 'app/locale'; -import {openModal} from 'app/actionCreators/modal'; import Link from 'app/components/links/link'; import Tooltip from 'app/components/tooltip'; +import {IconStack} from 'app/icons'; +import {t} from 'app/locale'; +import {Organization, Project} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; import EventView, { isFieldSortable, pickRelevantLocationQueryStrings, } from 'app/utils/discover/eventView'; -import {Column} from 'app/utils/discover/fields'; import {getFieldRenderer} from 'app/utils/discover/fieldRenderers'; -import {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; -import {generateEventSlug, eventDetailsRouteWithEventView} from 'app/utils/discover/urls'; -import {TOP_N, DisplayModes} from 'app/utils/discover/types'; +import {Column} from 'app/utils/discover/fields'; +import {DisplayModes, TOP_N} from 'app/utils/discover/types'; +import {eventDetailsRouteWithEventView, generateEventSlug} from 'app/utils/discover/urls'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; import withProjects from 'app/utils/withProjects'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; import {transactionSummaryRouteWithQuery} from 'app/views/performance/transactionSummary/utils'; import {getExpandedResults, pushEventViewToLocation} from '../utils'; + +import CellAction, {Actions, updateQuery} from './cellAction'; import ColumnEditModal, {modalCss} from './columnEditModal'; -import {TableColumn} from './types'; import HeaderCell from './headerCell'; -import CellAction, {Actions, updateQuery} from './cellAction'; import TableActions from './tableActions'; +import {TableColumn} from './types'; export type TableViewProps = { location: Location; diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/types.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/types.tsx index d024bafe1ece7a..94d67a559a761f 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/types.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/types.tsx @@ -1,11 +1,11 @@ import {GridColumnOrder, GridColumnSortBy} from 'app/components/gridEditable'; +import {TableDataRow} from 'app/utils/discover/discoverQuery'; import { + AggregateParameter, Column, ColumnType, ColumnValueType, - AggregateParameter, } from 'app/utils/discover/fields'; -import {TableDataRow} from 'app/utils/discover/discoverQuery'; /** * It is assumed that `aggregation` and `field` have the same ColumnValueType diff --git a/src/sentry/static/sentry/app/views/eventsV2/tags.tsx b/src/sentry/static/sentry/app/views/eventsV2/tags.tsx index 5427b0e61759bf..c61e692e4071b5 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/tags.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/tags.tsx @@ -1,23 +1,23 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; -import {Location, LocationDescriptor} from 'history'; import * as Sentry from '@sentry/react'; +import {Location, LocationDescriptor} from 'history'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; -import {Client} from 'app/api'; import {fetchTagFacets, Tag, TagSegment} from 'app/actionCreators/events'; -import SentryTypes from 'app/sentryTypes'; +import {Client} from 'app/api'; import {SectionHeading} from 'app/components/charts/styles'; import EmptyStateWarning from 'app/components/emptyStateWarning'; -import {IconWarning} from 'app/icons'; import Placeholder from 'app/components/placeholder'; import TagDistributionMeter from 'app/components/tagDistributionMeter'; -import withApi from 'app/utils/withApi'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; import {Organization} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView, {isAPIPayloadSimilar} from 'app/utils/discover/eventView'; +import withApi from 'app/utils/withApi'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx index 52cd9cf6217f77..98eb1f1572d0b1 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx @@ -1,35 +1,35 @@ -import Papa from 'papaparse'; -import {Location, Query} from 'history'; import {browserHistory} from 'react-router'; +import {Location, Query} from 'history'; +import Papa from 'papaparse'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; +import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable'; +import {URL_PARAM} from 'app/constants/globalSelectionHeader'; import {t} from 'app/locale'; -import {Event, LightWeightOrganization, SelectValue, Organization} from 'app/types'; -import {getTitle} from 'app/utils/events'; +import {Event, LightWeightOrganization, Organization, SelectValue} from 'app/types'; import {getUtcDateString} from 'app/utils/dates'; -import {URL_PARAM} from 'app/constants/globalSelectionHeader'; -import {disableMacros} from 'app/views/discover/result/utils'; -import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable'; -import EventView from 'app/utils/discover/eventView'; -import localStorage from 'app/utils/localStorage'; import {TableDataRow} from 'app/utils/discover/discoverQuery'; +import EventView from 'app/utils/discover/eventView'; import { - Field, + aggregateFunctionOutputType, + Aggregation, + AGGREGATIONS, Column, ColumnType, - AGGREGATIONS, - FIELDS, - aggregateFunctionOutputType, explodeFieldString, + Field, + FIELDS, getAggregateAlias, - TRACING_FIELDS, - Aggregation, isMeasurement, measurementType, + TRACING_FIELDS, } from 'app/utils/discover/fields'; +import {getTitle} from 'app/utils/events'; +import localStorage from 'app/utils/localStorage'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; +import {disableMacros} from 'app/views/discover/result/utils'; +import {FieldValue, FieldValueKind, TableColumn} from './table/types'; import {ALL_VIEWS, TRANSACTION_VIEWS, WEB_VITALS_VIEWS} from './data'; -import {TableColumn, FieldValue, FieldValueKind} from './table/types'; export type QueryWithColumnState = | Query diff --git a/src/sentry/static/sentry/app/views/integrationOrganizationLink.tsx b/src/sentry/static/sentry/app/views/integrationOrganizationLink.tsx index 7e8eac9eb1838a..c8cf6aeb2c91cb 100644 --- a/src/sentry/static/sentry/app/views/integrationOrganizationLink.tsx +++ b/src/sentry/static/sentry/app/views/integrationOrganizationLink.tsx @@ -1,28 +1,28 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; +import {components} from 'react-select'; import styled from '@emotion/styled'; import {urlEncode} from '@sentry/utils'; -import {components} from 'react-select'; -import {Organization, IntegrationProvider, Integration} from 'app/types'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import SelectControl from 'app/components/forms/selectControl'; +import IdBadge from 'app/components/idBadge'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import NarrowLayout from 'app/components/narrowLayout'; +import {IconFlag} from 'app/icons'; import {t, tct} from 'app/locale'; +import {Integration, IntegrationProvider, Organization} from 'app/types'; import { - trackIntegrationEvent, getIntegrationFeatureGate, SingleIntegrationEvent, + trackIntegrationEvent, } from 'app/utils/integrationUtil'; import {singleLineRenderer} from 'app/utils/marked'; -import Alert from 'app/components/alert'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; -import Field from 'app/views/settings/components/forms/field'; -import NarrowLayout from 'app/components/narrowLayout'; -import SelectControl from 'app/components/forms/selectControl'; -import IdBadge from 'app/components/idBadge'; -import {IconFlag} from 'app/icons'; -import LoadingIndicator from 'app/components/loadingIndicator'; import AddIntegration from 'app/views/organizationIntegrations/addIntegration'; +import Field from 'app/views/settings/components/forms/field'; //installationId present for Github flow type Props = RouteComponentProps<{integrationSlug: string; installationId?: string}, {}>; diff --git a/src/sentry/static/sentry/app/views/issueList/actions.tsx b/src/sentry/static/sentry/app/views/issueList/actions.tsx index ec69999ba4b078..9450fb07835cde 100644 --- a/src/sentry/static/sentry/app/views/issueList/actions.tsx +++ b/src/sentry/static/sentry/app/views/issueList/actions.tsx @@ -1,29 +1,29 @@ -import capitalize from 'lodash/capitalize'; -import uniq from 'lodash/uniq'; import React from 'react'; import styled from '@emotion/styled'; +import capitalize from 'lodash/capitalize'; +import uniq from 'lodash/uniq'; import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; -import {t, tct, tn} from 'app/locale'; -import {IconEllipsis, IconPause, IconPlay, IconIssues} from 'app/icons'; import {Client} from 'app/api'; -import {GlobalSelection, Group, Organization, Project, ResolutionStatus} from 'app/types'; -import space from 'app/styles/space'; -import theme from 'app/utils/theme'; +import Feature from 'app/components/acl/feature'; import ActionLink from 'app/components/actions/actionLink'; +import IgnoreActions from 'app/components/actions/ignore'; +import ResolveActions from 'app/components/actions/resolve'; import Checkbox from 'app/components/checkbox'; import DropdownLink from 'app/components/dropdownLink'; import ExternalLink from 'app/components/links/externalLink'; -import GroupStore from 'app/stores/groupStore'; -import IgnoreActions from 'app/components/actions/ignore'; import MenuItem from 'app/components/menuItem'; -import Projects from 'app/utils/projects'; -import ResolveActions from 'app/components/actions/resolve'; -import SelectedGroupStore from 'app/stores/selectedGroupStore'; import ToolbarHeader from 'app/components/toolbarHeader'; import Tooltip from 'app/components/tooltip'; -import Feature from 'app/components/acl/feature'; +import {IconEllipsis, IconIssues, IconPause, IconPlay} from 'app/icons'; +import {t, tct, tn} from 'app/locale'; +import GroupStore from 'app/stores/groupStore'; +import SelectedGroupStore from 'app/stores/selectedGroupStore'; +import space from 'app/styles/space'; +import {GlobalSelection, Group, Organization, Project, ResolutionStatus} from 'app/types'; import {callIfFunction} from 'app/utils/callIfFunction'; +import Projects from 'app/utils/projects'; +import theme from 'app/utils/theme'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; diff --git a/src/sentry/static/sentry/app/views/issueList/container.tsx b/src/sentry/static/sentry/app/views/issueList/container.tsx index 33511c18340916..376a95fcbf795e 100644 --- a/src/sentry/static/sentry/app/views/issueList/container.tsx +++ b/src/sentry/static/sentry/app/views/issueList/container.tsx @@ -1,8 +1,8 @@ import React from 'react'; import DocumentTitle from 'react-document-title'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import {Organization} from 'app/types'; import {metric} from 'app/utils/analytics'; import withOrganization, {isLightweightOrganization} from 'app/utils/withOrganization'; diff --git a/src/sentry/static/sentry/app/views/issueList/createSavedSearchButton.tsx b/src/sentry/static/sentry/app/views/issueList/createSavedSearchButton.tsx index d9fdf3459fe5aa..2e2187cc3e49ae 100644 --- a/src/sentry/static/sentry/app/views/issueList/createSavedSearchButton.tsx +++ b/src/sentry/static/sentry/app/views/issueList/createSavedSearchButton.tsx @@ -1,17 +1,17 @@ import React from 'react'; import Modal from 'react-bootstrap/lib/Modal'; +import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; +import {createSavedSearch} from 'app/actionCreators/savedSearches'; import {Client} from 'app/api'; -import {t} from 'app/locale'; import Access from 'app/components/acl/access'; import Button from 'app/components/button'; -import {createSavedSearch} from 'app/actionCreators/savedSearches'; -import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; import {TextField} from 'app/components/forms'; -import space from 'app/styles/space'; -import withApi from 'app/utils/withApi'; import {IconAdd} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import {LightWeightOrganization} from 'app/types'; +import withApi from 'app/utils/withApi'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/issueList/filters.tsx b/src/sentry/static/sentry/app/views/issueList/filters.tsx index 8dc13d3c2396d4..3ead4240421266 100644 --- a/src/sentry/static/sentry/app/views/issueList/filters.tsx +++ b/src/sentry/static/sentry/app/views/issueList/filters.tsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Organization, SavedSearch} from 'app/types'; -import {PageHeader} from 'app/styles/organization'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {t} from 'app/locale'; +import Feature from 'app/components/acl/feature'; import PageHeading from 'app/components/pageHeading'; import QueryCount from 'app/components/queryCount'; -import Feature from 'app/components/acl/feature'; +import {t} from 'app/locale'; +import {PageHeader} from 'app/styles/organization'; import space from 'app/styles/space'; +import {Organization, SavedSearch} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import SavedSearchSelector from './savedSearchSelector'; import IssueListSearchBar from './searchBar'; import IssueListSortOptions from './sortOptions'; -import SavedSearchSelector from './savedSearchSelector'; import {TagValueLoader} from './types'; type IssueListSearchBarProps = React.ComponentProps<typeof IssueListSearchBar>; diff --git a/src/sentry/static/sentry/app/views/issueList/header.tsx b/src/sentry/static/sentry/app/views/issueList/header.tsx index fa9fc573d421b5..e104137687727f 100644 --- a/src/sentry/static/sentry/app/views/issueList/header.tsx +++ b/src/sentry/static/sentry/app/views/issueList/header.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; +import * as Layout from 'app/components/layouts/thirds'; +import QueryCount from 'app/components/queryCount'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import QueryCount from 'app/components/queryCount'; -import * as Layout from 'app/components/layouts/thirds'; type Props = { query: string; diff --git a/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/congratsRobots.tsx b/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/congratsRobots.tsx index 33d2a021f96727..f601f043d12f63 100644 --- a/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/congratsRobots.tsx +++ b/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/congratsRobots.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; import video from 'app/../images/spot/congrats-robots.mp4'; import AutoplayVideo from 'app/components/autoplayVideo'; +import space from 'app/styles/space'; /** * Note, video needs `muted` for `autoplay` to work on Chrome diff --git a/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/index.tsx b/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/index.tsx index 33aecb637fb832..dcbdb4be963167 100644 --- a/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/index.tsx +++ b/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/index.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {Client} from 'app/api'; -import {DEFAULT_QUERY} from 'app/constants'; -import {LightWeightOrganization, Project} from 'app/types'; -import {t} from 'app/locale'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import LoadingIndicator from 'app/components/loadingIndicator'; import Placeholder from 'app/components/placeholder'; +import {DEFAULT_QUERY} from 'app/constants'; +import {t} from 'app/locale'; +import {LightWeightOrganization, Project} from 'app/types'; import NoUnresolvedIssues from './noUnresolvedIssues'; diff --git a/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/noUnresolvedIssues.tsx b/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/noUnresolvedIssues.tsx index 23d39dd94c1c7a..9f7e892285e558 100644 --- a/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/noUnresolvedIssues.tsx +++ b/src/sentry/static/sentry/app/views/issueList/noGroupsHandler/noUnresolvedIssues.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import congratsRobotsPlaceholder from 'app/../images/spot/congrats-robots-placeholder.jpg'; +import {t} from 'app/locale'; import space from 'app/styles/space'; const Placeholder = () => ( diff --git a/src/sentry/static/sentry/app/views/issueList/overview.tsx b/src/sentry/static/sentry/app/views/issueList/overview.tsx index 8d535c1bcdada4..adb11427c81ca4 100644 --- a/src/sentry/static/sentry/app/views/issueList/overview.tsx +++ b/src/sentry/static/sentry/app/views/issueList/overview.tsx @@ -1,36 +1,37 @@ +import React from 'react'; import {browserHistory} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import {withProfiler} from '@sentry/react'; +import {Location} from 'history'; import Cookies from 'js-cookie'; -import React from 'react'; import isEqual from 'lodash/isEqual'; import pickBy from 'lodash/pickBy'; import * as qs from 'query-string'; -import {withProfiler} from '@sentry/react'; -import {Location} from 'history'; -import styled from '@emotion/styled'; -import {css} from '@emotion/core'; -import {Client} from 'app/api'; -import {DEFAULT_QUERY, DEFAULT_STATS_PERIOD} from 'app/constants'; -import {tct} from 'app/locale'; -import {Panel, PanelBody} from 'app/components/panels'; -import {analytics, metric} from 'app/utils/analytics'; -import {defined} from 'app/utils'; +import {fetchOrgMembers, indexMembersByProject} from 'app/actionCreators/members'; import { deleteSavedSearch, fetchSavedSearches, resetSavedSearches, } from 'app/actionCreators/savedSearches'; -import {extractSelectionParameters} from 'app/components/organizations/globalSelectionHeader/utils'; -import {fetchOrgMembers, indexMembersByProject} from 'app/actionCreators/members'; -import {loadOrganizationTags, fetchTagValues} from 'app/actionCreators/tags'; -import {getUtcDateString} from 'app/utils/dates'; -import CursorPoller from 'app/utils/cursorPoller'; -import GroupStore from 'app/stores/groupStore'; +import {fetchTagValues, loadOrganizationTags} from 'app/actionCreators/tags'; +import {Client} from 'app/api'; +import Feature from 'app/components/acl/feature'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {extractSelectionParameters} from 'app/components/organizations/globalSelectionHeader/utils'; import Pagination from 'app/components/pagination'; +import {Panel, PanelBody} from 'app/components/panels'; +import QueryCount from 'app/components/queryCount'; +import StreamGroup from 'app/components/stream/group'; import ProcessingIssueList from 'app/components/stream/processingIssueList'; +import {DEFAULT_QUERY, DEFAULT_STATS_PERIOD} from 'app/constants'; +import {tct} from 'app/locale'; +import GroupStore from 'app/stores/groupStore'; +import {PageContent} from 'app/styles/organization'; +import space from 'app/styles/space'; import { GlobalSelection, Member, @@ -38,26 +39,25 @@ import { SavedSearch, TagCollection, } from 'app/types'; -import QueryCount from 'app/components/queryCount'; -import StreamGroup from 'app/components/stream/group'; -import StreamManager from 'app/utils/streamManager'; +import {defined} from 'app/utils'; +import {analytics, metric} from 'app/utils/analytics'; +import {callIfFunction} from 'app/utils/callIfFunction'; +import CursorPoller from 'app/utils/cursorPoller'; +import {getUtcDateString} from 'app/utils/dates'; import parseApiError from 'app/utils/parseApiError'; import parseLinkHeader from 'app/utils/parseLinkHeader'; +import StreamManager from 'app/utils/streamManager'; import withApi from 'app/utils/withApi'; import withGlobalSelection from 'app/utils/withGlobalSelection'; +import withIssueTags from 'app/utils/withIssueTags'; import withOrganization from 'app/utils/withOrganization'; import withSavedSearches from 'app/utils/withSavedSearches'; -import withIssueTags from 'app/utils/withIssueTags'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import space from 'app/styles/space'; -import {PageContent} from 'app/styles/organization'; -import Feature from 'app/components/acl/feature'; import IssueListActions from './actions'; import IssueListFilters from './filters'; import IssueListHeader from './header'; -import IssueListSidebar from './sidebar'; import NoGroupsHandler from './noGroupsHandler'; +import IssueListSidebar from './sidebar'; const MAX_ITEMS = 25; const DEFAULT_SORT = 'date'; diff --git a/src/sentry/static/sentry/app/views/issueList/savedSearchSelector.tsx b/src/sentry/static/sentry/app/views/issueList/savedSearchSelector.tsx index 7a31123a861710..202443c4bdcc4c 100644 --- a/src/sentry/static/sentry/app/views/issueList/savedSearchSelector.tsx +++ b/src/sentry/static/sentry/app/views/issueList/savedSearchSelector.tsx @@ -1,9 +1,7 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {Organization, SavedSearch} from 'app/types'; import Access from 'app/components/acl/access'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; @@ -11,9 +9,11 @@ import DropdownButton from 'app/components/dropdownButton'; import DropdownControl from 'app/components/dropdownControl'; import Tooltip from 'app/components/tooltip'; import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import space from 'app/styles/space'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; +import {Organization, SavedSearch} from 'app/types'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/issueList/searchBar.tsx b/src/sentry/static/sentry/app/views/issueList/searchBar.tsx index 0b9049cd066e91..300e5950b60990 100644 --- a/src/sentry/static/sentry/app/views/issueList/searchBar.tsx +++ b/src/sentry/static/sentry/app/views/issueList/searchBar.tsx @@ -1,16 +1,16 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {Client} from 'app/api'; -import {SavedSearchType, Tag, Organization, SavedSearch} from 'app/types'; import {fetchRecentSearches} from 'app/actionCreators/savedSearches'; -import SentryTypes from 'app/sentryTypes'; +import {Client} from 'app/api'; import SmartSearchBar from 'app/components/smartSearchBar'; +import {SearchItem} from 'app/components/smartSearchBar/types'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {Organization, SavedSearch, SavedSearchType, Tag} from 'app/types'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; -import {SearchItem} from 'app/components/smartSearchBar/types'; import {TagValueLoader} from './types'; diff --git a/src/sentry/static/sentry/app/views/issueList/sidebar.tsx b/src/sentry/static/sentry/app/views/issueList/sidebar.tsx index 9384c09709027c..ae1a66ada0bc83 100644 --- a/src/sentry/static/sentry/app/views/issueList/sidebar.tsx +++ b/src/sentry/static/sentry/app/views/issueList/sidebar.tsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import styled from '@emotion/styled'; import isEqual from 'lodash/isEqual'; import map from 'lodash/map'; -import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import LoadingIndicator from 'app/components/loadingIndicator'; import {IconClose} from 'app/icons/iconClose'; -import {queryToObj, objToQuery, QueryObj} from 'app/utils/stream'; import {t} from 'app/locale'; -import {Tag, TagCollection} from 'app/types'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {Tag, TagCollection} from 'app/types'; +import {objToQuery, QueryObj, queryToObj} from 'app/utils/stream'; -import {TagValueLoader} from './types'; import IssueListTagFilter from './tagFilter'; +import {TagValueLoader} from './types'; type DefaultProps = { tags: TagCollection; diff --git a/src/sentry/static/sentry/app/views/issueList/sortOptions.tsx b/src/sentry/static/sentry/app/views/issueList/sortOptions.tsx index 61738da9aa001f..68337b1d7cec99 100644 --- a/src/sentry/static/sentry/app/views/issueList/sortOptions.tsx +++ b/src/sentry/static/sentry/app/views/issueList/sortOptions.tsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/issueList/tagFilter.tsx b/src/sentry/static/sentry/app/views/issueList/tagFilter.tsx index 8e7ed4af3f7729..606aef1e0614c2 100644 --- a/src/sentry/static/sentry/app/views/issueList/tagFilter.tsx +++ b/src/sentry/static/sentry/app/views/issueList/tagFilter.tsx @@ -1,13 +1,13 @@ -import debounce from 'lodash/debounce'; import React from 'react'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; -import {Client} from 'app/api'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import SelectControl from 'app/components/forms/selectControl'; -import {Tag, TagValue} from 'app/types'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Tag, TagValue} from 'app/types'; import {TagValueLoader} from './types'; diff --git a/src/sentry/static/sentry/app/views/monitors/details.jsx b/src/sentry/static/sentry/app/views/monitors/details.jsx index e4c6df2dbe85b0..44cffe829429fe 100644 --- a/src/sentry/static/sentry/app/views/monitors/details.jsx +++ b/src/sentry/static/sentry/app/views/monitors/details.jsx @@ -1,8 +1,8 @@ import React from 'react'; -import AsyncView from 'app/views/asyncView'; import {Panel, PanelHeader} from 'app/components/panels'; import {t} from 'app/locale'; +import AsyncView from 'app/views/asyncView'; import MonitorCheckIns from './monitorCheckIns'; import MonitorHeader from './monitorHeader'; diff --git a/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx b/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx index 0d9ad98eb7a2c9..68a4e87cb64da2 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx +++ b/src/sentry/static/sentry/app/views/monitors/monitorCheckIns.tsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Monitor} from 'app/views/monitors/types'; -import {PanelBody, PanelItem} from 'app/components/panels'; import AsyncComponent from 'app/components/asyncComponent'; import Duration from 'app/components/duration'; +import {PanelBody, PanelItem} from 'app/components/panels'; import TimeSince from 'app/components/timeSince'; import space from 'app/styles/space'; +import {Monitor} from 'app/views/monitors/types'; import CheckInIcon from './checkInIcon'; diff --git a/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx b/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx index e111f697021f9f..b4d75ce9651576 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx +++ b/src/sentry/static/sentry/app/views/monitors/monitorForm.jsx @@ -1,19 +1,19 @@ import React, {Component} from 'react'; -import PropTypes from 'prop-types'; import {Observer} from 'mobx-react'; +import PropTypes from 'prop-types'; import Access from 'app/components/acl/access'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import withGlobalSelection from 'app/utils/withGlobalSelection'; +import withOrganization from 'app/utils/withOrganization'; import Field from 'app/views/settings/components/forms/field'; import Form from 'app/views/settings/components/forms/form'; import NumberField from 'app/views/settings/components/forms/numberField'; import SelectField from 'app/views/settings/components/forms/selectField'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; import TextField from 'app/views/settings/components/forms/textField'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import SentryTypes from 'app/sentryTypes'; -import {t, tct} from 'app/locale'; -import withGlobalSelection from 'app/utils/withGlobalSelection'; -import withOrganization from 'app/utils/withOrganization'; import MonitorModel from './monitorModel'; diff --git a/src/sentry/static/sentry/app/views/monitors/monitorHeader.jsx b/src/sentry/static/sentry/app/views/monitors/monitorHeader.jsx index 32eb4aa035457d..860d667b6f1ab2 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitorHeader.jsx +++ b/src/sentry/static/sentry/app/views/monitors/monitorHeader.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import TimeSince from 'app/components/timeSince'; import {t} from 'app/locale'; diff --git a/src/sentry/static/sentry/app/views/monitors/monitorHeaderActions.jsx b/src/sentry/static/sentry/app/views/monitors/monitorHeaderActions.jsx index f0a341a4c37c1d..3e48fe17aeef37 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitorHeaderActions.jsx +++ b/src/sentry/static/sentry/app/views/monitors/monitorHeaderActions.jsx @@ -1,22 +1,22 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import { addErrorMessage, addLoadingMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {logException} from 'app/utils/logging'; -import {t} from 'app/locale'; -import ButtonBar from 'app/components/buttonBar'; import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import Confirm from 'app/components/confirm'; import {IconDelete, IconEdit} from 'app/icons'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import withApi from 'app/utils/withApi'; import space from 'app/styles/space'; +import {logException} from 'app/utils/logging'; +import withApi from 'app/utils/withApi'; class MonitorHeaderActions extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/monitors/monitorStats.jsx b/src/sentry/static/sentry/app/views/monitors/monitorStats.jsx index 708647473c3f8c..6f279f5fff6323 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitorStats.jsx +++ b/src/sentry/static/sentry/app/views/monitors/monitorStats.jsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import AsyncComponent from 'app/components/asyncComponent'; +import MiniBarChart from 'app/components/charts/miniBarChart'; import {Panel, PanelBody} from 'app/components/panels'; import {t} from 'app/locale'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import MiniBarChart from 'app/components/charts/miniBarChart'; import theme from 'app/utils/theme'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; export default class MonitorStats extends AsyncComponent { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/monitors/monitors.jsx b/src/sentry/static/sentry/app/views/monitors/monitors.jsx index a08407422ec30c..06e63862dd017f 100644 --- a/src/sentry/static/sentry/app/views/monitors/monitors.jsx +++ b/src/sentry/static/sentry/app/views/monitors/monitors.jsx @@ -1,22 +1,22 @@ -import {Link, withRouter} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {Link, withRouter} from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {PageHeader} from 'app/styles/organization'; -import {Panel, PanelBody, PanelItem} from 'app/components/panels'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import FeatureBadge from 'app/components/featureBadge'; import Button from 'app/components/button'; +import FeatureBadge from 'app/components/featureBadge'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import PageHeading from 'app/components/pageHeading'; import Pagination from 'app/components/pagination'; +import {Panel, PanelBody, PanelItem} from 'app/components/panels'; import SearchBar from 'app/components/searchBar'; -import SentryTypes from 'app/sentryTypes'; import TimeSince from 'app/components/timeSince'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {PageHeader} from 'app/styles/organization'; import space from 'app/styles/space'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; import MonitorIcon from './monitorIcon'; diff --git a/src/sentry/static/sentry/app/views/newsletterConsent.tsx b/src/sentry/static/sentry/app/views/newsletterConsent.tsx index 29dee7aaa2529c..a454d4c16557f2 100644 --- a/src/sentry/static/sentry/app/views/newsletterConsent.tsx +++ b/src/sentry/static/sentry/app/views/newsletterConsent.tsx @@ -1,9 +1,9 @@ import React from 'react'; import {ApiForm, RadioBooleanField} from 'app/components/forms'; -import {tct, t} from 'app/locale'; -import NarrowLayout from 'app/components/narrowLayout'; import ExternalLink from 'app/components/links/externalLink'; +import NarrowLayout from 'app/components/narrowLayout'; +import {t, tct} from 'app/locale'; type Props = { onSubmitSuccess?: () => void; diff --git a/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx b/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx index e7ceae0305f7a0..a4debf2723d913 100644 --- a/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/createSampleEventButton.tsx @@ -1,19 +1,19 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; -import {Client} from 'app/api'; -import {Organization, Project} from 'app/types'; import { addErrorMessage, addLoadingMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import {trackAdhocEvent, trackAnalyticsEvent} from 'app/utils/analytics'; +import {Client} from 'app/api'; import Button from 'app/components/button'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {Organization, Project} from 'app/types'; +import {trackAdhocEvent, trackAnalyticsEvent} from 'app/utils/analytics'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; diff --git a/src/sentry/static/sentry/app/views/onboarding/onboarding.tsx b/src/sentry/static/sentry/app/views/onboarding/onboarding.tsx index fa340187c0f6a0..e886c02732207d 100644 --- a/src/sentry/static/sentry/app/views/onboarding/onboarding.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/onboarding.tsx @@ -1,25 +1,25 @@ -import {browserHistory, RouteComponentProps} from 'react-router'; -import DocumentTitle from 'react-document-title'; import React from 'react'; -import {motion, AnimatePresence} from 'framer-motion'; -import scrollToElement from 'scroll-to-element'; +import DocumentTitle from 'react-document-title'; +import {browserHistory, RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; +import {AnimatePresence, motion} from 'framer-motion'; +import scrollToElement from 'scroll-to-element'; -import {IS_ACCEPTANCE_TEST} from 'app/constants'; -import {analytics} from 'app/utils/analytics'; -import {t} from 'app/locale'; import Hook from 'app/components/hook'; import InlineSvg from 'app/components/inlineSvg'; import PageHeading from 'app/components/pageHeading'; +import {IS_ACCEPTANCE_TEST} from 'app/constants'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {analytics} from 'app/utils/analytics'; +import testableTransition from 'app/utils/testableTransition'; import withOrganization from 'app/utils/withOrganization'; import withProjects from 'app/utils/withProjects'; -import testableTransition from 'app/utils/testableTransition'; -import {Organization, Project} from 'app/types'; -import {StepDescriptor, StepData} from './types'; import OnboardingPlatform from './platform'; import OnboardingProjectSetup from './projectSetup'; +import {StepData, StepDescriptor} from './types'; import OnboardingWelcome from './welcome'; type AnalyticsOpts = { diff --git a/src/sentry/static/sentry/app/views/onboarding/platform.tsx b/src/sentry/static/sentry/app/views/onboarding/platform.tsx index 646d6a2a6ddc4f..05d8540b71c9f5 100644 --- a/src/sentry/static/sentry/app/views/onboarding/platform.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/platform.tsx @@ -1,18 +1,18 @@ -import {ClassNames} from '@emotion/core'; import React from 'react'; +import {ClassNames} from '@emotion/core'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {createProject} from 'app/actionCreators/projects'; -import {t, tct} from 'app/locale'; +import ProjectActions from 'app/actions/projectActions'; +import {Client} from 'app/api'; import Button from 'app/components/button'; import PlatformPicker from 'app/components/platformPicker'; -import ProjectActions from 'app/actions/projectActions'; +import {PlatformKey} from 'app/data/platformCategories'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Team} from 'app/types'; import withApi from 'app/utils/withApi'; import withTeams from 'app/utils/withTeams'; -import {Client} from 'app/api'; -import {Team} from 'app/types'; -import {PlatformKey} from 'app/data/platformCategories'; import {StepProps} from './types'; diff --git a/src/sentry/static/sentry/app/views/onboarding/projectSetup/firstEventIndicator.tsx b/src/sentry/static/sentry/app/views/onboarding/projectSetup/firstEventIndicator.tsx index a9b48a5c8f7702..f117c9c9c8ee98 100644 --- a/src/sentry/static/sentry/app/views/onboarding/projectSetup/firstEventIndicator.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/projectSetup/firstEventIndicator.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import {motion, AnimatePresence, Variants} from 'framer-motion'; import styled from '@emotion/styled'; +import {AnimatePresence, motion, Variants} from 'framer-motion'; -import {t} from 'app/locale'; import Button from 'app/components/button'; -import EventWaiter from 'app/utils/eventWaiter'; -import space from 'app/styles/space'; +import {IconCheckmark} from 'app/icons'; +import {t} from 'app/locale'; import pulsingIndicatorStyles from 'app/styles/pulsingIndicator'; +import space from 'app/styles/space'; import {Group, Organization} from 'app/types'; -import {IconCheckmark} from 'app/icons'; +import EventWaiter from 'app/utils/eventWaiter'; import testableTransition from 'app/utils/testableTransition'; type EventWaiterProps = Omit<React.ComponentProps<typeof EventWaiter>, 'children'>; diff --git a/src/sentry/static/sentry/app/views/onboarding/projectSetup/index.tsx b/src/sentry/static/sentry/app/views/onboarding/projectSetup/index.tsx index db0751fc7e6fe8..dbf71ab4516f1d 100644 --- a/src/sentry/static/sentry/app/views/onboarding/projectSetup/index.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/projectSetup/index.tsx @@ -1,15 +1,16 @@ import React from 'react'; -import {motion, AnimatePresence} from 'framer-motion'; import styled from '@emotion/styled'; +import {AnimatePresence, motion} from 'framer-motion'; -import {analytics} from 'app/utils/analytics'; -import {t} from 'app/locale'; import HookOrDefault from 'app/components/hookOrDefault'; -import withOrganization from 'app/utils/withOrganization'; -import testableTransition from 'app/utils/testableTransition'; +import {t} from 'app/locale'; import {Organization} from 'app/types'; +import {analytics} from 'app/utils/analytics'; +import testableTransition from 'app/utils/testableTransition'; +import withOrganization from 'app/utils/withOrganization'; import {StepProps} from '../types'; + import InviteMembers from './inviteMembers'; import LearnMore from './learnMore'; import ProjectDocs from './projectDocs'; diff --git a/src/sentry/static/sentry/app/views/onboarding/projectSetup/inviteMembers.tsx b/src/sentry/static/sentry/app/views/onboarding/projectSetup/inviteMembers.tsx index 58a231c873f524..19e218b72e9eda 100644 --- a/src/sentry/static/sentry/app/views/onboarding/projectSetup/inviteMembers.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/projectSetup/inviteMembers.tsx @@ -2,23 +2,23 @@ import React from 'react'; import styled from '@emotion/styled'; import {addSuccessMessage} from 'app/actionCreators/indicator'; -import {analytics} from 'app/utils/analytics'; import {getCurrentMember} from 'app/actionCreators/members'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import Alert from 'app/components/alert'; -import EmailField from 'app/views/settings/components/forms/emailField'; -import Form from 'app/views/settings/components/forms/form'; import Panel from 'app/components/panels/panel'; import {IconGroup} from 'app/icons'; -import SelectField from 'app/views/settings/components/forms/selectField'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Config, MemberRole, Organization, Project} from 'app/types'; +import {analytics} from 'app/utils/analytics'; import withApi from 'app/utils/withApi'; import withConfig from 'app/utils/withConfig'; import withOrganization from 'app/utils/withOrganization'; -import {Client} from 'app/api'; -import {Organization, Config, Project, MemberRole} from 'app/types'; +import EmailField from 'app/views/settings/components/forms/emailField'; +import Form from 'app/views/settings/components/forms/form'; import FormModel from 'app/views/settings/components/forms/model'; +import SelectField from 'app/views/settings/components/forms/selectField'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import {StepProps} from '../types'; diff --git a/src/sentry/static/sentry/app/views/onboarding/projectSetup/learnMore.tsx b/src/sentry/static/sentry/app/views/onboarding/projectSetup/learnMore.tsx index d494d5516fc037..2dcc339d31b11b 100644 --- a/src/sentry/static/sentry/app/views/onboarding/projectSetup/learnMore.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/projectSetup/learnMore.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; -import CreateSampleEventButton from 'app/views/onboarding/createSampleEventButton'; +import Alert from 'app/components/alert'; import Panel from 'app/components/panels/panel'; import PanelBody from 'app/components/panels/panelBody'; -import getDynamicText from 'app/utils/getDynamicText'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import Alert from 'app/components/alert'; +import getDynamicText from 'app/utils/getDynamicText'; +import CreateSampleEventButton from 'app/views/onboarding/createSampleEventButton'; import {StepProps} from '../types'; diff --git a/src/sentry/static/sentry/app/views/onboarding/projectSetup/projectDocs.tsx b/src/sentry/static/sentry/app/views/onboarding/projectSetup/projectDocs.tsx index a329b1cfcb4a07..f3c14e764ceaca 100644 --- a/src/sentry/static/sentry/app/views/onboarding/projectSetup/projectDocs.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/projectSetup/projectDocs.tsx @@ -1,31 +1,31 @@ -import styled from '@emotion/styled'; -import {css} from '@emotion/core'; -import PropTypes from 'prop-types'; import React from 'react'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import {AnimatePresence, motion} from 'framer-motion'; import PlatformIcon from 'platformicons'; +import PropTypes from 'prop-types'; -import {analytics} from 'app/utils/analytics'; import {loadDocs} from 'app/actionCreators/projects'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import Alert, {alertStyles} from 'app/components/alert'; import Button from 'app/components/button'; import ExternalLink from 'app/components/links/externalLink'; -import FirstEventIndicator from 'app/views/onboarding/projectSetup/firstEventIndicator'; -import {IconInfo} from 'app/icons'; import LoadingError from 'app/components/loadingError'; import Panel from 'app/components/panels/panel'; import PanelBody from 'app/components/panels/panelBody'; +import {PlatformKey} from 'app/data/platformCategories'; import platforms from 'app/data/platforms'; +import {IconInfo} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import withApi from 'app/utils/withApi'; +import {Organization, Project} from 'app/types'; +import {analytics} from 'app/utils/analytics'; import getDynamicText from 'app/utils/getDynamicText'; -import withOrganization from 'app/utils/withOrganization'; import testableTransition from 'app/utils/testableTransition'; -import {Organization, Project} from 'app/types'; -import {PlatformKey} from 'app/data/platformCategories'; -import {Client} from 'app/api'; import {Theme} from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; +import FirstEventIndicator from 'app/views/onboarding/projectSetup/firstEventIndicator'; import {StepProps} from '../types'; diff --git a/src/sentry/static/sentry/app/views/onboarding/types.tsx b/src/sentry/static/sentry/app/views/onboarding/types.tsx index 65843d4ffd1564..0f75a327955988 100644 --- a/src/sentry/static/sentry/app/views/onboarding/types.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/types.tsx @@ -1,5 +1,5 @@ -import {Project} from 'app/types'; import {PlatformKey} from 'app/data/platformCategories'; +import {Project} from 'app/types'; export type StepData = { platform?: PlatformKey | null; diff --git a/src/sentry/static/sentry/app/views/onboarding/welcome.tsx b/src/sentry/static/sentry/app/views/onboarding/welcome.tsx index 794acc0bcbc377..33778298de5236 100644 --- a/src/sentry/static/sentry/app/views/onboarding/welcome.tsx +++ b/src/sentry/static/sentry/app/views/onboarding/welcome.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {analytics} from 'app/utils/analytics'; -import {t, tct} from 'app/locale'; import Button from 'app/components/button'; +import {t, tct} from 'app/locale'; +import {Config, Organization} from 'app/types'; +import {analytics} from 'app/utils/analytics'; import withConfig from 'app/utils/withConfig'; import withOrganization from 'app/utils/withOrganization'; -import {Config, Organization} from 'app/types'; import {StepProps} from './types'; diff --git a/src/sentry/static/sentry/app/views/organizationActivity/activityFeedItem.tsx b/src/sentry/static/sentry/app/views/organizationActivity/activityFeedItem.tsx index aff6aef8609704..5078fc6dec7df9 100644 --- a/src/sentry/static/sentry/app/views/organizationActivity/activityFeedItem.tsx +++ b/src/sentry/static/sentry/app/views/organizationActivity/activityFeedItem.tsx @@ -1,22 +1,22 @@ -import {Link} from 'react-router'; import React from 'react'; +import {Link} from 'react-router'; import styled from '@emotion/styled'; -import {Activity, Organization} from 'app/types'; -import {t, tn, tct} from 'app/locale'; +import ActivityAvatar from 'app/components/activity/item/avatar'; import CommitLink from 'app/components/commitLink'; import Duration from 'app/components/duration'; -import ExternalLink from 'app/components/links/externalLink'; import IssueLink from 'app/components/issueLink'; -import MemberListStore from 'app/stores/memberListStore'; +import ExternalLink from 'app/components/links/externalLink'; import PullRequestLink from 'app/components/pullRequestLink'; -import TeamStore from 'app/stores/teamStore'; import TimeSince from 'app/components/timeSince'; import Version from 'app/components/version'; import VersionHoverCard from 'app/components/versionHoverCard'; -import marked from 'app/utils/marked'; +import {t, tct, tn} from 'app/locale'; +import MemberListStore from 'app/stores/memberListStore'; +import TeamStore from 'app/stores/teamStore'; import space from 'app/styles/space'; -import ActivityAvatar from 'app/components/activity/item/avatar'; +import {Activity, Organization} from 'app/types'; +import marked from 'app/utils/marked'; const defaultProps = { defaultClipped: false, diff --git a/src/sentry/static/sentry/app/views/organizationActivity/index.tsx b/src/sentry/static/sentry/app/views/organizationActivity/index.tsx index 99dcd2c8fad757..b863a42d3cf727 100644 --- a/src/sentry/static/sentry/app/views/organizationActivity/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationActivity/index.tsx @@ -1,19 +1,19 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Activity, Organization} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {Panel} from 'app/components/panels'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import ErrorBoundary from 'app/components/errorBoundary'; import LoadingIndicator from 'app/components/loadingIndicator'; import PageHeading from 'app/components/pageHeading'; import Pagination from 'app/components/pagination'; -import routeTitle from 'app/utils/routeTitle'; +import {Panel} from 'app/components/panels'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; import space from 'app/styles/space'; +import {Activity, Organization} from 'app/types'; +import routeTitle from 'app/utils/routeTitle'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; import ActivityFeedItem from './activityFeedItem'; diff --git a/src/sentry/static/sentry/app/views/organizationContext.tsx b/src/sentry/static/sentry/app/views/organizationContext.tsx index 8e4d8aa8a53c0b..df8ac8c42c26a0 100644 --- a/src/sentry/static/sentry/app/views/organizationContext.tsx +++ b/src/sentry/static/sentry/app/views/organizationContext.tsx @@ -1,33 +1,33 @@ -import DocumentTitle from 'react-document-title'; -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; -import * as Sentry from '@sentry/react'; +import DocumentTitle from 'react-document-title'; import {PlainRoute} from 'react-router/lib/Route'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; +import {openSudo} from 'app/actionCreators/modal'; +import {fetchOrganizationDetails} from 'app/actionCreators/organization'; +import ProjectActions from 'app/actions/projectActions'; import {Client} from 'app/api'; +import Alert from 'app/components/alert'; +import LoadingError from 'app/components/loadingError'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import Sidebar from 'app/components/sidebar'; import {ORGANIZATION_FETCH_ERROR_TYPES} from 'app/constants'; -import {Organization} from 'app/types'; -import {fetchOrganizationDetails} from 'app/actionCreators/organization'; -import {metric} from 'app/utils/analytics'; -import {openSudo} from 'app/actionCreators/modal'; import {t} from 'app/locale'; -import Alert from 'app/components/alert'; +import SentryTypes from 'app/sentryTypes'; import ConfigStore from 'app/stores/configStore'; import HookStore from 'app/stores/hookStore'; -import LoadingError from 'app/components/loadingError'; -import LoadingIndicator from 'app/components/loadingIndicator'; import OrganizationStore from 'app/stores/organizationStore'; -import ProjectActions from 'app/actions/projectActions'; -import SentryTypes from 'app/sentryTypes'; -import Sidebar from 'app/components/sidebar'; -import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; import space from 'app/styles/space'; -import withApi from 'app/utils/withApi'; -import withOrganizations from 'app/utils/withOrganizations'; +import {Organization} from 'app/types'; +import {metric} from 'app/utils/analytics'; import {callIfFunction} from 'app/utils/callIfFunction'; +import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; import RequestError from 'app/utils/requestError/requestError'; +import withApi from 'app/utils/withApi'; +import withOrganizations from 'app/utils/withOrganizations'; const defaultProps = { detailed: true, diff --git a/src/sentry/static/sentry/app/views/organizationCreate.tsx b/src/sentry/static/sentry/app/views/organizationCreate.tsx index 89641dd2feef4e..8058b9fe25f70f 100644 --- a/src/sentry/static/sentry/app/views/organizationCreate.tsx +++ b/src/sentry/static/sentry/app/views/organizationCreate.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import AsyncView from 'app/views/asyncView'; -import ConfigStore from 'app/stores/configStore'; -import NarrowLayout from 'app/components/narrowLayout'; import {ApiForm, BooleanField, TextField} from 'app/components/forms'; +import NarrowLayout from 'app/components/narrowLayout'; import {t, tct} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; +import AsyncView from 'app/views/asyncView'; export default class OrganizationCreate extends AsyncView { onSubmitSuccess = data => { diff --git a/src/sentry/static/sentry/app/views/organizationDetails/index.jsx b/src/sentry/static/sentry/app/views/organizationDetails/index.jsx index 1d4242b1b58cb7..a8f59a356cd3cd 100644 --- a/src/sentry/static/sentry/app/views/organizationDetails/index.jsx +++ b/src/sentry/static/sentry/app/views/organizationDetails/index.jsx @@ -2,17 +2,17 @@ import React, {Component} from 'react'; import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; -import {Client} from 'app/api'; import {switchOrganization} from 'app/actionCreators/organizations'; -import {t, tct} from 'app/locale'; -import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; import AlertActions from 'app/actions/alertActions'; +import {Client} from 'app/api'; import Button from 'app/components/button'; import ErrorBoundary from 'app/components/errorBoundary'; import Footer from 'app/components/footer'; import NarrowLayout from 'app/components/narrowLayout'; -import OrganizationContext from 'app/views/organizationContext'; +import {t, tct} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; +import OrganizationContext from 'app/views/organizationContext'; class DeletionInProgress extends Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/actions.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/actions.jsx index e0198ac40d1439..14c134774697fe 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/actions.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/actions.jsx @@ -1,38 +1,38 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; -import createReactClass from 'create-react-class'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; import { addErrorMessage, addLoadingMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {analytics} from 'app/utils/analytics'; import {openModal} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; -import {uniqueId} from 'app/utils/guid'; -import Button from 'app/components/button'; -import DropdownLink from 'app/components/dropdownLink'; -import EventView from 'app/utils/discover/eventView'; +import GroupActions from 'app/actions/groupActions'; import Feature from 'app/components/acl/feature'; import FeatureDisabled from 'app/components/acl/featureDisabled'; -import GroupActions from 'app/actions/groupActions'; -import GuideAnchor from 'app/components/assistant/guideAnchor'; import IgnoreActions from 'app/components/actions/ignore'; -import {IconDelete, IconStar, IconRefresh} from 'app/icons'; +import ResolveActions from 'app/components/actions/resolve'; +import GuideAnchor from 'app/components/assistant/guideAnchor'; +import Button from 'app/components/button'; +import DropdownLink from 'app/components/dropdownLink'; import Link from 'app/components/links/link'; import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; import MenuItem from 'app/components/menuItem'; -import ReprocessingForm from 'app/views/organizationGroupDetails/reprocessingForm'; -import ResolveActions from 'app/components/actions/resolve'; -import SentryTypes from 'app/sentryTypes'; import ShareIssue from 'app/components/shareIssue'; import Tooltip from 'app/components/tooltip'; +import {IconDelete, IconRefresh, IconStar} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {analytics} from 'app/utils/analytics'; +import EventView from 'app/utils/discover/eventView'; +import {uniqueId} from 'app/utils/guid'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; +import ReprocessingForm from 'app/views/organizationGroupDetails/reprocessingForm'; import SubscribeAction from './subscribeAction'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/eventToolbar.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/eventToolbar.jsx index df0c552f8c3fe5..06d232c960c515 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/eventToolbar.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/eventToolbar.jsx @@ -1,20 +1,20 @@ -import {Link} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; -import moment from 'moment-timezone'; +import {Link} from 'react-router'; import styled from '@emotion/styled'; +import moment from 'moment-timezone'; +import PropTypes from 'prop-types'; -import {IconWarning} from 'app/icons'; -import {t} from 'app/locale'; -import ConfigStore from 'app/stores/configStore'; import DateTime from 'app/components/dateTime'; -import ExternalLink from 'app/components/links/externalLink'; import FileSize from 'app/components/fileSize'; -import SentryTypes from 'app/sentryTypes'; -import Tooltip from 'app/components/tooltip'; -import getDynamicText from 'app/utils/getDynamicText'; +import ExternalLink from 'app/components/links/externalLink'; import NavigationButtonGroup from 'app/components/navigationButtonGroup'; +import Tooltip from 'app/components/tooltip'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import ConfigStore from 'app/stores/configStore'; import space from 'app/styles/space'; +import getDynamicText from 'app/utils/getDynamicText'; const formatDateDelta = (reference, observed) => { const duration = moment.duration(Math.abs(+observed - +reference)); diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivity.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivity.tsx index 44766826c22e84..cca9afe2bfe02e 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivity.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivity.tsx @@ -1,26 +1,26 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; +import {createNote, deleteNote, updateNote} from 'app/actionCreators/group'; import { addErrorMessage, addLoadingMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {createNote, deleteNote, updateNote} from 'app/actionCreators/group'; -import {t} from 'app/locale'; -import {uniqueId} from 'app/utils/guid'; +import {Client} from 'app/api'; import ActivityAuthor from 'app/components/activity/author'; import ActivityItem from 'app/components/activity/item'; -import ConfigStore from 'app/stores/configStore'; -import ErrorBoundary from 'app/components/errorBoundary'; import Note from 'app/components/activity/note'; import NoteInputWithStorage from 'app/components/activity/note/inputWithStorage'; -import withApi from 'app/utils/withApi'; -import withOrganization from 'app/utils/withOrganization'; -import {Activity, Group, Organization, User} from 'app/types'; -import {Client} from 'app/api'; import {CreateError} from 'app/components/activity/note/types'; +import ErrorBoundary from 'app/components/errorBoundary'; import {DEFAULT_ERROR_JSON} from 'app/constants'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; +import {Activity, Group, Organization, User} from 'app/types'; +import {uniqueId} from 'app/utils/guid'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; import GroupActivityItem from './groupActivityItem'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivityItem.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivityItem.jsx index 97b0701df0aff4..61f933a69e5759 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivityItem.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupActivityItem.jsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {t, tct, tn} from 'app/locale'; import CommitLink from 'app/components/commitLink'; import Duration from 'app/components/duration'; -import MemberListStore from 'app/stores/memberListStore'; import PullRequestLink from 'app/components/pullRequestLink'; -import TeamStore from 'app/stores/teamStore'; import Version from 'app/components/version'; +import {t, tct, tn} from 'app/locale'; +import MemberListStore from 'app/stores/memberListStore'; +import TeamStore from 'app/stores/teamStore'; class GroupActivityItem extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx index 06799b07c00a10..b881e4489a3165 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx @@ -1,28 +1,28 @@ -import DocumentTitle from 'react-document-title'; -import PropTypes from 'prop-types'; import React from 'react'; +import DocumentTitle from 'react-document-title'; import * as ReactRouter from 'react-router'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; import {Client} from 'app/api'; -import {Group, Organization, Project, Event, AvatarProject} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {callIfFunction} from 'app/utils/callIfFunction'; -import {t} from 'app/locale'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import GroupStore from 'app/stores/groupStore'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import MissingProjectMembership from 'app/components/projects/missingProjectMembership'; -import Projects from 'app/utils/projects'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import GroupStore from 'app/stores/groupStore'; +import {PageContent} from 'app/styles/organization'; +import {AvatarProject, Event, Group, Organization, Project} from 'app/types'; +import {callIfFunction} from 'app/utils/callIfFunction'; +import {getMessage, getTitle} from 'app/utils/events'; +import Projects from 'app/utils/projects'; import recreateRoute from 'app/utils/recreateRoute'; import withApi from 'app/utils/withApi'; -import {getMessage, getTitle} from 'app/utils/events'; import {ERROR_TYPES} from './constants'; -import {fetchGroupEventAndMarkSeen} from './utils'; import GroupHeader, {TAB} from './header'; +import {fetchGroupEventAndMarkSeen} from './utils'; type Error = typeof ERROR_TYPES[keyof typeof ERROR_TYPES] | null; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx index 1bc443bb5e1628..ecd1402a006ba7 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachments.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import pick from 'lodash/pick'; import * as ReactRouter from 'react-router'; +import pick from 'lodash/pick'; -import {Panel, PanelBody} from 'app/components/panels'; -import {t} from 'app/locale'; +import AsyncComponent from 'app/components/asyncComponent'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import LoadingIndicator from 'app/components/loadingIndicator'; import Pagination from 'app/components/pagination'; -import AsyncComponent from 'app/components/asyncComponent'; +import {Panel, PanelBody} from 'app/components/panels'; +import {t} from 'app/locale'; -import GroupEventAttachmentsTable from './groupEventAttachmentsTable'; import GroupEventAttachmentsFilter from './groupEventAttachmentsFilter'; +import GroupEventAttachmentsTable from './groupEventAttachmentsTable'; type Props = { projectSlug: string; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsFilter.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsFilter.tsx index 9a01cb1cbca59f..c8c51de4aa83e7 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsFilter.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsFilter.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import omit from 'lodash/omit'; -import xor from 'lodash/xor'; import {withRouter} from 'react-router'; import {WithRouterProps} from 'react-router/lib/withRouter'; import styled from '@emotion/styled'; +import omit from 'lodash/omit'; +import xor from 'lodash/xor'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; -import ButtonBar from 'app/components/buttonBar'; import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; const crashReportTypes = ['event.minidump', 'event.applecrashreport']; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx index 3d3e7b64d40eab..09beeb669a3b4b 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTable.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {EventAttachment} from 'app/types'; import {t} from 'app/locale'; +import {EventAttachment} from 'app/types'; import GroupEventAttachmentsTableRow from 'app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow'; type Props = { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx index 75ef452893a39b..c0a8904bc8ea34 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/groupEventAttachmentsTableRow.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import Link from 'app/components/links/link'; -import {t} from 'app/locale'; import DateTime from 'app/components/dateTime'; +import EventAttachmentActions from 'app/components/events/eventAttachmentActions'; import FileSize from 'app/components/fileSize'; +import Link from 'app/components/links/link'; +import {t} from 'app/locale'; import {EventAttachment} from 'app/types'; import AttachmentUrl from 'app/utils/attachmentUrl'; -import EventAttachmentActions from 'app/components/events/eventAttachmentActions'; import {types} from 'app/views/organizationGroupDetails/groupEventAttachments/types'; type Props = { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx index 131eb9c74ef1cb..73adf5e94d14fc 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventAttachments/index.tsx @@ -1,10 +1,10 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import {Organization, Group} from 'app/types'; import Feature from 'app/components/acl/feature'; -import withOrganization from 'app/utils/withOrganization'; import FeatureDisabled from 'app/components/acl/featureDisabled'; +import {Group, Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; import GroupEventAttachments from './groupEventAttachments'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx index 220511cdcc8286..6fdf5fb41f6e56 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/groupEventDetails.tsx @@ -1,27 +1,27 @@ -import {browserHistory} from 'react-router'; -import isEqual from 'lodash/isEqual'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; -import * as Sentry from '@sentry/react'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; -import {Client} from 'app/api'; -import {metric} from 'app/utils/analytics'; import {fetchSentryAppComponents} from 'app/actionCreators/sentryAppComponents'; -import {withMeta} from 'app/components/events/meta/metaProxy'; -import EventEntries from 'app/components/events/eventEntries'; +import {Client} from 'app/api'; import GroupEventDetailsLoadingError from 'app/components/errors/groupEventDetailsLoadingError'; +import EventEntries from 'app/components/events/eventEntries'; +import {withMeta} from 'app/components/events/meta/metaProxy'; import GroupSidebar from 'app/components/group/sidebar'; import LoadingIndicator from 'app/components/loadingIndicator'; import MutedBox from 'app/components/mutedBox'; import ResolutionBox from 'app/components/resolutionBox'; import SentryTypes from 'app/sentryTypes'; +import {Environment, Event, Group, Organization, Project} from 'app/types'; +import {metric} from 'app/utils/analytics'; import fetchSentryAppInstallations from 'app/utils/fetchSentryAppInstallations'; -import {Group, Project, Organization, Environment, Event} from 'app/types'; -import {fetchGroupEventAndMarkSeen, getEventEnvironment} from '../utils'; import GroupEventToolbar from '../eventToolbar'; +import {fetchGroupEventAndMarkSeen, getEventEnvironment} from '../utils'; type Props = RouteComponentProps< {orgId: string; groupId: string; eventId?: string}, diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/index.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/index.tsx index fc08fffeca370e..7b0059a80c35d6 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEventDetails/index.tsx @@ -2,18 +2,18 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {fetchOrganizationEnvironments} from 'app/actionCreators/environments'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; import OrganizationEnvironmentsStore from 'app/stores/organizationEnvironmentsStore'; -import {Client} from 'app/api'; import { + Environment, + Event, GlobalSelection, + Group, Organization, - Environment, Project, - Group, - Event, } from 'app/types'; import withApi from 'app/utils/withApi'; import withGlobalSelection from 'app/utils/withGlobalSelection'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx index 8c9905a7ca6c89..d0b16bc375dde5 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupEvents.jsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import pick from 'lodash/pick'; +import PropTypes from 'prop-types'; -import SentryTypes from 'app/sentryTypes'; -import {Panel, PanelBody} from 'app/components/panels'; -import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import EventsTable from 'app/components/eventsTable/eventsTable'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; import Pagination from 'app/components/pagination'; +import {Panel, PanelBody} from 'app/components/panels'; import SearchBar from 'app/components/searchBar'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import parseApiError from 'app/utils/parseApiError'; +import withApi from 'app/utils/withApi'; class GroupEvents extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/index.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/index.jsx index dc149175677850..3a2f9310de6333 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/index.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/index.jsx @@ -1,15 +1,15 @@ import React from 'react'; -import Reflux from 'reflux'; import createReactClass from 'create-react-class'; import * as queryString from 'query-string'; +import Reflux from 'reflux'; -import {t} from 'app/locale'; -import Alert from 'app/components/alert'; import GroupingActions from 'app/actions/groupingActions'; -import GroupingStore from 'app/stores/groupingStore'; +import Alert from 'app/components/alert'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import GroupingStore from 'app/stores/groupingStore'; import MergedList from './mergedList'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedItem.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedItem.jsx index a30d4785a5b884..1b137703576bc5 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedItem.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedItem.jsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; -import {IconChevron} from 'app/icons'; +import GroupingActions from 'app/actions/groupingActions'; import Checkbox from 'app/components/checkbox'; import EventOrGroupHeader from 'app/components/eventOrGroupHeader'; import FlowLayout from 'app/components/flowLayout'; -import GroupingActions from 'app/actions/groupingActions'; +import {IconChevron} from 'app/icons'; import GroupingStore from 'app/stores/groupingStore'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx index ab7ec887b7cb1e..cc232a34891d10 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedList.jsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Panel} from 'app/components/panels'; -import {t} from 'app/locale'; import EmptyStateWarning from 'app/components/emptyStateWarning'; import Pagination from 'app/components/pagination'; +import {Panel} from 'app/components/panels'; import QueryCount from 'app/components/queryCount'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import MergedItem from './mergedItem'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedToolbar.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedToolbar.jsx index dde5c2a46c3aab..426ca23dc3cc45 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedToolbar.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupMerged/mergedToolbar.jsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; -import pick from 'lodash/pick'; -import createReactClass from 'create-react-class'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import pick from 'lodash/pick'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; import {openDiffModal} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; import Button from 'app/components/button'; -import GroupingStore from 'app/stores/groupingStore'; import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; import SpreadLayout from 'app/components/spreadLayout'; import Toolbar from 'app/components/toolbar'; -import space from 'app/styles/space'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import GroupingStore from 'app/stores/groupingStore'; +import space from 'app/styles/space'; const MergedToolbar = createReactClass({ displayName: 'MergedToolbar', diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/index.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/index.tsx index 070d6c71876cdc..d2f2cbf3b80504 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/index.tsx @@ -1,20 +1,20 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; +import React from 'react'; import {browserHistory} from 'react-router'; -import {Location} from 'history'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import React from 'react'; +import {Location} from 'history'; import * as queryString from 'query-string'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; import GroupingActions from 'app/actions/groupingActions'; -import GroupingStore from 'app/stores/groupingStore'; +import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import ButtonBar from 'app/components/buttonBar'; -import Button from 'app/components/button'; +import {t} from 'app/locale'; +import GroupingStore from 'app/stores/groupingStore'; +import space from 'app/styles/space'; import {Project} from 'app/types'; -import Alert from 'app/components/alert'; import {callIfFunction} from 'app/utils/callIfFunction'; import List from './list'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/item.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/item.tsx index e696d7d0f6117f..18be08b0684ef3 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/item.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/item.tsx @@ -1,24 +1,24 @@ import React from 'react'; -import classNames from 'classnames'; import {css} from '@emotion/core'; import styled from '@emotion/styled'; +import classNames from 'classnames'; -import {t} from 'app/locale'; import {openDiffModal} from 'app/actionCreators/modal'; +import GroupingActions from 'app/actions/groupingActions'; +import Button from 'app/components/button'; import Checkbox from 'app/components/checkbox'; import Count from 'app/components/count'; import EventOrGroupExtraDetails from 'app/components/eventOrGroupExtraDetails'; import EventOrGroupHeader from 'app/components/eventOrGroupHeader'; import FlowLayout from 'app/components/flowLayout'; -import GroupingActions from 'app/actions/groupingActions'; -import GroupingStore from 'app/stores/groupingStore'; import Hovercard from 'app/components/hovercard'; import ScoreBar from 'app/components/scoreBar'; import SimilarScoreCard from 'app/components/similarScoreCard'; -import Button from 'app/components/button'; import SpreadLayout from 'app/components/spreadLayout'; -import {Organization, Group, Project} from 'app/types'; +import {t} from 'app/locale'; +import GroupingStore from 'app/stores/groupingStore'; import space from 'app/styles/space'; +import {Group, Organization, Project} from 'app/types'; import {callIfFunction} from 'app/utils/callIfFunction'; const similarInterfaces = ['exception', 'message']; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/list.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/list.tsx index e44184f7bd2b36..5d79b5687bff47 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/list.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/list.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import Pagination from 'app/components/pagination'; import Button from 'app/components/button'; -import SimilarSpectrum from 'app/components/similarSpectrum'; import EmptyStateWarning from 'app/components/emptyStateWarning'; +import Pagination from 'app/components/pagination'; import {Panel, PanelBody} from 'app/components/panels'; +import SimilarSpectrum from 'app/components/similarSpectrum'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {Organization, Project, Group} from 'app/types'; +import {Group, Organization, Project} from 'app/types'; import Item from './item'; import Toolbar from './toolbar'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/toolbar.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/toolbar.tsx index c17cb727d370f9..cbc0ba364656eb 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/toolbar.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarStackTrace/toolbar.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import GroupingStore from 'app/stores/groupingStore'; -import SpreadLayout from 'app/components/spreadLayout'; -import FlowLayout from 'app/components/flowLayout'; -import Confirm from 'app/components/confirm'; import Button from 'app/components/button'; +import Confirm from 'app/components/confirm'; +import FlowLayout from 'app/components/flowLayout'; +import SpreadLayout from 'app/components/spreadLayout'; import Toolbar from 'app/components/toolbar'; import ToolbarHeader from 'app/components/toolbarHeader'; -import {callIfFunction} from 'app/utils/callIfFunction'; +import {t} from 'app/locale'; +import GroupingStore from 'app/stores/groupingStore'; import space from 'app/styles/space'; +import {callIfFunction} from 'app/utils/callIfFunction'; type Props = { onMerge: () => void; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/body.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/body.tsx index 775aeffe95f11b..53d653666c5c3a 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/body.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/body.tsx @@ -2,15 +2,15 @@ import React from 'react'; import {Location} from 'history'; import moment from 'moment-timezone'; -import LoadingIndicator from 'app/components/loadingIndicator'; +import EmptyStateWarning from 'app/components/emptyStateWarning'; import {getTraceDateTimeRange} from 'app/components/events/interfaces/spans/utils'; -import EventView from 'app/utils/discover/eventView'; -import {t} from 'app/locale'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import {Panel, PanelBody} from 'app/components/panels'; import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; -import {Organization, Event} from 'app/types'; +import {t} from 'app/locale'; +import {Event, Organization} from 'app/types'; import DiscoverQuery from 'app/utils/discover/discoverQuery'; -import {Panel, PanelBody} from 'app/components/panels'; -import EmptyStateWarning from 'app/components/emptyStateWarning'; +import EventView from 'app/utils/discover/eventView'; import List from './list'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/list.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/list.tsx index 3d2752ab67db8d..e35230eed36a16 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/list.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupSimilarIssues/similarTraceID/list.tsx @@ -1,25 +1,25 @@ import React from 'react'; -import {Location, Query} from 'history'; import {browserHistory} from 'react-router'; -import pick from 'lodash/pick'; -import * as Sentry from '@sentry/react'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; +import {Location, Query} from 'history'; +import pick from 'lodash/pick'; -import {tct} from 'app/locale'; -import {URL_PARAM} from 'app/constants/globalSelectionHeader'; +import {Client} from 'app/api'; +import DateTime from 'app/components/dateTime'; +import EmptyStateWarning from 'app/components/emptyStateWarning'; import GroupListHeader from 'app/components/issues/groupListHeader'; +import LoadingError from 'app/components/loadingError'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import Pagination from 'app/components/pagination'; import {Panel, PanelBody} from 'app/components/panels'; import StreamGroup from 'app/components/stream/group'; +import {URL_PARAM} from 'app/constants/globalSelectionHeader'; +import {tct} from 'app/locale'; import GroupStore from 'app/stores/groupStore'; -import Pagination from 'app/components/pagination'; -import withApi from 'app/utils/withApi'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import {Client} from 'app/api'; import {Group} from 'app/types'; -import EmptyStateWarning from 'app/components/emptyStateWarning'; -import LoadingError from 'app/components/loadingError'; -import DateTime from 'app/components/dateTime'; import {TableDataRow} from 'app/utils/discover/discoverQuery'; +import withApi from 'app/utils/withApi'; type CustomGroup = Group & { eventID: string; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.tsx index 9ca85b753f7c16..e276b4dabe5c9a 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTagValues.tsx @@ -1,25 +1,25 @@ -import sortBy from 'lodash/sortBy'; -import property from 'lodash/property'; import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import property from 'lodash/property'; +import sortBy from 'lodash/sortBy'; -import {isUrl, percent} from 'app/utils'; -import {t} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; -import UserBadge from 'app/components/idBadge/userBadge'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import DataExport, {ExportQueryType} from 'app/components/dataExport'; import DeviceName from 'app/components/deviceName'; -import ExternalLink from 'app/components/links/externalLink'; -import GlobalSelectionLink from 'app/components/globalSelectionLink'; -import {IconMail, IconOpen} from 'app/icons'; import DetailedError from 'app/components/errors/detailedError'; +import GlobalSelectionLink from 'app/components/globalSelectionLink'; +import UserBadge from 'app/components/idBadge/userBadge'; +import ExternalLink from 'app/components/links/externalLink'; import Pagination from 'app/components/pagination'; import TimeSince from 'app/components/timeSince'; -import DataExport, {ExportQueryType} from 'app/components/dataExport'; +import {IconMail, IconOpen} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {Group, Tag, TagValue, Environment} from 'app/types'; +import {Environment, Group, Tag, TagValue} from 'app/types'; +import {isUrl, percent} from 'app/utils'; type RouteParams = { groupId: string; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx index 9d947aa2263a31..eff0233977c5f0 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupTags.jsx @@ -1,21 +1,21 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import isEqual from 'lodash/isEqual'; import styled from '@emotion/styled'; +import isEqual from 'lodash/isEqual'; +import PropTypes from 'prop-types'; -import SentryTypes from 'app/sentryTypes'; +import Alert from 'app/components/alert'; import Count from 'app/components/count'; import DeviceName from 'app/components/deviceName'; +import GlobalSelectionLink from 'app/components/globalSelectionLink'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import {percent} from 'app/utils'; -import {t, tct} from 'app/locale'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import Alert from 'app/components/alert'; -import withApi from 'app/utils/withApi'; -import space from 'app/styles/space'; -import GlobalSelectionLink from 'app/components/globalSelectionLink'; import Version from 'app/components/version'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; +import {percent} from 'app/utils'; +import withApi from 'app/utils/withApi'; class GroupTags extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.tsx index 00f547edcf6657..1a3fb9fcb234b7 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupUserFeedback.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import isEqual from 'lodash/isEqual'; import {RouteComponentProps} from 'react-router/lib/Router'; +import isEqual from 'lodash/isEqual'; -import {Group, Organization, Project, UserReport} from 'app/types'; import EventUserFeedback from 'app/components/events/userFeedback'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import {Panel} from 'app/components/panels'; import Pagination from 'app/components/pagination'; +import {Panel} from 'app/components/panels'; +import {Group, Organization, Project, UserReport} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; import UserFeedbackEmpty from 'app/views/userFeedback/userFeedbackEmpty'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx index abca4d3621889c..c18122130e3a84 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/header.jsx @@ -1,28 +1,28 @@ +import React from 'react'; import {Link} from 'react-router'; +import styled from '@emotion/styled'; import omit from 'lodash/omit'; import PropTypes from 'prop-types'; -import React from 'react'; -import styled from '@emotion/styled'; import {fetchOrgMembers} from 'app/actionCreators/members'; -import {t} from 'app/locale'; import AssigneeSelector from 'app/components/assigneeSelector'; +import GuideAnchor from 'app/components/assistant/guideAnchor'; +import Badge from 'app/components/badge'; import Count from 'app/components/count'; +import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; import EventAnnotation from 'app/components/events/eventAnnotation'; import EventMessage from 'app/components/events/eventMessage'; -import EventOrGroupTitle from 'app/components/eventOrGroupTitle'; -import GuideAnchor from 'app/components/assistant/guideAnchor'; +import ProjectBadge from 'app/components/idBadge/projectBadge'; import ListLink from 'app/components/links/listLink'; import NavTabs from 'app/components/navTabs'; -import ProjectBadge from 'app/components/idBadge/projectBadge'; import SeenByList from 'app/components/seenByList'; -import SentryTypes from 'app/sentryTypes'; import ShortId from 'app/components/shortId'; import Tooltip from 'app/components/tooltip'; -import Badge from 'app/components/badge'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; -import withApi from 'app/utils/withApi'; import {getMessage} from 'app/utils/events'; +import withApi from 'app/utils/withApi'; import GroupActions from './actions'; import UnhandledTag, {TagAndMessageWrapper} from './unhandledTag'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/index.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/index.tsx index f2bf0870b22fac..12d016969a3ac6 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/index.tsx @@ -1,10 +1,10 @@ -import * as ReactRouter from 'react-router'; import React from 'react'; +import * as ReactRouter from 'react-router'; +import {GlobalSelection, Organization} from 'app/types'; import {analytics, metric} from 'app/utils/analytics'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization, {isLightweightOrganization} from 'app/utils/withOrganization'; -import {GlobalSelection, Organization} from 'app/types'; import GroupDetails from './groupDetails'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/reprocessingForm.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/reprocessingForm.tsx index 9d3ba57546ace4..a6de6b04c3ddb4 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/reprocessingForm.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/reprocessingForm.tsx @@ -1,18 +1,18 @@ import React from 'react'; -import styled from '@emotion/styled'; import {browserHistory} from 'react-router'; +import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {Group, Organization} from 'app/types'; -import {t, tct} from 'app/locale'; import {ModalRenderProps} from 'app/actionCreators/modal'; +import Alert from 'app/components/alert'; import FeatureBadge from 'app/components/featureBadge'; +import ApiForm from 'app/components/forms/apiForm'; import NumberField from 'app/components/forms/numberField'; +import ExternalLink from 'app/components/links/externalLink'; import List from 'app/components/list'; import ListItem from 'app/components/list/listItem'; -import Alert from 'app/components/alert'; -import ApiForm from 'app/components/forms/apiForm'; -import ExternalLink from 'app/components/links/externalLink'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {Group, Organization} from 'app/types'; type Props = ModalRenderProps & { group: Group; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/subscribeAction.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/subscribeAction.tsx index 56d334c54c13e2..3f6d29154fc022 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/subscribeAction.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/subscribeAction.tsx @@ -1,12 +1,12 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Group} from 'app/types'; -import SentryTypes from 'app/sentryTypes'; +import Tooltip from 'app/components/tooltip'; import {IconBell} from 'app/icons'; import {t} from 'app/locale'; -import Tooltip from 'app/components/tooltip'; +import SentryTypes from 'app/sentryTypes'; +import {Group} from 'app/types'; import {getSubscriptionReason} from './utils'; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/unhandledTag.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/unhandledTag.tsx index 5292ee22900510..1c026c117ad490 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/unhandledTag.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/unhandledTag.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; -import Tag from 'app/components/tagDeprecated'; import Feature from 'app/components/acl/feature'; +import Tag from 'app/components/tagDeprecated'; import Tooltip from 'app/components/tooltip'; import {IconSubtract} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; const TagWrapper = styled('div')` margin-right: ${space(1)}; diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/utils.jsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/utils.jsx index a795e55d6a72b7..aad5645494180d 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/utils.jsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/utils.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {t, tct} from 'app/locale'; import {Client} from 'app/api'; +import {t, tct} from 'app/locale'; /** * Fetches group data and mark as seen diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx index 976c6d2c58cde0..65fdf9f3bc26ff 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/SplitInstallationIdModal.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import {addSuccessMessage} from 'app/actionCreators/indicator'; import Button from 'app/components/button'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; -import {addSuccessMessage} from 'app/actionCreators/indicator'; type Props = { installationId: string; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx index baba14b23009fc..a444399b8005ce 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx @@ -1,13 +1,14 @@ -import startCase from 'lodash/startCase'; import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import startCase from 'lodash/startCase'; import Access from 'app/components/acl/access'; import Alert, {Props as AlertProps} from 'app/components/alert'; import AsyncComponent from 'app/components/asyncComponent'; import ExternalLink from 'app/components/links/externalLink'; import {Panel} from 'app/components/panels'; +import Tag from 'app/components/tagDeprecated'; import Tooltip from 'app/components/tooltip'; import {IconClose, IconDocs, IconGeneric, IconGithub, IconProject} from 'app/icons'; import {t} from 'app/locale'; @@ -28,10 +29,9 @@ import { } from 'app/utils/integrationUtil'; import marked, {singleLineRenderer} from 'app/utils/marked'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import Tag from 'app/components/tagDeprecated'; -import IntegrationStatus from './integrationStatus'; import RequestIntegrationButton from './integrationRequest/RequestIntegrationButton'; +import IntegrationStatus from './integrationStatus'; type Tab = 'overview' | 'configurations'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.tsx index b80e0570bac468..35fde53b9b3505 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegration.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import * as queryString from 'query-string'; -import {IntegrationProvider, IntegrationWithConfig, Organization} from 'app/types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {IntegrationProvider, IntegrationWithConfig, Organization} from 'app/types'; import {trackIntegrationEvent} from 'app/utils/integrationUtil'; type Props = { diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegrationButton.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegrationButton.tsx index 8a390826caca9f..90ab3eb26acd9b 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegrationButton.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/addIntegrationButton.tsx @@ -3,7 +3,7 @@ import React from 'react'; import Button from 'app/components/button'; import Tooltip from 'app/components/tooltip'; import {t} from 'app/locale'; -import {IntegrationWithConfig, IntegrationProvider, Organization} from 'app/types'; +import {IntegrationProvider, IntegrationWithConfig, Organization} from 'app/types'; import AddIntegration from './addIntegration'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/installedIntegration.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/installedIntegration.tsx index 62ff9828a70a27..75d5567a8ab802 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/installedIntegration.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/installedIntegration.tsx @@ -10,7 +10,7 @@ import Tooltip from 'app/components/tooltip'; import {IconDelete, IconFlag, IconSettings, IconWarning} from 'app/icons'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import {IntegrationProvider, Integration, Organization, ObjectStatus} from 'app/types'; +import {Integration, IntegrationProvider, ObjectStatus, Organization} from 'app/types'; import {SingleIntegrationEvent} from 'app/utils/integrationUtil'; import theme from 'app/utils/theme'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/installedPlugin.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/installedPlugin.tsx index 37658e7e4a6125..45eeae2fd8e932 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/installedPlugin.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/installedPlugin.tsx @@ -1,24 +1,24 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import Access from 'app/components/acl/access'; -import Button from 'app/components/button'; -import Confirm from 'app/components/confirm'; -import Alert from 'app/components/alert'; -import {IconDelete, IconFlag, IconSettings} from 'app/icons'; -import ProjectBadge from 'app/components/idBadge/projectBadge'; -import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; import { addErrorMessage, - addSuccessMessage, addLoadingMessage, + addSuccessMessage, } from 'app/actionCreators/indicator'; -import {PluginNoProject, PluginProjectItem, Organization, AvatarProject} from 'app/types'; -import {SingleIntegrationEvent} from 'app/utils/integrationUtil'; -import space from 'app/styles/space'; +import {Client} from 'app/api'; +import Access from 'app/components/acl/access'; +import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import Confirm from 'app/components/confirm'; +import ProjectBadge from 'app/components/idBadge/projectBadge'; import Switch from 'app/components/switch'; +import {IconDelete, IconFlag, IconSettings} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {AvatarProject, Organization, PluginNoProject, PluginProjectItem} from 'app/types'; +import {SingleIntegrationEvent} from 'app/utils/integrationUtil'; +import withApi from 'app/utils/withApi'; export type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationAlertRules.jsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationAlertRules.jsx index 810509b779bcba..e1a249ce228619 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationAlertRules.jsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationAlertRules.jsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import {t} from 'app/locale'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import ProjectBadge from 'app/components/idBadge/projectBadge'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import withProjects from 'app/utils/withProjects'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; class IntegrationAlertRules extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationCodeMappings.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationCodeMappings.tsx index ad43268fc83b82..d76e9c1155e919 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationCodeMappings.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationCodeMappings.tsx @@ -1,30 +1,30 @@ import React from 'react'; -import styled from '@emotion/styled'; import Modal from 'react-bootstrap/lib/Modal'; +import styled from '@emotion/styled'; import sortBy from 'lodash/sortBy'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; -import {IconAdd} from 'app/icons'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import RepositoryProjectPathConfigForm from 'app/components/repositoryProjectPathConfigForm'; import RepositoryProjectPathConfigRow, { + ButtonColumn, + InputPathColumn, NameRepoColumn, OutputPathColumn, - InputPathColumn, - ButtonColumn, } from 'app/components/repositoryProjectPathConfigRow'; -import RepositoryProjectPathConfigForm from 'app/components/repositoryProjectPathConfigForm'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import space from 'app/styles/space'; +import {IconAdd} from 'app/icons'; import {t} from 'app/locale'; -import withOrganization from 'app/utils/withOrganization'; -import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import space from 'app/styles/space'; import { Integration, Organization, Repository, RepositoryProjectPathConfig, } from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = AsyncComponent['props'] & { integration: Integration; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationDetailedView.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationDetailedView.tsx index 6b7d77452271e7..ad565eab6f1a9d 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationDetailedView.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationDetailedView.tsx @@ -1,6 +1,6 @@ -import keyBy from 'lodash/keyBy'; import React from 'react'; import styled from '@emotion/styled'; +import keyBy from 'lodash/keyBy'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {RequestOptions} from 'app/api'; @@ -12,7 +12,7 @@ import {t} from 'app/locale'; import space from 'app/styles/space'; import {Integration, IntegrationProvider} from 'app/types'; import {sortArray} from 'app/utils'; -import {isSlackWorkspaceApp, getReauthAlertText} from 'app/utils/integrationUtil'; +import {getReauthAlertText, isSlackWorkspaceApp} from 'app/utils/integrationUtil'; import withOrganization from 'app/utils/withOrganization'; import AbstractIntegrationDetailedView from './abstractIntegrationDetailedView'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationIcon.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationIcon.tsx index 6f5960a59a84a2..b65e21cbc46c33 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationIcon.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationIcon.tsx @@ -2,7 +2,7 @@ import React from 'react'; import styled from '@emotion/styled'; import PropTypes from 'prop-types'; -import PluginIcon, {ICON_PATHS, DEFAULT_ICON} from 'app/plugins/components/pluginIcon'; +import PluginIcon, {DEFAULT_ICON, ICON_PATHS} from 'app/plugins/components/pluginIcon'; import {Integration} from 'app/types'; type Props = { diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationItem.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationItem.tsx index 468b9ea2c9d2b3..4a1bb6442d6168 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationItem.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationItem.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import IntegrationIcon from 'app/views/organizationIntegrations/integrationIcon'; import space from 'app/styles/space'; import {Integration} from 'app/types'; +import IntegrationIcon from 'app/views/organizationIntegrations/integrationIcon'; type DefaultProps = { compact: boolean; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx index b12c1a696bdb67..18490dbd1b4304 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationListDirectory.tsx @@ -1,3 +1,6 @@ +import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import debounce from 'lodash/debounce'; import flatten from 'lodash/flatten'; @@ -5,9 +8,6 @@ import groupBy from 'lodash/groupBy'; import startCase from 'lodash/startCase'; import uniq from 'lodash/uniq'; import * as queryString from 'query-string'; -import React from 'react'; -import {browserHistory} from 'react-router'; -import {RouteComponentProps} from 'react-router/lib/Router'; import Feature from 'app/components/acl/feature'; import AsyncComponent from 'app/components/asyncComponent'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx index 60b06ca1b2b4f5..1c8eb42038362a 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRepos.tsx @@ -1,24 +1,24 @@ -import PropTypes from 'prop-types'; -import debounce from 'lodash/debounce'; import React from 'react'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; +import PropTypes from 'prop-types'; -import {migrateRepository, addRepository} from 'app/actionCreators/integrations'; +import {addRepository, migrateRepository} from 'app/actionCreators/integrations'; import RepositoryActions from 'app/actions/repositoryActions'; import Alert from 'app/components/alert'; import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; -import {IconCommit, IconFlag} from 'app/icons'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; import Pagination from 'app/components/pagination'; -import RepositoryRow from 'app/components/repositoryRow'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import space from 'app/styles/space'; +import RepositoryRow from 'app/components/repositoryRow'; +import {IconCommit, IconFlag} from 'app/icons'; import {t} from 'app/locale'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {Integration, Repository} from 'app/types'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = AsyncComponent['props'] & { integration: Integration; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRequest/RequestIntegrationModal.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRequest/RequestIntegrationModal.tsx index 478285e2199667..08bddb734accfa 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRequest/RequestIntegrationModal.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRequest/RequestIntegrationModal.tsx @@ -5,9 +5,9 @@ import {ModalRenderProps} from 'app/actionCreators/modal'; import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; import {t} from 'app/locale'; +import {trackIntegrationEvent} from 'app/utils/integrationUtil'; import TextareaField from 'app/views/settings/components/forms/textareaField'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import {trackIntegrationEvent} from 'app/utils/integrationUtil'; import RequestIntegrationButton from './RequestIntegrationButton'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx index 2f2f266147834b..303abbd6faef8a 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationRow.tsx @@ -2,18 +2,18 @@ import React from 'react'; import styled from '@emotion/styled'; import startCase from 'lodash/startCase'; -import {IconWarning} from 'app/icons'; -import Button from 'app/components/button'; import Alert from 'app/components/alert'; +import Button from 'app/components/button'; import Link from 'app/components/links/link'; import {PanelItem} from 'app/components/panels'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; import PluginIcon from 'app/plugins/components/pluginIcon'; import space from 'app/styles/space'; -import {Organization, SentryApp, IntegrationInstallationStatus} from 'app/types'; -import {t} from 'app/locale'; +import {IntegrationInstallationStatus, Organization, SentryApp} from 'app/types'; import { - trackIntegrationEvent, convertIntegrationTypeToSnakeCase, + trackIntegrationEvent, } from 'app/utils/integrationUtil'; import IntegrationStatus from './integrationStatus'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationStatus.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationStatus.tsx index acddad69c9c5f6..8ab0f75cb34187 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/integrationStatus.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/integrationStatus.tsx @@ -2,10 +2,10 @@ import React from 'react'; import styled from '@emotion/styled'; import CircleIndicator from 'app/components/circleIndicator'; -import theme from 'app/utils/theme'; import {t} from 'app/locale'; import space from 'app/styles/space'; import {IntegrationInstallationStatus} from 'app/types'; +import theme from 'app/utils/theme'; import {COLORS} from './constants'; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.tsx index b038fd9b65dee8..e96f1d3d7099e4 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/migrationWarnings.tsx @@ -1,11 +1,11 @@ import React from 'react'; import groupBy from 'lodash/groupBy'; -import {tct} from 'app/locale'; -import AddIntegration from 'app/views/organizationIntegrations/addIntegration'; import AlertLink from 'app/components/alertLink'; import AsyncComponent from 'app/components/asyncComponent'; -import {IntegrationProvider, Integration, Repository} from 'app/types'; +import {tct} from 'app/locale'; +import {Integration, IntegrationProvider, Repository} from 'app/types'; +import AddIntegration from 'app/views/organizationIntegrations/addIntegration'; type Props = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/organizationIntegrations/pluginDetailedView.tsx b/src/sentry/static/sentry/app/views/organizationIntegrations/pluginDetailedView.tsx index 07ee76f0fec330..4909edc09b3a93 100644 --- a/src/sentry/static/sentry/app/views/organizationIntegrations/pluginDetailedView.tsx +++ b/src/sentry/static/sentry/app/views/organizationIntegrations/pluginDetailedView.tsx @@ -6,7 +6,7 @@ import Button from 'app/components/button'; import ContextPickerModal from 'app/components/contextPickerModal'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import {PluginWithProjectList, PluginProjectItem} from 'app/types'; +import {PluginProjectItem, PluginWithProjectList} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; import AbstractIntegrationDetailedView from './abstractIntegrationDetailedView'; diff --git a/src/sentry/static/sentry/app/views/organizationJoinRequest.tsx b/src/sentry/static/sentry/app/views/organizationJoinRequest.tsx index bcbe49ef92bffb..b0aedb2aed7f15 100644 --- a/src/sentry/static/sentry/app/views/organizationJoinRequest.tsx +++ b/src/sentry/static/sentry/app/views/organizationJoinRequest.tsx @@ -1,15 +1,15 @@ import React from 'react'; -import styled from '@emotion/styled'; import {Params} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import NarrowLayout from 'app/components/narrowLayout'; +import {IconMegaphone} from 'app/icons'; import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; import {trackAdhocEvent} from 'app/utils/analytics'; import EmailField from 'app/views/settings/components/forms/emailField'; import Form from 'app/views/settings/components/forms/form'; -import {IconMegaphone} from 'app/icons'; -import NarrowLayout from 'app/components/narrowLayout'; -import space from 'app/styles/space'; type Props = { params: Params; diff --git a/src/sentry/static/sentry/app/views/organizationRoot.tsx b/src/sentry/static/sentry/app/views/organizationRoot.tsx index 46c30c8a04cc8e..d81a14f8dcca35 100644 --- a/src/sentry/static/sentry/app/views/organizationRoot.tsx +++ b/src/sentry/static/sentry/app/views/organizationRoot.tsx @@ -1,8 +1,8 @@ -import {withRouter, RouteComponentProps} from 'react-router'; import React from 'react'; +import {RouteComponentProps, withRouter} from 'react-router'; -import {setActiveProject} from 'app/actionCreators/projects'; import {setLastRoute} from 'app/actionCreators/navigation'; +import {setActiveProject} from 'app/actionCreators/projects'; type Props = RouteComponentProps<{}, {}>; diff --git a/src/sentry/static/sentry/app/views/organizationStats/index.tsx b/src/sentry/static/sentry/app/views/organizationStats/index.tsx index 0543b349c41105..a7df83deefc6bb 100644 --- a/src/sentry/static/sentry/app/views/organizationStats/index.tsx +++ b/src/sentry/static/sentry/app/views/organizationStats/index.tsx @@ -1,17 +1,17 @@ import React from 'react'; -import {RouteComponentProps} from 'react-router/lib/Router'; import DocumentTitle from 'react-document-title'; +import {RouteComponentProps} from 'react-router/lib/Router'; import {Client} from 'app/api'; import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; -import withOrganization from 'app/utils/withOrganization'; -import {Series} from 'app/types/echarts'; import {Organization, Project, TimeseriesValue} from 'app/types'; +import {Series} from 'app/types/echarts'; import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; import OrganizationStatsDetails from './organizationStatsDetails'; -import {ProjectTotal, OrgTotal} from './types'; +import {OrgTotal, ProjectTotal} from './types'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/organizationStats/organizationStatsDetails.tsx b/src/sentry/static/sentry/app/views/organizationStats/organizationStatsDetails.tsx index 5fd1c860b7c711..64599d1495d123 100644 --- a/src/sentry/static/sentry/app/views/organizationStats/organizationStatsDetails.tsx +++ b/src/sentry/static/sentry/app/views/organizationStats/organizationStatsDetails.tsx @@ -1,24 +1,24 @@ import React from 'react'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import {t} from 'app/locale'; +import MiniBarChart from 'app/components/charts/miniBarChart'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; +import PageHeading from 'app/components/pageHeading'; import Pagination from 'app/components/pagination'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; +import {Organization, Project} from 'app/types'; +import {Series} from 'app/types/echarts'; +import PerformanceAlert from 'app/views/organizationStats/performanceAlert'; import ProjectTable from 'app/views/organizationStats/projectTable'; -import TextBlock from 'app/views/settings/components/text/textBlock'; -import PageHeading from 'app/components/pageHeading'; import { - ProjectTableLayout, ProjectTableDataElement, + ProjectTableLayout, } from 'app/views/organizationStats/projectTableLayout'; -import MiniBarChart from 'app/components/charts/miniBarChart'; -import {PageContent} from 'app/styles/organization'; -import PerformanceAlert from 'app/views/organizationStats/performanceAlert'; -import {Series} from 'app/types/echarts'; -import {Project, Organization} from 'app/types'; +import TextBlock from 'app/views/settings/components/text/textBlock'; -import {ProjectTotal, OrgTotal} from './types'; +import {OrgTotal, ProjectTotal} from './types'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/organizationStats/performanceAlert.tsx b/src/sentry/static/sentry/app/views/organizationStats/performanceAlert.tsx index 5a77019ad2203b..b10cce34bfad34 100644 --- a/src/sentry/static/sentry/app/views/organizationStats/performanceAlert.tsx +++ b/src/sentry/static/sentry/app/views/organizationStats/performanceAlert.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {t} from 'app/locale'; -import {IconInfo} from 'app/icons'; -import Alert from 'app/components/alert'; import Feature from 'app/components/acl/feature'; +import Alert from 'app/components/alert'; +import {IconInfo} from 'app/icons'; +import {t} from 'app/locale'; type Props = {message?: React.ReactNode}; diff --git a/src/sentry/static/sentry/app/views/organizationStats/projectTable.tsx b/src/sentry/static/sentry/app/views/organizationStats/projectTable.tsx index ed25fbec127cf8..748c6c8c124ded 100644 --- a/src/sentry/static/sentry/app/views/organizationStats/projectTable.tsx +++ b/src/sentry/static/sentry/app/views/organizationStats/projectTable.tsx @@ -2,14 +2,14 @@ import React from 'react'; import {Link} from 'react-router'; import styled from '@emotion/styled'; -import { - ProjectTableLayout, - ProjectTableDataElement, -} from 'app/views/organizationStats/projectTableLayout'; import Count from 'app/components/count'; -import {formatPercentage} from 'app/utils/formatters'; import space from 'app/styles/space'; import {Organization, Project} from 'app/types'; +import {formatPercentage} from 'app/utils/formatters'; +import { + ProjectTableDataElement, + ProjectTableLayout, +} from 'app/views/organizationStats/projectTableLayout'; import {ProjectTotal} from './types'; diff --git a/src/sentry/static/sentry/app/views/organizationStats/projectTableLayout.tsx b/src/sentry/static/sentry/app/views/organizationStats/projectTableLayout.tsx index 7448baf44e55f3..d9a3ad29b05758 100644 --- a/src/sentry/static/sentry/app/views/organizationStats/projectTableLayout.tsx +++ b/src/sentry/static/sentry/app/views/organizationStats/projectTableLayout.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; -import space from 'app/styles/space'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; export const ProjectTableLayout = styled('div')` display: grid; diff --git a/src/sentry/static/sentry/app/views/performance/breadcrumb.tsx b/src/sentry/static/sentry/app/views/performance/breadcrumb.tsx index c29cb464c1efa9..f84b54b1cf6ee0 100644 --- a/src/sentry/static/sentry/app/views/performance/breadcrumb.tsx +++ b/src/sentry/static/sentry/app/views/performance/breadcrumb.tsx @@ -1,14 +1,14 @@ import React from 'react'; import {Location, LocationDescriptor} from 'history'; +import Breadcrumbs, {Crumb} from 'app/components/breadcrumbs'; import {t} from 'app/locale'; import {Organization} from 'app/types'; -import Breadcrumbs, {Crumb} from 'app/components/breadcrumbs'; import {decodeScalar} from 'app/utils/queryString'; -import {getPerformanceLandingUrl} from './utils'; import {transactionSummaryRouteWithQuery} from './transactionSummary/utils'; import {vitalsRouteWithQuery} from './transactionVitals/utils'; +import {getPerformanceLandingUrl} from './utils'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/performance/charts/chart.tsx b/src/sentry/static/sentry/app/views/performance/charts/chart.tsx index 6bdeff8696bc6d..208a473e2ccec9 100644 --- a/src/sentry/static/sentry/app/views/performance/charts/chart.tsx +++ b/src/sentry/static/sentry/app/views/performance/charts/chart.tsx @@ -3,11 +3,11 @@ import * as ReactRouter from 'react-router'; import max from 'lodash/max'; import min from 'lodash/min'; -import {Series} from 'app/types/echarts'; import AreaChart from 'app/components/charts/areaChart'; import ChartZoom from 'app/components/charts/chartZoom'; +import {Series} from 'app/types/echarts'; +import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; import {aggregateOutputType} from 'app/utils/discover/fields'; -import {tooltipFormatter, axisLabelFormatter} from 'app/utils/discover/charts'; import theme from 'app/utils/theme'; type Props = { diff --git a/src/sentry/static/sentry/app/views/performance/charts/footer.tsx b/src/sentry/static/sentry/app/views/performance/charts/footer.tsx index fcb54ac6816214..af4312c1a6d1e1 100644 --- a/src/sentry/static/sentry/app/views/performance/charts/footer.tsx +++ b/src/sentry/static/sentry/app/views/performance/charts/footer.tsx @@ -1,19 +1,19 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {Location} from 'history'; import * as Sentry from '@sentry/react'; +import {Location} from 'history'; -import {Organization} from 'app/types'; -import {t} from 'app/locale'; +import {fetchTotalCount} from 'app/actionCreators/events'; import {Client} from 'app/api'; +import OptionSelector from 'app/components/charts/optionSelector'; import { ChartControls, InlineContainer, SectionHeading, SectionValue, } from 'app/components/charts/styles'; -import {fetchTotalCount} from 'app/actionCreators/events'; -import OptionSelector from 'app/components/charts/optionSelector'; +import {t} from 'app/locale'; +import {Organization} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView, {isAPIPayloadSimilar} from 'app/utils/discover/eventView'; diff --git a/src/sentry/static/sentry/app/views/performance/charts/index.tsx b/src/sentry/static/sentry/app/views/performance/charts/index.tsx index 6368d20a6c996f..423a4a82d1fc5a 100644 --- a/src/sentry/static/sentry/app/views/performance/charts/index.tsx +++ b/src/sentry/static/sentry/app/views/performance/charts/index.tsx @@ -1,23 +1,24 @@ import React from 'react'; -import {Location} from 'history'; import * as ReactRouter from 'react-router'; +import {Location} from 'history'; -import {Organization} from 'app/types'; import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; -import {getInterval} from 'app/components/charts/utils'; +import EventsRequest from 'app/components/charts/eventsRequest'; import LoadingPanel from 'app/components/charts/loadingPanel'; -import QuestionTooltip from 'app/components/questionTooltip'; -import getDynamicText from 'app/utils/getDynamicText'; +import {getInterval} from 'app/components/charts/utils'; import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import {Panel} from 'app/components/panels'; -import EventView from 'app/utils/discover/eventView'; -import EventsRequest from 'app/components/charts/eventsRequest'; -import {getUtcToLocalDateObject} from 'app/utils/dates'; +import QuestionTooltip from 'app/components/questionTooltip'; import {IconWarning} from 'app/icons'; +import {Organization} from 'app/types'; +import {getUtcToLocalDateObject} from 'app/utils/dates'; +import EventView from 'app/utils/discover/eventView'; +import getDynamicText from 'app/utils/getDynamicText'; +import withApi from 'app/utils/withApi'; import {getAxisOptions} from '../data'; -import {HeaderContainer, HeaderTitle, ErrorPanel} from '../styles'; +import {ErrorPanel, HeaderContainer, HeaderTitle} from '../styles'; + import Chart from './chart'; import Footer from './footer'; diff --git a/src/sentry/static/sentry/app/views/performance/compare/content.tsx b/src/sentry/static/sentry/app/views/performance/compare/content.tsx index 19c997dc04de09..d68d0aad0e4f23 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/content.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/content.tsx @@ -1,19 +1,20 @@ import React from 'react'; -import styled from '@emotion/styled'; import {Params} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; import {Location} from 'history'; +import * as Layout from 'app/components/layouts/thirds'; +import {Panel} from 'app/components/panels'; import {t} from 'app/locale'; import {Event, Organization} from 'app/types'; -import {Panel} from 'app/components/panels'; -import * as Layout from 'app/components/layouts/thirds'; -import Breadcrumb from 'app/views/performance/breadcrumb'; import {decodeScalar} from 'app/utils/queryString'; +import Breadcrumb from 'app/views/performance/breadcrumb'; + +import {FilterViews} from '../landing'; import TraceView from './traceView'; import TransactionSummary from './transactionSummary'; import {isTransactionEvent} from './utils'; -import {FilterViews} from '../landing'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/performance/compare/fetchEvent.tsx b/src/sentry/static/sentry/app/views/performance/compare/fetchEvent.tsx index 0546d3817fb0a6..a436d67ddec4e5 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/fetchEvent.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/fetchEvent.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; import {Event} from 'app/types'; +import withApi from 'app/utils/withApi'; export type ChildrenProps = { isLoading: boolean; diff --git a/src/sentry/static/sentry/app/views/performance/compare/index.tsx b/src/sentry/static/sentry/app/views/performance/compare/index.tsx index 81e0b8a86c6805..6d9b16512c4744 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/index.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/index.tsx @@ -1,21 +1,21 @@ import React from 'react'; import {Params} from 'react-router/lib/Router'; -import {Location} from 'history'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import {Location} from 'history'; -import {t} from 'app/locale'; -import withOrganization from 'app/utils/withOrganization'; -import {Organization} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import NotFound from 'app/components/errors/notFound'; -import LoadingIndicator from 'app/components/loadingIndicator'; +import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; import LoadingError from 'app/components/loadingError'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; +import {Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; -import FetchEvent, {ChildrenProps} from './fetchEvent'; import TransactionComparisonContent from './content'; +import FetchEvent, {ChildrenProps} from './fetchEvent'; type ComparedEventSlugs = { baselineEventSlug: string | undefined; diff --git a/src/sentry/static/sentry/app/views/performance/compare/spanBar.tsx b/src/sentry/static/sentry/app/views/performance/compare/spanBar.tsx index bc8f45b60be2cb..f4793123ad22ab 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/spanBar.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/spanBar.tsx @@ -1,53 +1,53 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import theme from 'app/utils/theme'; -import space from 'app/styles/space'; import Count from 'app/components/count'; -import {TreeDepthType} from 'app/components/events/interfaces/spans/types'; -import { - SPAN_ROW_HEIGHT, - SPAN_ROW_PADDING, - SpanRow, - getHatchPattern, -} from 'app/components/events/interfaces/spans/styles'; +import * as DividerHandlerManager from 'app/components/events/interfaces/spans/dividerHandlerManager'; import { - TOGGLE_BORDER_BOX, - SpanRowCellContainer, - SpanRowCell, - SpanBarTitleContainer, - SpanBarTitle, - OperationName, - StyledIconChevron, - SpanTreeTogglerContainer, ConnectorBar, - SpanTreeConnector, - SpanTreeToggler, DividerLine, DividerLineGhostContainer, getBackgroundColor, + OperationName, + SpanBarTitle, + SpanBarTitleContainer, + SpanRowCell, + SpanRowCellContainer, + SpanTreeConnector, + SpanTreeToggler, + SpanTreeTogglerContainer, + StyledIconChevron, + TOGGLE_BORDER_BOX, } from 'app/components/events/interfaces/spans/spanBar'; import { + getHatchPattern, + SPAN_ROW_HEIGHT, + SPAN_ROW_PADDING, + SpanRow, +} from 'app/components/events/interfaces/spans/styles'; +import {TreeDepthType} from 'app/components/events/interfaces/spans/types'; +import { + getHumanDuration, + isOrphanTreeDepth, toPercent, unwrapTreeDepth, - isOrphanTreeDepth, - getHumanDuration, } from 'app/components/events/interfaces/spans/utils'; -import * as DividerHandlerManager from 'app/components/events/interfaces/spans/dividerHandlerManager'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import theme from 'app/utils/theme'; +import SpanDetail from './spanDetail'; +import {SpanBarRectangle} from './styles'; import { DiffSpanType, + generateCSSWidth, + getSpanDescription, + getSpanDuration, getSpanID, getSpanOperation, - getSpanDescription, isOrphanDiffSpan, SpanGeneratedBoundsType, - getSpanDuration, - generateCSSWidth, } from './utils'; -import {SpanBarRectangle} from './styles'; -import SpanDetail from './spanDetail'; type Props = { span: Readonly<DiffSpanType>; diff --git a/src/sentry/static/sentry/app/views/performance/compare/spanDetail.tsx b/src/sentry/static/sentry/app/views/performance/compare/spanDetail.tsx index 668f6fbf9f7149..e02921a8de2fa3 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/spanDetail.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/spanDetail.tsx @@ -1,26 +1,26 @@ import React from 'react'; import styled from '@emotion/styled'; -import theme from 'app/utils/theme'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; -import getDynamicText from 'app/utils/getDynamicText'; import DateTime from 'app/components/dateTime'; -import Pill from 'app/components/pill'; -import Pills from 'app/components/pills'; import {SpanDetailContainer} from 'app/components/events/interfaces/spans/spanDetail'; -import {SpanType, rawSpanKeys} from 'app/components/events/interfaces/spans/types'; +import {rawSpanKeys, SpanType} from 'app/components/events/interfaces/spans/types'; import {getHumanDuration} from 'app/components/events/interfaces/spans/utils'; +import Pill from 'app/components/pill'; +import Pills from 'app/components/pills'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import getDynamicText from 'app/utils/getDynamicText'; +import theme from 'app/utils/theme'; +import SpanDetailContent from './spanDetailContent'; +import {SpanBarRectangle} from './styles'; import { DiffSpanType, - SpanGeneratedBoundsType, generateCSSWidth, - SpanWidths, getSpanDuration, + SpanGeneratedBoundsType, + SpanWidths, } from './utils'; -import {SpanBarRectangle} from './styles'; -import SpanDetailContent from './spanDetailContent'; type DurationDisplay = 'right' | 'inset'; diff --git a/src/sentry/static/sentry/app/views/performance/compare/spanDetailContent.tsx b/src/sentry/static/sentry/app/views/performance/compare/spanDetailContent.tsx index 3bf9d94d750fa5..7335e1530dd8e4 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/spanDetailContent.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/spanDetailContent.tsx @@ -1,11 +1,11 @@ import React from 'react'; import map from 'lodash/map'; +import DateTime from 'app/components/dateTime'; +import {Row, SpanDetails, Tags} from 'app/components/events/interfaces/spans/spanDetail'; +import {rawSpanKeys, SpanType} from 'app/components/events/interfaces/spans/types'; import {t} from 'app/locale'; import getDynamicText from 'app/utils/getDynamicText'; -import DateTime from 'app/components/dateTime'; -import {SpanType, rawSpanKeys} from 'app/components/events/interfaces/spans/types'; -import {SpanDetails, Row, Tags} from 'app/components/events/interfaces/spans/spanDetail'; type Props = { span: Readonly<SpanType>; diff --git a/src/sentry/static/sentry/app/views/performance/compare/spanGroup.tsx b/src/sentry/static/sentry/app/views/performance/compare/spanGroup.tsx index c6d45bd492f634..2dc64d1520575e 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/spanGroup.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/spanGroup.tsx @@ -2,8 +2,8 @@ import React from 'react'; import {TreeDepthType} from 'app/components/events/interfaces/spans/types'; -import {DiffSpanType, SpanGeneratedBoundsType} from './utils'; import SpanBar from './spanBar'; +import {DiffSpanType, SpanGeneratedBoundsType} from './utils'; type Props = { span: Readonly<DiffSpanType>; diff --git a/src/sentry/static/sentry/app/views/performance/compare/spanTree.tsx b/src/sentry/static/sentry/app/views/performance/compare/spanTree.tsx index d2cbcd834a8b31..886dc9405a4bec 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/spanTree.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/spanTree.tsx @@ -1,23 +1,23 @@ import React from 'react'; import styled from '@emotion/styled'; -import {SentryTransactionEvent} from 'app/types'; +import * as DividerHandlerManager from 'app/components/events/interfaces/spans/dividerHandlerManager'; import { - TreeDepthType, OrphanTreeDepth, + TreeDepthType, } from 'app/components/events/interfaces/spans/types'; -import * as DividerHandlerManager from 'app/components/events/interfaces/spans/dividerHandlerManager'; +import {SentryTransactionEvent} from 'app/types'; +import SpanGroup from './spanGroup'; import { - diffTransactions, + boundsGenerator, DiffSpanType, - SpanChildrenLookupType, + diffTransactions, getSpanID, - boundsGenerator, - SpanGeneratedBoundsType, isOrphanDiffSpan, + SpanChildrenLookupType, + SpanGeneratedBoundsType, } from './utils'; -import SpanGroup from './spanGroup'; type RenderedSpanTree = { spanTree: JSX.Element | null; diff --git a/src/sentry/static/sentry/app/views/performance/compare/traceView.tsx b/src/sentry/static/sentry/app/views/performance/compare/traceView.tsx index 8c7b9b2ed456de..fcee5e374c9ad6 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/traceView.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/traceView.tsx @@ -1,13 +1,13 @@ import React from 'react'; +import {getTraceContext} from 'app/components/events/interfaces/spans/utils'; +import {IconWarning} from 'app/icons'; import {t} from 'app/locale'; import {Event} from 'app/types'; -import {IconWarning} from 'app/icons'; -import {getTraceContext} from 'app/components/events/interfaces/spans/utils'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {isTransactionEvent} from './utils'; import SpanTree from './spanTree'; +import {isTransactionEvent} from './utils'; type Props = { baselineEvent: Event; diff --git a/src/sentry/static/sentry/app/views/performance/compare/transactionSummary.tsx b/src/sentry/static/sentry/app/views/performance/compare/transactionSummary.tsx index 28d444ece17628..c82c6acbe670b6 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/transactionSummary.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/transactionSummary.tsx @@ -1,15 +1,16 @@ import React from 'react'; +import {Params} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import {Location} from 'history'; -import {Params} from 'react-router/lib/Router'; +import {getHumanDuration, parseTrace} from 'app/components/events/interfaces/spans/utils'; +import Link from 'app/components/links/link'; import {t} from 'app/locale'; import space from 'app/styles/space'; import {Event, Organization} from 'app/types'; -import Link from 'app/components/links/link'; -import {getHumanDuration, parseTrace} from 'app/components/events/interfaces/spans/utils'; import {getTransactionDetailsUrl} from '../utils'; + import {isTransactionEvent} from './utils'; type Props = { diff --git a/src/sentry/static/sentry/app/views/performance/compare/utils.tsx b/src/sentry/static/sentry/app/views/performance/compare/utils.tsx index d6963b5ecc8104..02f019f52d4dea 100644 --- a/src/sentry/static/sentry/app/views/performance/compare/utils.tsx +++ b/src/sentry/static/sentry/app/views/performance/compare/utils.tsx @@ -1,13 +1,13 @@ import jaro from 'wink-jaro-distance'; -import {SentryTransactionEvent} from 'app/types'; import {RawSpanType, SpanType} from 'app/components/events/interfaces/spans/types'; import { - parseTrace, generateRootSpan, isOrphanSpan, + parseTrace, toPercent, } from 'app/components/events/interfaces/spans/utils'; +import {SentryTransactionEvent} from 'app/types'; // Minimum threshold score for descriptions that are similar. const COMMON_SIMILARITY_DESCRIPTION_THRESHOLD = 0.8; diff --git a/src/sentry/static/sentry/app/views/performance/data.tsx b/src/sentry/static/sentry/app/views/performance/data.tsx index d61c469ef76d49..ec5a6af2bd2dbb 100644 --- a/src/sentry/static/sentry/app/views/performance/data.tsx +++ b/src/sentry/static/sentry/app/views/performance/data.tsx @@ -1,10 +1,10 @@ import {Location} from 'history'; import {t} from 'app/locale'; -import {NewQuery, LightWeightOrganization, SelectValue} from 'app/types'; +import {LightWeightOrganization, NewQuery, SelectValue} from 'app/types'; import EventView from 'app/utils/discover/eventView'; import {decodeScalar} from 'app/utils/queryString'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; export const DEFAULT_STATS_PERIOD = '24h'; diff --git a/src/sentry/static/sentry/app/views/performance/index.tsx b/src/sentry/static/sentry/app/views/performance/index.tsx index 9d8818c4b1cb4f..5bbba6fdf3836e 100644 --- a/src/sentry/static/sentry/app/views/performance/index.tsx +++ b/src/sentry/static/sentry/app/views/performance/index.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import {t} from 'app/locale'; -import {Organization} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import SentryTypes from 'app/sentryTypes'; import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {PageContent} from 'app/styles/organization'; +import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; type Props = { diff --git a/src/sentry/static/sentry/app/views/performance/landing.tsx b/src/sentry/static/sentry/app/views/performance/landing.tsx index 079f0f2c9a6056..ef67ffed02d08c 100644 --- a/src/sentry/static/sentry/app/views/performance/landing.tsx +++ b/src/sentry/static/sentry/app/views/performance/landing.tsx @@ -1,51 +1,51 @@ import React from 'react'; -import {Location} from 'history'; import {browserHistory, InjectedRouter} from 'react-router'; import styled from '@emotion/styled'; +import {Location} from 'history'; import isEqual from 'lodash/isEqual'; -import {Client} from 'app/api'; -import {t} from 'app/locale'; -import {GlobalSelection, Organization, Project} from 'app/types'; -import {loadOrganizationTags} from 'app/actionCreators/tags'; import {updateDateTime} from 'app/actionCreators/globalSelection'; -import SearchBar from 'app/views/events/searchBar'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; -import {PageContent} from 'app/styles/organization'; -import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import {loadOrganizationTags} from 'app/actionCreators/tags'; +import {Client} from 'app/api'; import Alert from 'app/components/alert'; -import FeatureBadge from 'app/components/featureBadge'; -import EventView from 'app/utils/discover/eventView'; -import {generateAggregateFields} from 'app/utils/discover/fields'; -import space from 'app/styles/space'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import FeatureBadge from 'app/components/featureBadge'; +import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; import {IconFlag} from 'app/icons'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; +import space from 'app/styles/space'; +import {GlobalSelection, Organization, Project} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; +import EventView from 'app/utils/discover/eventView'; +import {generateAggregateFields} from 'app/utils/discover/fields'; +import {decodeScalar} from 'app/utils/queryString'; +import { + QueryResults, + stringifyQueryObject, + tokenizeSearch, +} from 'app/utils/tokenizeSearch'; import withApi from 'app/utils/withApi'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization from 'app/utils/withOrganization'; import withProjects from 'app/utils/withProjects'; -import { - tokenizeSearch, - stringifyQueryObject, - QueryResults, -} from 'app/utils/tokenizeSearch'; -import {decodeScalar} from 'app/utils/queryString'; +import SearchBar from 'app/views/events/searchBar'; -import {generatePerformanceEventView, DEFAULT_STATS_PERIOD} from './data'; -import Table from './table'; import Charts from './charts/index'; -import Onboarding from './onboarding'; -import {addRoutePerformanceContext, getTransactionSearchQuery} from './utils'; import TrendsContent from './trends/content'; import { - modifyTrendsViewDefaultPeriod, - DEFAULT_TRENDS_STATS_PERIOD, DEFAULT_MAX_DURATION, + DEFAULT_TRENDS_STATS_PERIOD, + modifyTrendsViewDefaultPeriod, } from './trends/utils'; +import {DEFAULT_STATS_PERIOD, generatePerformanceEventView} from './data'; +import Onboarding from './onboarding'; +import Table from './table'; +import {addRoutePerformanceContext, getTransactionSearchQuery} from './utils'; export enum FilterViews { ALL_TRANSACTIONS = 'ALL_TRANSACTIONS', diff --git a/src/sentry/static/sentry/app/views/performance/onboarding.tsx b/src/sentry/static/sentry/app/views/performance/onboarding.tsx index da27157f7de60f..0537238b5600fa 100644 --- a/src/sentry/static/sentry/app/views/performance/onboarding.tsx +++ b/src/sentry/static/sentry/app/views/performance/onboarding.tsx @@ -1,23 +1,23 @@ import React from 'react'; import styled from '@emotion/styled'; -import OnboardingPanel from 'app/components/onboardingPanel'; +import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import FeatureTourModal, { + TourImage, TourStep, TourText, - TourImage, } from 'app/components/modals/featureTourModal'; -import Button from 'app/components/button'; -import ButtonBar from 'app/components/buttonBar'; +import OnboardingPanel from 'app/components/onboardingPanel'; import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; import {Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import emptyStateImg from '../../../images/spot/performance-empty-state.svg'; -import tourMetrics from '../../../images/spot/performance-tour-metrics.svg'; +import tourAlert from '../../../images/spot/performance-tour-alert.svg'; import tourCorrelate from '../../../images/spot/performance-tour-correlate.svg'; +import tourMetrics from '../../../images/spot/performance-tour-metrics.svg'; import tourTrace from '../../../images/spot/performance-tour-trace.svg'; -import tourAlert from '../../../images/spot/performance-tour-alert.svg'; const performanceSetupUrl = 'https://docs.sentry.io/performance-monitoring/getting-started/'; diff --git a/src/sentry/static/sentry/app/views/performance/table.tsx b/src/sentry/static/sentry/app/views/performance/table.tsx index 9cbce48d9f71bd..2394b2f4f153bb 100644 --- a/src/sentry/static/sentry/app/views/performance/table.tsx +++ b/src/sentry/static/sentry/app/views/performance/table.tsx @@ -1,21 +1,21 @@ import React from 'react'; -import {Location, LocationDescriptorObject} from 'history'; import * as ReactRouter from 'react-router'; +import {Location, LocationDescriptorObject} from 'history'; -import {IconStar} from 'app/icons'; -import {Organization, Project} from 'app/types'; -import Pagination from 'app/components/pagination'; -import Link from 'app/components/links/link'; -import EventView, {EventData, isFieldSortable} from 'app/utils/discover/eventView'; -import {TableColumn} from 'app/views/eventsV2/table/types'; import GridEditable, {COL_WIDTH_UNDEFINED, GridColumn} from 'app/components/gridEditable'; import SortLink from 'app/components/gridEditable/sortLink'; -import HeaderCell from 'app/views/eventsV2/table/headerCell'; -import CellAction, {Actions, updateQuery} from 'app/views/eventsV2/table/cellAction'; +import Link from 'app/components/links/link'; +import Pagination from 'app/components/pagination'; +import {IconStar} from 'app/icons'; +import {Organization, Project} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {getFieldRenderer} from 'app/utils/discover/fieldRenderers'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; import DiscoverQuery, {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; +import EventView, {EventData, isFieldSortable} from 'app/utils/discover/eventView'; +import {getFieldRenderer} from 'app/utils/discover/fieldRenderers'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; +import CellAction, {Actions, updateQuery} from 'app/views/eventsV2/table/cellAction'; +import HeaderCell from 'app/views/eventsV2/table/headerCell'; +import {TableColumn} from 'app/views/eventsV2/table/types'; import {transactionSummaryRouteWithQuery} from './transactionSummary/utils'; import {COLUMN_TITLES} from './data'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionDetails/content.tsx b/src/sentry/static/sentry/app/views/performance/transactionDetails/content.tsx index 8a327bb3cb703a..93595c96718d2d 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionDetails/content.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionDetails/content.tsx @@ -3,26 +3,26 @@ import {Params} from 'react-router/lib/Router'; import {Location} from 'history'; import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {Organization, Event, EventTag} from 'app/types'; -import SentryTypes from 'app/sentryTypes'; -import EventMetadata from 'app/components/events/eventMetadata'; -import {BorderlessEventEntries} from 'app/components/events/eventEntries'; -import * as SpanEntryContext from 'app/components/events/interfaces/spans/context'; +import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; -import LoadingError from 'app/components/loadingError'; import NotFound from 'app/components/errors/notFound'; -import AsyncComponent from 'app/components/asyncComponent'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import RootSpanStatus from 'app/components/events/rootSpanStatus'; +import {BorderlessEventEntries} from 'app/components/events/eventEntries'; +import EventMetadata from 'app/components/events/eventMetadata'; +import * as SpanEntryContext from 'app/components/events/interfaces/spans/context'; import OpsBreakdown from 'app/components/events/opsBreakdown'; import RealUserMonitoring from 'app/components/events/realUserMonitoring'; +import RootSpanStatus from 'app/components/events/rootSpanStatus'; +import * as Layout from 'app/components/layouts/thirds'; +import LoadingError from 'app/components/loadingError'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import TagsTable from 'app/components/tagsTable'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {Event, EventTag, Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import Projects from 'app/utils/projects'; -import * as Layout from 'app/components/layouts/thirds'; +import {appendTagCondition, decodeScalar} from 'app/utils/queryString'; import Breadcrumb from 'app/views/performance/breadcrumb'; -import {decodeScalar, appendTagCondition} from 'app/utils/queryString'; import {transactionSummaryRouteWithQuery} from '../transactionSummary/utils'; import {getTransactionDetailsUrl} from '../utils'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionDetails/index.tsx b/src/sentry/static/sentry/app/views/performance/transactionDetails/index.tsx index 3463b0e4169576..6d6a695adb2202 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionDetails/index.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionDetails/index.tsx @@ -1,15 +1,15 @@ -import {Params} from 'react-router/lib/Router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {Params} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import {Location} from 'history'; +import PropTypes from 'prop-types'; -import {Organization} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {t} from 'app/locale'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {PageContent} from 'app/styles/organization'; +import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; import EventDetailsContent from './content'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/baselineQuery.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/baselineQuery.tsx index e3712341943165..0d9033d259e93a 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/baselineQuery.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/baselineQuery.tsx @@ -2,8 +2,8 @@ import React from 'react'; import isEqual from 'lodash/isEqual'; import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; import EventView from 'app/utils/discover/eventView'; +import withApi from 'app/utils/withApi'; export type BaselineQueryResults = { 'transaction.duration': number; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/charts.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/charts.tsx index d294d224f0d026..877288f9281e38 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/charts.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/charts.tsx @@ -2,28 +2,29 @@ import React from 'react'; import {browserHistory} from 'react-router'; import {Location} from 'history'; -import {OrganizationSummary, SelectValue} from 'app/types'; -import {t} from 'app/locale'; -import {Panel} from 'app/components/panels'; -import EventView from 'app/utils/discover/eventView'; +import OptionSelector from 'app/components/charts/optionSelector'; import { ChartControls, InlineContainer, SectionHeading, SectionValue, } from 'app/components/charts/styles'; +import {Panel} from 'app/components/panels'; +import {t} from 'app/locale'; +import {OrganizationSummary, SelectValue} from 'app/types'; +import EventView from 'app/utils/discover/eventView'; import {decodeScalar} from 'app/utils/queryString'; -import OptionSelector from 'app/components/charts/optionSelector'; import {YAxis} from 'app/views/releases/detail/overview/chart/releaseChartControls'; import {ChartContainer} from '../styles'; +import {TrendFunctionField} from '../trends/types'; +import {TRENDS_FUNCTIONS} from '../trends/utils'; + import DurationChart from './durationChart'; +import DurationPercentileChart from './durationPercentileChart'; import LatencyChart from './latencyChart'; import TrendChart from './trendChart'; import VitalsChart from './vitalsChart'; -import DurationPercentileChart from './durationPercentileChart'; -import {TrendFunctionField} from '../trends/types'; -import {TRENDS_FUNCTIONS} from '../trends/utils'; export enum DisplayModes { DURATION_PERCENTILE = 'durationpercentile', diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/content.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/content.tsx index 958a5f5b399604..d5ad18ffd68b11 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/content.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/content.tsx @@ -1,33 +1,33 @@ import React from 'react'; -import {Location} from 'history'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import {Location} from 'history'; import omit from 'lodash/omit'; -import {Organization, Project} from 'app/types'; +import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; +import * as Layout from 'app/components/layouts/thirds'; import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; import {generateQueryWithTag} from 'app/utils'; import EventView from 'app/utils/discover/eventView'; import {getAggregateAlias} from 'app/utils/discover/fields'; -import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; -import * as Layout from 'app/components/layouts/thirds'; -import Tags from 'app/views/eventsV2/tags'; -import SearchBar from 'app/views/events/searchBar'; import {decodeScalar} from 'app/utils/queryString'; import withProjects from 'app/utils/withProjects'; +import SearchBar from 'app/views/events/searchBar'; +import Tags from 'app/views/eventsV2/tags'; import { PERCENTILE as VITAL_PERCENTILE, VITAL_GROUPS, } from 'app/views/performance/transactionVitals/constants'; -import TransactionHeader, {Tab} from './header'; -import TransactionList from './transactionList'; -import UserStats from './userStats'; import TransactionSummaryCharts from './charts'; +import TransactionHeader, {Tab} from './header'; import RelatedIssues from './relatedIssues'; import SidebarCharts from './sidebarCharts'; import StatusBreakdown from './statusBreakdown'; +import TransactionList from './transactionList'; +import UserStats from './userStats'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/durationChart.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/durationChart.tsx index fe5343e6cbccf2..984e0a71f63436 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/durationChart.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/durationChart.tsx @@ -3,26 +3,26 @@ import {browserHistory} from 'react-router'; import * as ReactRouter from 'react-router'; import {Location} from 'history'; -import {OrganizationSummary} from 'app/types'; import {Client} from 'app/api'; -import {t} from 'app/locale'; import AreaChart from 'app/components/charts/areaChart'; import ChartZoom from 'app/components/charts/chartZoom'; import ErrorPanel from 'app/components/charts/errorPanel'; -import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; -import TransitionChart from 'app/components/charts/transitionChart'; import EventsRequest from 'app/components/charts/eventsRequest'; import ReleaseSeries from 'app/components/charts/releaseSeries'; -import QuestionTooltip from 'app/components/questionTooltip'; +import TransitionChart from 'app/components/charts/transitionChart'; +import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; import {getInterval, getSeriesSelection} from 'app/components/charts/utils'; +import QuestionTooltip from 'app/components/questionTooltip'; import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import {OrganizationSummary} from 'app/types'; import {getUtcToLocalDateObject} from 'app/utils/dates'; +import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; import EventView from 'app/utils/discover/eventView'; -import withApi from 'app/utils/withApi'; +import getDynamicText from 'app/utils/getDynamicText'; import {decodeScalar} from 'app/utils/queryString'; import theme from 'app/utils/theme'; -import {tooltipFormatter, axisLabelFormatter} from 'app/utils/discover/charts'; -import getDynamicText from 'app/utils/getDynamicText'; +import withApi from 'app/utils/withApi'; import {HeaderTitleLegend} from '../styles'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/durationPercentileChart.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/durationPercentileChart.tsx index be0c7448216421..3aee4cf91a49f0 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/durationPercentileChart.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/durationPercentileChart.tsx @@ -3,18 +3,18 @@ import {Location} from 'history'; import isEqual from 'lodash/isEqual'; import pick from 'lodash/pick'; -import {IconWarning} from 'app/icons'; -import {t} from 'app/locale'; +import AsyncComponent from 'app/components/asyncComponent'; import AreaChart from 'app/components/charts/areaChart'; import ErrorPanel from 'app/components/charts/errorPanel'; import LoadingPanel from 'app/components/charts/loadingPanel'; import QuestionTooltip from 'app/components/questionTooltip'; -import AsyncComponent from 'app/components/asyncComponent'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; import {OrganizationSummary} from 'app/types'; -import EventView from 'app/utils/discover/eventView'; import {axisLabelFormatter} from 'app/utils/discover/charts'; -import theme from 'app/utils/theme'; +import EventView from 'app/utils/discover/eventView'; import {getDuration} from 'app/utils/formatters'; +import theme from 'app/utils/theme'; import {HeaderTitleLegend} from '../styles'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/header.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/header.tsx index d62f731b80e644..7c173c4b47790b 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/header.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/header.tsx @@ -1,24 +1,25 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; -import {Organization, Project} from 'app/types'; -import EventView from 'app/utils/discover/eventView'; import Feature from 'app/components/acl/feature'; -import FeatureBadge from 'app/components/featureBadge'; +import ButtonBar from 'app/components/buttonBar'; import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; +import FeatureBadge from 'app/components/featureBadge'; import * as Layout from 'app/components/layouts/thirds'; -import ButtonBar from 'app/components/buttonBar'; import ListLink from 'app/components/links/listLink'; import NavTabs from 'app/components/navTabs'; import {t} from 'app/locale'; +import {Organization, Project} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import Breadcrumb from 'app/views/performance/breadcrumb'; +import EventView from 'app/utils/discover/eventView'; import {decodeScalar} from 'app/utils/queryString'; +import Breadcrumb from 'app/views/performance/breadcrumb'; + +import {vitalsRouteWithQuery} from '../transactionVitals/utils'; import KeyTransactionButton from './keyTransactionButton'; import {transactionSummaryRouteWithQuery} from './utils'; -import {vitalsRouteWithQuery} from '../transactionVitals/utils'; export enum Tab { TransactionSummary, diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx index 21d9c90a320b44..088c48cd2e31e9 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/index.tsx @@ -1,40 +1,41 @@ import React from 'react'; -import {Params} from 'react-router/lib/Router'; import {browserHistory} from 'react-router'; -import {Location} from 'history'; +import {Params} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import {Location} from 'history'; import isEqual from 'lodash/isEqual'; -import {Client} from 'app/api'; -import {t} from 'app/locale'; import {loadOrganizationTags} from 'app/actionCreators/tags'; -import {Organization, Project, GlobalSelection} from 'app/types'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {Client} from 'app/api'; +import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import LoadingIndicator from 'app/components/loadingIndicator'; import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {t} from 'app/locale'; import {PageContent} from 'app/styles/organization'; +import {GlobalSelection, Organization, Project} from 'app/types'; +import DiscoverQuery from 'app/utils/discover/discoverQuery'; import EventView from 'app/utils/discover/eventView'; import { Column, - WebVital, getAggregateAlias, isAggregateField, + WebVital, } from 'app/utils/discover/fields'; import {decodeScalar} from 'app/utils/queryString'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; -import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import DiscoverQuery from 'app/utils/discover/discoverQuery'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; import withApi from 'app/utils/withApi'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization from 'app/utils/withOrganization'; import withProjects from 'app/utils/withProjects'; -import SummaryContent from './content'; -import {addRoutePerformanceContext, getTransactionName} from '../utils'; import { PERCENTILE as VITAL_PERCENTILE, VITAL_GROUPS, } from '../transactionVitals/constants'; +import {addRoutePerformanceContext, getTransactionName} from '../utils'; + +import SummaryContent from './content'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/keyTransactionButton.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/keyTransactionButton.tsx index 3a4434c1c0122d..8cf46130921442 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/keyTransactionButton.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/keyTransactionButton.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import withApi from 'app/utils/withApi'; +import {toggleKeyTransaction} from 'app/actionCreators/performance'; import {Client} from 'app/api'; import Button from 'app/components/button'; import {IconStar} from 'app/icons'; import {t} from 'app/locale'; -import EventView from 'app/utils/discover/eventView'; import {Organization} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {toggleKeyTransaction} from 'app/actionCreators/performance'; +import EventView from 'app/utils/discover/eventView'; +import withApi from 'app/utils/withApi'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/latencyChart.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/latencyChart.tsx index 038cb8cc616183..114e83284a4246 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/latencyChart.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/latencyChart.tsx @@ -3,19 +3,19 @@ import {Location} from 'history'; import isEqual from 'lodash/isEqual'; import pick from 'lodash/pick'; -import {IconWarning} from 'app/icons'; -import {t} from 'app/locale'; +import AsyncComponent from 'app/components/asyncComponent'; import BarChart from 'app/components/charts/barChart'; +import BarChartZoom from 'app/components/charts/barChartZoom'; import ErrorPanel from 'app/components/charts/errorPanel'; import LoadingPanel from 'app/components/charts/loadingPanel'; import QuestionTooltip from 'app/components/questionTooltip'; -import AsyncComponent from 'app/components/asyncComponent'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; import {OrganizationSummary} from 'app/types'; -import EventView from 'app/utils/discover/eventView'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import theme from 'app/utils/theme'; +import EventView from 'app/utils/discover/eventView'; import {getDuration} from 'app/utils/formatters'; -import BarChartZoom from 'app/components/charts/barChartZoom'; +import theme from 'app/utils/theme'; import {HeaderTitleLegend} from '../styles'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/relatedIssues.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/relatedIssues.tsx index 128ab3af3d8ad7..73740593d141a5 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/relatedIssues.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/relatedIssues.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; import pick from 'lodash/pick'; -import {t, tct} from 'app/locale'; -import {DEFAULT_RELATIVE_PERIODS} from 'app/constants'; -import {URL_PARAM} from 'app/constants/globalSelectionHeader'; -import {SectionHeading} from 'app/components/charts/styles'; import Button from 'app/components/button'; +import {SectionHeading} from 'app/components/charts/styles'; import EmptyStateWarning from 'app/components/emptyStateWarning'; +import GroupList from 'app/components/issues/groupList'; import {Panel, PanelBody} from 'app/components/panels'; +import {DEFAULT_RELATIVE_PERIODS} from 'app/constants'; +import {URL_PARAM} from 'app/constants/globalSelectionHeader'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; import {OrganizationSummary} from 'app/types'; -import GroupList from 'app/components/issues/groupList'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import {stringifyQueryObject, QueryResults} from 'app/utils/tokenizeSearch'; +import {QueryResults, stringifyQueryObject} from 'app/utils/tokenizeSearch'; type Props = { organization: OrganizationSummary; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/sidebarCharts.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/sidebarCharts.tsx index 2cd60d9817a710..d6f8f4345c693c 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/sidebarCharts.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/sidebarCharts.tsx @@ -4,31 +4,31 @@ import styled from '@emotion/styled'; import {Location} from 'history'; import {Client} from 'app/api'; -import {t} from 'app/locale'; -import {LightWeightOrganization} from 'app/types'; -import EventView from 'app/utils/discover/eventView'; import ChartZoom from 'app/components/charts/chartZoom'; -import LineChart from 'app/components/charts/lineChart'; import ErrorPanel from 'app/components/charts/errorPanel'; import EventsRequest from 'app/components/charts/eventsRequest'; -import QuestionTooltip from 'app/components/questionTooltip'; +import LineChart from 'app/components/charts/lineChart'; import {SectionHeading} from 'app/components/charts/styles'; -import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; import TransitionChart from 'app/components/charts/transitionChart'; +import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; import {getInterval} from 'app/components/charts/utils'; +import QuestionTooltip from 'app/components/questionTooltip'; import {IconWarning} from 'app/icons'; -import {getTermHelp} from 'app/views/performance/data'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {LightWeightOrganization} from 'app/types'; import {getUtcToLocalDateObject} from 'app/utils/dates'; +import {tooltipFormatter} from 'app/utils/discover/charts'; +import EventView from 'app/utils/discover/eventView'; import { formatAbbreviatedNumber, formatFloat, formatPercentage, } from 'app/utils/formatters'; -import {tooltipFormatter} from 'app/utils/discover/charts'; import {decodeScalar} from 'app/utils/queryString'; import theme from 'app/utils/theme'; -import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; +import {getTermHelp} from 'app/views/performance/data'; type Props = ReactRouter.WithRouterProps & { api: Client; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/statusBreakdown.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/statusBreakdown.tsx index fe715d424549e8..c3e58ffa7dc796 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/statusBreakdown.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/statusBreakdown.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; -import {t} from 'app/locale'; -import {LightWeightOrganization} from 'app/types'; import BreakdownBars from 'app/components/charts/breakdownBars'; +import ErrorPanel from 'app/components/charts/errorPanel'; import {SectionHeading} from 'app/components/charts/styles'; -import Placeholder from 'app/components/placeholder'; import EmptyStateWarning from 'app/components/emptyStateWarning'; -import ErrorPanel from 'app/components/charts/errorPanel'; -import {IconWarning} from 'app/icons'; +import Placeholder from 'app/components/placeholder'; import QuestionTooltip from 'app/components/questionTooltip'; -import EventView from 'app/utils/discover/eventView'; +import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {LightWeightOrganization} from 'app/types'; import DiscoverQuery from 'app/utils/discover/discoverQuery'; +import EventView from 'app/utils/discover/eventView'; import {getTermHelp} from 'app/views/performance/data'; -import space from 'app/styles/space'; type Props = { organization: LightWeightOrganization; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/transactionList.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/transactionList.tsx index 7546a16d287a6a..4a4cee8900af80 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/transactionList.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/transactionList.tsx @@ -1,34 +1,35 @@ import React from 'react'; -import {Location, Query} from 'history'; -import styled from '@emotion/styled'; import {browserHistory} from 'react-router'; +import styled from '@emotion/styled'; +import {Location, Query} from 'history'; -import {Organization} from 'app/types'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; import DiscoverButton from 'app/components/discoverButton'; import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; -import PanelTable from 'app/components/panels/panelTable'; +import SortLink from 'app/components/gridEditable/sortLink'; import Link from 'app/components/links/link'; import LoadingIndicator from 'app/components/loadingIndicator'; import Pagination from 'app/components/pagination'; +import PanelTable from 'app/components/panels/panelTable'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; -import CellAction, {Actions, updateQuery} from 'app/views/eventsV2/table/cellAction'; -import {TableColumn} from 'app/views/eventsV2/table/types'; -import HeaderCell from 'app/views/eventsV2/table/headerCell'; +import space from 'app/styles/space'; +import {Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import DiscoverQuery, {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; import EventView, {MetaType} from 'app/utils/discover/eventView'; -import SortLink from 'app/components/gridEditable/sortLink'; import {getFieldRenderer} from 'app/utils/discover/fieldRenderers'; import {getAggregateAlias, Sort} from 'app/utils/discover/fields'; import {generateEventSlug} from 'app/utils/discover/urls'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; import {getDuration} from 'app/utils/formatters'; import {decodeScalar} from 'app/utils/queryString'; -import DiscoverQuery, {TableData, TableDataRow} from 'app/utils/discover/discoverQuery'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; +import CellAction, {Actions, updateQuery} from 'app/views/eventsV2/table/cellAction'; +import HeaderCell from 'app/views/eventsV2/table/headerCell'; +import {TableColumn} from 'app/views/eventsV2/table/types'; import {GridCell, GridCellNumber} from '../styles'; -import {getTransactionDetailsUrl, getTransactionComparisonUrl} from '../utils'; +import {getTransactionComparisonUrl, getTransactionDetailsUrl} from '../utils'; + import BaselineQuery, {BaselineQueryResults} from './baselineQuery'; const TOP_TRANSACTION_LIMIT = 5; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/trendChart.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/trendChart.tsx index 705551e71c6953..c3a18a107e590d 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/trendChart.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/trendChart.tsx @@ -3,26 +3,26 @@ import * as ReactRouter from 'react-router'; import {browserHistory} from 'react-router'; import {Location} from 'history'; -import {OrganizationSummary} from 'app/types'; import {Client} from 'app/api'; -import {t} from 'app/locale'; -import LineChart from 'app/components/charts/lineChart'; import ChartZoom from 'app/components/charts/chartZoom'; import ErrorPanel from 'app/components/charts/errorPanel'; -import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; -import TransitionChart from 'app/components/charts/transitionChart'; import EventsRequest from 'app/components/charts/eventsRequest'; +import LineChart from 'app/components/charts/lineChart'; import ReleaseSeries from 'app/components/charts/releaseSeries'; -import QuestionTooltip from 'app/components/questionTooltip'; +import TransitionChart from 'app/components/charts/transitionChart'; +import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; import {getInterval, getSeriesSelection} from 'app/components/charts/utils'; +import QuestionTooltip from 'app/components/questionTooltip'; import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import {OrganizationSummary} from 'app/types'; import {getUtcToLocalDateObject} from 'app/utils/dates'; +import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; import EventView from 'app/utils/discover/eventView'; -import withApi from 'app/utils/withApi'; +import getDynamicText from 'app/utils/getDynamicText'; import {decodeScalar} from 'app/utils/queryString'; import theme from 'app/utils/theme'; -import {tooltipFormatter, axisLabelFormatter} from 'app/utils/discover/charts'; -import getDynamicText from 'app/utils/getDynamicText'; +import withApi from 'app/utils/withApi'; import {HeaderTitleLegend} from '../styles'; import {transformEventStatsSmoothed} from '../trends/utils'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/userStats.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/userStats.tsx index 1bea4362e74e43..72228389a0f9a8 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/userStats.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/userStats.tsx @@ -1,24 +1,24 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; +import {SectionHeading} from 'app/components/charts/styles'; import Link from 'app/components/links/link'; import QuestionTooltip from 'app/components/questionTooltip'; -import {SectionHeading} from 'app/components/charts/styles'; import UserMisery from 'app/components/userMisery'; import {t} from 'app/locale'; -import {Organization} from 'app/types'; import space from 'app/styles/space'; +import {Organization} from 'app/types'; import {getFieldRenderer} from 'app/utils/discover/fieldRenderers'; import {getAggregateAlias} from 'app/utils/discover/fields'; import {decodeScalar} from 'app/utils/queryString'; import {getTermHelp} from 'app/views/performance/data'; -import {vitalsRouteWithQuery} from 'app/views/performance/transactionVitals/utils'; import { PERCENTILE as VITAL_PERCENTILE, VITAL_GROUPS, WEB_VITAL_DETAILS, } from 'app/views/performance/transactionVitals/constants'; +import {vitalsRouteWithQuery} from 'app/views/performance/transactionVitals/utils'; type Props = { totals: Record<string, number>; diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/utils.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/utils.tsx index 8ee04b32052b23..8cf0f9027149e7 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/utils.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/utils.tsx @@ -1,6 +1,7 @@ import {Query} from 'history'; import {TrendFunctionField} from '../trends/types'; + import {DisplayModes} from './charts'; export function generateTransactionSummaryRoute({orgSlug}: {orgSlug: String}): string { diff --git a/src/sentry/static/sentry/app/views/performance/transactionSummary/vitalsChart.tsx b/src/sentry/static/sentry/app/views/performance/transactionSummary/vitalsChart.tsx index 6a39a59a755587..133dbf565f7137 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionSummary/vitalsChart.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionSummary/vitalsChart.tsx @@ -3,27 +3,27 @@ import {browserHistory} from 'react-router'; import * as ReactRouter from 'react-router'; import {Location} from 'history'; -import {OrganizationSummary} from 'app/types'; import {Client} from 'app/api'; -import {t} from 'app/locale'; -import LineChart from 'app/components/charts/lineChart'; import ChartZoom from 'app/components/charts/chartZoom'; import ErrorPanel from 'app/components/charts/errorPanel'; -import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; -import TransitionChart from 'app/components/charts/transitionChart'; import EventsRequest from 'app/components/charts/eventsRequest'; +import LineChart from 'app/components/charts/lineChart'; import ReleaseSeries from 'app/components/charts/releaseSeries'; -import QuestionTooltip from 'app/components/questionTooltip'; +import TransitionChart from 'app/components/charts/transitionChart'; +import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; import {getInterval, getSeriesSelection} from 'app/components/charts/utils'; +import QuestionTooltip from 'app/components/questionTooltip'; import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; +import {OrganizationSummary} from 'app/types'; import {getUtcToLocalDateObject} from 'app/utils/dates'; +import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; import EventView from 'app/utils/discover/eventView'; -import {getMeasurementSlug, getAggregateArg} from 'app/utils/discover/fields'; -import withApi from 'app/utils/withApi'; +import {getAggregateArg, getMeasurementSlug} from 'app/utils/discover/fields'; +import getDynamicText from 'app/utils/getDynamicText'; import {decodeScalar} from 'app/utils/queryString'; import theme from 'app/utils/theme'; -import {tooltipFormatter, axisLabelFormatter} from 'app/utils/discover/charts'; -import getDynamicText from 'app/utils/getDynamicText'; +import withApi from 'app/utils/withApi'; import {HeaderTitleLegend} from '../styles'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionVitals/constants.tsx b/src/sentry/static/sentry/app/views/performance/transactionVitals/constants.tsx index 80225e052a8278..9a61b49edffb8d 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionVitals/constants.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionVitals/constants.tsx @@ -1,6 +1,6 @@ import {t} from 'app/locale'; -import {WebVital, measurementType} from 'app/utils/discover/fields'; import {SelectValue} from 'app/types'; +import {measurementType, WebVital} from 'app/utils/discover/fields'; import theme from 'app/utils/theme'; import {Vital, VitalGroup} from './types'; diff --git a/src/sentry/static/sentry/app/views/performance/transactionVitals/content.tsx b/src/sentry/static/sentry/app/views/performance/transactionVitals/content.tsx index f1f43594f8e3f9..88fd05989609a4 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionVitals/content.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionVitals/content.tsx @@ -1,24 +1,25 @@ import React from 'react'; -import {Location} from 'history'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import {Location} from 'history'; import Button from 'app/components/button'; import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; +import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import * as Layout from 'app/components/layouts/thirds'; import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; import {t} from 'app/locale'; import space from 'app/styles/space'; import {Organization, Project} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView from 'app/utils/discover/eventView'; import {decodeScalar} from 'app/utils/queryString'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; import SearchBar from 'app/views/events/searchBar'; -import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; -import VitalsPanel from './vitalsPanel'; import TransactionHeader, {Tab} from '../transactionSummary/header'; + import {FILTER_OPTIONS, ZOOM_KEYS} from './constants'; +import VitalsPanel from './vitalsPanel'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/views/performance/transactionVitals/index.tsx b/src/sentry/static/sentry/app/views/performance/transactionVitals/index.tsx index 6e07d264942a01..aff0c276eef174 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionVitals/index.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionVitals/index.tsx @@ -1,28 +1,29 @@ import React from 'react'; -import {Location} from 'history'; import {browserHistory, WithRouterProps} from 'react-router'; import styled from '@emotion/styled'; +import {Location} from 'history'; -import Alert from 'app/components/alert'; import Feature from 'app/components/acl/feature'; +import Alert from 'app/components/alert'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import {t} from 'app/locale'; import {PageContent} from 'app/styles/organization'; -import {Organization, Project, GlobalSelection} from 'app/types'; +import {GlobalSelection, Organization, Project} from 'app/types'; import EventView from 'app/utils/discover/eventView'; -import {WebVital, isAggregateField} from 'app/utils/discover/fields'; +import {isAggregateField, WebVital} from 'app/utils/discover/fields'; import {decodeScalar} from 'app/utils/queryString'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; import withGlobalSelection from 'app/utils/withGlobalSelection'; import withOrganization from 'app/utils/withOrganization'; import withProjects from 'app/utils/withProjects'; -import {PERCENTILE, WEB_VITAL_DETAILS, VITAL_GROUPS} from './constants'; -import RumContent from './content'; import {getTransactionName} from '../utils'; +import {PERCENTILE, VITAL_GROUPS, WEB_VITAL_DETAILS} from './constants'; +import RumContent from './content'; + type Props = { location: Location; organization: Organization; diff --git a/src/sentry/static/sentry/app/views/performance/transactionVitals/utils.tsx b/src/sentry/static/sentry/app/views/performance/transactionVitals/utils.tsx index 8a0f3b481a52e5..c4d3d082ed7c53 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionVitals/utils.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionVitals/utils.tsx @@ -1,7 +1,7 @@ -import {Query} from 'history'; import {ECharts} from 'echarts'; +import {Query} from 'history'; -import {HistogramData, Rectangle, Point} from './types'; +import {HistogramData, Point, Rectangle} from './types'; export function generateVitalsRoute({orgSlug}: {orgSlug: String}): string { return `/organizations/${orgSlug}/performance/summary/vitals/`; diff --git a/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx b/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx index 3ff0c669ac927e..969633a26d987e 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalCard.tsx @@ -1,20 +1,21 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; -import throttle from 'lodash/throttle'; +import {Location} from 'history'; import isEqual from 'lodash/isEqual'; +import throttle from 'lodash/throttle'; -import {Organization} from 'app/types'; import BarChart from 'app/components/charts/barChart'; import BarChartZoom from 'app/components/charts/barChartZoom'; import MarkLine from 'app/components/charts/components/markLine'; import MarkPoint from 'app/components/charts/components/markPoint'; import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; -import Tag from 'app/components/tagDeprecated'; import DiscoverButton from 'app/components/discoverButton'; +import Tag from 'app/components/tagDeprecated'; import {FIRE_SVG_PATH} from 'app/icons/iconFire'; import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import EventView from 'app/utils/discover/eventView'; import {getAggregateAlias} from 'app/utils/discover/fields'; import { @@ -23,14 +24,13 @@ import { formatPercentage, getDuration, } from 'app/utils/formatters'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; import theme from 'app/utils/theme'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; import {NUM_BUCKETS, PERCENTILE} from './constants'; -import {Card, CardSummary, CardSectionHeading, StatNumber, Description} from './styles'; -import {HistogramData, Vital, Rectangle} from './types'; -import {findNearestBucketIndex, getRefRect, asPixelRect, mapPoint} from './utils'; +import {Card, CardSectionHeading, CardSummary, Description, StatNumber} from './styles'; +import {HistogramData, Rectangle, Vital} from './types'; +import {asPixelRect, findNearestBucketIndex, getRefRect, mapPoint} from './utils'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalsPanel.tsx b/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalsPanel.tsx index 4e4498aaa0d25a..1faacfd69ac380 100644 --- a/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalsPanel.tsx +++ b/src/sentry/static/sentry/app/views/performance/transactionVitals/vitalsPanel.tsx @@ -5,14 +5,14 @@ import {Panel} from 'app/components/panels'; import {Organization} from 'app/types'; import DiscoverQuery, {TableData} from 'app/utils/discover/discoverQuery'; import EventView from 'app/utils/discover/eventView'; -import {WebVital, getAggregateAlias} from 'app/utils/discover/fields'; -import {decodeScalar} from 'app/utils/queryString'; +import {getAggregateAlias, WebVital} from 'app/utils/discover/fields'; import {GenericChildrenProps} from 'app/utils/discover/genericDiscoverQuery'; +import {decodeScalar} from 'app/utils/queryString'; -import {NUM_BUCKETS, PERCENTILE, WEB_VITAL_DETAILS, VITAL_GROUPS} from './constants'; +import {NUM_BUCKETS, PERCENTILE, VITAL_GROUPS, WEB_VITAL_DETAILS} from './constants'; +import MeasurementsHistogramQuery from './measurementsHistogramQuery'; import {HistogramData, VitalGroup} from './types'; import VitalCard from './vitalCard'; -import MeasurementsHistogramQuery from './measurementsHistogramQuery'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/performance/trends/changedTransactions.tsx b/src/sentry/static/sentry/app/views/performance/trends/changedTransactions.tsx index 3fc27e783646f9..7793e9c134375b 100644 --- a/src/sentry/static/sentry/app/views/performance/trends/changedTransactions.tsx +++ b/src/sentry/static/sentry/app/views/performance/trends/changedTransactions.tsx @@ -1,61 +1,62 @@ import React from 'react'; -import {Location, Query} from 'history'; -import styled from '@emotion/styled'; import {browserHistory} from 'react-router'; +import styled from '@emotion/styled'; +import {Location, Query} from 'history'; -import {Panel} from 'app/components/panels'; -import Pagination from 'app/components/pagination'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import withOrganization from 'app/utils/withOrganization'; -import {Organization, Project, AvatarProject} from 'app/types'; -import {decodeScalar} from 'app/utils/queryString'; -import space from 'app/styles/space'; -import {RadioLineItem} from 'app/views/settings/components/forms/controls/radioGroup'; -import Link from 'app/components/links/link'; +import {Client} from 'app/api'; +import ProjectAvatar from 'app/components/avatar/projectAvatar'; import Button from 'app/components/button'; -import Radio from 'app/components/radio'; -import Tooltip from 'app/components/tooltip'; import Count from 'app/components/count'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; -import {formatPercentage, getDuration} from 'app/utils/formatters'; +import DropdownLink from 'app/components/dropdownLink'; import EmptyStateWarning from 'app/components/emptyStateWarning'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import withProjects from 'app/utils/withProjects'; -import {IconEllipsis} from 'app/icons'; +import Link from 'app/components/links/link'; +import LoadingIndicator from 'app/components/loadingIndicator'; import MenuItem from 'app/components/menuItem'; -import DropdownLink from 'app/components/dropdownLink'; -import ProjectAvatar from 'app/components/avatar/projectAvatar'; -import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; +import Pagination from 'app/components/pagination'; +import {Panel} from 'app/components/panels'; import QuestionTooltip from 'app/components/questionTooltip'; +import Radio from 'app/components/radio'; +import Tooltip from 'app/components/tooltip'; +import {IconEllipsis} from 'app/icons'; +import {t} from 'app/locale'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; +import {AvatarProject, Organization, Project} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import {formatPercentage, getDuration} from 'app/utils/formatters'; +import {decodeScalar} from 'app/utils/queryString'; import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; +import withProjects from 'app/utils/withProjects'; +import {RadioLineItem} from 'app/views/settings/components/forms/controls/radioGroup'; + +import {HeaderTitleLegend} from '../styles'; +import {DisplayModes} from '../transactionSummary/charts'; +import {transactionSummaryRouteWithQuery} from '../transactionSummary/utils'; -import TrendsDiscoverQuery from './trendsDiscoverQuery'; import Chart from './chart'; +import TrendsDiscoverQuery from './trendsDiscoverQuery'; import { - TrendChangeType, - TrendView, NormalizedTrendsTransaction, + TrendChangeType, TrendFunctionField, TrendsStats, + TrendView, } from './types'; import { - trendToColor, - transformValueDelta, - transformDeltaSpread, + getCurrentConfidenceLevel, + getCurrentTrendFunction, + getSelectedQueryKey, + getTrendProjectId, modifyTrendView, normalizeTrends, - getSelectedQueryKey, - getCurrentTrendFunction, - getCurrentConfidenceLevel, StyledIconArrow, - getTrendProjectId, + transformDeltaSpread, + transformValueDelta, trendCursorNames, + trendToColor, } from './utils'; -import {transactionSummaryRouteWithQuery} from '../transactionSummary/utils'; -import {HeaderTitleLegend} from '../styles'; -import {DisplayModes} from '../transactionSummary/charts'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/performance/trends/chart.tsx b/src/sentry/static/sentry/app/views/performance/trends/chart.tsx index 1cea6104f17d18..fef64922e0a39a 100644 --- a/src/sentry/static/sentry/app/views/performance/trends/chart.tsx +++ b/src/sentry/static/sentry/app/views/performance/trends/chart.tsx @@ -1,32 +1,32 @@ import React from 'react'; -import {withRouter, browserHistory} from 'react-router'; +import {browserHistory, withRouter} from 'react-router'; import {WithRouterProps} from 'react-router/lib/withRouter'; -import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; -import TransitionChart from 'app/components/charts/transitionChart'; -import ReleaseSeries from 'app/components/charts/releaseSeries'; -import getDynamicText from 'app/utils/getDynamicText'; -import {getUtcToLocalDateObject} from 'app/utils/dates'; -import {decodeList, decodeScalar} from 'app/utils/queryString'; -import withApi from 'app/utils/withApi'; import {Client} from 'app/api'; -import EventView from 'app/utils/discover/eventView'; -import {OrganizationSummary, EventsStatsData, Project} from 'app/types'; -import LineChart from 'app/components/charts/lineChart'; import ChartZoom from 'app/components/charts/chartZoom'; +import LineChart from 'app/components/charts/lineChart'; +import ReleaseSeries from 'app/components/charts/releaseSeries'; +import TransitionChart from 'app/components/charts/transitionChart'; +import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; +import {EventsStatsData, OrganizationSummary, Project} from 'app/types'; import {Series} from 'app/types/echarts'; -import theme from 'app/utils/theme'; +import {getUtcToLocalDateObject} from 'app/utils/dates'; import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; +import EventView from 'app/utils/discover/eventView'; +import getDynamicText from 'app/utils/getDynamicText'; +import {decodeList, decodeScalar} from 'app/utils/queryString'; +import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; import {YAxis} from 'app/views/releases/detail/overview/chart/releaseChartControls'; +import {NormalizedTrendsTransaction, TrendChangeType, TrendsStats} from './types'; import { getCurrentTrendFunction, getIntervalRatio, - transformEventStatsSmoothed, getUnselectedSeries, + transformEventStatsSmoothed, trendToColor, } from './utils'; -import {TrendChangeType, TrendsStats, NormalizedTrendsTransaction} from './types'; const QUERY_KEYS = [ 'environment', diff --git a/src/sentry/static/sentry/app/views/performance/trends/content.tsx b/src/sentry/static/sentry/app/views/performance/trends/content.tsx index 4b764541b53d58..fb0378b23ae721 100644 --- a/src/sentry/static/sentry/app/views/performance/trends/content.tsx +++ b/src/sentry/static/sentry/app/views/performance/trends/content.tsx @@ -1,33 +1,34 @@ import React from 'react'; -import {Location} from 'history'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import {Location} from 'history'; -import {GlobalSelection, Organization} from 'app/types'; -import EventView from 'app/utils/discover/eventView'; -import {generateAggregateFields} from 'app/utils/discover/fields'; import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import SearchBar from 'app/views/events/searchBar'; import space from 'app/styles/space'; -import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; +import {GlobalSelection, Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import EventView from 'app/utils/discover/eventView'; +import {generateAggregateFields} from 'app/utils/discover/fields'; import {decodeScalar} from 'app/utils/queryString'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; import withGlobalSelection from 'app/utils/withGlobalSelection'; +import SearchBar from 'app/views/events/searchBar'; +import {FilterViews} from '../landing'; import {getTransactionSearchQuery} from '../utils'; -import {TrendChangeType, TrendView, TrendFunctionField} from './types'; + +import ChangedTransactions from './changedTransactions'; +import {TrendChangeType, TrendFunctionField, TrendView} from './types'; import { - DEFAULT_MAX_DURATION, - TRENDS_FUNCTIONS, CONFIDENCE_LEVELS, - resetCursors, - getCurrentTrendFunction, + DEFAULT_MAX_DURATION, getCurrentConfidenceLevel, + getCurrentTrendFunction, getSelectedQueryKey, + resetCursors, + TRENDS_FUNCTIONS, } from './utils'; -import ChangedTransactions from './changedTransactions'; -import {FilterViews} from '../landing'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/performance/trends/trendsDiscoverQuery.tsx b/src/sentry/static/sentry/app/views/performance/trends/trendsDiscoverQuery.tsx index 020f643108fedc..d7cb5efc123656 100644 --- a/src/sentry/static/sentry/app/views/performance/trends/trendsDiscoverQuery.tsx +++ b/src/sentry/static/sentry/app/views/performance/trends/trendsDiscoverQuery.tsx @@ -1,5 +1,9 @@ import React from 'react'; +import GenericDiscoverQuery, { + DiscoverQueryProps, + GenericChildrenProps, +} from 'app/utils/discover/genericDiscoverQuery'; import withApi from 'app/utils/withApi'; import { TrendChangeType, @@ -9,10 +13,6 @@ import { TrendView, } from 'app/views/performance/trends/types'; import {getCurrentTrendFunction} from 'app/views/performance/trends/utils'; -import GenericDiscoverQuery, { - DiscoverQueryProps, - GenericChildrenProps, -} from 'app/utils/discover/genericDiscoverQuery'; export type TrendsRequest = { trendChangeType?: TrendChangeType; diff --git a/src/sentry/static/sentry/app/views/performance/trends/types.ts b/src/sentry/static/sentry/app/views/performance/trends/types.ts index 2e073ceefdb72d..c93fea517decd1 100644 --- a/src/sentry/static/sentry/app/views/performance/trends/types.ts +++ b/src/sentry/static/sentry/app/views/performance/trends/types.ts @@ -1,8 +1,8 @@ import moment from 'moment'; -import EventView, {LocationQuery} from 'app/utils/discover/eventView'; -import {EventsStatsData} from 'app/types'; import {EventQuery} from 'app/actionCreators/events'; +import {EventsStatsData} from 'app/types'; +import EventView, {LocationQuery} from 'app/utils/discover/eventView'; export type TrendView = EventView & { orderby?: string; diff --git a/src/sentry/static/sentry/app/views/performance/trends/utils.tsx b/src/sentry/static/sentry/app/views/performance/trends/utils.tsx index aadc0fcab876f0..682a4e9b5800f7 100644 --- a/src/sentry/static/sentry/app/views/performance/trends/utils.tsx +++ b/src/sentry/static/sentry/app/views/performance/trends/utils.tsx @@ -1,30 +1,30 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; -import moment from 'moment'; import {ASAP} from 'downsample/methods/ASAP'; +import {Location} from 'history'; +import moment from 'moment'; -import theme from 'app/utils/theme'; import {getInterval} from 'app/components/charts/utils'; -import {decodeScalar} from 'app/utils/queryString'; -import {tokenizeSearch} from 'app/utils/tokenizeSearch'; import Duration from 'app/components/duration'; -import {Sort, Field} from 'app/utils/discover/fields'; +import {IconArrow} from 'app/icons'; import {t} from 'app/locale'; import space from 'app/styles/space'; import {Project} from 'app/types'; -import EventView from 'app/utils/discover/eventView'; -import {IconArrow} from 'app/icons'; import {Series, SeriesDataUnit} from 'app/types/echarts'; +import EventView from 'app/utils/discover/eventView'; +import {Field, Sort} from 'app/utils/discover/fields'; +import {decodeScalar} from 'app/utils/queryString'; +import theme from 'app/utils/theme'; +import {tokenizeSearch} from 'app/utils/tokenizeSearch'; import { - TrendFunction, ConfidenceLevel, - TrendChangeType, - TrendView, - TrendsTransaction, NormalizedTrendsTransaction, + TrendChangeType, + TrendFunction, TrendFunctionField, + TrendsTransaction, + TrendView, } from './types'; export const DEFAULT_TRENDS_STATS_PERIOD = '14d'; diff --git a/src/sentry/static/sentry/app/views/performance/utils.tsx b/src/sentry/static/sentry/app/views/performance/utils.tsx index a293d45b51bb7f..8a0d5a6d032e3d 100644 --- a/src/sentry/static/sentry/app/views/performance/utils.tsx +++ b/src/sentry/static/sentry/app/views/performance/utils.tsx @@ -1,9 +1,9 @@ import {Location, LocationDescriptor, Query} from 'history'; -import {OrganizationSummary, GlobalSelection} from 'app/types'; -import {decodeScalar} from 'app/utils/queryString'; -import getCurrentSentryReactTransaction from 'app/utils/getCurrentSentryReactTransaction'; +import {GlobalSelection, OrganizationSummary} from 'app/types'; import {statsPeriodToDays} from 'app/utils/dates'; +import getCurrentSentryReactTransaction from 'app/utils/getCurrentSentryReactTransaction'; +import {decodeScalar} from 'app/utils/queryString'; export function getPerformanceLandingUrl(organization: OrganizationSummary): string { return `/organizations/${organization.slug}/performance/`; diff --git a/src/sentry/static/sentry/app/views/permissionDenied.tsx b/src/sentry/static/sentry/app/views/permissionDenied.tsx index cc1f33cfeb8a45..d469e864550f05 100644 --- a/src/sentry/static/sentry/app/views/permissionDenied.tsx +++ b/src/sentry/static/sentry/app/views/permissionDenied.tsx @@ -1,13 +1,13 @@ -import {withRouter, WithRouterProps} from 'react-router'; -import DocumentTitle from 'react-document-title'; -import PropTypes from 'prop-types'; import React from 'react'; +import DocumentTitle from 'react-document-title'; +import {withRouter, WithRouterProps} from 'react-router'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; -import {t, tct} from 'app/locale'; import ExternalLink from 'app/components/links/externalLink'; -import {PageContent} from 'app/styles/organization'; import LoadingError from 'app/components/loadingError'; +import {t, tct} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; const ERROR_NAME = 'Permission Denied'; diff --git a/src/sentry/static/sentry/app/views/projectDetail/index.tsx b/src/sentry/static/sentry/app/views/projectDetail/index.tsx index f8a32de23ba5c5..199149fb4e2614 100644 --- a/src/sentry/static/sentry/app/views/projectDetail/index.tsx +++ b/src/sentry/static/sentry/app/views/projectDetail/index.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import {t} from 'app/locale'; -import {PageContent} from 'app/styles/organization'; import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; import withOrganization from 'app/utils/withOrganization'; import ProjectDetail from './projectDetail'; diff --git a/src/sentry/static/sentry/app/views/projectDetail/projectDetail.tsx b/src/sentry/static/sentry/app/views/projectDetail/projectDetail.tsx index db2958ab31a4a0..e78d1c43ab4799 100644 --- a/src/sentry/static/sentry/app/views/projectDetail/projectDetail.tsx +++ b/src/sentry/static/sentry/app/views/projectDetail/projectDetail.tsx @@ -2,21 +2,21 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {Organization, Project} from 'app/types'; -import AsyncView from 'app/views/asyncView'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; -import {PageContent} from 'app/styles/organization'; -import routeTitleGen from 'app/utils/routeTitle'; -import {IconSettings} from 'app/icons'; -import * as Layout from 'app/components/layouts/thirds'; import Breadcrumbs from 'app/components/breadcrumbs'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import CreateAlertButton from 'app/components/createAlertButton'; import IdBadge from 'app/components/idBadge'; +import * as Layout from 'app/components/layouts/thirds'; +import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import TextOverflow from 'app/components/textOverflow'; -import CreateAlertButton from 'app/components/createAlertButton'; +import {IconSettings} from 'app/icons'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; +import {Organization, Project} from 'app/types'; +import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; import ProjectScoreCards from './projectScoreCards'; import ProjectTeamAccess from './projectTeamAccess'; diff --git a/src/sentry/static/sentry/app/views/projectDetail/projectTeamAccess.tsx b/src/sentry/static/sentry/app/views/projectDetail/projectTeamAccess.tsx index a4777fdb44bdf3..a420227dba5c94 100644 --- a/src/sentry/static/sentry/app/views/projectDetail/projectTeamAccess.tsx +++ b/src/sentry/static/sentry/app/views/projectDetail/projectTeamAccess.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Organization, Project} from 'app/types'; +import Button from 'app/components/button'; import {SectionHeading} from 'app/components/charts/styles'; -import {t, tn} from 'app/locale'; +import IdBadge from 'app/components/idBadge'; import Link from 'app/components/links/link'; -import space from 'app/styles/space'; import Placeholder from 'app/components/placeholder'; -import IdBadge from 'app/components/idBadge'; -import Button from 'app/components/button'; +import {t, tn} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/projectEventRedirect.tsx b/src/sentry/static/sentry/app/views/projectEventRedirect.tsx index 6ba14b1687fccb..48d71f78e66c9a 100644 --- a/src/sentry/static/sentry/app/views/projectEventRedirect.tsx +++ b/src/sentry/static/sentry/app/views/projectEventRedirect.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; +import PropTypes from 'prop-types'; -import {PageContent} from 'app/styles/organization'; -import {t} from 'app/locale'; import DetailedError from 'app/components/errors/detailedError'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; type Props = RouteComponentProps<{}, {}>; diff --git a/src/sentry/static/sentry/app/views/projectInstall/createProject.tsx b/src/sentry/static/sentry/app/views/projectInstall/createProject.tsx index 65a63148f23ee9..ef07a4ec40ea51 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/createProject.tsx +++ b/src/sentry/static/sentry/app/views/projectInstall/createProject.tsx @@ -1,31 +1,31 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; import PlatformIcon from 'platformicons'; +import PropTypes from 'prop-types'; -import {Organization, Project, Team} from 'app/types'; -import {inputStyles} from 'app/styles/input'; import {openCreateTeamModal} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; +import ProjectActions from 'app/actions/projectActions'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; +import SelectControl from 'app/components/forms/selectControl'; import PageHeading from 'app/components/pageHeading'; import PlatformPicker from 'app/components/platformPicker'; -import ProjectActions from 'app/actions/projectActions'; -import SelectControl from 'app/components/forms/selectControl'; import Tooltip from 'app/components/tooltip'; -import getPlatformName from 'app/utils/getPlatformName'; +import {IconAdd} from 'app/icons'; +import {t} from 'app/locale'; +import {inputStyles} from 'app/styles/input'; import space from 'app/styles/space'; +import {Organization, Project, Team} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import getPlatformName from 'app/utils/getPlatformName'; +import slugify from 'app/utils/slugify'; import theme from 'app/utils/theme'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; import withTeams from 'app/utils/withTeams'; import IssueAlertOptions from 'app/views/projectInstall/issueAlertOptions'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import slugify from 'app/utils/slugify'; -import {IconAdd} from 'app/icons'; type RuleEventData = { eventKey: string; diff --git a/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx b/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx index f96a2f043d28b8..d64bbe5e8a0961 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx +++ b/src/sentry/static/sentry/app/views/projectInstall/issueAlertOptions.tsx @@ -1,16 +1,16 @@ import React, {ReactElement} from 'react'; -import isEqual from 'lodash/isEqual'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; +import isEqual from 'lodash/isEqual'; +import AsyncComponent from 'app/components/asyncComponent'; +import SelectControl from 'app/components/forms/selectControl'; +import PageHeading from 'app/components/pageHeading'; import {t} from 'app/locale'; -import {Organization} from 'app/types'; import space from 'app/styles/space'; +import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; -import AsyncComponent from 'app/components/asyncComponent'; import Input from 'app/views/settings/components/forms/controls/input'; -import PageHeading from 'app/components/pageHeading'; -import SelectControl from 'app/components/forms/selectControl'; import RadioGroup from 'app/views/settings/components/forms/controls/radioGroup'; enum MetricValues { diff --git a/src/sentry/static/sentry/app/views/projectInstall/newProject.tsx b/src/sentry/static/sentry/app/views/projectInstall/newProject.tsx index 3937295be27f13..e4c3805a80cada 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/newProject.tsx +++ b/src/sentry/static/sentry/app/views/projectInstall/newProject.tsx @@ -1,9 +1,9 @@ -import DocumentTitle from 'react-document-title'; import React from 'react'; +import DocumentTitle from 'react-document-title'; import styled from '@emotion/styled'; -import CreateProject from 'app/views/projectInstall/createProject'; import space from 'app/styles/space'; +import CreateProject from 'app/views/projectInstall/createProject'; const NewProject = () => ( <Container> diff --git a/src/sentry/static/sentry/app/views/projectInstall/overview.tsx b/src/sentry/static/sentry/app/views/projectInstall/overview.tsx index 3a00e62f8a52ad..d018cd4ece80a5 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/overview.tsx +++ b/src/sentry/static/sentry/app/views/projectInstall/overview.tsx @@ -1,23 +1,23 @@ -import {browserHistory} from 'react-router'; -import styled from '@emotion/styled'; import React from 'react'; +import {browserHistory} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; import AutoSelectText from 'app/components/autoSelectText'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import Button from 'app/components/button'; import ExternalLink from 'app/components/links/externalLink'; import PlatformPicker from 'app/components/platformPicker'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; -import recreateRoute from 'app/utils/recreateRoute'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {PlatformKey} from 'app/data/platformCategories'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import withOrganization from 'app/utils/withOrganization'; import {Organization} from 'app/types'; +import recreateRoute from 'app/utils/recreateRoute'; +import withOrganization from 'app/utils/withOrganization'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; -import {PlatformKey} from 'app/data/platformCategories'; type Props = RouteComponentProps<{orgId: string; projectId: string}, {}> & { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/projectInstall/platform.tsx b/src/sentry/static/sentry/app/views/projectInstall/platform.tsx index 2c00f382127ef6..e1ecc61d2120e7 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/platform.tsx +++ b/src/sentry/static/sentry/app/views/projectInstall/platform.tsx @@ -1,31 +1,32 @@ -import {browserHistory, WithRouterProps} from 'react-router'; +import 'prism-sentry/index.css'; + import React from 'react'; +import {browserHistory, WithRouterProps} from 'react-router'; import styled from '@emotion/styled'; -import 'prism-sentry/index.css'; -import {Client} from 'app/api'; -import { - performance as performancePlatforms, - PlatformKey, -} from 'app/data/platformCategories'; import {loadDocs} from 'app/actionCreators/projects'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; +import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; -import Feature from 'app/components/acl/feature'; -import {IconInfo} from 'app/icons'; +import NotFound from 'app/components/errors/notFound'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import NotFound from 'app/components/errors/notFound'; -import {PageHeader} from 'app/styles/organization'; -import Projects from 'app/utils/projects'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import { + performance as performancePlatforms, + PlatformKey, +} from 'app/data/platformCategories'; import platforms from 'app/data/platforms'; +import {IconInfo} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {PageHeader} from 'app/styles/organization'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import Projects from 'app/utils/projects'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; -import {Organization, Project} from 'app/types'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/projects/projectContext.jsx b/src/sentry/static/sentry/app/views/projects/projectContext.jsx index 89ae2ab4861bf3..8090d7c63a05f8 100644 --- a/src/sentry/static/sentry/app/views/projects/projectContext.jsx +++ b/src/sentry/static/sentry/app/views/projects/projectContext.jsx @@ -1,22 +1,22 @@ -import {withRouter} from 'react-router'; +import React from 'react'; import DocumentTitle from 'react-document-title'; +import {withRouter} from 'react-router'; +import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; -import React from 'react'; import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import {fetchOrgMembers} from 'app/actionCreators/members'; import {setActiveProject} from 'app/actionCreators/projects'; -import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import MemberListStore from 'app/stores/memberListStore'; import MissingProjectMembership from 'app/components/projects/missingProjectMembership'; -import ProjectsStore from 'app/stores/projectsStore'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import withProjects from 'app/utils/withProjects'; +import MemberListStore from 'app/stores/memberListStore'; +import ProjectsStore from 'app/stores/projectsStore'; +import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; +import withProjects from 'app/utils/withProjects'; const ERROR_TYPES = { MISSING_MEMBERSHIP: 'MISSING_MEMBERSHIP', diff --git a/src/sentry/static/sentry/app/views/projects/redirectDeprecatedProjectRoute.jsx b/src/sentry/static/sentry/app/views/projects/redirectDeprecatedProjectRoute.jsx index 50d45098991185..3016046e68869c 100644 --- a/src/sentry/static/sentry/app/views/projects/redirectDeprecatedProjectRoute.jsx +++ b/src/sentry/static/sentry/app/views/projects/redirectDeprecatedProjectRoute.jsx @@ -1,16 +1,16 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import isString from 'lodash/isString'; import styled from '@emotion/styled'; +import isString from 'lodash/isString'; +import PropTypes from 'prop-types'; -import {analytics} from 'app/utils/analytics'; -import {t} from 'app/locale'; import Alert from 'app/components/alert'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import Redirect from 'app/utils/redirect'; -import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {analytics} from 'app/utils/analytics'; +import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; +import Redirect from 'app/utils/redirect'; import withApi from 'app/utils/withApi'; class ProjectDetailsInner extends React.Component { diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/chart.tsx b/src/sentry/static/sentry/app/views/projectsDashboard/chart.tsx index d52e9ac86b9fe9..e35c6cd304b4f7 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/chart.tsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/chart.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import {Project} from 'app/types'; -import {t} from 'app/locale'; import BaseChart from 'app/components/charts/baseChart'; -import theme from 'app/utils/theme'; +import {t} from 'app/locale'; +import {Project} from 'app/types'; import {axisLabelFormatter} from 'app/utils/discover/charts'; +import theme from 'app/utils/theme'; import NoEvents from './noEvents'; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/deploys.tsx b/src/sentry/static/sentry/app/views/projectsDashboard/deploys.tsx index 538e4c4c65f03b..1f49cd2723027e 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/deploys.tsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/deploys.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Project, Deploy as DeployType} from 'app/types'; -import {t} from 'app/locale'; import Button from 'app/components/button'; -import SentryTypes from 'app/sentryTypes'; import TextOverflow from 'app/components/textOverflow'; import TimeSince from 'app/components/timeSince'; import Version from 'app/components/version'; +import {IconReleases} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {Deploy as DeployType, Project} from 'app/types'; import getDynamicText from 'app/utils/getDynamicText'; -import {IconReleases} from 'app/icons'; const DEPLOY_COUNT = 2; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/index.tsx b/src/sentry/static/sentry/app/views/projectsDashboard/index.tsx index bf4ae21ac28e96..3efadf6fc29aad 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/index.tsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/index.tsx @@ -1,31 +1,31 @@ -import {Link} from 'react-router'; -import LazyLoad from 'react-lazyload'; -import PropTypes from 'prop-types'; import React from 'react'; +import LazyLoad from 'react-lazyload'; +import {Link} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import uniqBy from 'lodash/uniqBy'; -import flatten from 'lodash/flatten'; import {withProfiler} from '@sentry/react'; -import {RouteComponentProps} from 'react-router/lib/Router'; +import flatten from 'lodash/flatten'; +import uniqBy from 'lodash/uniqBy'; +import PropTypes from 'prop-types'; import {Client} from 'app/api'; -import {TeamWithProjects, Organization} from 'app/types'; -import {sortProjects} from 'app/utils'; -import {t} from 'app/locale'; -import LoadingError from 'app/components/loadingError'; import Button from 'app/components/button'; import IdBadge from 'app/components/idBadge'; +import LoadingError from 'app/components/loadingError'; +import LoadingIndicator from 'app/components/loadingIndicator'; import NoProjectMessage from 'app/components/noProjectMessage'; import PageHeading from 'app/components/pageHeading'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import ProjectsStatsStore from 'app/stores/projectsStatsStore'; +import {IconAdd} from 'app/icons'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import ProjectsStatsStore from 'app/stores/projectsStatsStore'; import space from 'app/styles/space'; -import LoadingIndicator from 'app/components/loadingIndicator'; +import {Organization, TeamWithProjects} from 'app/types'; +import {sortProjects} from 'app/utils'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; import withTeamsForUser from 'app/utils/withTeamsForUser'; -import {IconAdd} from 'app/icons'; import Resources from './resources'; import TeamSection from './teamSection'; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/projectCard.tsx b/src/sentry/static/sentry/app/views/projectsDashboard/projectCard.tsx index 6385d24ae63253..c026343c7c4110 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/projectCard.tsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/projectCard.tsx @@ -1,23 +1,23 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; -import {Organization, Project} from 'app/types'; -import BookmarkStar from 'app/components/projects/bookmarkStar'; -import {Client} from 'app/api'; import {loadStatsForProject} from 'app/actionCreators/projects'; -import {t, tn} from 'app/locale'; +import {Client} from 'app/api'; import IdBadge from 'app/components/idBadge'; import Link from 'app/components/links/link'; -import ProjectsStatsStore from 'app/stores/projectsStatsStore'; +import BookmarkStar from 'app/components/projects/bookmarkStar'; +import QuestionTooltip from 'app/components/questionTooltip'; +import {t, tn} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import ProjectsStatsStore from 'app/stores/projectsStatsStore'; import space from 'app/styles/space'; -import withOrganization from 'app/utils/withOrganization'; -import withApi from 'app/utils/withApi'; +import {Organization, Project} from 'app/types'; import {formatAbbreviatedNumber} from 'app/utils/formatters'; -import QuestionTooltip from 'app/components/questionTooltip'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; import Chart from './chart'; import Deploys from './deploys'; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/resources.tsx b/src/sentry/static/sentry/app/views/projectsDashboard/resources.tsx index f17f74ed18e3c1..a82d2b651fccf2 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/resources.tsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/resources.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Organization} from 'app/types'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; import PageHeading from 'app/components/pageHeading'; import ResourceCard from 'app/components/resourceCard'; -import space from 'app/styles/space'; import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; -import releasesImg from '../../../images/spot/releases.svg'; import breadcrumbsImg from '../../../images/spot/breadcrumbs-generic.svg'; import docsImg from '../../../images/spot/code-arguments-tags-mirrored.svg'; +import releasesImg from '../../../images/spot/releases.svg'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/teamMembers.tsx b/src/sentry/static/sentry/app/views/projectsDashboard/teamMembers.tsx index 336abfc6256af8..6c49c381ef34bb 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/teamMembers.tsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/teamMembers.tsx @@ -1,9 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {Member} from 'app/types'; import AsyncComponent from 'app/components/asyncComponent'; import AvatarList from 'app/components/avatar/avatarList'; +import {Member} from 'app/types'; type Props = AsyncComponent['props'] & { teamId: string; diff --git a/src/sentry/static/sentry/app/views/projectsDashboard/teamSection.tsx b/src/sentry/static/sentry/app/views/projectsDashboard/teamSection.tsx index 7e277a0b44d782..90505a5c209ea6 100644 --- a/src/sentry/static/sentry/app/views/projectsDashboard/teamSection.tsx +++ b/src/sentry/static/sentry/app/views/projectsDashboard/teamSection.tsx @@ -1,14 +1,14 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Team, Project, Scope} from 'app/types'; +import PageHeading from 'app/components/pageHeading'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; -import PageHeading from 'app/components/pageHeading'; +import {Project, Scope, Team} from 'app/types'; -import TeamMembers from './teamMembers'; import ProjectCard from './projectCard'; +import TeamMembers from './teamMembers'; type Props = { team: Team; diff --git a/src/sentry/static/sentry/app/views/releases/detail/artifacts/index.tsx b/src/sentry/static/sentry/app/views/releases/detail/artifacts/index.tsx index fc655fc894a359..121bfc4d9ff580 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/artifacts/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/artifacts/index.tsx @@ -1,14 +1,14 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; +import AlertLink from 'app/components/alertLink'; +import {Main} from 'app/components/layouts/thirds'; import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import routeTitleGen from 'app/utils/routeTitle'; +import {Organization} from 'app/types'; import {formatVersion} from 'app/utils/formatters'; +import routeTitleGen from 'app/utils/routeTitle'; import withOrganization from 'app/utils/withOrganization'; -import {Organization} from 'app/types'; -import AlertLink from 'app/components/alertLink'; -import {Main} from 'app/components/layouts/thirds'; +import AsyncView from 'app/views/asyncView'; import {ReleaseContext} from '..'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/commits.tsx b/src/sentry/static/sentry/app/views/releases/detail/commits.tsx index cf6df6a7903434..d150d8f597c8c2 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/commits.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/commits.tsx @@ -3,19 +3,19 @@ import {RouteComponentProps} from 'react-router/lib/Router'; import {Client} from 'app/api'; import CommitRow from 'app/components/commitRow'; +import Pagination from 'app/components/pagination'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t} from 'app/locale'; import {Commit, Repository} from 'app/types'; -import routeTitleGen from 'app/utils/routeTitle'; import {formatVersion} from 'app/utils/formatters'; +import routeTitleGen from 'app/utils/routeTitle'; import withApi from 'app/utils/withApi'; -import Pagination from 'app/components/pagination'; import AsyncView from 'app/views/asyncView'; -import {PanelHeader, Panel, PanelBody} from 'app/components/panels'; +import EmptyState from './emptyState'; +import RepositorySwitcher from './repositorySwitcher'; import {getCommitsByRepository, getQuery, getReposToRender} from './utils'; import withRepositories from './withRepositories'; -import RepositorySwitcher from './repositorySwitcher'; -import EmptyState from './emptyState'; type Props = RouteComponentProps<{orgId: string; release: string}, {}> & { api: Client; diff --git a/src/sentry/static/sentry/app/views/releases/detail/filesChanged.tsx b/src/sentry/static/sentry/app/views/releases/detail/filesChanged.tsx index d366d5b4b1043f..f8664d0f3e9db4 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/filesChanged.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/filesChanged.tsx @@ -3,21 +3,21 @@ import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import {Client} from 'app/api'; +import FileChange from 'app/components/fileChange'; +import {Main} from 'app/components/layouts/thirds'; +import Pagination from 'app/components/pagination'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t, tn} from 'app/locale'; import {CommitFile, Repository} from 'app/types'; -import routeTitleGen from 'app/utils/routeTitle'; import {formatVersion} from 'app/utils/formatters'; +import routeTitleGen from 'app/utils/routeTitle'; import withApi from 'app/utils/withApi'; -import {Main} from 'app/components/layouts/thirds'; -import Pagination from 'app/components/pagination'; import AsyncView from 'app/views/asyncView'; -import {PanelHeader, Panel, PanelBody} from 'app/components/panels'; -import FileChange from 'app/components/fileChange'; -import {getFilesByRepository, getReposToRender, getQuery} from './utils'; -import withRepositories from './withRepositories'; -import RepositorySwitcher from './repositorySwitcher'; import EmptyState from './emptyState'; +import RepositorySwitcher from './repositorySwitcher'; +import {getFilesByRepository, getQuery, getReposToRender} from './utils'; +import withRepositories from './withRepositories'; type Props = RouteComponentProps<{orgId: string; release: string}, {}> & { api: Client; diff --git a/src/sentry/static/sentry/app/views/releases/detail/index.tsx b/src/sentry/static/sentry/app/views/releases/detail/index.tsx index 45b1ea9f4e4c13..245676b1d8d7b2 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/index.tsx @@ -1,34 +1,34 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import pick from 'lodash/pick'; import styled from '@emotion/styled'; +import pick from 'lodash/pick'; +import Alert from 'app/components/alert'; +import AsyncComponent from 'app/components/asyncComponent'; +import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import LoadingIndicator from 'app/components/loadingIndicator'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import {URL_PARAM} from 'app/constants/globalSelectionHeader'; +import {IconInfo, IconWarning} from 'app/icons'; import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; +import space from 'app/styles/space'; import { - Organization, - ReleaseProject, - ReleaseMeta, Deploy, GlobalSelection, + Organization, + ReleaseMeta, + ReleaseProject, ReleaseWithHealth, } from 'app/types'; -import AsyncView from 'app/views/asyncView'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; -import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; -import {PageContent} from 'app/styles/organization'; -import withOrganization from 'app/utils/withOrganization'; -import routeTitleGen from 'app/utils/routeTitle'; -import {URL_PARAM} from 'app/constants/globalSelectionHeader'; import {formatVersion} from 'app/utils/formatters'; -import AsyncComponent from 'app/components/asyncComponent'; +import routeTitleGen from 'app/utils/routeTitle'; import withGlobalSelection from 'app/utils/withGlobalSelection'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import {IconInfo, IconWarning} from 'app/icons'; -import space from 'app/styles/space'; -import Alert from 'app/components/alert'; +import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; -import ReleaseHeader from './releaseHeader'; import PickProjectToContinue from './pickProjectToContinue'; +import ReleaseHeader from './releaseHeader'; import {getReleaseEventView} from './utils'; type ReleaseContext = { @@ -289,5 +289,5 @@ const Body = styled('div')` padding: ${space(2)} ${space(4)}; `; -export {ReleasesDetailContainer, ReleaseContext}; +export {ReleaseContext, ReleasesDetailContainer}; export default withGlobalSelection(withOrganization(ReleasesDetailContainer)); diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChart.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChart.tsx index a894496dacc15d..b66b7351005316 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChart.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChart.tsx @@ -1,19 +1,19 @@ import React from 'react'; -import isEqual from 'lodash/isEqual'; import {browserHistory} from 'react-router'; import {Location} from 'history'; +import isEqual from 'lodash/isEqual'; -import LineChart from 'app/components/charts/lineChart'; import AreaChart from 'app/components/charts/areaChart'; +import LineChart from 'app/components/charts/lineChart'; import StackedAreaChart from 'app/components/charts/stackedAreaChart'; import {getSeriesSelection} from 'app/components/charts/utils'; import {parseStatsPeriod} from 'app/components/organizations/timeRangeSelector/utils'; import {Series} from 'app/types/echarts'; -import theme from 'app/utils/theme'; import {defined} from 'app/utils'; -import {getExactDuration} from 'app/utils/formatters'; import {axisDuration} from 'app/utils/discover/charts'; +import {getExactDuration} from 'app/utils/formatters'; import {decodeList} from 'app/utils/queryString'; +import theme from 'app/utils/theme'; import {YAxis} from './releaseChartControls'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChartContainer.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChartContainer.tsx index b0c1208214c51c..675c4e1874acaa 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChartContainer.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/healthChartContainer.tsx @@ -2,15 +2,16 @@ import React from 'react'; import * as ReactRouter from 'react-router'; import ChartZoom from 'app/components/charts/chartZoom'; -import {IconWarning} from 'app/icons'; -import {GlobalSelection} from 'app/types'; +import ErrorPanel from 'app/components/charts/errorPanel'; import TransitionChart from 'app/components/charts/transitionChart'; import TransparentLoadingMask from 'app/components/charts/transparentLoadingMask'; -import ErrorPanel from 'app/components/charts/errorPanel'; +import {IconWarning} from 'app/icons'; +import {GlobalSelection} from 'app/types'; + +import {ReleaseStatsRequestRenderProps} from '../releaseStatsRequest'; import HealthChart from './healthChart'; import {YAxis} from './releaseChartControls'; -import {ReleaseStatsRequestRenderProps} from '../releaseStatsRequest'; type Props = Omit< ReleaseStatsRequestRenderProps, diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/index.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/index.tsx index 31f884d8e27043..ba6dc591c9556b 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/index.tsx @@ -2,17 +2,18 @@ import React from 'react'; import * as ReactRouter from 'react-router'; import {Location} from 'history'; -import {GlobalSelection, Organization, ReleaseMeta} from 'app/types'; -import {Panel} from 'app/components/panels'; import {Client} from 'app/api'; import EventsChart from 'app/components/charts/eventsChart'; +import {Panel} from 'app/components/panels'; import {t} from 'app/locale'; +import {GlobalSelection, Organization, ReleaseMeta} from 'app/types'; import {decodeScalar} from 'app/utils/queryString'; import theme from 'app/utils/theme'; -import ReleaseChartControls, {YAxis, PERFORMANCE_AXIS} from './releaseChartControls'; import {ReleaseStatsRequestRenderProps} from '../releaseStatsRequest'; + import HealthChartContainer from './healthChartContainer'; +import ReleaseChartControls, {PERFORMANCE_AXIS, YAxis} from './releaseChartControls'; import {getReleaseEventView} from './utils'; type Props = Omit<ReleaseStatsRequestRenderProps, 'crashFreeTimeBreakdown'> & { diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/releaseChartControls.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/releaseChartControls.tsx index 115f9976c9c0f9..bd2c019a5fafaf 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/releaseChartControls.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/releaseChartControls.tsx @@ -1,19 +1,19 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; +import OptionSelector from 'app/components/charts/optionSelector'; import { ChartControls, InlineContainer, SectionHeading, SectionValue, } from 'app/components/charts/styles'; -import OptionSelector from 'app/components/charts/optionSelector'; import QuestionTooltip from 'app/components/questionTooltip'; -import {WEB_VITAL_DETAILS} from 'app/views/performance/transactionVitals/constants'; -import {WebVital} from 'app/utils/discover/fields'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {SelectValue, Organization} from 'app/types'; +import {Organization, SelectValue} from 'app/types'; +import {WebVital} from 'app/utils/discover/fields'; +import {WEB_VITAL_DETAILS} from 'app/views/performance/transactionVitals/constants'; export enum YAxis { SESSIONS = 'sessions', diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/utils.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/utils.tsx index 8825646ca1326e..b9a0b93d9641e4 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/chart/utils.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/chart/utils.tsx @@ -1,12 +1,12 @@ -import {TWO_WEEKS, getDiffInMinutes, DateTimeObject} from 'app/components/charts/utils'; -import EventView from 'app/utils/discover/eventView'; +import {DateTimeObject, getDiffInMinutes, TWO_WEEKS} from 'app/components/charts/utils'; +import {t} from 'app/locale'; import {GlobalSelection} from 'app/types'; -import {formatVersion} from 'app/utils/formatters'; import {getUtcDateString} from 'app/utils/dates'; -import {t} from 'app/locale'; -import {stringifyQueryObject, QueryResults} from 'app/utils/tokenizeSearch'; -import {WEB_VITAL_DETAILS} from 'app/views/performance/transactionVitals/constants'; +import EventView from 'app/utils/discover/eventView'; import {WebVital} from 'app/utils/discover/fields'; +import {formatVersion} from 'app/utils/formatters'; +import {QueryResults, stringifyQueryObject} from 'app/utils/tokenizeSearch'; +import {WEB_VITAL_DETAILS} from 'app/views/performance/transactionVitals/constants'; import {YAxis} from './releaseChartControls'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/commitAuthorBreakdown.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/commitAuthorBreakdown.tsx index d7298c31e6ba47..db2fff732d96f1 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/commitAuthorBreakdown.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/commitAuthorBreakdown.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tn} from 'app/locale'; -import space from 'app/styles/space'; +import AsyncComponent from 'app/components/asyncComponent'; import UserAvatar from 'app/components/avatar/userAvatar'; +import Button from 'app/components/button'; +import {t, tn} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; -import AsyncComponent from 'app/components/asyncComponent'; +import space from 'app/styles/space'; +import {Commit, User} from 'app/types'; import {percent} from 'app/utils'; import {userDisplayName} from 'app/utils/formatters'; -import {Commit, User} from 'app/types'; -import Button from 'app/components/button'; import {SectionHeading, Wrapper} from './styles'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/deploys.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/deploys.tsx index 26901a7c19a0b8..14df9aaa3230e8 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/deploys.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/deploys.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; +import DeployBadge from 'app/components/deployBadge'; +import TextOverflow from 'app/components/textOverflow'; +import TimeSince from 'app/components/timeSince'; import {t} from 'app/locale'; import space from 'app/styles/space'; import {Deploy} from 'app/types'; -import TimeSince from 'app/components/timeSince'; -import DeployBadge from 'app/components/deployBadge'; -import TextOverflow from 'app/components/textOverflow'; import {SectionHeading, Wrapper} from './styles'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/index.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/index.tsx index 6279901a96389b..25b80043a8dbd8 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/index.tsx @@ -1,43 +1,44 @@ import React from 'react'; -import {Location, LocationDescriptor, Query} from 'history'; +import {browserHistory} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {browserHistory} from 'react-router'; +import {Location, LocationDescriptor, Query} from 'history'; +import {restoreRelease} from 'app/actionCreators/release'; +import {Client} from 'app/api'; import Feature from 'app/components/acl/feature'; -import space from 'app/styles/space'; +import TransactionsList, {DropdownOption} from 'app/components/discover/transactionsList'; +import {Body, Main, Side} from 'app/components/layouts/thirds'; import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import withOrganization from 'app/utils/withOrganization'; -import withGlobalSelection from 'app/utils/withGlobalSelection'; -import {NewQuery, Organization, GlobalSelection, ReleaseProject} from 'app/types'; -import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; +import space from 'app/styles/space'; +import {GlobalSelection, NewQuery, Organization, ReleaseProject} from 'app/types'; import {getUtcDateString} from 'app/utils/dates'; +import {TableDataRow} from 'app/utils/discover/discoverQuery'; import EventView from 'app/utils/discover/eventView'; -import {TrendView, TrendChangeType} from 'app/views/performance/trends/types'; import {formatVersion} from 'app/utils/formatters'; +import {decodeScalar} from 'app/utils/queryString'; import routeTitleGen from 'app/utils/routeTitle'; -import {Body, Main, Side} from 'app/components/layouts/thirds'; -import {restoreRelease} from 'app/actionCreators/release'; -import TransactionsList, {DropdownOption} from 'app/components/discover/transactionsList'; -import {TableDataRow} from 'app/utils/discover/discoverQuery'; -import {transactionSummaryRouteWithQuery} from 'app/views/performance/transactionSummary/utils'; +import withApi from 'app/utils/withApi'; +import withGlobalSelection from 'app/utils/withGlobalSelection'; +import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; import {DisplayModes} from 'app/views/performance/transactionSummary/charts'; -import {decodeScalar} from 'app/utils/queryString'; +import {transactionSummaryRouteWithQuery} from 'app/views/performance/transactionSummary/utils'; +import {TrendChangeType, TrendView} from 'app/views/performance/trends/types'; + +import {isReleaseArchived} from '../../utils'; +import {ReleaseContext} from '..'; import ReleaseChart from './chart/'; -import Issues from './issues'; +import {YAxis} from './chart/releaseChartControls'; import CommitAuthorBreakdown from './commitAuthorBreakdown'; -import ProjectReleaseDetails from './projectReleaseDetails'; -import OtherProjects from './otherProjects'; -import TotalCrashFreeUsers from './totalCrashFreeUsers'; import Deploys from './deploys'; -import ReleaseStatsRequest from './releaseStatsRequest'; +import Issues from './issues'; +import OtherProjects from './otherProjects'; +import ProjectReleaseDetails from './projectReleaseDetails'; import ReleaseArchivedNotice from './releaseArchivedNotice'; -import {YAxis} from './chart/releaseChartControls'; -import {ReleaseContext} from '..'; -import {isReleaseArchived} from '../../utils'; +import ReleaseStatsRequest from './releaseStatsRequest'; +import TotalCrashFreeUsers from './totalCrashFreeUsers'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/issues.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/issues.tsx index b4e1148b759b5d..4dca4f1247e123 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/issues.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/issues.tsx @@ -1,26 +1,27 @@ import React from 'react'; import styled from '@emotion/styled'; -import pick from 'lodash/pick'; import {Location} from 'history'; +import pick from 'lodash/pick'; -import {t, tct} from 'app/locale'; -import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; -import DropdownButton from 'app/components/dropdownButton'; +import Feature from 'app/components/acl/feature'; import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import DiscoverButton from 'app/components/discoverButton'; +import DropdownButton from 'app/components/dropdownButton'; +import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import GroupList from 'app/components/issues/groupList'; -import space from 'app/styles/space'; import {Panel} from 'app/components/panels'; import {DEFAULT_RELATIVE_PERIODS} from 'app/constants'; -import {GlobalSelection} from 'app/types'; -import Feature from 'app/components/acl/feature'; import {URL_PARAM} from 'app/constants/globalSelectionHeader'; -import ButtonBar from 'app/components/buttonBar'; -import {stringifyQueryObject, QueryResults} from 'app/utils/tokenizeSearch'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {GlobalSelection} from 'app/types'; +import {QueryResults, stringifyQueryObject} from 'app/utils/tokenizeSearch'; -import {getReleaseEventView} from './chart/utils'; import EmptyState from '../emptyState'; +import {getReleaseEventView} from './chart/utils'; + enum IssuesType { NEW = 'new', UNHANDLED = 'unhandled', diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/otherProjects.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/otherProjects.tsx index 492c5d3ff3be08..0ed52b685959da 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/otherProjects.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/otherProjects.tsx @@ -2,13 +2,13 @@ import React from 'react'; import styled from '@emotion/styled'; import {Location} from 'history'; -import {t, tn} from 'app/locale'; -import space from 'app/styles/space'; +import Button from 'app/components/button'; +import ProjectBadge from 'app/components/idBadge/projectBadge'; import Link from 'app/components/links/link'; +import {t, tn} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {ReleaseProject} from 'app/types'; -import Button from 'app/components/button'; -import ProjectBadge from 'app/components/idBadge/projectBadge'; import {SectionHeading, Wrapper} from './styles'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/projectReleaseDetails.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/projectReleaseDetails.tsx index 0f9fb0a8065b61..104557f1e34353 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/projectReleaseDetails.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/projectReleaseDetails.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tn} from 'app/locale'; -import space from 'app/styles/space'; -import {ReleaseWithHealth, ReleaseMeta} from 'app/types'; -import Version from 'app/components/version'; -import TimeSince from 'app/components/timeSince'; +import Count from 'app/components/count'; import DateTime from 'app/components/dateTime'; import Link from 'app/components/links/link'; -import Count from 'app/components/count'; +import TimeSince from 'app/components/timeSince'; +import Version from 'app/components/version'; +import {t, tn} from 'app/locale'; +import space from 'app/styles/space'; +import {ReleaseMeta, ReleaseWithHealth} from 'app/types'; import {SectionHeading, Wrapper} from './styles'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/releaseArchivedNotice.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/releaseArchivedNotice.tsx index 18bc23df364da3..4e1c9b13a78a4b 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/releaseArchivedNotice.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/releaseArchivedNotice.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {IconInfo} from 'app/icons'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; +import {IconInfo} from 'app/icons'; +import {t} from 'app/locale'; type Props = { multi?: boolean; diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/releaseStatsRequest.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/releaseStatsRequest.tsx index a44aec5ca2f92d..9db270bb78605f 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/releaseStatsRequest.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/releaseStatsRequest.tsx @@ -1,26 +1,27 @@ import React from 'react'; -import pick from 'lodash/pick'; -import omitBy from 'lodash/omitBy'; +import {Location} from 'history'; import isEqual from 'lodash/isEqual'; -import meanBy from 'lodash/meanBy'; import mean from 'lodash/mean'; -import {Location} from 'history'; +import meanBy from 'lodash/meanBy'; +import omitBy from 'lodash/omitBy'; +import pick from 'lodash/pick'; -import {Client} from 'app/api'; +import {fetchTotalCount} from 'app/actionCreators/events'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {t, tct} from 'app/locale'; -import {Organization, GlobalSelection, CrashFreeTimeBreakdown} from 'app/types'; +import {Client} from 'app/api'; +import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; +import CHART_PALETTE from 'app/constants/chartPalette'; import {URL_PARAM} from 'app/constants/globalSelectionHeader'; -import {percent, defined} from 'app/utils'; +import {t, tct} from 'app/locale'; +import {CrashFreeTimeBreakdown, GlobalSelection, Organization} from 'app/types'; import {Series} from 'app/types/echarts'; -import {getParams} from 'app/components/organizations/globalSelectionHeader/getParams'; +import {defined, percent} from 'app/utils'; import {getExactDuration} from 'app/utils/formatters'; -import {fetchTotalCount} from 'app/actionCreators/events'; -import CHART_PALETTE from 'app/constants/chartPalette'; + +import {displayCrashFreePercent, getCrashFreePercent, roundDuration} from '../../utils'; import {YAxis} from './chart/releaseChartControls'; import {getInterval, getReleaseEventView} from './chart/utils'; -import {displayCrashFreePercent, getCrashFreePercent, roundDuration} from '../../utils'; const omitIgnoredProps = (props: Props) => omitBy(props, (_, key) => diff --git a/src/sentry/static/sentry/app/views/releases/detail/overview/totalCrashFreeUsers.tsx b/src/sentry/static/sentry/app/views/releases/detail/overview/totalCrashFreeUsers.tsx index 7f7a912389e6c6..5f7ba5a278b62c 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/overview/totalCrashFreeUsers.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/overview/totalCrashFreeUsers.tsx @@ -2,16 +2,17 @@ import React from 'react'; import styled from '@emotion/styled'; import moment from 'moment'; +import Count from 'app/components/count'; import {t, tn} from 'app/locale'; -import space from 'app/styles/space'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {CrashFreeTimeBreakdown} from 'app/types'; import {defined} from 'app/utils'; -import Count from 'app/components/count'; -import {SectionHeading, Wrapper} from './styles'; import {displayCrashFreePercent} from '../../utils'; +import {SectionHeading, Wrapper} from './styles'; + type Props = { crashFreeTimeBreakdown: CrashFreeTimeBreakdown; }; diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseActions.tsx b/src/sentry/static/sentry/app/views/releases/detail/releaseActions.tsx index 3dbd34b296a086..fbdb994325b6b8 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseActions.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseActions.tsx @@ -1,23 +1,23 @@ import React from 'react'; -import PropTypes from 'prop-types'; -import styled from '@emotion/styled'; import {browserHistory} from 'react-router'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import SentryTypes from 'app/sentryTypes'; -import {t, tct, tn} from 'app/locale'; -import {Release, ReleaseMeta} from 'app/types'; -import space from 'app/styles/space'; +import {archiveRelease, restoreRelease} from 'app/actionCreators/release'; +import {Client} from 'app/api'; import Button from 'app/components/button'; -import {IconEllipsis} from 'app/icons'; import Confirm from 'app/components/confirm'; import DropdownLink from 'app/components/dropdownLink'; -import MenuItem from 'app/components/menuItem'; import ProjectBadge from 'app/components/idBadge/projectBadge'; -import {formatVersion} from 'app/utils/formatters'; -import Tooltip from 'app/components/tooltip'; +import MenuItem from 'app/components/menuItem'; import TextOverflow from 'app/components/textOverflow'; -import {archiveRelease, restoreRelease} from 'app/actionCreators/release'; -import {Client} from 'app/api'; +import Tooltip from 'app/components/tooltip'; +import {IconEllipsis} from 'app/icons'; +import {t, tct, tn} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; +import {Release, ReleaseMeta} from 'app/types'; +import {formatVersion} from 'app/utils/formatters'; import {isReleaseArchived} from '../utils'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseHeader.tsx b/src/sentry/static/sentry/app/views/releases/detail/releaseHeader.tsx index 1f5456ab468f26..c66f1966b7eb2d 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseHeader.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseHeader.tsx @@ -1,34 +1,34 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; import pick from 'lodash/pick'; -import {URL_PARAM} from 'app/constants/globalSelectionHeader'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; import Feature from 'app/components/acl/feature'; -import ListLink from 'app/components/links/listLink'; -import ExternalLink from 'app/components/links/externalLink'; -import NavTabs from 'app/components/navTabs'; -import {Organization, Release, ReleaseProject, ReleaseMeta} from 'app/types'; -import Version from 'app/components/version'; +import Badge from 'app/components/badge'; +import Breadcrumbs from 'app/components/breadcrumbs'; import Clipboard from 'app/components/clipboard'; -import {IconCopy, IconOpen} from 'app/icons'; -import Tooltip from 'app/components/tooltip'; import Count from 'app/components/count'; -import TimeSince from 'app/components/timeSince'; -import {formatVersion, formatAbbreviatedNumber} from 'app/utils/formatters'; -import Breadcrumbs from 'app/components/breadcrumbs'; import DeployBadge from 'app/components/deployBadge'; -import Badge from 'app/components/badge'; import * as Layout from 'app/components/layouts/thirds'; -import {getTermHelp} from 'app/views/performance/data'; +import ExternalLink from 'app/components/links/externalLink'; +import ListLink from 'app/components/links/listLink'; +import NavTabs from 'app/components/navTabs'; +import TimeSince from 'app/components/timeSince'; +import Tooltip from 'app/components/tooltip'; +import Version from 'app/components/version'; +import {URL_PARAM} from 'app/constants/globalSelectionHeader'; +import {IconCopy, IconOpen} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, Release, ReleaseMeta, ReleaseProject} from 'app/types'; import DiscoverQuery from 'app/utils/discover/discoverQuery'; import EventView from 'app/utils/discover/eventView'; import {getAggregateAlias} from 'app/utils/discover/fields'; +import {formatAbbreviatedNumber, formatVersion} from 'app/utils/formatters'; +import {getTermHelp} from 'app/views/performance/data'; -import ReleaseStat from './releaseStat'; import ReleaseActions from './releaseActions'; +import ReleaseStat from './releaseStat'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/views/releases/detail/releaseStat.tsx b/src/sentry/static/sentry/app/views/releases/detail/releaseStat.tsx index 45e50b64140fb9..7f6fcf494b3761 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/releaseStat.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/releaseStat.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; import QuestionTooltip from 'app/components/questionTooltip'; +import space from 'app/styles/space'; type Props = { label: string; diff --git a/src/sentry/static/sentry/app/views/releases/detail/repositorySwitcher.tsx b/src/sentry/static/sentry/app/views/releases/detail/repositorySwitcher.tsx index 825a86511105a5..44b1a250b800bf 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/repositorySwitcher.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/repositorySwitcher.tsx @@ -1,10 +1,10 @@ import React from 'react'; +import {InjectedRouter} from 'react-router'; import styled from '@emotion/styled'; import {Location} from 'history'; -import {InjectedRouter} from 'react-router'; -import {t} from 'app/locale'; import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; import {Repository} from 'app/types'; diff --git a/src/sentry/static/sentry/app/views/releases/detail/utils.tsx b/src/sentry/static/sentry/app/views/releases/detail/utils.tsx index 605dc69fb88b4e..b8398de3b46182 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/utils.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/utils.tsx @@ -1,19 +1,19 @@ import {Location} from 'history'; import pick from 'lodash/pick'; +import {URL_PARAM} from 'app/constants/globalSelectionHeader'; +import {t} from 'app/locale'; import { Commit, CommitFile, - LightWeightOrganization, FilesByRepository, GlobalSelection, + LightWeightOrganization, Repository, } from 'app/types'; -import {t} from 'app/locale'; -import EventView from 'app/utils/discover/eventView'; import {getUtcDateString} from 'app/utils/dates'; -import {URL_PARAM} from 'app/constants/globalSelectionHeader'; -import {stringifyQueryObject, QueryResults} from 'app/utils/tokenizeSearch'; +import EventView from 'app/utils/discover/eventView'; +import {QueryResults, stringifyQueryObject} from 'app/utils/tokenizeSearch'; export type CommitsByRepository = { [key: string]: Commit[]; diff --git a/src/sentry/static/sentry/app/views/releases/detail/withRepositories/index.tsx b/src/sentry/static/sentry/app/views/releases/detail/withRepositories/index.tsx index 859a805268cdee..43007885dc4693 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/withRepositories/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/withRepositories/index.tsx @@ -2,14 +2,15 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import * as Sentry from '@sentry/react'; -import {t} from 'app/locale'; +import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; -import getDisplayName from 'app/utils/getDisplayName'; -import {Repository} from 'app/types'; import LoadingIndicator from 'app/components/loadingIndicator'; -import {addErrorMessage} from 'app/actionCreators/indicator'; +import {t} from 'app/locale'; +import {Repository} from 'app/types'; +import getDisplayName from 'app/utils/getDisplayName'; import {ReleaseContext} from '..'; + import NoRepoConnected from './noRepoConnected'; // We require these props when using this HOC diff --git a/src/sentry/static/sentry/app/views/releases/detail/withRepositories/noRepoConnected.tsx b/src/sentry/static/sentry/app/views/releases/detail/withRepositories/noRepoConnected.tsx index 86ff7bc4cccfae..cbd40c97a279a5 100644 --- a/src/sentry/static/sentry/app/views/releases/detail/withRepositories/noRepoConnected.tsx +++ b/src/sentry/static/sentry/app/views/releases/detail/withRepositories/noRepoConnected.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import {t} from 'app/locale'; import Button from 'app/components/button'; +import {Panel} from 'app/components/panels'; import {IconCommit} from 'app/icons'; +import {t} from 'app/locale'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {Panel} from 'app/components/panels'; type Props = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/releases/list/adoptionTooltip.tsx b/src/sentry/static/sentry/app/views/releases/list/adoptionTooltip.tsx index d6aff799b9d842..f7b6ee3fe991ef 100644 --- a/src/sentry/static/sentry/app/views/releases/list/adoptionTooltip.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/adoptionTooltip.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; +import Count from 'app/components/count'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import Count from 'app/components/count'; type Props = { totalUsers: number; diff --git a/src/sentry/static/sentry/app/views/releases/list/clippedHealthRows.tsx b/src/sentry/static/sentry/app/views/releases/list/clippedHealthRows.tsx index 67003c6d9432b7..6363bd5ceaea8b 100644 --- a/src/sentry/static/sentry/app/views/releases/list/clippedHealthRows.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/clippedHealthRows.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {t, tct} from 'app/locale'; import Button from 'app/components/button'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; const defaultprops = { maxVisibleItems: 4, diff --git a/src/sentry/static/sentry/app/views/releases/list/crashFree.tsx b/src/sentry/static/sentry/app/views/releases/list/crashFree.tsx index 1e77202dd1cf71..d199309c7351c3 100644 --- a/src/sentry/static/sentry/app/views/releases/list/crashFree.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/crashFree.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {IconFire, IconWarning, IconCheckmark} from 'app/icons'; +import {IconCheckmark, IconFire, IconWarning} from 'app/icons'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; import {displayCrashFreePercent} from '../utils'; diff --git a/src/sentry/static/sentry/app/views/releases/list/healthStatsChart.tsx b/src/sentry/static/sentry/app/views/releases/list/healthStatsChart.tsx index 41a3b8613b739a..f904d2f5dbb8f3 100644 --- a/src/sentry/static/sentry/app/views/releases/list/healthStatsChart.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/healthStatsChart.tsx @@ -2,13 +2,13 @@ import React from 'react'; import LazyLoad from 'react-lazyload'; -import {Series} from 'app/types/echarts'; -import {t} from 'app/locale'; import MiniBarChart from 'app/components/charts/miniBarChart'; +import {t} from 'app/locale'; +import {Series} from 'app/types/echarts'; import theme from 'app/utils/theme'; -import {StatsSubject} from './healthStatsSubject'; import {StatsPeriod} from './healthStatsPeriod'; +import {StatsSubject} from './healthStatsSubject'; type DefaultProps = { height: number; diff --git a/src/sentry/static/sentry/app/views/releases/list/healthStatsPeriod.tsx b/src/sentry/static/sentry/app/views/releases/list/healthStatsPeriod.tsx index 443a389192d0b2..05e4520dd6f77d 100644 --- a/src/sentry/static/sentry/app/views/releases/list/healthStatsPeriod.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/healthStatsPeriod.tsx @@ -2,9 +2,9 @@ import React from 'react'; import styled from '@emotion/styled'; import {Location} from 'history'; +import Link from 'app/components/links/link'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import Link from 'app/components/links/link'; export type StatsPeriod = '24h' | '14d'; diff --git a/src/sentry/static/sentry/app/views/releases/list/healthStatsSubject.tsx b/src/sentry/static/sentry/app/views/releases/list/healthStatsSubject.tsx index e7fa971b49585d..6d99d6152c9063 100644 --- a/src/sentry/static/sentry/app/views/releases/list/healthStatsSubject.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/healthStatsSubject.tsx @@ -2,9 +2,9 @@ import React from 'react'; import styled from '@emotion/styled'; import {Location} from 'history'; +import Link from 'app/components/links/link'; import {t} from 'app/locale'; import space from 'app/styles/space'; -import Link from 'app/components/links/link'; export type StatsSubject = 'sessions' | 'users'; diff --git a/src/sentry/static/sentry/app/views/releases/list/index.tsx b/src/sentry/static/sentry/app/views/releases/list/index.tsx index d5f650c4ee0823..51051b9171d606 100644 --- a/src/sentry/static/sentry/app/views/releases/list/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/index.tsx @@ -1,34 +1,35 @@ import React from 'react'; +import {forceCheck} from 'react-lazyload'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import pick from 'lodash/pick'; -import {forceCheck} from 'react-lazyload'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; -import AsyncView from 'app/views/asyncView'; -import {Organization, Release, GlobalSelection, ReleaseStatus} from 'app/types'; -import routeTitleGen from 'app/utils/routeTitle'; -import SearchBar from 'app/components/searchBar'; -import Pagination from 'app/components/pagination'; -import PageHeading from 'app/components/pageHeading'; -import withOrganization from 'app/utils/withOrganization'; -import withGlobalSelection from 'app/utils/withGlobalSelection'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; -import {PageContent, PageHeader} from 'app/styles/organization'; import EmptyStateWarning from 'app/components/emptyStateWarning'; +import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; +import LoadingIndicator from 'app/components/loadingIndicator'; import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import {getRelativeSummary} from 'app/components/organizations/timeRangeSelector/utils'; +import PageHeading from 'app/components/pageHeading'; +import Pagination from 'app/components/pagination'; +import SearchBar from 'app/components/searchBar'; import {DEFAULT_STATS_PERIOD} from 'app/constants'; +import {t} from 'app/locale'; +import {PageContent, PageHeader} from 'app/styles/organization'; +import space from 'app/styles/space'; +import {GlobalSelection, Organization, Release, ReleaseStatus} from 'app/types'; import {defined} from 'app/utils'; +import routeTitleGen from 'app/utils/routeTitle'; +import withGlobalSelection from 'app/utils/withGlobalSelection'; +import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; + +import ReleaseArchivedNotice from '../detail/overview/releaseArchivedNotice'; -import ReleaseListSortOptions from './releaseListSortOptions'; -import ReleaseLanding from './releaseLanding'; import IntroBanner from './introBanner'; import ReleaseCard from './releaseCard'; +import ReleaseLanding from './releaseLanding'; import ReleaseListDisplayOptions from './releaseListDisplayOptions'; -import ReleaseArchivedNotice from '../detail/overview/releaseArchivedNotice'; +import ReleaseListSortOptions from './releaseListSortOptions'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/releases/list/introBanner.tsx b/src/sentry/static/sentry/app/views/releases/list/introBanner.tsx index 03c730ac228560..bbc70b83c22d50 100644 --- a/src/sentry/static/sentry/app/views/releases/list/introBanner.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/introBanner.tsx @@ -1,11 +1,11 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import Banner from 'app/components/banner'; import Button from 'app/components/button'; -import localStorage from 'app/utils/localStorage'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import localStorage from 'app/utils/localStorage'; import backgroundLighthouse from '../../../../images/spot/background-lighthouse.svg'; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseCard.tsx b/src/sentry/static/sentry/app/views/releases/list/releaseCard.tsx index aaa77ff7d3c1da..1272dd9bd533b2 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseCard.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseCard.tsx @@ -2,26 +2,27 @@ import React from 'react'; import styled from '@emotion/styled'; import {Location} from 'history'; -import space from 'app/styles/space'; +import Feature from 'app/components/acl/feature'; +import {AvatarListWrapper} from 'app/components/avatar/avatarList'; import Count from 'app/components/count'; -import Version from 'app/components/version'; +import DeployBadge from 'app/components/deployBadge'; +import Link from 'app/components/links/link'; import {Panel, PanelBody, PanelItem} from 'app/components/panels'; import ReleaseStats from 'app/components/releaseStats'; -import {Release, GlobalSelection} from 'app/types'; +import TextOverflow from 'app/components/textOverflow'; import TimeSince from 'app/components/timeSince'; +import Tooltip from 'app/components/tooltip'; +import Version from 'app/components/version'; import {t, tn} from 'app/locale'; -import {AvatarListWrapper} from 'app/components/avatar/avatarList'; -import TextOverflow from 'app/components/textOverflow'; import overflowEllipsis from 'app/styles/overflowEllipsis'; -import DeployBadge from 'app/components/deployBadge'; -import Link from 'app/components/links/link'; -import Feature from 'app/components/acl/feature'; -import Tooltip from 'app/components/tooltip'; +import space from 'app/styles/space'; +import {GlobalSelection, Release} from 'app/types'; -import ReleaseHealth from './releaseHealth'; -import NotAvailable from './notAvailable'; import {getReleaseNewIssuesUrl} from '../utils'; +import NotAvailable from './notAvailable'; +import ReleaseHealth from './releaseHealth'; + type Props = { release: Release; orgSlug: string; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/compactContent.tsx b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/compactContent.tsx index 6a4497c84a0aa3..ab4a2ef825361f 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/compactContent.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/compactContent.tsx @@ -1,16 +1,17 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; import {PanelBody} from 'app/components/panels'; -import {ReleaseProject, Release} from 'app/types'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Release, ReleaseProject} from 'app/types'; import ClippedHealthRows from '../clippedHealthRows'; + import Header from './header'; +import IssuesQuantity from './issuesQuantity'; import Item from './item'; import ProjectName from './projectName'; -import IssuesQuantity from './issuesQuantity'; type Props = { projects: Array<ReleaseProject>; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/content.tsx b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/content.tsx index 6fde56c5948ea6..5e58a9b8693a05 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/content.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/content.tsx @@ -2,28 +2,29 @@ import React from 'react'; import styled from '@emotion/styled'; import {Location} from 'history'; -import {Release, ReleaseProject} from 'app/types'; +import Count from 'app/components/count'; +import Link from 'app/components/links/link'; import {PanelBody} from 'app/components/panels'; +import Placeholder from 'app/components/placeholder'; +import ScoreBar from 'app/components/scoreBar'; +import TextOverflow from 'app/components/textOverflow'; +import Tooltip from 'app/components/tooltip'; import {t, tn} from 'app/locale'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; -import Count from 'app/components/count'; +import {Release, ReleaseProject} from 'app/types'; import {defined} from 'app/utils'; import theme from 'app/utils/theme'; -import ScoreBar from 'app/components/scoreBar'; -import Tooltip from 'app/components/tooltip'; -import TextOverflow from 'app/components/textOverflow'; -import Placeholder from 'app/components/placeholder'; -import Link from 'app/components/links/link'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; -import HealthStatsChart from '../healthStatsChart'; import {convertAdoptionToProgress, getReleaseNewIssuesUrl} from '../../utils'; -import HealthStatsSubject, {StatsSubject} from '../healthStatsSubject'; -import HealthStatsPeriod, {StatsPeriod} from '../healthStatsPeriod'; import AdoptionTooltip from '../adoptionTooltip'; -import NotAvailable from '../notAvailable'; import ClippedHealthRows from '../clippedHealthRows'; import CrashFree from '../crashFree'; +import HealthStatsChart from '../healthStatsChart'; +import HealthStatsPeriod, {StatsPeriod} from '../healthStatsPeriod'; +import HealthStatsSubject, {StatsSubject} from '../healthStatsSubject'; +import NotAvailable from '../notAvailable'; + import Header from './header'; import Item from './item'; import ProjectName from './projectName'; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/index.tsx b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/index.tsx index 205d2c1c733e98..6da18cc1d2cbcb 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/index.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {Location} from 'history'; -import partition from 'lodash/partition'; import flatten from 'lodash/flatten'; +import partition from 'lodash/partition'; -import {Release, GlobalSelection} from 'app/types'; +import {GlobalSelection, Release} from 'app/types'; -import Content from './content'; import CompactContent from './compactContent'; +import Content from './content'; type Props = { release: Release; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/issuesQuantity.tsx b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/issuesQuantity.tsx index eca9b48cf98b28..e2ae8ec08faf34 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseHealth/issuesQuantity.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseHealth/issuesQuantity.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tn} from 'app/locale'; -import Tooltip from 'app/components/tooltip'; -import Link from 'app/components/links/link'; import Count from 'app/components/count'; +import Link from 'app/components/links/link'; +import Tooltip from 'app/components/tooltip'; +import {t, tn} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx b/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx index 19d121c1ef3152..d347387fd0d397 100644 --- a/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx +++ b/src/sentry/static/sentry/app/views/releases/list/releaseLanding.tsx @@ -1,26 +1,26 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {Project, Organization} from 'app/types'; -import {analytics} from 'app/utils/analytics'; import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; -import OnboardingPanel from 'app/components/onboardingPanel'; -import withProject from 'app/utils/withProject'; +import EmptyStateWarning from 'app/components/emptyStateWarning'; import FeatureTourModal, { - TourStep, TourImage, + TourStep, TourText, } from 'app/components/modals/featureTourModal'; +import OnboardingPanel from 'app/components/onboardingPanel'; +import {t} from 'app/locale'; +import {Organization, Project} from 'app/types'; +import {analytics} from 'app/utils/analytics'; +import withProject from 'app/utils/withProject'; import AsyncView from 'app/views/asyncView'; -import EmptyStateWarning from 'app/components/emptyStateWarning'; import emptyStateImg from '../../../../images/spot/releases-empty-state.svg'; import commitImage from '../../../../images/spot/releases-tour-commits.svg'; -import statsImage from '../../../../images/spot/releases-tour-stats.svg'; -import resolutionImage from '../../../../images/spot/releases-tour-resolution.svg'; import emailImage from '../../../../images/spot/releases-tour-email.svg'; +import resolutionImage from '../../../../images/spot/releases-tour-resolution.svg'; +import statsImage from '../../../../images/spot/releases-tour-stats.svg'; const TOUR_STEPS: TourStep[] = [ { diff --git a/src/sentry/static/sentry/app/views/releases/utils/index.tsx b/src/sentry/static/sentry/app/views/releases/utils/index.tsx index 9c9ba6ea52f84b..49324f11b82cf0 100644 --- a/src/sentry/static/sentry/app/views/releases/utils/index.tsx +++ b/src/sentry/static/sentry/app/views/releases/utils/index.tsx @@ -1,7 +1,7 @@ import round from 'lodash/round'; -import {stringifyQueryObject, QueryResults} from 'app/utils/tokenizeSearch'; import {Release, ReleaseStatus} from 'app/types'; +import {QueryResults, stringifyQueryObject} from 'app/utils/tokenizeSearch'; export const roundDuration = (seconds: number) => { return round(seconds, seconds > 60 ? 0 : 3); diff --git a/src/sentry/static/sentry/app/views/routeError.tsx b/src/sentry/static/sentry/app/views/routeError.tsx index 02865e632b0449..b77f222904dfa1 100644 --- a/src/sentry/static/sentry/app/views/routeError.tsx +++ b/src/sentry/static/sentry/app/views/routeError.tsx @@ -1,14 +1,14 @@ -import {withRouter, WithRouterProps} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; -import * as Sentry from '@sentry/react'; +import {withRouter, WithRouterProps} from 'react-router'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; import Alert from 'app/components/alert'; -import {t, tct} from 'app/locale'; -import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; import {IconWarning} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; type Props = WithRouterProps & { error: Error | undefined; diff --git a/src/sentry/static/sentry/app/views/routeNotFound.tsx b/src/sentry/static/sentry/app/views/routeNotFound.tsx index efef6b29c7541f..deb1ea280214d9 100644 --- a/src/sentry/static/sentry/app/views/routeNotFound.tsx +++ b/src/sentry/static/sentry/app/views/routeNotFound.tsx @@ -1,11 +1,11 @@ import React from 'react'; import DocumentTitle from 'react-document-title'; -import {Location} from 'history'; import * as Sentry from '@sentry/react'; +import {Location} from 'history'; +import NotFound from 'app/components/errors/notFound'; import Footer from 'app/components/footer'; import Sidebar from 'app/components/sidebar'; -import NotFound from 'app/components/errors/notFound'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.tsx b/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.tsx index 6ccd3c6013eefb..4e8094917b09b0 100644 --- a/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.tsx +++ b/src/sentry/static/sentry/app/views/sentryAppExternalInstallation.tsx @@ -1,26 +1,26 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import {addErrorMessage} from 'app/actionCreators/indicator'; +import {installSentryApp} from 'app/actionCreators/sentryAppInstallations'; +import Alert from 'app/components/alert'; +import OrganizationAvatar from 'app/components/avatar/organizationAvatar'; +import SelectControl from 'app/components/forms/selectControl'; +import SentryAppDetailsModal from 'app/components/modals/sentryAppDetailsModal'; +import NarrowLayout from 'app/components/narrowLayout'; +import {IconFlag} from 'app/icons'; +import {t, tct} from 'app/locale'; import { LightWeightOrganization, Organization, SentryApp, SentryAppInstallation, } from 'app/types'; -import {addErrorMessage} from 'app/actionCreators/indicator'; +import {trackIntegrationEvent} from 'app/utils/integrationUtil'; import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; -import {installSentryApp} from 'app/actionCreators/sentryAppInstallations'; -import {t, tct} from 'app/locale'; -import Alert from 'app/components/alert'; import AsyncView from 'app/views/asyncView'; import Field from 'app/views/settings/components/forms/field'; -import {IconFlag} from 'app/icons'; -import NarrowLayout from 'app/components/narrowLayout'; -import OrganizationAvatar from 'app/components/avatar/organizationAvatar'; -import SelectControl from 'app/components/forms/selectControl'; -import SentryAppDetailsModal from 'app/components/modals/sentryAppDetailsModal'; -import {trackIntegrationEvent} from 'app/utils/integrationUtil'; type Props = RouteComponentProps<{sentryAppSlug: string}, {}>; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.tsx b/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.tsx index a0a75a6f8d7c7e..0249c40b9e0079 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountAuthorizations.tsx @@ -1,18 +1,18 @@ +import React from 'react'; import {Link} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; -import React from 'react'; import styled from '@emotion/styled'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import Button from 'app/components/button'; import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; +import {IconDelete} from 'app/icons'; import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {ApiApplication} from 'app/types'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; -import {IconDelete} from 'app/icons'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import {ApiApplication} from 'app/types'; -import space from 'app/styles/space'; type Authorization = { application: ApiApplication; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx b/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx index c52362d3a76770..d5d57c95bf1410 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountClose.jsx @@ -1,7 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import {addErrorMessage, addMessage} from 'app/actionCreators/indicator'; +import {openModal} from 'app/actionCreators/modal'; +import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import Confirm from 'app/components/confirm'; import { Panel, PanelAlert, @@ -9,14 +14,9 @@ import { PanelHeader, PanelItem, } from 'app/components/panels'; -import {addMessage, addErrorMessage} from 'app/actionCreators/indicator'; -import {openModal} from 'app/actionCreators/modal'; +import {IconFlag} from 'app/icons'; import {t, tct} from 'app/locale'; -import Alert from 'app/components/alert'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; -import Confirm from 'app/components/confirm'; -import {IconFlag} from 'app/icons'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountDetails.tsx b/src/sentry/static/sentry/app/views/settings/account/accountDetails.tsx index e5777fbf9db9ef..e6fe4375d99206 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountDetails.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import AsyncView from 'app/views/asyncView'; +import {updateUser} from 'app/actionCreators/account'; +import {APIRequestMethod} from 'app/api'; import AvatarChooser from 'app/components/avatarChooser'; -import Form from 'app/views/settings/components/forms/form'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import accountDetailsFields from 'app/data/forms/accountDetails'; import accountPreferencesFields from 'app/data/forms/accountPreferences'; -import {APIRequestMethod} from 'app/api'; -import {updateUser} from 'app/actionCreators/account'; import {t} from 'app/locale'; import {User} from 'app/types'; +import AsyncView from 'app/views/asyncView'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; const ENDPOINT = '/users/me/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx b/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx index f3cd63b4128deb..07cc2db2ae2952 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountEmails.jsx @@ -1,21 +1,21 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; import AlertLink from 'app/components/alertLink'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import Tag from 'app/components/tagDeprecated'; +import accountEmailsFields from 'app/data/forms/accountEmails'; import {IconDelete, IconStack} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import AsyncView from 'app/views/asyncView'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import Tag from 'app/components/tagDeprecated'; -import accountEmailsFields from 'app/data/forms/accountEmails'; -import space from 'app/styles/space'; -import ButtonBar from 'app/components/buttonBar'; const ENDPOINT = '/users/me/emails/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountIdentities.tsx b/src/sentry/static/sentry/app/views/settings/account/accountIdentities.tsx index 91981c42970b73..3e792ef3f2b18d 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountIdentities.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountIdentities.tsx @@ -3,12 +3,12 @@ import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import {disconnectIdentity} from 'app/actionCreators/account'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import {t} from 'app/locale'; import {Identity} from 'app/types'; +import AsyncView from 'app/views/asyncView'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; const ENDPOINT = '/users/me/social-identities/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx b/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx index 01e9710b6f1cc4..412a7c4da164c2 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountNotificationFineTuning.jsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import Pagination from 'app/components/pagination'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {fields} from 'app/data/forms/accountNotificationSettings'; import {t} from 'app/locale'; +import withOrganizations from 'app/utils/withOrganizations'; import AsyncView from 'app/views/asyncView'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import Pagination from 'app/components/pagination'; import SelectField from 'app/views/settings/components/forms/selectField'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import withOrganizations from 'app/utils/withOrganizations'; const ACCOUNT_NOTIFICATION_FIELDS = { alerts: { diff --git a/src/sentry/static/sentry/app/views/settings/account/accountNotifications.jsx b/src/sentry/static/sentry/app/views/settings/account/accountNotifications.jsx index bf9c878563a61f..8c881d47fa3212 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountNotifications.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountNotifications.jsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import AlertLink from 'app/components/alertLink'; +import Link from 'app/components/links/link'; +import {PanelFooter} from 'app/components/panels'; +import accountNotificationFields from 'app/data/forms/accountNotificationSettings'; +import {IconChevron, IconMail} from 'app/icons'; +import {t} from 'app/locale'; import AsyncView from 'app/views/asyncView'; import Form from 'app/views/settings/components/forms/form'; -import {IconChevron, IconMail} from 'app/icons'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import Link from 'app/components/links/link'; -import {PanelFooter} from 'app/components/panels'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import accountNotificationFields from 'app/data/forms/accountNotificationSettings'; const FINE_TUNE_FOOTERS = { [t('Alerts')]: { diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityDetails.tsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityDetails.tsx index e929d454b805dd..29acc7daa046f4 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityDetails.tsx @@ -5,23 +5,23 @@ * Also displays 2fa method specific details. */ import React from 'react'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; import CircleIndicator from 'app/components/circleIndicator'; import DateTime from 'app/components/dateTime'; +import Tooltip from 'app/components/tooltip'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Authenticator} from 'app/types'; +import AsyncView from 'app/views/asyncView'; import RecoveryCodes from 'app/views/settings/account/accountSecurity/components/recoveryCodes'; import RemoveConfirm from 'app/views/settings/account/accountSecurity/components/removeConfirm'; +import U2fEnrolledDetails from 'app/views/settings/account/accountSecurity/components/u2fEnrolledDetails'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import Tooltip from 'app/components/tooltip'; -import U2fEnrolledDetails from 'app/views/settings/account/accountSecurity/components/u2fEnrolledDetails'; -import space from 'app/styles/space'; -import {Authenticator} from 'app/types'; const ENDPOINT = '/users/me/authenticators/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityEnroll.jsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityEnroll.jsx index bc089213761b01..57edaca3b31e9b 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityEnroll.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityEnroll.jsx @@ -1,7 +1,6 @@ -import {withRouter} from 'react-router'; import React from 'react'; +import {withRouter} from 'react-router'; -import {PanelItem} from 'app/components/panels'; import { addErrorMessage, addMessage, @@ -9,20 +8,21 @@ import { } from 'app/actionCreators/indicator'; import {openRecoveryOptions} from 'app/actionCreators/modal'; import {fetchOrganizationByMember} from 'app/actionCreators/organizations'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; import CircleIndicator from 'app/components/circleIndicator'; +import {PanelItem} from 'app/components/panels'; +import Qrcode from 'app/components/qrcode'; +import U2fsign from 'app/components/u2f/u2fsign'; +import {t} from 'app/locale'; +import getPendingInvite from 'app/utils/getPendingInvite'; +import AsyncView from 'app/views/asyncView'; +import RemoveConfirm from 'app/views/settings/account/accountSecurity/components/removeConfirm'; import Field from 'app/views/settings/components/forms/field'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import Qrcode from 'app/components/qrcode'; -import RemoveConfirm from 'app/views/settings/account/accountSecurity/components/removeConfirm'; +import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; -import U2fsign from 'app/components/u2f/u2fsign'; -import getPendingInvite from 'app/utils/getPendingInvite'; /** * Retrieve additional form fields (or modify ones) based on 2fa method diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityWrapper.tsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityWrapper.tsx index 5830a3be1a9373..993ff44bd28219 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityWrapper.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/accountSecurityWrapper.tsx @@ -1,11 +1,11 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Authenticator, OrganizationSummary} from 'app/types'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {defined} from 'app/utils'; -import {t} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; +import {t} from 'app/locale'; +import {Authenticator, OrganizationSummary} from 'app/types'; +import {defined} from 'app/utils'; const ENDPOINT = '/users/me/authenticators/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/recoveryCodes.jsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/recoveryCodes.jsx index b5bbd1611ff0c7..c3f9377ce07bb6 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/recoveryCodes.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/recoveryCodes.jsx @@ -1,21 +1,21 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import Button from 'app/components/button'; +import Clipboard from 'app/components/clipboard'; +import Confirm from 'app/components/confirm'; import { Panel, + PanelAlert, PanelBody, PanelHeader, PanelItem, - PanelAlert, } from 'app/components/panels'; -import {t} from 'app/locale'; -import Button from 'app/components/button'; -import Clipboard from 'app/components/clipboard'; -import Confirm from 'app/components/confirm'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import {IconCopy, IconDownload, IconPrint} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; class RecoveryCodes extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/removeConfirm.jsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/removeConfirm.jsx index 1fdc0ded7e5227..f1d91515b2621b 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/removeConfirm.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/removeConfirm.jsx @@ -1,8 +1,8 @@ import React from 'react'; +import Confirm from 'app/components/confirm'; import {t} from 'app/locale'; import ConfirmHeader from 'app/views/settings/account/accountSecurity/components/confirmHeader'; -import Confirm from 'app/components/confirm'; import TextBlock from 'app/views/settings/components/text/textBlock'; const message = ( diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/twoFactorRequired.jsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/twoFactorRequired.jsx index a441fcfa12f0eb..de44469b8a2434 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/twoFactorRequired.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/twoFactorRequired.jsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {tct} from 'app/locale'; import Alert from 'app/components/alert'; import ExternalLink from 'app/components/links/externalLink'; import {IconFlag} from 'app/icons'; +import {tct} from 'app/locale'; import space from 'app/styles/space'; import getPendingInvite from 'app/utils/getPendingInvite'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.jsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.jsx index c4036858977e56..a4f729892127c0 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/components/u2fEnrolledDetails.jsx @@ -1,18 +1,18 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; -import ConfirmHeader from 'app/views/settings/account/accountSecurity/components/confirmHeader'; import DateTime from 'app/components/dateTime'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import Tooltip from 'app/components/tooltip'; import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import ConfirmHeader from 'app/views/settings/account/accountSecurity/components/confirmHeader'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import TextBlock from 'app/views/settings/components/text/textBlock'; /** * List u2f devices w/ ability to remove a single device diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/index.tsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/index.tsx index bd593b5dc31273..a6e00f8e7620a2 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/index.tsx @@ -1,27 +1,27 @@ -import * as ReactRouter from 'react-router'; import React from 'react'; +import * as ReactRouter from 'react-router'; import styled from '@emotion/styled'; -import {Authenticator, OrganizationSummary} from 'app/types'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; import CircleIndicator from 'app/components/circleIndicator'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import Field from 'app/views/settings/components/forms/field'; import ListLink from 'app/components/links/listLink'; import NavTabs from 'app/components/navTabs'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import Tooltip from 'app/components/tooltip'; import {IconDelete} from 'app/icons'; -import PasswordForm from 'app/views/settings/account/passwordForm'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Authenticator, OrganizationSummary} from 'app/types'; +import recreateRoute from 'app/utils/recreateRoute'; +import AsyncView from 'app/views/asyncView'; import RemoveConfirm from 'app/views/settings/account/accountSecurity/components/removeConfirm'; +import TwoFactorRequired from 'app/views/settings/account/accountSecurity/components/twoFactorRequired'; +import PasswordForm from 'app/views/settings/account/passwordForm'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import Field from 'app/views/settings/components/forms/field'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import Tooltip from 'app/components/tooltip'; -import TwoFactorRequired from 'app/views/settings/account/accountSecurity/components/twoFactorRequired'; -import recreateRoute from 'app/utils/recreateRoute'; -import space from 'app/styles/space'; type Props = { authenticators: Authenticator[] | null; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/sessionHistory/index.tsx b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/sessionHistory/index.tsx index 123bf798493dfd..2a2ff85249caf7 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSecurity/sessionHistory/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSecurity/sessionHistory/index.tsx @@ -1,15 +1,15 @@ import React from 'react'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; +import ListLink from 'app/components/links/listLink'; +import NavTabs from 'app/components/navTabs'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t} from 'app/locale'; +import {InternetProtocol} from 'app/types'; +import recreateRoute from 'app/utils/recreateRoute'; import AsyncView from 'app/views/asyncView'; -import ListLink from 'app/components/links/listLink'; -import NavTabs from 'app/components/navTabs'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import recreateRoute from 'app/utils/recreateRoute'; -import {InternetProtocol} from 'app/types'; import SessionRow from './sessionRow'; import {tableLayout} from './utils'; diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSettingsLayout.jsx b/src/sentry/static/sentry/app/views/settings/account/accountSettingsLayout.jsx index 13919a02f24788..37f97b98ec1d46 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSettingsLayout.jsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSettingsLayout.jsx @@ -1,10 +1,10 @@ import React from 'react'; -import AccountSettingsNavigation from 'app/views/settings/account/accountSettingsNavigation'; import {fetchOrganizationDetails} from 'app/actionCreators/organizations'; import SentryTypes from 'app/sentryTypes'; -import SettingsLayout from 'app/views/settings/components/settingsLayout'; import withLatestContext from 'app/utils/withLatestContext'; +import AccountSettingsNavigation from 'app/views/settings/account/accountSettingsNavigation'; +import SettingsLayout from 'app/views/settings/components/settingsLayout'; class AccountSettingsLayout extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx b/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx index 13aeac9aac3e8f..9fa4cef3aeb293 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSettingsNavigation.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; import navigationConfiguration from 'app/views/settings/account/navigationConfiguration'; +import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; const AccountSettingsNavigation = () => ( <SettingsNavigation navigationObjects={navigationConfiguration} /> diff --git a/src/sentry/static/sentry/app/views/settings/account/accountSubscriptions.tsx b/src/sentry/static/sentry/app/views/settings/account/accountSubscriptions.tsx index 6723a360062506..351a5e47079154 100644 --- a/src/sentry/static/sentry/app/views/settings/account/accountSubscriptions.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/accountSubscriptions.tsx @@ -1,19 +1,19 @@ import React from 'react'; import styled from '@emotion/styled'; -import moment from 'moment'; import groupBy from 'lodash/groupBy'; +import moment from 'moment'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import DateTime from 'app/components/dateTime'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import Switch from 'app/components/switch'; +import {IconToggle} from 'app/icons'; import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; import AsyncView from 'app/views/asyncView'; -import DateTime from 'app/components/dateTime'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import Switch from 'app/components/switch'; -import space from 'app/styles/space'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import {IconToggle} from 'app/icons'; const ENDPOINT = '/users/me/subscriptions/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx b/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx index 8bf630a3ba0e1a..fe3e2992218dd3 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiApplications/details.tsx @@ -1,19 +1,19 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {ApiApplication} from 'app/types'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import apiApplication from 'app/data/forms/apiApplication'; import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import ConfigStore from 'app/stores/configStore'; +import {ApiApplication} from 'app/types'; +import getDynamicText from 'app/utils/getDynamicText'; +import AsyncView from 'app/views/asyncView'; import Form from 'app/views/settings/components/forms/form'; import FormField from 'app/views/settings/components/forms/formField'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; -import apiApplication from 'app/data/forms/apiApplication'; -import getDynamicText from 'app/utils/getDynamicText'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; type Props = RouteComponentProps<{appId: string}, {}>; type State = { diff --git a/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx b/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx index 4a11effb10f8fb..4f4a0684b301e9 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiApplications/index.tsx @@ -1,20 +1,20 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {ApiApplication} from 'app/types'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; +import Button from 'app/components/button'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {IconAdd} from 'app/icons'; import {t} from 'app/locale'; +import {ApiApplication} from 'app/types'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import Row from 'app/views/settings/account/apiApplications/row'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import {IconAdd} from 'app/icons'; const ROUTE_PREFIX = '/settings/account/api/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/apiApplications/row.tsx b/src/sentry/static/sentry/app/views/settings/account/apiApplications/row.tsx index 0ed1f9aece433c..ee8e9b58bc2e54 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiApplications/row.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiApplications/row.tsx @@ -1,20 +1,20 @@ import React from 'react'; import styled from '@emotion/styled'; -import Link from 'app/components/links/link'; -import {ApiApplication} from 'app/types'; -import {Client} from 'app/api'; -import {PanelItem} from 'app/components/panels'; import { addErrorMessage, addLoadingMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; +import {Client} from 'app/api'; import Button from 'app/components/button'; +import Link from 'app/components/links/link'; +import {PanelItem} from 'app/components/panels'; import {IconDelete} from 'app/icons'; -import getDynamicText from 'app/utils/getDynamicText'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {ApiApplication} from 'app/types'; +import getDynamicText from 'app/utils/getDynamicText'; const ROUTE_PREFIX = '/settings/account/api/'; diff --git a/src/sentry/static/sentry/app/views/settings/account/apiNewToken.tsx b/src/sentry/static/sentry/app/views/settings/account/apiNewToken.tsx index 5aad5c1affe742..ba4eca1cdb13dc 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiNewToken.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiNewToken.tsx @@ -1,13 +1,13 @@ -import {browserHistory} from 'react-router'; -import DocumentTitle from 'react-document-title'; import React from 'react'; +import DocumentTitle from 'react-document-title'; +import {browserHistory} from 'react-router'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {API_ACCESS_SCOPES, DEFAULT_API_ACCESS_SCOPES} from 'app/constants'; import {t, tct} from 'app/locale'; import ApiForm from 'app/views/settings/components/forms/apiForm'; -import FormField from 'app/views/settings/components/forms/formField'; import MultipleCheckbox from 'app/views/settings/components/forms/controls/multipleCheckbox'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import FormField from 'app/views/settings/components/forms/formField'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; diff --git a/src/sentry/static/sentry/app/views/settings/account/apiTokenRow.tsx b/src/sentry/static/sentry/app/views/settings/account/apiTokenRow.tsx index bcef18cda46af4..8a6115f0250b90 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiTokenRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiTokenRow.tsx @@ -1,13 +1,13 @@ import React from 'react'; import styled from '@emotion/styled'; -import {InternalAppApiToken} from 'app/types'; -import {IconSubtract} from 'app/icons'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; import Button from 'app/components/button'; import DateTime from 'app/components/dateTime'; import {PanelItem} from 'app/components/panels'; +import {IconSubtract} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {InternalAppApiToken} from 'app/types'; import getDynamicText from 'app/utils/getDynamicText'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; diff --git a/src/sentry/static/sentry/app/views/settings/account/apiTokens.tsx b/src/sentry/static/sentry/app/views/settings/account/apiTokens.tsx index e257f46ad63f64..2ed64d84f0f4d0 100644 --- a/src/sentry/static/sentry/app/views/settings/account/apiTokens.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/apiTokens.tsx @@ -1,21 +1,21 @@ import React from 'react'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; +import AlertLink from 'app/components/alertLink'; +import Button from 'app/components/button'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t, tct} from 'app/locale'; import {InternalAppApiToken, Organization} from 'app/types'; -import AlertLink from 'app/components/alertLink'; -import ApiTokenRow from 'app/views/settings/account/apiTokenRow'; +import withOrganization from 'app/utils/withOrganization'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; +import ApiTokenRow from 'app/views/settings/account/apiTokenRow'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import withOrganization from 'app/utils/withOrganization'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/account/passwordForm.tsx b/src/sentry/static/sentry/app/views/settings/account/passwordForm.tsx index fe8f8fbaa5df6f..f4f0647c8efd79 100644 --- a/src/sentry/static/sentry/app/views/settings/account/passwordForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/account/passwordForm.tsx @@ -1,13 +1,13 @@ import React from 'react'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import Form from 'app/views/settings/components/forms/form'; import Button from 'app/components/button'; -import ConfigStore from 'app/stores/configStore'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; import {PanelAlert, PanelItem} from 'app/components/panels'; import accountPasswordFields from 'app/data/forms/accountPassword'; +import {t} from 'app/locale'; +import ConfigStore from 'app/stores/configStore'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; type OnSubmitSuccess = Parameters<NonNullable<Form['props']['onSubmitSuccess']>>; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/content.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/content.tsx index 0f431e24461d98..5c3b9dd7b5176d 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/content.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/content.tsx @@ -1,8 +1,8 @@ import React from 'react'; +import {IconWarning} from 'app/icons'; import {t} from 'app/locale'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {IconWarning} from 'app/icons'; import Rules from './rules'; import {Rule} from './types'; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/convertRelayPiiConfig.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/convertRelayPiiConfig.tsx index 0b7916d88f77b6..8a07562fc9f25d 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/convertRelayPiiConfig.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/convertRelayPiiConfig.tsx @@ -1,4 +1,4 @@ -import {RuleType, MethodType, Rule, PiiConfig, Applications, RuleDefault} from './types'; +import {Applications, MethodType, PiiConfig, Rule, RuleDefault, RuleType} from './types'; // Remap PII config format to something that is more usable in React. Ideally // we would stop doing this at some point and make some updates to how we diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/index.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/index.tsx index 9efa08faa225e2..51f0d8ab5709cb 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/index.tsx @@ -1,23 +1,23 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {t, tct} from 'app/locale'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; -import {Client} from 'app/api'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import ExternalLink from 'app/components/links/externalLink'; +import {openModal} from 'app/actionCreators/modal'; +import {Client} from 'app/api'; import Button from 'app/components/button'; +import ExternalLink from 'app/components/links/externalLink'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; import {Organization, Project} from 'app/types'; -import {openModal} from 'app/actionCreators/modal'; -import Edit from './modals/edit'; import Add from './modals/add'; -import OrganizationRules from './organizationRules'; -import {Rule, ProjectId} from './types'; +import Edit from './modals/edit'; +import Content from './content'; import convertRelayPiiConfig from './convertRelayPiiConfig'; +import OrganizationRules from './organizationRules'; import submitRules from './submitRules'; -import Content from './content'; +import {ProjectId, Rule} from './types'; const ADVANCED_DATASCRUBBING_LINK = 'https://docs.sentry.io/data-management/advanced-datascrubbing/'; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/add.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/add.tsx index 7f2edcfe70a22b..45856d17cce488 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/add.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/add.tsx @@ -2,8 +2,9 @@ import React from 'react'; import {t} from 'app/locale'; +import {ProjectId, Rule} from '../types'; + import ModalManager from './modalManager'; -import {Rule, ProjectId} from '../types'; type ModalManagerProps<T extends ProjectId> = ModalManager<T>['props']; type Props<T extends ProjectId> = Omit< diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/edit.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/edit.tsx index de43b86c79348e..91f1abda72f6b3 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/edit.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/edit.tsx @@ -2,8 +2,9 @@ import React from 'react'; import {t} from 'app/locale'; +import {ProjectId, Rule} from '../types'; + import ModalManager from './modalManager'; -import {Rule, ProjectId} from '../types'; type ModalManagerProps<T extends ProjectId> = ModalManager<T>['props']; type Props<T extends ProjectId> = Omit< diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdField.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdField.tsx index f92acb8e6f9813..816b43c7d42f2c 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdField.tsx @@ -2,15 +2,16 @@ import React from 'react'; import styled from '@emotion/styled'; import isEqual from 'lodash/isEqual'; -import Input from 'app/views/settings/components/forms/controls/input'; import {t} from 'app/locale'; import space from 'app/styles/space'; +import Input from 'app/views/settings/components/forms/controls/input'; import Field from 'app/views/settings/components/forms/field'; -import EventIdFieldStatusIcon from './eventIdFieldStatusIcon'; -import {EventIdStatus, EventId} from '../../types'; +import {EventId, EventIdStatus} from '../../types'; import {saveToSourceGroupData} from '../utils'; +import EventIdFieldStatusIcon from './eventIdFieldStatusIcon'; + type Props = { onUpdateEventId: (eventId: string) => void; eventId: EventId; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdFieldStatusIcon.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdFieldStatusIcon.tsx index c35c1448cce9e0..7bae4a3382e210 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdFieldStatusIcon.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/eventIdFieldStatusIcon.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import ControlState from 'app/views/settings/components/forms/field/controlState'; -import {t} from 'app/locale'; import Tooltip from 'app/components/tooltip'; -import {IconClose, IconCheckmark} from 'app/icons'; +import {IconCheckmark, IconClose} from 'app/icons'; +import {t} from 'app/locale'; +import ControlState from 'app/views/settings/components/forms/field/controlState'; import {EventIdStatus} from '../../types'; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/index.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/index.tsx index 81700e7ef533ec..8306991723dbec 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/index.tsx @@ -2,25 +2,26 @@ import React from 'react'; import styled from '@emotion/styled'; import sortBy from 'lodash/sortBy'; -import space from 'app/styles/space'; +import Button from 'app/components/button'; +import {IconChevron} from 'app/icons'; import {t} from 'app/locale'; +import space from 'app/styles/space'; import Input from 'app/views/settings/components/forms/controls/input'; import Field from 'app/views/settings/components/forms/field'; -import Button from 'app/components/button'; -import {IconChevron} from 'app/icons'; -import EventIdField from './eventIdField'; -import SelectField from './selectField'; -import SourceField from './sourceField'; -import {getRuleLabel, getMethodLabel} from '../../utils'; import { + EventId, + KeysOfUnion, MethodType, - RuleType, Rule, + RuleType, SourceSuggestion, - KeysOfUnion, - EventId, } from '../../types'; +import {getMethodLabel, getRuleLabel} from '../../utils'; + +import EventIdField from './eventIdField'; +import SelectField from './selectField'; +import SourceField from './sourceField'; type Values = Omit<Record<KeysOfUnion<Rule>, string>, 'id'>; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/selectField.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/selectField.tsx index 9bfcc7f42db60f..067ea088dae6b9 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/selectField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/selectField.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import styled from '@emotion/styled'; // eslint import checks can't find types in the flow code. // eslint-disable-next-line import/named import {components, OptionProps} from 'react-select'; +import styled from '@emotion/styled'; import SelectControl from 'app/components/forms/selectControl'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceField.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceField.tsx index 8f4373b4155274..16b7ed3c8f5349 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceField.tsx @@ -1,15 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; -import InputField from 'app/views/settings/components/forms/inputField'; import TextOverflow from 'app/components/textOverflow'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import {defined} from 'app/utils'; +import InputField from 'app/views/settings/components/forms/inputField'; -import {unarySuggestions, binarySuggestions} from '../../utils'; -import SourceSuggestionExamples from './sourceSuggestionExamples'; import {SourceSuggestion, SourceSuggestionType} from '../../types'; +import {binarySuggestions, unarySuggestions} from '../../utils'; + +import SourceSuggestionExamples from './sourceSuggestionExamples'; const defaultHelp = t( 'Where to look. In the simplest case this can be an attribute name.' diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceSuggestionExamples.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceSuggestionExamples.tsx index 1c1d857c036b47..7177646379aa28 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceSuggestionExamples.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/form/sourceSuggestionExamples.tsx @@ -1,10 +1,10 @@ -import Modal from 'react-bootstrap/lib/Modal'; import React from 'react'; +import Modal from 'react-bootstrap/lib/Modal'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; import Button from 'app/components/button'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; type Props = { examples: Array<string>; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/modalManager.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/modalManager.tsx index 4d92da7823624d..abd71bbedbe403 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/modalManager.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/modalManager.tsx @@ -1,26 +1,27 @@ import React from 'react'; -import omit from 'lodash/omit'; import isEqual from 'lodash/isEqual'; +import omit from 'lodash/omit'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import {ModalRenderProps} from 'app/actionCreators/modal'; import {Client} from 'app/api'; import {t} from 'app/locale'; -import {ModalRenderProps} from 'app/actionCreators/modal'; import {Organization, Project} from 'app/types'; +import submitRules from '../submitRules'; import { - RuleType, + EventIdStatus, + KeysOfUnion, MethodType, - Rule, ProjectId, - KeysOfUnion, - EventIdStatus, + Rule, + RuleType, } from '../types'; -import submitRules from '../submitRules'; +import {valueSuggestions} from '../utils'; + import Form from './form'; -import Modal from './modal'; import handleError, {ErrorType} from './handleError'; -import {valueSuggestions} from '../utils'; +import Modal from './modal'; import {fetchSourceGroupData, saveToSourceGroupData} from './utils'; type FormProps = React.ComponentProps<typeof Form>; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/utils.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/utils.tsx index 04de0ada2c3df9..f94ebcb83557d2 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/utils.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/modals/utils.tsx @@ -1,7 +1,8 @@ -import {fetchFromStorage, saveToStorage} from './localStorage'; -import {EventIdStatus, EventId} from '../types'; +import {EventId, EventIdStatus} from '../types'; import {valueSuggestions} from '../utils'; +import {fetchFromStorage, saveToStorage} from './localStorage'; + function fetchSourceGroupData() { const fetchedSourceGroupData = fetchFromStorage(); if (!fetchedSourceGroupData) { diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/organizationRules.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/organizationRules.tsx index 2532aa2d5d9853..b25c7429d881b1 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/organizationRules.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/organizationRules.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import {IconChevron} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import Rules from './rules'; import {Rule} from './types'; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/rules.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/rules.tsx index a029a4869049c4..1bdc3af5643ab7 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/rules.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/rules.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; +import Button from 'app/components/button'; import TextOverflow from 'app/components/textOverflow'; import {IconDelete, IconEdit} from 'app/icons'; -import Button from 'app/components/button'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {MethodType, Rule, RuleType} from './types'; import {getMethodLabel, getRuleLabel} from './utils'; -import {RuleType, MethodType, Rule} from './types'; type Props = { rules: Array<Rule>; diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/submitRules.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/submitRules.tsx index ce63fb27223f44..a7d90377589c27 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/submitRules.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/submitRules.tsx @@ -1,6 +1,6 @@ import {Client} from 'app/api'; -import {RuleType, MethodType, PiiConfig, Applications, Rule} from './types'; +import {Applications, MethodType, PiiConfig, Rule, RuleType} from './types'; function getSubmitFormatRule(rule: Rule): PiiConfig { if (rule.type === RuleType.PATTERN && rule.method === MethodType.REPLACE) { diff --git a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/utils.tsx b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/utils.tsx index 940abde6897913..4be3ab5c0bf11d 100644 --- a/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/utils.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/dataScrubbing/utils.tsx @@ -1,6 +1,6 @@ import {t} from 'app/locale'; -import {RuleType, MethodType, SourceSuggestionType, SourceSuggestion} from './types'; +import {MethodType, RuleType, SourceSuggestion, SourceSuggestionType} from './types'; function getRuleLabel(type: RuleType) { switch (type) { @@ -167,9 +167,9 @@ const valueSuggestions: Array<SourceSuggestion> = [ ]; export { - getRuleLabel, + binarySuggestions, getMethodLabel, + getRuleLabel, unarySuggestions, - binarySuggestions, valueSuggestions, }; diff --git a/src/sentry/static/sentry/app/views/settings/components/emptyMessage.tsx b/src/sentry/static/sentry/app/views/settings/components/emptyMessage.tsx index cc84e0fb7f2dfd..4b7649f3de9615 100644 --- a/src/sentry/static/sentry/app/views/settings/components/emptyMessage.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/emptyMessage.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import TextBlock from 'app/views/settings/components/text/textBlock'; import space from 'app/styles/space'; +import TextBlock from 'app/views/settings/components/text/textBlock'; type Props = { title?: React.ReactNode; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/apiForm.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/apiForm.tsx index d8d9434855be60..707b0a9d460bc8 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/apiForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/apiForm.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {Client} from 'app/api'; import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; +import {Client} from 'app/api'; import {t} from 'app/locale'; import Form from 'app/views/settings/components/forms/form'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/booleanField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/booleanField.jsx index 7224d69798c9c4..bd254e28ad37d3 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/booleanField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/booleanField.jsx @@ -1,9 +1,9 @@ import React from 'react'; import PropTypes from 'prop-types'; -import InputField from 'app/views/settings/components/forms/inputField'; -import Switch from 'app/components/switch'; import Confirm from 'app/components/confirm'; +import Switch from 'app/components/switch'; +import InputField from 'app/views/settings/components/forms/inputField'; export default class BooleanField extends InputField { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/choiceMapperField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/choiceMapperField.jsx index ebe86ad20a0ec0..782267465a543d 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/choiceMapperField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/choiceMapperField.jsx @@ -1,16 +1,16 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {defined, objectIsEmpty} from 'app/utils'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; -import InputField from 'app/views/settings/components/forms/inputField'; import SelectControl from 'app/components/forms/selectControl'; import {IconAdd, IconDelete} from 'app/icons'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {defined, objectIsEmpty} from 'app/utils'; +import InputField from 'app/views/settings/components/forms/inputField'; const selectControlShape = PropTypes.shape(SelectControl.propTypes); diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/input.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/input.tsx index 68259834b5aeb7..c860f965f17da5 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/input.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/input.tsx @@ -1,5 +1,5 @@ -import styled, {StyledComponent} from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import styled, {StyledComponent} from '@emotion/styled'; import {inputStyles} from 'app/styles/input'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx index cf6c788d94f837..e8fe5ed50ed79c 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/multipleCheckbox.jsx @@ -1,7 +1,7 @@ -import {Box} from 'reflexbox'; -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import {Box} from 'reflexbox'; // eslint-disable-line no-restricted-imports import {defined} from 'app/utils'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioBoolean.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioBoolean.jsx index 720cb3189e319d..59fa71465a4c58 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioBoolean.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioBoolean.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; class Option extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx index 392bfe7efc8f6b..83be5fb2e631a2 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/radioGroup.tsx @@ -1,7 +1,7 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import Radio from 'app/components/radio'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/rangeSlider.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/rangeSlider.tsx index 1920523268a761..1e9bc69db3346f 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/rangeSlider.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/rangeSlider.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {t} from 'app/locale'; -import Input from 'app/views/settings/components/forms/controls/input'; import space from 'app/styles/space'; +import Input from 'app/views/settings/components/forms/controls/input'; type Props = { name: string; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/controls/textarea.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/controls/textarea.tsx index 835689fd2a20d0..755bca9bf0c211 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/controls/textarea.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/controls/textarea.tsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React from 'react'; import TextareaAutosize from 'react-autosize-textarea'; -import styled from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {inputStyles} from 'app/styles/input'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/datePickerField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/datePickerField.tsx index d75505a9dc52f3..d6a9118598b24d 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/datePickerField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/datePickerField.tsx @@ -1,14 +1,14 @@ import 'react-date-range/dist/styles.css'; import 'react-date-range/dist/theme/default.css'; -import {Calendar} from 'react-date-range'; import React from 'react'; -import moment from 'moment'; +import {Calendar} from 'react-date-range'; import styled from '@emotion/styled'; +import moment from 'moment'; -import {inputStyles} from 'app/styles/input'; import DropdownMenu from 'app/components/dropdownMenu'; import {IconCalendar} from 'app/icons'; +import {inputStyles} from 'app/styles/input'; import space from 'app/styles/space'; import InputField, {onEvent} from './inputField'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/field/controlState.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/field/controlState.tsx index 9006e2a31c9c51..b717ff97d0cef3 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/field/controlState.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/field/controlState.tsx @@ -1,8 +1,8 @@ import React from 'react'; import styled from '@emotion/styled'; -import {fadeOut, pulse} from 'app/styles/animations'; import {IconCheckmark, IconWarning} from 'app/icons'; +import {fadeOut, pulse} from 'app/styles/animations'; import Spinner from 'app/views/settings/components/forms/spinner'; type Props = { diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldControl.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldControl.tsx index 3dc617cab9531e..c3e8f296c1e659 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldControl.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldControl.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import FieldControlState from 'app/views/settings/components/forms/field/fieldControlState'; import QuestionTooltip from 'app/components/questionTooltip'; import space from 'app/styles/space'; +import FieldControlState from 'app/views/settings/components/forms/field/fieldControlState'; const defaultProps = { flexibleControlStateSize: false, diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldLabel.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldLabel.tsx index 0d16beb1294ffb..88055ea8940207 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldLabel.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/field/fieldLabel.tsx @@ -1,5 +1,5 @@ -import styled from '@emotion/styled'; import isPropValid from '@emotion/is-prop-valid'; +import styled from '@emotion/styled'; import space from 'app/styles/space'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/field/index.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/field/index.tsx index f662cdf927ab88..7c73b7bfea8c28 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/field/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/field/index.tsx @@ -5,8 +5,8 @@ * This is unconnected to any Form state */ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import QuestionTooltip from 'app/components/questionTooltip'; import ControlState from 'app/views/settings/components/forms/field/controlState'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/fieldFromConfig.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/fieldFromConfig.tsx index 2dfca2f28c8eb2..aef39533394fc0 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/fieldFromConfig.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/fieldFromConfig.tsx @@ -1,24 +1,24 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {Scope} from 'app/types'; import BooleanField from './booleanField'; +import ChoiceMapperField from './choiceMapperField'; import EmailField from './emailField'; +import FieldSeparator from './fieldSeparator'; import HiddenField from './hiddenField'; +import InputField from './inputField'; import NumberField from './numberField'; +import ProjectMapperField from './projectMapperField'; +import RadioField from './radioField'; import RangeField from './rangeField'; +import RichListField from './richListField'; import SelectField from './selectField'; +import SentryProjectSelectorField from './sentryProjectSelectorField'; import TableField from './tableField'; -import TextField from './textField'; import TextareaField from './textareaField'; -import RadioField from './radioField'; -import InputField from './inputField'; -import ChoiceMapperField from './choiceMapperField'; -import RichListField from './richListField'; -import FieldSeparator from './fieldSeparator'; -import ProjectMapperField from './projectMapperField'; -import SentryProjectSelectorField from './sentryProjectSelectorField'; +import TextField from './textField'; import {Field} from './type'; type Props = { diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/form.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/form.tsx index 792413c41e0e98..f87df5e38a526f 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/form.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/form.tsx @@ -1,15 +1,15 @@ -import {Observer} from 'mobx-react'; -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import {Observer} from 'mobx-react'; +import PropTypes from 'prop-types'; import {APIRequestMethod} from 'app/api'; -import {t} from 'app/locale'; import Button from 'app/components/button'; -import FormModel, {FormOptions} from 'app/views/settings/components/forms/model'; import Panel from 'app/components/panels/panel'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import {isRenderFunc} from 'app/utils/isRenderFunc'; +import FormModel, {FormOptions} from 'app/views/settings/components/forms/model'; type Data = Record<string, any>; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/formField/controlState.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/formField/controlState.tsx index d2b6db439143bc..4f46f0fd3809e5 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/formField/controlState.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/formField/controlState.tsx @@ -1,8 +1,8 @@ -import {Observer} from 'mobx-react'; import React from 'react'; +import {Observer} from 'mobx-react'; -import ControlState from 'app/views/settings/components/forms/field/controlState'; import FormState from 'app/components/forms/state'; +import ControlState from 'app/views/settings/components/forms/field/controlState'; import FormModel from 'app/views/settings/components/forms/model'; type Props = { diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/formField/index.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/formField/index.tsx index 863318bd95c10e..5a414fc54c12b1 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/formField/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/formField/index.tsx @@ -1,21 +1,21 @@ -import {Observer} from 'mobx-react'; -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import {Observer} from 'mobx-react'; +import PropTypes from 'prop-types'; +import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import PanelAlert from 'app/components/panels/panelAlert'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import {defined} from 'app/utils'; import {sanitizeQuerySelector} from 'app/utils/sanitizeQuerySelector'; -import {t} from 'app/locale'; -import Button from 'app/components/button'; import Field from 'app/views/settings/components/forms/field'; import FieldControl from 'app/views/settings/components/forms/field/fieldControl'; import FieldErrorReason from 'app/views/settings/components/forms/field/fieldErrorReason'; import FormFieldControlState from 'app/views/settings/components/forms/formField/controlState'; -import PanelAlert from 'app/components/panels/panelAlert'; -import ReturnButton from 'app/views/settings/components/forms/returnButton'; -import space from 'app/styles/space'; -import Alert from 'app/components/alert'; import FormModel from 'app/views/settings/components/forms/model'; +import ReturnButton from 'app/views/settings/components/forms/returnButton'; /** * Some fields don't need to implement their own onChange handlers, in diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/formPanel.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/formPanel.tsx index 5499b21f20a07b..2e9a12880cee6a 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/formPanel.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/formPanel.tsx @@ -1,9 +1,9 @@ import React from 'react'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; -import {sanitizeQuerySelector} from 'app/utils/sanitizeQuerySelector'; import {Scope} from 'app/types'; +import {sanitizeQuerySelector} from 'app/utils/sanitizeQuerySelector'; +import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; import {FieldObject, JsonFormObject} from './type'; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/inputField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/inputField.tsx index f621e55a9a5c3e..8189c9bf977095 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/inputField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/inputField.tsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; import omit from 'lodash/omit'; +import PropTypes from 'prop-types'; -import FormField from 'app/views/settings/components/forms/formField'; import Input from 'app/views/settings/components/forms/controls/input'; +import FormField from 'app/views/settings/components/forms/formField'; type Props = { field?: (props) => React.ReactNode; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx index 3a60a791ba7556..c32c5927ba1a92 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/jsonForm.tsx @@ -1,16 +1,16 @@ -import {Box} from 'reflexbox'; -import PropTypes from 'prop-types'; import React from 'react'; -import scrollToElement from 'scroll-to-element'; -import {Location} from 'history'; import * as Sentry from '@sentry/react'; +import {Location} from 'history'; +import PropTypes from 'prop-types'; +import {Box} from 'reflexbox'; // eslint-disable-line no-restricted-imports +import scrollToElement from 'scroll-to-element'; import {defined} from 'app/utils'; import {sanitizeQuerySelector} from 'app/utils/sanitizeQuerySelector'; -import {Field, FieldObject, JsonFormObject} from './type'; import FieldFromConfig from './fieldFromConfig'; import FormPanel from './formPanel'; +import {Field, FieldObject, JsonFormObject} from './type'; type DefaultProps = { additionalFieldProps: {[key: string]: any}; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx index ee93ed8875ef29..38e445bf24bf3a 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/model.tsx @@ -1,11 +1,11 @@ -import {observable, computed, action, ObservableMap} from 'mobx'; import isEqual from 'lodash/isEqual'; +import {action, computed, observable, ObservableMap} from 'mobx'; -import {Client, APIRequestMethod} from 'app/api'; import {addErrorMessage, saveOnBlurUndoMessage} from 'app/actionCreators/indicator'; -import {defined} from 'app/utils'; -import {t} from 'app/locale'; +import {APIRequestMethod, Client} from 'app/api'; import FormState from 'app/components/forms/state'; +import {t} from 'app/locale'; +import {defined} from 'app/utils'; type Snapshot = Map<string, FieldValue>; type SaveSnapshot = (() => number) | null; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/passwordField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/passwordField.jsx index 26a93f2ca5b52f..1e6d6da7089023 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/passwordField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/passwordField.jsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import InputField from 'app/views/settings/components/forms/inputField'; import FormState from 'app/components/forms/state'; +import InputField from 'app/views/settings/components/forms/inputField'; // TODO(dcramer): im not entirely sure this is working correctly with // value propagation in all scenarios diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/projectMapperField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/projectMapperField.tsx index 0c542744fbf3b4..8d439b41fc84ce 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/projectMapperField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/projectMapperField.tsx @@ -1,29 +1,29 @@ import React from 'react'; -import styled from '@emotion/styled'; import {components} from 'react-select'; +import styled from '@emotion/styled'; -import space from 'app/styles/space'; -import InputField from 'app/views/settings/components/forms/inputField'; -import FormFieldControlState from 'app/views/settings/components/forms/formField/controlState'; -import FieldErrorReason from 'app/views/settings/components/forms/field/fieldErrorReason'; -import FormModel from 'app/views/settings/components/forms/model'; -import {ProjectMapperType} from 'app/views/settings/components/forms/type'; +import Button from 'app/components/button'; import SelectControl from 'app/components/forms/selectControl'; import IdBadge from 'app/components/idBadge'; -import Button from 'app/components/button'; +import ExternalLink from 'app/components/links/externalLink'; +import {PanelAlert} from 'app/components/panels'; import { - IconVercel, - IconGeneric, - IconDelete, - IconOpen, IconAdd, IconArrow, + IconDelete, + IconGeneric, + IconOpen, + IconVercel, } from 'app/icons'; -import ExternalLink from 'app/components/links/externalLink'; import {t} from 'app/locale'; -import {removeAtArrayIndex} from 'app/utils/removeAtArrayIndex'; +import space from 'app/styles/space'; import {safeGetQsParam} from 'app/utils/integrationUtil'; -import {PanelAlert} from 'app/components/panels'; +import {removeAtArrayIndex} from 'app/utils/removeAtArrayIndex'; +import FieldErrorReason from 'app/views/settings/components/forms/field/fieldErrorReason'; +import FormFieldControlState from 'app/views/settings/components/forms/formField/controlState'; +import InputField from 'app/views/settings/components/forms/inputField'; +import FormModel from 'app/views/settings/components/forms/model'; +import {ProjectMapperType} from 'app/views/settings/components/forms/type'; type MappedValue = string | number; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/radioBooleanField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/radioBooleanField.tsx index 0496ab8f89fc93..f4f54806bf7fb7 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/radioBooleanField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/radioBooleanField.tsx @@ -1,8 +1,8 @@ import React from 'react'; import omit from 'lodash/omit'; -import InputField from './inputField'; import RadioBoolean from './controls/radioBoolean'; +import InputField from './inputField'; type Props = Omit<InputField['props'], 'field'>; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/rangeField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/rangeField.tsx index b597f51b905c68..c35c2af077ed6d 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/rangeField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/rangeField.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import InputField, {onEvent} from 'app/views/settings/components/forms/inputField'; import RangeSlider from 'app/views/settings/components/forms/controls/rangeSlider'; +import InputField, {onEvent} from 'app/views/settings/components/forms/inputField'; type DefaultProps = { formatMessageValue?: false | Function; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.tsx index 3d058c78cfb0f7..45f71354a7661a 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/returnButton.tsx @@ -1,9 +1,9 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {IconReturn} from 'app/icons/iconReturn'; import Tooltip from 'app/components/tooltip'; +import {IconReturn} from 'app/icons/iconReturn'; +import {t} from 'app/locale'; const SubmitButton = styled('div')` background: transparent; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx index 8c30eff740379d..928880cbc91066 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/richListField.jsx @@ -1,15 +1,15 @@ -import pickBy from 'lodash/pickBy'; -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import pickBy from 'lodash/pickBy'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import Button from 'app/components/button'; +import Confirm from 'app/components/confirm'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; import {IconAdd, IconDelete, IconSettings} from 'app/icons'; +import {t} from 'app/locale'; import InputField from 'app/views/settings/components/forms/inputField'; -import Confirm from 'app/components/confirm'; const RichListProps = { /** diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx index 5090770c2d2d81..efa38997f94242 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/selectField.jsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import InputField from 'app/views/settings/components/forms/inputField'; import SelectControl from 'app/components/forms/selectControl'; +import InputField from 'app/views/settings/components/forms/inputField'; const getChoices = props => { let choices = props.choices || []; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/sentryProjectSelectorField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/sentryProjectSelectorField.tsx index 8964783bda10c2..1b1492124da7d5 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/sentryProjectSelectorField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/sentryProjectSelectorField.tsx @@ -1,11 +1,11 @@ import React from 'react'; import {components} from 'react-select'; -import {t} from 'app/locale'; -import InputField from 'app/views/settings/components/forms/inputField'; -import IdBadge from 'app/components/idBadge'; import SelectControl from 'app/components/forms/selectControl'; +import IdBadge from 'app/components/idBadge'; +import {t} from 'app/locale'; import {Project} from 'app/types'; +import InputField from 'app/views/settings/components/forms/inputField'; const defaultProps = { avatarSize: 20, diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/tableField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/tableField.tsx index 24152878ed5f43..1266be9f0b6d6b 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/tableField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/tableField.tsx @@ -2,16 +2,16 @@ import React from 'react'; import styled from '@emotion/styled'; import flatten from 'lodash/flatten'; -import {defined, objectIsEmpty} from 'app/utils'; -import {t} from 'app/locale'; +import Alert from 'app/components/alert'; import Button from 'app/components/button'; -import Input from 'app/views/settings/components/forms/controls/input'; -import InputField from 'app/views/settings/components/forms/inputField'; -import space from 'app/styles/space'; -import {IconAdd, IconDelete} from 'app/icons'; import Confirm from 'app/components/confirm'; -import Alert from 'app/components/alert'; +import {IconAdd, IconDelete} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {defined, objectIsEmpty} from 'app/utils'; import {singleLineRenderer} from 'app/utils/marked'; +import Input from 'app/views/settings/components/forms/controls/input'; +import InputField from 'app/views/settings/components/forms/inputField'; import {TableType} from 'app/views/settings/components/forms/type'; const defaultProps = { diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/textCopyInput.jsx b/src/sentry/static/sentry/app/views/settings/components/forms/textCopyInput.jsx index e2aefafa4263d5..d15735fe0a6dc1 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/textCopyInput.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/textCopyInput.jsx @@ -1,13 +1,13 @@ -import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {inputStyles} from 'app/styles/input'; -import {selectText} from 'app/utils/selectText'; import Button from 'app/components/button'; import Clipboard from 'app/components/clipboard'; import {IconCopy} from 'app/icons'; +import {inputStyles} from 'app/styles/input'; +import {selectText} from 'app/utils/selectText'; const Wrapper = styled('div')` display: flex; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/textareaField.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/textareaField.tsx index f08e6b2e58a8be..32ac0ac2287c75 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/textareaField.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/textareaField.tsx @@ -1,8 +1,8 @@ import React from 'react'; import omit from 'lodash/omit'; -import InputField from 'app/views/settings/components/forms/inputField'; import Textarea from 'app/views/settings/components/forms/controls/textarea'; +import InputField from 'app/views/settings/components/forms/inputField'; type Props = Omit<InputField['props'], 'field'>; diff --git a/src/sentry/static/sentry/app/views/settings/components/forms/type.tsx b/src/sentry/static/sentry/app/views/settings/components/forms/type.tsx index 8584fe95a333e3..65c4067affc844 100644 --- a/src/sentry/static/sentry/app/views/settings/components/forms/type.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/forms/type.tsx @@ -1,9 +1,9 @@ import React from 'react'; import {createFilter} from 'react-select'; -import RangeSlider from 'app/views/settings/components/forms/controls/rangeSlider'; import Alert from 'app/components/alert'; import {AvatarProject, Project} from 'app/types'; +import RangeSlider from 'app/views/settings/components/forms/controls/rangeSlider'; export const FieldType = [ 'array', diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx index b680199907c0ed..1081348edb5516 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown.jsx @@ -1,8 +1,8 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import Crumb from 'app/views/settings/components/settingsBreadcrumb/crumb'; import DropdownAutoCompleteMenu from 'app/components/dropdownAutoComplete/menu'; +import Crumb from 'app/views/settings/components/settingsBreadcrumb/crumb'; import Divider from 'app/views/settings/components/settingsBreadcrumb/divider'; const EXIT_DELAY = 0; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/divider.jsx b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/divider.jsx index 2cb3f4f3d498d1..c460df9b861f55 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/divider.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/divider.jsx @@ -1,6 +1,6 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {IconChevron} from 'app/icons'; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/index.jsx b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/index.jsx index 8293c3c01836ef..ed4a989ca89ff0 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/index.jsx @@ -1,20 +1,20 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; import styled from '@emotion/styled'; +import createReactClass from 'create-react-class'; +import PropTypes from 'prop-types'; +import Reflux from 'reflux'; +import SettingsBreadcrumbActions from 'app/actions/settingsBreadcrumbActions'; +import Link from 'app/components/links/link'; +import SentryTypes from 'app/sentryTypes'; +import SettingsBreadcrumbStore from 'app/stores/settingsBreadcrumbStore'; +import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; +import recreateRoute from 'app/utils/recreateRoute'; import Crumb from 'app/views/settings/components/settingsBreadcrumb/crumb'; import Divider from 'app/views/settings/components/settingsBreadcrumb/divider'; import OrganizationCrumb from 'app/views/settings/components/settingsBreadcrumb/organizationCrumb'; import ProjectCrumb from 'app/views/settings/components/settingsBreadcrumb/projectCrumb'; -import SentryTypes from 'app/sentryTypes'; -import SettingsBreadcrumbActions from 'app/actions/settingsBreadcrumbActions'; -import SettingsBreadcrumbStore from 'app/stores/settingsBreadcrumbStore'; import TeamCrumb from 'app/views/settings/components/settingsBreadcrumb/teamCrumb'; -import Link from 'app/components/links/link'; -import getRouteStringFromRoutes from 'app/utils/getRouteStringFromRoutes'; -import recreateRoute from 'app/utils/recreateRoute'; const MENUS = { Organization: OrganizationCrumb, diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/organizationCrumb.jsx b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/organizationCrumb.jsx index 2ee0884318d26c..497e390b5d7682 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/organizationCrumb.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/organizationCrumb.jsx @@ -1,15 +1,15 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import BreadcrumbDropdown from 'app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown'; import IdBadge from 'app/components/idBadge'; -import MenuItem from 'app/views/settings/components/settingsBreadcrumb/menuItem'; import SentryTypes from 'app/sentryTypes'; -import findFirstRouteWithoutRouteParam from 'app/views/settings/components/settingsBreadcrumb/findFirstRouteWithoutRouteParam'; import recreateRoute from 'app/utils/recreateRoute'; import withLatestContext from 'app/utils/withLatestContext'; +import BreadcrumbDropdown from 'app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown'; +import findFirstRouteWithoutRouteParam from 'app/views/settings/components/settingsBreadcrumb/findFirstRouteWithoutRouteParam'; +import MenuItem from 'app/views/settings/components/settingsBreadcrumb/menuItem'; import {CrumbLink} from '.'; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/projectCrumb.jsx b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/projectCrumb.jsx index e30ec0b316bfe4..83e8f8a958c0e4 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/projectCrumb.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/projectCrumb.jsx @@ -1,19 +1,19 @@ -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import BreadcrumbDropdown from 'app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown'; import IdBadge from 'app/components/idBadge'; import LoadingIndicator from 'app/components/loadingIndicator'; -import MenuItem from 'app/views/settings/components/settingsBreadcrumb/menuItem'; import SentryTypes from 'app/sentryTypes'; -import findFirstRouteWithoutRouteParam from 'app/views/settings/components/settingsBreadcrumb/findFirstRouteWithoutRouteParam'; +import space from 'app/styles/space'; import recreateRoute from 'app/utils/recreateRoute'; import replaceRouterParams from 'app/utils/replaceRouterParams'; -import space from 'app/styles/space'; import withLatestContext from 'app/utils/withLatestContext'; import withProjects from 'app/utils/withProjects'; +import BreadcrumbDropdown from 'app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown'; +import findFirstRouteWithoutRouteParam from 'app/views/settings/components/settingsBreadcrumb/findFirstRouteWithoutRouteParam'; +import MenuItem from 'app/views/settings/components/settingsBreadcrumb/menuItem'; import {CrumbLink} from '.'; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/teamCrumb.jsx b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/teamCrumb.jsx index 7b4ff00cced082..8e3f17984e8411 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/teamCrumb.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsBreadcrumb/teamCrumb.jsx @@ -1,12 +1,12 @@ +import React from 'react'; import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; -import React from 'react'; -import BreadcrumbDropdown from 'app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown'; import IdBadge from 'app/components/idBadge'; -import MenuItem from 'app/views/settings/components/settingsBreadcrumb/menuItem'; import recreateRoute from 'app/utils/recreateRoute'; import withTeams from 'app/utils/withTeams'; +import BreadcrumbDropdown from 'app/views/settings/components/settingsBreadcrumb/breadcrumbDropdown'; +import MenuItem from 'app/views/settings/components/settingsBreadcrumb/menuItem'; import {CrumbLink} from '.'; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsLayout.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsLayout.tsx index 9d8c2b5212e1ba..c57a19ff06404b 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsLayout.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsLayout.tsx @@ -1,14 +1,14 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; import Button from 'app/components/button'; -import {slideInLeft, fadeIn} from 'app/styles/animations'; import {IconClose, IconMenu} from 'app/icons'; +import {t} from 'app/locale'; +import {fadeIn, slideInLeft} from 'app/styles/animations'; +import space from 'app/styles/space'; import SettingsBreadcrumb from './settingsBreadcrumb'; import SettingsHeader from './settingsHeader'; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsNavItem.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsNavItem.tsx index 14e0ebf694ecd5..2f4e9259747439 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsNavItem.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsNavItem.tsx @@ -1,10 +1,10 @@ -import {Link} from 'react-router'; import React from 'react'; +import {Link} from 'react-router'; import styled from '@emotion/styled'; import Badge from 'app/components/badge'; -import HookOrDefault from 'app/components/hookOrDefault'; import FeatureBadge from 'app/components/featureBadge'; +import HookOrDefault from 'app/components/hookOrDefault'; type Props = { to: React.ComponentProps<Link>['to']; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx index 291e257c9efcdd..b64f957a4f920c 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsNavigation.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import * as Sentry from '@sentry/react'; import styled from '@emotion/styled'; +import * as Sentry from '@sentry/react'; import space from 'app/styles/space'; import SettingsNavigationGroup from 'app/views/settings/components/settingsNavigationGroup'; -import {NavigationSection, NavigationProps} from 'app/views/settings/types'; +import {NavigationProps, NavigationSection} from 'app/views/settings/types'; type DefaultProps = { /** diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsNavigationGroup.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsNavigationGroup.tsx index 9f6ef80e5b9614..b3a12a0a7f2756 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsNavigationGroup.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsNavigationGroup.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import SettingsNavItem from 'app/views/settings/components/settingsNavItem'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import replaceRouterParams from 'app/utils/replaceRouterParams'; +import SettingsNavItem from 'app/views/settings/components/settingsNavItem'; import {NavigationGroupProps} from 'app/views/settings/types'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; const SettingsNavigationGroup = (props: NavigationGroupProps) => { const {organization, project, name, items} = props; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsPageHeader.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsPageHeader.tsx index c6effb9959c9b9..493b7f7ab02f36 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsPageHeader.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsPageHeader.tsx @@ -1,9 +1,9 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import space from 'app/styles/space'; import {HeaderTitle} from 'app/styles/organization'; +import space from 'app/styles/space'; type Props = { // The title diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsProjectItem.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsProjectItem.tsx index 5e720bf260574a..18a325f459d03e 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsProjectItem.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsProjectItem.tsx @@ -1,11 +1,11 @@ -import styled from '@emotion/styled'; import React from 'react'; +import styled from '@emotion/styled'; -import BookmarkStar from 'app/components/projects/bookmarkStar'; import Link from 'app/components/links/link'; import ProjectLabel from 'app/components/projectLabel'; +import BookmarkStar from 'app/components/projects/bookmarkStar'; import space from 'app/styles/space'; -import {Project, Organization} from 'app/types'; +import {Organization, Project} from 'app/types'; type Props = { project: Project; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsSearch/index.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsSearch/index.tsx index 70e1179f30beaf..c00652b9c86532 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsSearch/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsSearch/index.tsx @@ -2,9 +2,9 @@ import React from 'react'; import keydown from 'react-keydown'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import {IconSearch} from 'app/icons'; import Search from 'app/components/search'; +import {IconSearch} from 'app/icons'; +import {t} from 'app/locale'; const MIN_SEARCH_LENGTH = 1; const MAX_RESULTS = 10; diff --git a/src/sentry/static/sentry/app/views/settings/components/settingsWrapper.tsx b/src/sentry/static/sentry/app/views/settings/components/settingsWrapper.tsx index e2f103a977cc48..b284bdc0d9d763 100644 --- a/src/sentry/static/sentry/app/views/settings/components/settingsWrapper.tsx +++ b/src/sentry/static/sentry/app/views/settings/components/settingsWrapper.tsx @@ -3,10 +3,10 @@ import styled from '@emotion/styled'; import {Location} from 'history'; import PropTypes from 'prop-types'; -import ScrollToTop from 'app/views/settings/components/scrollToTop'; import space from 'app/styles/space'; import {Organization, Project} from 'app/types'; import withLatestContext from 'app/utils/withLatestContext'; +import ScrollToTop from 'app/views/settings/components/scrollToTop'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx b/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx index f1d31e033453c5..8908c0ec3021c9 100644 --- a/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx +++ b/src/sentry/static/sentry/app/views/settings/components/teamSelect.jsx @@ -1,21 +1,21 @@ -import PropTypes from 'prop-types'; import React from 'react'; -import debounce from 'lodash/debounce'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; +import PropTypes from 'prop-types'; -import {DEFAULT_DEBOUNCE_DURATION, TEAMS_PER_PAGE} from 'app/constants'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import {IconSubtract} from 'app/icons'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import Link from 'app/components/links/link'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import {DEFAULT_DEBOUNCE_DURATION, TEAMS_PER_PAGE} from 'app/constants'; +import {IconSubtract} from 'app/icons'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; class TeamSelect extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/actions.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/actions.tsx index f3f926e4217d74..2a50013dce62b0 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/actions.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/actions.tsx @@ -1,6 +1,6 @@ import {Client} from 'app/api'; -import {SavedIncidentRule, IncidentRule} from './types'; +import {IncidentRule, SavedIncidentRule} from './types'; function isSavedRule(rule: IncidentRule): rule is SavedIncidentRule { return !!rule.id; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/constants.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/constants.tsx index b60d4e9ef9214a..df57557e71b868 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/constants.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/constants.tsx @@ -1,14 +1,14 @@ +import EventView from 'app/utils/discover/eventView'; +import {AggregationKey, LooseFieldKey} from 'app/utils/discover/fields'; +import {WEB_VITAL_DETAILS} from 'app/views/performance/transactionVitals/constants'; import { AlertRuleThresholdType, - UnsavedIncidentRule, - Trigger, Dataset, Datasource, EventTypes, + Trigger, + UnsavedIncidentRule, } from 'app/views/settings/incidentRules/types'; -import EventView from 'app/utils/discover/eventView'; -import {AggregationKey, LooseFieldKey} from 'app/utils/discover/fields'; -import {WEB_VITAL_DETAILS} from 'app/views/performance/transactionVitals/constants'; export const DEFAULT_AGGREGATE = 'count()'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/create.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/create.tsx index e19ecc120caef3..6a0525ba7286f9 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/create.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/create.tsx @@ -1,12 +1,12 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import {Organization, Project} from 'app/types'; +import EventView from 'app/utils/discover/eventView'; import { createDefaultRule, createRuleFromEventView, } from 'app/views/settings/incidentRules/constants'; -import EventView from 'app/utils/discover/eventView'; import RuleForm from './ruleForm'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/details.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/details.tsx index d456b433fd656d..bdf1d22e20a3d8 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/details.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/details.tsx @@ -1,10 +1,10 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {IncidentRule} from 'app/views/settings/incidentRules/types'; import {Organization} from 'app/types'; import AsyncView from 'app/views/asyncView'; import RuleForm from 'app/views/settings/incidentRules/ruleForm'; +import {IncidentRule} from 'app/views/settings/incidentRules/types'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/list.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/list.tsx index 13b839dbd1d87c..e589d15e342472 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/list.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/list.tsx @@ -1,22 +1,22 @@ +import React from 'react'; import {Link} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; -import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import {IconDelete, IconEdit} from 'app/icons'; -import recreateRoute from 'app/utils/recreateRoute'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import recreateRoute from 'app/utils/recreateRoute'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import {SavedIncidentRule} from './types'; import {deleteRule} from './actions'; +import {SavedIncidentRule} from './types'; type State = { rules: SavedIncidentRule[]; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/metricField.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/metricField.tsx index 61b236eedf2e13..e63164883b06a5 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/metricField.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/metricField.tsx @@ -1,27 +1,27 @@ import React from 'react'; -import styled from '@emotion/styled'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; -import FormField from 'app/views/settings/components/forms/formField'; -import {t, tct} from 'app/locale'; -import {QueryField} from 'app/views/eventsV2/table/queryField'; -import {generateFieldOptions} from 'app/views/eventsV2/utils'; -import {FieldValueKind} from 'app/views/eventsV2/table/types'; -import {Organization} from 'app/types'; -import space from 'app/styles/space'; -import FormModel from 'app/views/settings/components/forms/model'; import Button from 'app/components/button'; import Tooltip from 'app/components/tooltip'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization} from 'app/types'; import { - explodeFieldString, - generateFieldAsString, AGGREGATIONS, + explodeFieldString, FIELDS, + generateFieldAsString, } from 'app/utils/discover/fields'; +import {QueryField} from 'app/views/eventsV2/table/queryField'; +import {FieldValueKind} from 'app/views/eventsV2/table/types'; +import {generateFieldOptions} from 'app/views/eventsV2/utils'; +import FormField from 'app/views/settings/components/forms/formField'; +import FormModel from 'app/views/settings/components/forms/model'; import {errorFieldConfig, transactionFieldConfig} from './constants'; -import {Dataset} from './types'; import {PRESET_AGGREGATES} from './presets'; +import {Dataset} from './types'; type Props = Omit<FormField['props'], 'children'> & { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/presets.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/presets.tsx index 8f58cb0c3c6fb8..148fc95a72ad3d 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/presets.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/presets.tsx @@ -1,6 +1,6 @@ +import Link from 'app/components/links/link'; import {t} from 'app/locale'; import {Project} from 'app/types'; -import Link from 'app/components/links/link'; import {DisplayModes} from 'app/utils/discover/types'; import {tokenizeSearch} from 'app/utils/tokenizeSearch'; import {Incident, IncidentStats} from 'app/views/alerts/types'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsForm.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsForm.tsx index 88f53e3498960c..675636f6827708 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsForm.tsx @@ -1,27 +1,27 @@ import React from 'react'; import styled from '@emotion/styled'; +import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; -import {DATA_SOURCE_LABELS} from 'app/views/alerts/utils'; -import {Environment, Organization} from 'app/types'; +import Feature from 'app/components/acl/feature'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import {addErrorMessage} from 'app/actionCreators/indicator'; +import Tooltip from 'app/components/tooltip'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {Environment, Organization} from 'app/types'; import {defined} from 'app/utils'; import {getDisplayName} from 'app/utils/environment'; -import {t, tct} from 'app/locale'; -import FormField from 'app/views/settings/components/forms/formField'; +import theme from 'app/utils/theme'; +import {DATA_SOURCE_LABELS} from 'app/views/alerts/utils'; import SearchBar from 'app/views/events/searchBar'; -import FieldLabel from 'app/views/settings/components/forms/field/fieldLabel'; import RadioGroup from 'app/views/settings/components/forms/controls/radioGroup'; +import FieldLabel from 'app/views/settings/components/forms/field/fieldLabel'; +import FormField from 'app/views/settings/components/forms/formField'; import SelectField from 'app/views/settings/components/forms/selectField'; -import space from 'app/styles/space'; -import theme from 'app/utils/theme'; -import Tooltip from 'app/components/tooltip'; -import Feature from 'app/components/acl/feature'; -import {TimeWindow, IncidentRule, Dataset} from './types'; -import MetricField from './metricField'; import {DATASET_EVENT_TYPE_FILTERS, DEFAULT_AGGREGATE} from './constants'; +import MetricField from './metricField'; +import {Dataset, IncidentRule, TimeWindow} from './types'; const TIME_WINDOW_MAP: Record<TimeWindow, string> = { [TimeWindow.ONE_MINUTE]: t('1 minute'), diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsFormWithGuiFilters.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsFormWithGuiFilters.tsx index 4f135452241eb9..d4de70c1e3b836 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsFormWithGuiFilters.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleConditionsFormWithGuiFilters.tsx @@ -1,31 +1,31 @@ import React from 'react'; import styled from '@emotion/styled'; +import {addErrorMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; +import Feature from 'app/components/acl/feature'; +import SelectControl from 'app/components/forms/selectControl'; +import List from 'app/components/list'; +import ListItem from 'app/components/list/listItem'; +import {Panel, PanelBody} from 'app/components/panels'; +import Tooltip from 'app/components/tooltip'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {Environment, Organization} from 'app/types'; +import {getDisplayName} from 'app/utils/environment'; +import theme from 'app/utils/theme'; import { convertDatasetEventTypesToSource, DATA_SOURCE_LABELS, DATA_SOURCE_TO_SET_AND_EVENT_TYPES, } from 'app/views/alerts/utils'; -import {Environment, Organization} from 'app/types'; -import {Panel, PanelBody} from 'app/components/panels'; -import {addErrorMessage} from 'app/actionCreators/indicator'; -import {getDisplayName} from 'app/utils/environment'; -import {t, tct} from 'app/locale'; -import FormField from 'app/views/settings/components/forms/formField'; -import List from 'app/components/list'; -import ListItem from 'app/components/list/listItem'; import SearchBar from 'app/views/events/searchBar'; +import FormField from 'app/views/settings/components/forms/formField'; import SelectField from 'app/views/settings/components/forms/selectField'; -import SelectControl from 'app/components/forms/selectControl'; -import Tooltip from 'app/components/tooltip'; -import space from 'app/styles/space'; -import theme from 'app/utils/theme'; -import Feature from 'app/components/acl/feature'; -import {TimeWindow, IncidentRule, Datasource} from './types'; -import MetricField from './metricField'; import {DEFAULT_AGGREGATE} from './constants'; +import MetricField from './metricField'; +import {Datasource, IncidentRule, TimeWindow} from './types'; const TIME_WINDOW_MAP: Record<TimeWindow, string> = { [TimeWindow.ONE_MINUTE]: t('1 minute window'), diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx index 88974b95e0dcba..4af4d5dc4fad25 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/ruleForm/index.tsx @@ -1,41 +1,32 @@ +import React from 'react'; import {PlainRoute} from 'react-router/lib/Route'; import {RouteComponentProps} from 'react-router/lib/Router'; -import React from 'react'; -import {Organization, Project} from 'app/types'; -import FormModel from 'app/views/settings/components/forms/model'; -import {defined} from 'app/utils'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; +import { + addErrorMessage, + addLoadingMessage, + addSuccessMessage, + clearIndicators, +} from 'app/actionCreators/indicator'; import {fetchOrganizationTags} from 'app/actionCreators/tags'; -import {t} from 'app/locale'; import Access from 'app/components/acl/access'; +import Feature from 'app/components/acl/feature'; import AsyncComponent from 'app/components/asyncComponent'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; -import Feature from 'app/components/acl/feature'; +import {t} from 'app/locale'; +import {Organization, Project} from 'app/types'; +import {defined} from 'app/utils'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; +import withProject from 'app/utils/withProject'; +import {convertDatasetEventTypesToSource} from 'app/views/alerts/utils'; import Form from 'app/views/settings/components/forms/form'; +import FormModel from 'app/views/settings/components/forms/model'; import RuleNameForm from 'app/views/settings/incidentRules/ruleNameForm'; import Triggers from 'app/views/settings/incidentRules/triggers'; import TriggersChart from 'app/views/settings/incidentRules/triggers/chart'; import hasThresholdValue from 'app/views/settings/incidentRules/utils/hasThresholdValue'; -import withProject from 'app/utils/withProject'; -import { - addErrorMessage, - addLoadingMessage, - addSuccessMessage, - clearIndicators, -} from 'app/actionCreators/indicator'; -import {convertDatasetEventTypesToSource} from 'app/views/alerts/utils'; -import { - AlertRuleThresholdType, - IncidentRule, - MetricActionTemplate, - Trigger, - Dataset, - UnsavedIncidentRule, - Datasource, -} from '../types'; import {addOrUpdateRule} from '../actions'; import { createDefaultTrigger, @@ -44,6 +35,15 @@ import { } from '../constants'; import RuleConditionsForm from '../ruleConditionsForm'; import RuleConditionsFormWithGuiFilters from '../ruleConditionsFormWithGuiFilters'; +import { + AlertRuleThresholdType, + Dataset, + Datasource, + IncidentRule, + MetricActionTemplate, + Trigger, + UnsavedIncidentRule, +} from '../types'; const POLLING_MAX_TIME_LIMIT = 3 * 60000; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/actionTargetSelector.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/actionTargetSelector.tsx index 805e56e65e5d98..a170c45503d457 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/actionTargetSelector.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/actionTargetSelector.tsx @@ -2,6 +2,7 @@ import React from 'react'; import SelectControl from 'app/components/forms/selectControl'; import SelectMembers from 'app/components/selectMembers'; +import {Organization, Project, SelectValue} from 'app/types'; import Input from 'app/views/settings/components/forms/controls/input'; import { Action, @@ -9,7 +10,6 @@ import { MetricActionTemplate, TargetType, } from 'app/views/settings/incidentRules/types'; -import {Organization, Project, SelectValue} from 'app/types'; const getPlaceholderForType = (type: ActionType) => { switch (type) { diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/deleteActionButton.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/deleteActionButton.tsx index c33e30d653f63a..257588d10ee312 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/deleteActionButton.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/actionsPanel/deleteActionButton.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; type Props = Omit<React.ComponentProps<typeof Button>, 'onClick'> & { index: number; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx index 74e449b532fc9d..37ff283dc1334b 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/index.tsx @@ -1,29 +1,30 @@ import React from 'react'; -import maxBy from 'lodash/maxBy'; -import chunk from 'lodash/chunk'; import styled from '@emotion/styled'; +import chunk from 'lodash/chunk'; +import maxBy from 'lodash/maxBy'; -import {Client} from 'app/api'; import {fetchTotalCount} from 'app/actionCreators/events'; +import {Client} from 'app/api'; +import Feature from 'app/components/acl/feature'; +import EventsRequest from 'app/components/charts/eventsRequest'; import { ChartControls, InlineContainer, SectionHeading, SectionValue, } from 'app/components/charts/styles'; -import {t} from 'app/locale'; -import {Organization, Project} from 'app/types'; -import {SeriesDataUnit} from 'app/types/echarts'; -import {Panel, PanelBody} from 'app/components/panels'; -import Feature from 'app/components/acl/feature'; -import EventsRequest from 'app/components/charts/eventsRequest'; +import SelectControl from 'app/components/forms/selectControl'; import LoadingMask from 'app/components/loadingMask'; +import {Panel, PanelBody} from 'app/components/panels'; import Placeholder from 'app/components/placeholder'; -import SelectControl from 'app/components/forms/selectControl'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {SeriesDataUnit} from 'app/types/echarts'; import withApi from 'app/utils/withApi'; -import {IncidentRule, TimeWindow, TimePeriod, Trigger} from '../../types'; +import {IncidentRule, TimePeriod, TimeWindow, Trigger} from '../../types'; + import ThresholdsChart from './thresholdsChart'; type Props = { diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/thresholdsChart.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/thresholdsChart.tsx index 2844cb23e5dcc0..5690e8a36d8ee0 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/thresholdsChart.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/chart/thresholdsChart.tsx @@ -1,18 +1,18 @@ -import {ECharts} from 'echarts'; import React from 'react'; import color from 'color'; +import {ECharts} from 'echarts'; import debounce from 'lodash/debounce'; import flatten from 'lodash/flatten'; -import {GlobalSelection} from 'app/types'; -import {ReactEchartsRef, Series} from 'app/types/echarts'; import Graphic from 'app/components/charts/components/graphic'; -import LineChart, {LineChartSeries} from 'app/components/charts/lineChart'; import Legend from 'app/components/charts/components/legend'; +import LineChart, {LineChartSeries} from 'app/components/charts/lineChart'; import space from 'app/styles/space'; +import {GlobalSelection} from 'app/types'; +import {ReactEchartsRef, Series} from 'app/types/echarts'; import theme from 'app/utils/theme'; -import {Trigger, AlertRuleThresholdType, IncidentRule} from '../../types'; +import {AlertRuleThresholdType, IncidentRule, Trigger} from '../../types'; type DefaultProps = { data: Series[]; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx index ee285c3174227e..8129a712a3c42a 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/form.tsx @@ -1,22 +1,22 @@ import React from 'react'; import styled from '@emotion/styled'; -import {Client} from 'app/api'; -import {Config, Organization, Project} from 'app/types'; import {fetchOrgMembers} from 'app/actionCreators/members'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import CircleIndicator from 'app/components/circleIndicator'; -import Field from 'app/views/settings/components/forms/field'; -import ThresholdControl from 'app/views/settings/incidentRules/triggers/thresholdControl'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {Config, Organization, Project} from 'app/types'; import withApi from 'app/utils/withApi'; import withConfig from 'app/utils/withConfig'; -import space from 'app/styles/space'; +import Field from 'app/views/settings/components/forms/field'; +import ThresholdControl from 'app/views/settings/incidentRules/triggers/thresholdControl'; import { AlertRuleThresholdType, + ThresholdControlValue, Trigger, UnsavedIncidentRule, - ThresholdControlValue, UnsavedTrigger, } from '../types'; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/index.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/index.tsx index 241c65a661d371..0b4a939254800c 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/index.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import {Organization, Project} from 'app/types'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {t} from 'app/locale'; +import {Organization, Project} from 'app/types'; import {removeAtArrayIndex} from 'app/utils/removeAtArrayIndex'; import {replaceAtArrayIndex} from 'app/utils/replaceAtArrayIndex'; -import {t} from 'app/locale'; -import TriggerForm from 'app/views/settings/incidentRules/triggers/form'; import withProjects from 'app/utils/withProjects'; import ActionsPanel from 'app/views/settings/incidentRules/triggers/actionsPanel'; +import TriggerForm from 'app/views/settings/incidentRules/triggers/form'; import { + Action, AlertRuleThresholdType, MetricActionTemplate, Trigger, UnsavedIncidentRule, - Action, } from '../types'; type Props = { diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/thresholdControl.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/thresholdControl.tsx index e8718c606bc1b6..9050c27914a4ac 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/thresholdControl.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/triggers/thresholdControl.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import { - ThresholdControlValue, - AlertRuleThresholdType, -} from 'app/views/settings/incidentRules/types'; -import {t, tct} from 'app/locale'; -import Input from 'app/views/settings/components/forms/controls/input'; import SelectControl from 'app/components/forms/selectControl'; -import space from 'app/styles/space'; import NumberDragControl from 'app/components/numberDragControl'; import Tooltip from 'app/components/tooltip'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import Input from 'app/views/settings/components/forms/controls/input'; +import { + AlertRuleThresholdType, + ThresholdControlValue, +} from 'app/views/settings/incidentRules/types'; type Props = ThresholdControlValue & { type: string; diff --git a/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsLayout.tsx b/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsLayout.tsx index dc55b86b76bd32..7ca00d60da8236 100644 --- a/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsLayout.tsx +++ b/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsLayout.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import OrganizationSettingsNavigation from 'app/views/settings/organization/organizationSettingsNavigation'; import SettingsLayout from 'app/views/settings/components/settingsLayout'; +import OrganizationSettingsNavigation from 'app/views/settings/organization/organizationSettingsNavigation'; type Props = RouteComponentProps<{orgId: string}, {}> & { children: React.ReactNode; diff --git a/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsNavigation.tsx b/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsNavigation.tsx index 311535b76561c2..044b4f7d643841 100644 --- a/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsNavigation.tsx +++ b/src/sentry/static/sentry/app/views/settings/organization/organizationSettingsNavigation.tsx @@ -1,14 +1,14 @@ -import Reflux from 'reflux'; import React from 'react'; import createReactClass from 'create-react-class'; +import Reflux from 'reflux'; import SentryTypes from 'app/sentryTypes'; import HookStore from 'app/stores/hookStore'; -import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; -import navigationConfiguration from 'app/views/settings/organization/navigationConfiguration'; -import withOrganization from 'app/utils/withOrganization'; import {Organization} from 'app/types'; import {HookName, Hooks} from 'app/types/hooks'; +import withOrganization from 'app/utils/withOrganization'; +import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; +import navigationConfiguration from 'app/views/settings/organization/navigationConfiguration'; import {NavigationSection} from 'app/views/settings/types'; type Props = { diff --git a/src/sentry/static/sentry/app/views/settings/organization/permissionAlert.tsx b/src/sentry/static/sentry/app/views/settings/organization/permissionAlert.tsx index e54c30ac3718d9..5f8044608ac267 100644 --- a/src/sentry/static/sentry/app/views/settings/organization/permissionAlert.tsx +++ b/src/sentry/static/sentry/app/views/settings/organization/permissionAlert.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import Access from 'app/components/acl/access'; import Alert from 'app/components/alert'; import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; type Props = React.ComponentPropsWithoutRef<typeof Alert> & Pick<React.ComponentProps<typeof Access>, 'access'>; diff --git a/src/sentry/static/sentry/app/views/settings/organizationApiKeys/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationApiKeys/index.tsx index 8c90f6d7f23bea..397d9ead7a2b41 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationApiKeys/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationApiKeys/index.tsx @@ -1,17 +1,17 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Organization} from 'app/types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import routeTitleGen from 'app/utils/routeTitle'; +import {Organization} from 'app/types'; import recreateRoute from 'app/utils/recreateRoute'; +import routeTitleGen from 'app/utils/routeTitle'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; -import {DeprecatedApiKey} from './types'; import OrganizationApiKeysList from './organizationApiKeysList'; +import {DeprecatedApiKey} from './types'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeyDetails.tsx b/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeyDetails.tsx index 82720c3f4be853..eccf6bac3ab3a9 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeyDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeyDetails.tsx @@ -1,22 +1,22 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {API_ACCESS_SCOPES} from 'app/constants'; -import {Organization} from 'app/types'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {API_ACCESS_SCOPES} from 'app/constants'; import {t} from 'app/locale'; -import ApiForm from 'app/views/settings/components/forms/apiForm'; -import FormField from 'app/views/settings/components/forms/formField'; -import MultipleCheckbox from 'app/views/settings/components/forms/controls/multipleCheckbox'; -import AsyncView from 'app/views/asyncView'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextField from 'app/views/settings/components/forms/textField'; -import TextareaField from 'app/views/settings/components/forms/textareaField'; +import {Organization} from 'app/types'; import recreateRoute from 'app/utils/recreateRoute'; import routeTitleGen from 'app/utils/routeTitle'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; +import ApiForm from 'app/views/settings/components/forms/apiForm'; +import MultipleCheckbox from 'app/views/settings/components/forms/controls/multipleCheckbox'; +import FormField from 'app/views/settings/components/forms/formField'; +import TextareaField from 'app/views/settings/components/forms/textareaField'; +import TextField from 'app/views/settings/components/forms/textField'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import {DeprecatedApiKey} from './types'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx b/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx index dc8f2d6ba5dd77..c370e087925a13 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationApiKeys/organizationApiKeysList.tsx @@ -1,21 +1,21 @@ +import React from 'react'; import {PlainRoute} from 'react-router/lib/Route'; import {RouteComponentProps} from 'react-router/lib/Router'; -import React from 'react'; import styled from '@emotion/styled'; -import {PanelTable} from 'app/components/panels'; -import {inputStyles} from 'app/styles/input'; -import {t, tct} from 'app/locale'; import Alert from 'app/components/alert'; import AutoSelectText from 'app/components/autoSelectText'; import Button from 'app/components/button'; import ExternalLink from 'app/components/links/externalLink'; -import {IconDelete, IconAdd} from 'app/icons'; import Link from 'app/components/links/link'; import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; +import {PanelTable} from 'app/components/panels'; +import {IconAdd, IconDelete} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {inputStyles} from 'app/styles/input'; +import recreateRoute from 'app/utils/recreateRoute'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import recreateRoute from 'app/utils/recreateRoute'; import {DeprecatedApiKey} from './types'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx b/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx index 4d161b2afa1131..a7ba0bac4c2cab 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationAuditLog/auditLogList.jsx @@ -1,18 +1,18 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import UserAvatar from 'app/components/avatar/userAvatar'; import DateTime from 'app/components/dateTime'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SelectField from 'app/components/forms/selectField'; import Pagination from 'app/components/pagination'; import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import SelectField from 'app/components/forms/selectField'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import Tooltip from 'app/components/tooltip'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; const avatarStyle = { width: 36, diff --git a/src/sentry/static/sentry/app/views/settings/organizationAuditLog/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationAuditLog/index.jsx index f7af02b1715aca..cbff17839f3e6d 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationAuditLog/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationAuditLog/index.jsx @@ -1,11 +1,11 @@ +import React from 'react'; import {browserHistory} from 'react-router'; import PropTypes from 'prop-types'; -import React from 'react'; -import AsyncView from 'app/views/asyncView'; -import SentryTypes from 'app/sentryTypes'; import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; import AuditLogList from './auditLogList'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationAuth/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationAuth/index.jsx index d081295a675977..60dda92018a0b2 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationAuth/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationAuth/index.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import SentryTypes from 'app/sentryTypes'; import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; import OrganizationAuthList from './organizationAuthList'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationAuth/organizationAuthList.jsx b/src/sentry/static/sentry/app/views/settings/organizationAuth/organizationAuthList.jsx index 96fa3149cd6efd..d01afc32260b9d 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationAuth/organizationAuthList.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationAuth/organizationAuthList.jsx @@ -1,16 +1,16 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {CSRF_COOKIE_NAME} from 'app/constants'; +import ExternalLink from 'app/components/links/externalLink'; import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; -import {descopeFeatureName} from 'app/utils'; +import {CSRF_COOKIE_NAME} from 'app/constants'; import {t, tct} from 'app/locale'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import ExternalLink from 'app/components/links/externalLink'; -import PermissionAlert from 'app/views/settings/organization/permissionAlert'; import SentryTypes from 'app/sentryTypes'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import {descopeFeatureName} from 'app/utils'; import getCookie from 'app/utils/getCookie'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import PermissionAlert from 'app/views/settings/organization/permissionAlert'; import ProviderItem from './providerItem'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationAuth/providerItem.jsx b/src/sentry/static/sentry/app/views/settings/organizationAuth/providerItem.jsx index 7247f7d5391dea..fa24db05d0804a 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationAuth/providerItem.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationAuth/providerItem.jsx @@ -1,18 +1,18 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {PanelItem} from 'app/components/panels'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; import Access from 'app/components/acl/access'; -import Button from 'app/components/button'; import Feature from 'app/components/acl/feature'; import FeatureDisabled from 'app/components/acl/featureDisabled'; +import Button from 'app/components/button'; import Hovercard from 'app/components/hovercard'; -import SentryTypes from 'app/sentryTypes'; -import {IconLock} from 'app/icons'; +import {PanelItem} from 'app/components/panels'; import Tag from 'app/components/tagDeprecated'; +import {IconLock} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import space from 'app/styles/space'; import {descopeFeatureName} from 'app/utils'; export default class ProviderItem extends React.PureComponent { diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/index.tsx index e7ca70dd333103..86d2eb900e6699 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/index.tsx @@ -1,20 +1,20 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; +import {removeSentryApp} from 'app/actionCreators/sentryApps'; import AlertLink from 'app/components/alertLink'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {IconAdd} from 'app/icons'; -import {removeSentryApp} from 'app/actionCreators/sentryApps'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; +import {Organization, SentryApp} from 'app/types'; +import routeTitleGen from 'app/utils/routeTitle'; +import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import SentryApplicationRow from 'app/views/settings/organizationDeveloperSettings/sentryApplicationRow'; -import withOrganization from 'app/utils/withOrganization'; -import {t} from 'app/locale'; -import routeTitleGen from 'app/utils/routeTitle'; -import {Organization, SentryApp} from 'app/types'; type Props = Omit<AsyncView['props'], 'params'> & { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx index d93414587968ef..5d95efe66a681c 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionSelection.tsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; import find from 'lodash/find'; import flatMap from 'lodash/flatMap'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import {SENTRY_APP_PERMISSIONS} from 'app/constants'; -import SelectField from 'app/views/settings/components/forms/selectField'; +import {t} from 'app/locale'; import {Permissions} from 'app/types/index'; +import SelectField from 'app/views/settings/components/forms/selectField'; /** * Custom form element that presents API scopes in a resource-centric way. Meaning diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionsObserver.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionsObserver.tsx index 6f14c55c71a124..bf934ac76f505c 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionsObserver.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/permissionsObserver.tsx @@ -1,12 +1,12 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {toResourcePermissions} from 'app/utils/consolidatedScopes'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t} from 'app/locale'; +import {Permissions, Scope, WebhookEvent} from 'app/types'; +import {toResourcePermissions} from 'app/utils/consolidatedScopes'; import PermissionSelection from 'app/views/settings/organizationDeveloperSettings/permissionSelection'; import Subscriptions from 'app/views/settings/organizationDeveloperSettings/resourceSubscriptions'; -import {WebhookEvent, Permissions, Scope} from 'app/types'; type DefaultProps = { webhookDisabled: boolean; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx index 7ed9329dbe5f6c..ed5b8f45392a97 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/resourceSubscriptions.tsx @@ -1,14 +1,14 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import SubscriptionBox from 'app/views/settings/organizationDeveloperSettings/subscriptionBox'; +import {Context} from 'app/components/forms/form'; +import {Permissions, WebhookEvent} from 'app/types'; import { EVENT_CHOICES, PERMISSIONS_MAP, } from 'app/views/settings/organizationDeveloperSettings/constants'; -import {WebhookEvent, Permissions} from 'app/types'; -import {Context} from 'app/components/forms/form'; +import SubscriptionBox from 'app/views/settings/organizationDeveloperSettings/subscriptionBox'; type Resource = typeof EVENT_CHOICES[number]; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/index.tsx index 88d8ee7b8f34a9..edfcad53d4f9cb 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/index.tsx @@ -1,17 +1,17 @@ import React from 'react'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; -import AsyncView from 'app/views/asyncView'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import LineChart from 'app/components/charts/lineChart'; -import {Panel, PanelBody, PanelHeader, PanelFooter} from 'app/components/panels'; import BarChart from 'app/components/charts/barChart'; -import Link from 'app/components/links/link'; +import LineChart from 'app/components/charts/lineChart'; import DateTime from 'app/components/dateTime'; -import space from 'app/styles/space'; +import Link from 'app/components/links/link'; +import {Panel, PanelBody, PanelFooter, PanelHeader} from 'app/components/panels'; import {t} from 'app/locale'; +import space from 'app/styles/space'; import {SentryApp} from 'app/types'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import RequestLog from './requestLog'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx index cb8f514b038478..9724f89e27179c 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx @@ -1,24 +1,24 @@ import React from 'react'; import styled from '@emotion/styled'; -import moment from 'moment-timezone'; import memoize from 'lodash/memoize'; +import moment from 'moment-timezone'; import AsyncComponent from 'app/components/asyncComponent'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import Button from 'app/components/button'; +import Checkbox from 'app/components/checkbox'; import DateTime from 'app/components/dateTime'; -import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import DropdownButton from 'app/components/dropdownButton'; -import Tag from 'app/components/tagDeprecated'; +import DropdownControl, {DropdownItem} from 'app/components/dropdownControl'; import ExternalLink from 'app/components/links/externalLink'; import LoadingIndicator from 'app/components/loadingIndicator'; -import Checkbox from 'app/components/checkbox'; -import Button from 'app/components/button'; -import space from 'app/styles/space'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import Tag from 'app/components/tagDeprecated'; import {IconChevron, IconFlag, IconOpen} from 'app/icons'; import {t} from 'app/locale'; -import {SentryApp, SentryAppWebhookRequest, SentryAppSchemaIssueLink} from 'app/types'; +import space from 'app/styles/space'; +import {SentryApp, SentryAppSchemaIssueLink, SentryAppWebhookRequest} from 'app/types'; import {Theme} from 'app/utils/theme'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; const ALL_EVENTS = t('All Events'); const MAX_PER_PAGE = 10; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx index 0d22bace75d2f5..6fcd294d96ba48 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx @@ -1,39 +1,39 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {Observer} from 'mobx-react'; -import omit from 'lodash/omit'; -import scrollToElement from 'scroll-to-element'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import omit from 'lodash/omit'; +import {Observer} from 'mobx-react'; +import scrollToElement from 'scroll-to-element'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; -import {Panel, PanelItem, PanelBody, PanelHeader} from 'app/components/panels'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import { + addSentryAppToken, + removeSentryAppToken, +} from 'app/actionCreators/sentryAppTokens'; +import Button from 'app/components/button'; +import DateTime from 'app/components/dateTime'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import Tooltip from 'app/components/tooltip'; +import {SENTRY_APP_PERMISSIONS} from 'app/constants'; +import { + internalIntegrationForms, + publicIntegrationForms, +} from 'app/data/forms/sentryApplication'; +import {IconAdd, IconDelete} from 'app/icons'; import {t} from 'app/locale'; +import {InternalAppApiToken, Scope, SentryApp} from 'app/types'; +import getDynamicText from 'app/utils/getDynamicText'; +import routeTitleGen from 'app/utils/routeTitle'; import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; import Form from 'app/views/settings/components/forms/form'; -import FormModel, {FieldValue} from 'app/views/settings/components/forms/model'; import FormField from 'app/views/settings/components/forms/formField'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import {IconAdd, IconDelete} from 'app/icons'; +import FormModel, {FieldValue} from 'app/views/settings/components/forms/model'; +import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import PermissionsObserver from 'app/views/settings/organizationDeveloperSettings/permissionsObserver'; -import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; -import { - publicIntegrationForms, - internalIntegrationForms, -} from 'app/data/forms/sentryApplication'; -import getDynamicText from 'app/utils/getDynamicText'; -import routeTitleGen from 'app/utils/routeTitle'; -import DateTime from 'app/components/dateTime'; -import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import { - addSentryAppToken, - removeSentryAppToken, -} from 'app/actionCreators/sentryAppTokens'; -import {SentryApp, InternalAppApiToken, Scope} from 'app/types'; -import Tooltip from 'app/components/tooltip'; -import {SENTRY_APP_PERMISSIONS} from 'app/constants'; type Resource = 'Project' | 'Team' | 'Release' | 'Event' | 'Organization' | 'Member'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/actionButtons.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/actionButtons.tsx index 1b1683ef2d079e..7d0dee878b24ff 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/actionButtons.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/actionButtons.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import {LightWeightOrganization, SentryApp} from 'app/types'; import Button from 'app/components/button'; -import {IconDelete, IconStats, IconUpgrade} from 'app/icons'; import ConfirmDelete from 'app/components/confirmDelete'; +import {IconDelete, IconStats, IconUpgrade} from 'app/icons'; import {t} from 'app/locale'; import space from 'app/styles/space'; +import {LightWeightOrganization, SentryApp} from 'app/types'; type Props = { org: LightWeightOrganization; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx index 95d685b73d6ae4..1f123f96b4bc97 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/sentryApplicationRow/index.tsx @@ -2,12 +2,12 @@ import React from 'react'; import {Link} from 'react-router'; import styled from '@emotion/styled'; +import {openModal} from 'app/actionCreators/modal'; +import SentryAppPublishRequestModal from 'app/components/modals/sentryAppPublishRequestModal'; import {PanelItem} from 'app/components/panels'; import {t} from 'app/locale'; -import space from 'app/styles/space'; import PluginIcon from 'app/plugins/components/pluginIcon'; -import {openModal} from 'app/actionCreators/modal'; -import SentryAppPublishRequestModal from 'app/components/modals/sentryAppPublishRequestModal'; +import space from 'app/styles/space'; import {Organization, SentryApp} from 'app/types'; import SentryApplicationRowButtons from './sentryApplicationRowButtons'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/subscriptionBox.tsx b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/subscriptionBox.tsx index 266ced65bfb2f7..04db70c934adc8 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/subscriptionBox.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationDeveloperSettings/subscriptionBox.tsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import Checkbox from 'app/components/checkbox'; +import Tooltip from 'app/components/tooltip'; import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; import { DESCRIPTIONS, EVENT_CHOICES, } from 'app/views/settings/organizationDeveloperSettings/constants'; -import Checkbox from 'app/components/checkbox'; -import Tooltip from 'app/components/tooltip'; -import withOrganization from 'app/utils/withOrganization'; -import SentryTypes from 'app/sentryTypes'; -import {Organization} from 'app/types'; type Resource = typeof EVENT_CHOICES[number]; diff --git a/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/index.tsx index b279d569390020..a8481f913f6075 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/index.tsx @@ -1,25 +1,25 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Client} from 'app/api'; -import {Organization} from 'app/types'; -import {Panel, PanelHeader} from 'app/components/panels'; import {addLoadingMessage} from 'app/actionCreators/indicator'; import { changeOrganizationSlug, removeAndRedirectToRemainingOrganization, updateOrganization, } from 'app/actionCreators/organizations'; -import {t, tct} from 'app/locale'; -import Field from 'app/views/settings/components/forms/field'; +import {Client} from 'app/api'; import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; -import PermissionAlert from 'app/views/settings/organization/permissionAlert'; +import {Panel, PanelHeader} from 'app/components/panels'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import {t, tct} from 'app/locale'; +import {Organization} from 'app/types'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; +import Field from 'app/views/settings/components/forms/field'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; +import PermissionAlert from 'app/views/settings/organization/permissionAlert'; import OrganizationSettingsForm from './organizationSettingsForm'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/organizationSettingsForm.tsx b/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/organizationSettingsForm.tsx index bbe69ea99d7417..735839e787eafb 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/organizationSettingsForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationGeneralSettings/organizationSettingsForm.tsx @@ -1,16 +1,16 @@ +import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {Location} from 'history'; -import React from 'react'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {updateOrganization} from 'app/actionCreators/organizations'; import AsyncComponent from 'app/components/asyncComponent'; import AvatarChooser from 'app/components/avatarChooser'; -import Form from 'app/views/settings/components/forms/form'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; import organizationSettingsFields from 'app/data/forms/organizationGeneralSettings'; -import withOrganization from 'app/utils/withOrganization'; import {Organization, Scope} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; type Props = { location: Location; diff --git a/src/sentry/static/sentry/app/views/settings/organizationIntegrations/configureIntegration.tsx b/src/sentry/static/sentry/app/views/settings/organizationIntegrations/configureIntegration.tsx index a1a99a1cd8192f..671937c67213f3 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationIntegrations/configureIntegration.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationIntegrations/configureIntegration.tsx @@ -2,27 +2,27 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import List from 'app/components/list'; +import ListItem from 'app/components/list/listItem'; +import NavTabs from 'app/components/navTabs'; +import {IconAdd, IconArrow} from 'app/icons'; import {t} from 'app/locale'; +import {IntegrationProvider, IntegrationWithConfig, Organization} from 'app/types'; +import {trackIntegrationEvent} from 'app/utils/integrationUtil'; +import {singleLineRenderer} from 'app/utils/marked'; +import withOrganization from 'app/utils/withOrganization'; import AsyncView from 'app/views/asyncView'; import AddIntegration from 'app/views/organizationIntegrations/addIntegration'; -import BreadcrumbTitle from 'app/views/settings/components/settingsBreadcrumb/breadcrumbTitle'; -import Button from 'app/components/button'; -import {IconAdd, IconArrow} from 'app/icons'; -import Form from 'app/views/settings/components/forms/form'; import IntegrationAlertRules from 'app/views/organizationIntegrations/integrationAlertRules'; +import IntegrationCodeMappings from 'app/views/organizationIntegrations/integrationCodeMappings'; import IntegrationItem from 'app/views/organizationIntegrations/integrationItem'; import IntegrationRepos from 'app/views/organizationIntegrations/integrationRepos'; -import IntegrationCodeMappings from 'app/views/organizationIntegrations/integrationCodeMappings'; +import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; +import BreadcrumbTitle from 'app/views/settings/components/settingsBreadcrumb/breadcrumbTitle'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import withOrganization from 'app/utils/withOrganization'; -import {Organization, IntegrationWithConfig, IntegrationProvider} from 'app/types'; -import {trackIntegrationEvent} from 'app/utils/integrationUtil'; -import {singleLineRenderer} from 'app/utils/marked'; -import Alert from 'app/components/alert'; -import NavTabs from 'app/components/navTabs'; -import List from 'app/components/list'; -import ListItem from 'app/components/list/listItem'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/components/membersFilter.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/components/membersFilter.tsx index f593b8a182a360..a0514516b0fa05 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/components/membersFilter.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/components/membersFilter.tsx @@ -1,13 +1,13 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import {MemberRole} from 'app/types'; -import space from 'app/styles/space'; import Checkbox from 'app/components/checkbox'; import Switch from 'app/components/switch'; -import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {MemberRole} from 'app/types'; +import {stringifyQueryObject, tokenizeSearch} from 'app/utils/tokenizeSearch'; type Props = { className?: string; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx index 77d3d0ced281d2..aa8c43367ba9c4 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/index.jsx @@ -1,23 +1,23 @@ -import {withRouter} from 'react-router'; -import PropTypes from 'prop-types'; import React from 'react'; -import classNames from 'classnames'; +import {withRouter} from 'react-router'; import * as Sentry from '@sentry/react'; +import classNames from 'classnames'; +import PropTypes from 'prop-types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; +import Button from 'app/components/button'; +import TextField from 'app/components/forms/textField'; +import LoadingIndicator from 'app/components/loadingIndicator'; import {MEMBER_ROLES} from 'app/constants'; import {t, tct} from 'app/locale'; -import withApi from 'app/utils/withApi'; -import withOrganization from 'app/utils/withOrganization'; import SentryTypes from 'app/sentryTypes'; -import Button from 'app/components/button'; import ConfigStore from 'app/stores/configStore'; -import LoadingIndicator from 'app/components/loadingIndicator'; +import replaceRouterParams from 'app/utils/replaceRouterParams'; +import withApi from 'app/utils/withApi'; +import withOrganization from 'app/utils/withOrganization'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; -import TextField from 'app/components/forms/textField'; import TeamSelect from 'app/views/settings/components/teamSelect'; -import replaceRouterParams from 'app/utils/replaceRouterParams'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import RoleSelect from './roleSelect'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/roleSelect.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/roleSelect.tsx index 6efd1f7629ab18..a16ad4a4452a4d 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/roleSelect.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteMember/roleSelect.tsx @@ -1,11 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {MemberRole} from 'app/types'; import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import {t} from 'app/locale'; import Radio from 'app/components/radio'; +import {t} from 'app/locale'; +import {MemberRole} from 'app/types'; import TextBlock from 'app/views/settings/components/text/textBlock'; const Label = styled('label')` diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteRequestRow.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteRequestRow.tsx index 7a980c93d6b6f4..8ebfdd48496e38 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteRequestRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/inviteRequestRow.tsx @@ -1,18 +1,18 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Member, Organization, Team, MemberRole} from 'app/types'; -import {PanelItem} from 'app/components/panels'; -import {t, tct} from 'app/locale'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; +import SelectControl from 'app/components/forms/selectControl'; import HookOrDefault from 'app/components/hookOrDefault'; +import {PanelItem} from 'app/components/panels'; +import RoleSelectControl from 'app/components/roleSelectControl'; import Tag from 'app/components/tagDeprecated'; import Tooltip from 'app/components/tooltip'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import SelectControl from 'app/components/forms/selectControl'; -import RoleSelectControl from 'app/components/roleSelectControl'; +import {Member, MemberRole, Organization, Team} from 'app/types'; type Props = { inviteRequest: Member; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationAccessRequests.jsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationAccessRequests.jsx index 75e7f9310ee021..e01bc955d394bf 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationAccessRequests.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationAccessRequests.jsx @@ -1,11 +1,11 @@ import React from 'react'; -import PropTypes from 'prop-types'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {t, tct} from 'app/locale'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import Button from 'app/components/button'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import {t, tct} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; import withApi from 'app/utils/withApi'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx index 38d45a9e03ff93..29fa9d7db4ab9d 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberDetail.tsx @@ -1,34 +1,34 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; -import {Member, Organization, Team} from 'app/types'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import {removeAuthenticator} from 'app/actionCreators/account'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {inputStyles} from 'app/styles/input'; -import {removeAuthenticator} from 'app/actionCreators/account'; import {resendMemberInvite, updateMember} from 'app/actionCreators/members'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import AutoSelectText from 'app/components/autoSelectText'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; import DateTime from 'app/components/dateTime'; -import ExternalLink from 'app/components/links/externalLink'; -import Field from 'app/views/settings/components/forms/field'; import NotFound from 'app/components/errors/notFound'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TeamSelect from 'app/views/settings/components/teamSelect'; +import ExternalLink from 'app/components/links/externalLink'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import Tooltip from 'app/components/tooltip'; -import recreateRoute from 'app/utils/recreateRoute'; +import {t, tct} from 'app/locale'; +import {inputStyles} from 'app/styles/input'; import space from 'app/styles/space'; +import {Member, Organization, Team} from 'app/types'; +import recreateRoute from 'app/utils/recreateRoute'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; +import Field from 'app/views/settings/components/forms/field'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TeamSelect from 'app/views/settings/components/teamSelect'; import RoleSelect from './inviteMember/roleSelect'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberRow.jsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberRow.jsx index 3bbfa5934f2c7d..7246429bb32b48 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberRow.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMemberRow.jsx @@ -1,15 +1,15 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {PanelItem} from 'app/components/panels'; -import {t, tct} from 'app/locale'; import UserAvatar from 'app/components/avatar/userAvatar'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; -import {IconClose, IconCheckmark, IconFlag, IconMail, IconSubtract} from 'app/icons'; import Link from 'app/components/links/link'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {PanelItem} from 'app/components/panels'; +import {IconCheckmark, IconClose, IconFlag, IconMail, IconSubtract} from 'app/icons'; +import {t, tct} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; import recreateRoute from 'app/utils/recreateRoute'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx index e8036792f24fcd..7cebbcb8fa5ac7 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersList.tsx @@ -1,30 +1,30 @@ -import {ClassNames} from '@emotion/core'; -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; +import {ClassNames} from '@emotion/core'; import styled from '@emotion/styled'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {Organization, Member, MemberRole} from 'app/types'; -import {IconSliders} from 'app/icons'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import ConfigStore from 'app/stores/configStore'; -import Pagination from 'app/components/pagination'; -import routeTitleGen from 'app/utils/routeTitle'; -import SentryTypes from 'app/sentryTypes'; -import {redirectToRemainingOrganization} from 'app/actionCreators/organizations'; import {resendMemberInvite} from 'app/actionCreators/members'; -import withOrganization from 'app/utils/withOrganization'; +import {redirectToRemainingOrganization} from 'app/actionCreators/organizations'; import Button from 'app/components/button'; import DropdownMenu from 'app/components/dropdownMenu'; -import space from 'app/styles/space'; +import Pagination from 'app/components/pagination'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {MEMBER_ROLES} from 'app/constants'; +import {IconSliders} from 'app/icons'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import ConfigStore from 'app/stores/configStore'; +import space from 'app/styles/space'; +import {Member, MemberRole, Organization} from 'app/types'; +import routeTitleGen from 'app/utils/routeTitle'; import theme from 'app/utils/theme'; +import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import OrganizationMemberRow from './organizationMemberRow'; import MembersFilter from './components/membersFilter'; +import OrganizationMemberRow from './organizationMemberRow'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersWrapper.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersWrapper.tsx index b2cb749065326d..1bfcbd4b29d19c 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersWrapper.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationMembersWrapper.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; import {openInviteMembersModal} from 'app/actionCreators/modal'; -import {Organization, Member} from 'app/types'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import AsyncView from 'app/views/asyncView'; +import AlertLink from 'app/components/alertLink'; import Badge from 'app/components/badge'; -import {IconMail} from 'app/icons'; import ListLink from 'app/components/links/listLink'; -import AlertLink from 'app/components/alertLink'; import NavTabs from 'app/components/navTabs'; +import {IconMail} from 'app/icons'; +import {t} from 'app/locale'; +import {Member, Organization} from 'app/types'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; import routeTitleGen from 'app/utils/routeTitle'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; type Props = { children?: any; diff --git a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationRequestsView.tsx b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationRequestsView.tsx index 803dce932168d8..eed2b1cdf33db4 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationRequestsView.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationMembers/organizationRequestsView.tsx @@ -1,17 +1,17 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; +import PropTypes from 'prop-types'; -import {MEMBER_ROLES} from 'app/constants'; -import {AccessRequest, Member, Organization, Team} from 'app/types'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {MEMBER_ROLES} from 'app/constants'; import {t, tct} from 'app/locale'; +import {AccessRequest, Member, Organization, Team} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import withOrganization from 'app/utils/withOrganization'; import withTeams from 'app/utils/withTeams'; import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; import InviteRequestRow from './inviteRequestRow'; import OrganizationAccessRequests from './organizationAccessRequests'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationPerformance/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationPerformance/index.tsx index c4d7b2b7b79ab8..5f0cca88d65fa2 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationPerformance/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationPerformance/index.tsx @@ -2,16 +2,16 @@ import React from 'react'; import {Location} from 'history'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import {updateOrganization} from 'app/actionCreators/organizations'; +import ExternalLink from 'app/components/links/externalLink'; import {t, tct} from 'app/locale'; +import {Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; import {JsonFormObject} from 'app/views/settings/components/forms/type'; -import ExternalLink from 'app/components/links/externalLink'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import PermissionAlert from 'app/views/settings/organization/permissionAlert'; -import {updateOrganization} from 'app/actionCreators/organizations'; -import withOrganization from 'app/utils/withOrganization'; -import {Organization} from 'app/types'; const fields: JsonFormObject[] = [ { diff --git a/src/sentry/static/sentry/app/views/settings/organizationProjects/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationProjects/index.tsx index 215e8a7ceaf470..a98ebedb2f3171 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationProjects/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationProjects/index.tsx @@ -1,25 +1,25 @@ import React from 'react'; -import {Location} from 'history'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import {Location} from 'history'; -import {Organization, Project} from 'app/types'; -import {sortProjects} from 'app/utils'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import LoadingIndicator from 'app/components/loadingIndicator'; import Pagination from 'app/components/pagination'; import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import Placeholder from 'app/components/placeholder'; -import ProjectListItem from 'app/views/settings/components/settingsProjectItem'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import routeTitleGen from 'app/utils/routeTitle'; -import space from 'app/styles/space'; -import withOrganization from 'app/utils/withOrganization'; import {IconAdd} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {sortProjects} from 'app/utils'; import {decodeScalar} from 'app/utils/queryString'; +import routeTitleGen from 'app/utils/routeTitle'; +import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import ProjectListItem from 'app/views/settings/components/settingsProjectItem'; import ProjectStatsGraph from './projectStatsGraph'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.tsx b/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.tsx index 5cfd25ff87e5d3..3515bc7cf61fc5 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationProjects/projectStatsGraph.tsx @@ -1,10 +1,10 @@ import React from 'react'; import LazyLoad from 'react-lazyload'; +import MiniBarChart from 'app/components/charts/miniBarChart'; import {t} from 'app/locale'; import {Project} from 'app/types'; import {Series} from 'app/types/echarts'; -import MiniBarChart from 'app/components/charts/miniBarChart'; type Props = { project: Project; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx b/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx index 821e9664b140e7..5ab644eef82fac 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRateLimits/organizationRateLimits.jsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import {t, tct} from 'app/locale'; import Field from 'app/views/settings/components/forms/field'; import Form from 'app/views/settings/components/forms/form'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import RangeField from 'app/views/settings/components/forms/rangeField'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/index.tsx index 9a66bd9112917a..40fce0e46e11bd 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/index.tsx @@ -1,11 +1,11 @@ import React from 'react'; +import Access from 'app/components/acl/access'; import Feature from 'app/components/acl/feature'; import FeatureDisabled from 'app/components/acl/featureDisabled'; import {PanelAlert} from 'app/components/panels'; import {t} from 'app/locale'; import withOrganization from 'app/utils/withOrganization'; -import Access from 'app/components/acl/access'; import RelayWrapper from './relayWrapper'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/activityList.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/activityList.tsx index eb01ff649e5e52..1ca804e5c12da3 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/activityList.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/activityList.tsx @@ -1,10 +1,10 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; +import DateTime from 'app/components/dateTime'; import {PanelTable} from 'app/components/panels'; +import {t} from 'app/locale'; import {RelayActivity} from 'app/types'; -import DateTime from 'app/components/dateTime'; type Props = { activities: Array<RelayActivity>; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/cardHeader.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/cardHeader.tsx index e774c0a4ea7daf..e10e63800e6fa8 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/cardHeader.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/cardHeader.tsx @@ -1,16 +1,16 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; import Button from 'app/components/button'; -import ConfirmDelete from 'app/components/confirmDelete'; import ButtonBar from 'app/components/buttonBar'; -import QuestionTooltip from 'app/components/questionTooltip'; +import Clipboard from 'app/components/clipboard'; +import ConfirmDelete from 'app/components/confirmDelete'; import DateTime from 'app/components/dateTime'; -import {IconEdit, IconDelete, IconCopy} from 'app/icons'; +import QuestionTooltip from 'app/components/questionTooltip'; +import {IconCopy, IconDelete, IconEdit} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; import {Relay} from 'app/types'; -import Clipboard from 'app/components/clipboard'; type Props = Relay & { onEdit: (publicKey: Relay['publicKey']) => () => void; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/index.tsx index 51f1ac2eba436b..8493a978a18bcb 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/index.tsx @@ -2,12 +2,12 @@ import React from 'react'; import styled from '@emotion/styled'; import orderBy from 'lodash/orderBy'; -import {Relay, RelayActivity} from 'app/types'; import space from 'app/styles/space'; +import {Relay, RelayActivity} from 'app/types'; -import {getRelaysByPublicKey} from './utils'; -import CardHeader from './cardHeader'; import ActivityList from './activityList'; +import CardHeader from './cardHeader'; +import {getRelaysByPublicKey} from './utils'; import WaitingActivity from './waitingActivity'; type CardHeaderProps = React.ComponentProps<typeof CardHeader>; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/waitingActivity.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/waitingActivity.tsx index e3d57dec939217..afb494fb8aafe5 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/list/waitingActivity.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/list/waitingActivity.tsx @@ -1,11 +1,11 @@ import React from 'react'; -import {t, tct} from 'app/locale'; -import {Panel} from 'app/components/panels'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import CommandLine from 'app/components/commandLine'; +import {Panel} from 'app/components/panels'; import {IconRefresh} from 'app/icons'; +import {t, tct} from 'app/locale'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = { onRefresh: () => void; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/add/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/add/index.tsx index 443e73a05ea0aa..ee8719f9bdd85f 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/add/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/add/index.tsx @@ -1,14 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; import ExternalLink from 'app/components/links/externalLink'; import List from 'app/components/list'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; import ModalManager from '../modalManager'; -import Terminal from './terminal'; + import Item from './item'; +import Terminal from './terminal'; class Add extends ModalManager { getTitle() { diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/form.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/form.tsx index ee8c8c072f5137..4b73d956d91bb3 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/form.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/form.tsx @@ -1,12 +1,12 @@ import React from 'react'; import {t} from 'app/locale'; +import {Relay} from 'app/types'; import Input from 'app/views/settings/components/forms/controls/input'; -import FieldHelp from 'app/views/settings/components/forms/field/fieldHelp'; import Textarea from 'app/views/settings/components/forms/controls/textarea'; import Field from 'app/views/settings/components/forms/field'; +import FieldHelp from 'app/views/settings/components/forms/field/fieldHelp'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; -import {Relay} from 'app/types'; type FormField = keyof Pick<Relay, 'name' | 'publicKey' | 'description'>; type Values = Record<FormField, string>; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/modalManager.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/modalManager.tsx index fbab2a010ff589..44e34eaed2a78b 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/modalManager.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/modals/modalManager.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import omit from 'lodash/omit'; import isEqual from 'lodash/isEqual'; +import omit from 'lodash/omit'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import {ModalRenderProps} from 'app/actionCreators/modal'; import {Client} from 'app/api'; import {t} from 'app/locale'; -import {ModalRenderProps} from 'app/actionCreators/modal'; import {Organization, Relay} from 'app/types'; import Form from './form'; -import Modal from './modal'; import handleXhrErrorResponse from './handleXhrErrorResponse'; +import Modal from './modal'; type FormProps = React.ComponentProps<typeof Form>; type Values = FormProps['values']; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRelay/relayWrapper.tsx b/src/sentry/static/sentry/app/views/settings/organizationRelay/relayWrapper.tsx index e29604bd10bdaf..4796abe39672a6 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRelay/relayWrapper.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRelay/relayWrapper.tsx @@ -1,20 +1,20 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import omit from 'lodash/omit'; -import isEqual from 'lodash/isEqual'; import styled from '@emotion/styled'; +import isEqual from 'lodash/isEqual'; +import omit from 'lodash/omit'; -import {updateOrganization} from 'app/actionCreators/organizations'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {openModal} from 'app/actionCreators/modal'; -import {t, tct} from 'app/locale'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import {Organization, Relay, RelayActivity} from 'app/types'; -import ExternalLink from 'app/components/links/externalLink'; +import {updateOrganization} from 'app/actionCreators/organizations'; import Button from 'app/components/button'; -import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import ExternalLink from 'app/components/links/externalLink'; import {IconAdd} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {Organization, Relay, RelayActivity} from 'app/types'; import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import Add from './modals/add'; import Edit from './modals/edit'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx b/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx index 50cf1bb9159dac..22237f4ad6e05e 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRepositories/addRepositoryLink.jsx @@ -1,11 +1,11 @@ +import React from 'react'; import Modal from 'react-bootstrap/lib/Modal'; import PropTypes from 'prop-types'; -import React from 'react'; +import PluginComponentBase from 'app/components/bases/pluginComponentBase'; import {FormState} from 'app/components/forms'; -import {parseRepo} from 'app/utils'; import {t, tct} from 'app/locale'; -import PluginComponentBase from 'app/components/bases/pluginComponentBase'; +import {parseRepo} from 'app/utils'; const UNKNOWN_ERROR = { error_type: 'unknown', diff --git a/src/sentry/static/sentry/app/views/settings/organizationRepositories/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationRepositories/index.jsx index 939ab58ac164a5..bacee1bd502e1e 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRepositories/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRepositories/index.jsx @@ -1,10 +1,10 @@ import React from 'react'; -import {sortArray} from 'app/utils'; -import AsyncView from 'app/views/asyncView'; import Pagination from 'app/components/pagination'; import {t} from 'app/locale'; +import {sortArray} from 'app/utils'; import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; import OrganizationRepositories from './organizationRepositories'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx b/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx index 0f9ff25e5cb438..1e05fc84b1277d 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationRepositories/organizationRepositories.tsx @@ -1,18 +1,18 @@ -import PropTypes from 'prop-types'; import React from 'react'; import {Params} from 'react-router/lib/Router'; +import PropTypes from 'prop-types'; -import {Repository, RepositoryStatus} from 'app/types'; import {Client} from 'app/api'; -import {t, tct} from 'app/locale'; import AlertLink from 'app/components/alertLink'; import Button from 'app/components/button'; -import RepositoryRow from 'app/components/repositoryRow'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import RepositoryRow from 'app/components/repositoryRow'; import {IconCommit} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {Repository, RepositoryStatus} from 'app/types'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = { itemList: Repository[]; diff --git a/src/sentry/static/sentry/app/views/settings/organizationSecurityAndPrivacy/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationSecurityAndPrivacy/index.tsx index c9858529ce67c7..d8bbc942440cb6 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationSecurityAndPrivacy/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationSecurityAndPrivacy/index.tsx @@ -1,17 +1,17 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import {t} from 'app/locale'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import Form from 'app/views/settings/components/forms/form'; -import AsyncView from 'app/views/asyncView'; -import {Organization} from 'app/types'; import {addErrorMessage} from 'app/actionCreators/indicator'; import {updateOrganization} from 'app/actionCreators/organizations'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import organizationSecurityAndPrivacyGroups from 'app/data/forms/organizationSecurityAndPrivacyGroups'; +import {t} from 'app/locale'; +import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import AsyncView from 'app/views/asyncView'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import DataScrubbing from '../components/dataScrubbing'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.tsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.tsx index 5aa3af8e6360e0..85ac8e66702cf0 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsList.tsx @@ -2,11 +2,11 @@ import React from 'react'; import styled from '@emotion/styled'; import {openCreateTeamModal} from 'app/actionCreators/modal'; -import {tct} from 'app/locale'; -import TextBlock from 'app/views/settings/components/text/textBlock'; import Button from 'app/components/button'; +import {tct} from 'app/locale'; import {Organization, Team} from 'app/types'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import AllTeamsRow from './allTeamsRow'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsRow.tsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsRow.tsx index b58c4030d2b438..17e290b230a1b0 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/allTeamsRow.tsx @@ -1,16 +1,16 @@ -import {Link} from 'react-router'; import React from 'react'; +import {Link} from 'react-router'; import styled from '@emotion/styled'; -import {Client} from 'app/api'; -import {Organization, Team} from 'app/types'; -import {PanelItem} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {joinTeam, leaveTeam} from 'app/actionCreators/teams'; -import {t, tct, tn} from 'app/locale'; +import {Client} from 'app/api'; import Button from 'app/components/button'; import IdBadge from 'app/components/idBadge'; +import {PanelItem} from 'app/components/panels'; +import {t, tct, tn} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, Team} from 'app/types'; import withApi from 'app/utils/withApi'; type Props = { diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/index.tsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/index.tsx index 0c5e07609aabc1..2bc3eb7e7a8b44 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/index.tsx @@ -2,12 +2,12 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {loadStats} from 'app/actionCreators/projects'; +import {Client} from 'app/api'; +import {Organization, Team} from 'app/types'; import {sortArray} from 'app/utils'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; import withTeams from 'app/utils/withTeams'; -import {Client} from 'app/api'; -import {Organization, Team} from 'app/types'; import OrganizationTeams from './organizationTeams'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/organizationTeams.tsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/organizationTeams.tsx index eda3ae585a6dad..fdaa98d036b372 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/organizationTeams.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/organizationTeams.tsx @@ -2,14 +2,14 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {openCreateTeamModal} from 'app/actionCreators/modal'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import recreateRoute from 'app/utils/recreateRoute'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import {IconAdd} from 'app/icons'; +import {t} from 'app/locale'; import {Organization, Team} from 'app/types'; +import recreateRoute from 'app/utils/recreateRoute'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import AllTeamsList from './allTeamsList'; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.tsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.tsx index 72e6f486488127..031857f4b84b8e 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamDetails.tsx @@ -1,26 +1,26 @@ -import {browserHistory} from 'react-router'; import React from 'react'; -import styled from '@emotion/styled'; +import {browserHistory} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; import isEqual from 'lodash/isEqual'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {fetchTeamDetails, joinTeam} from 'app/actionCreators/teams'; -import {t, tct} from 'app/locale'; import {Client} from 'app/api'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import IdBadge from 'app/components/idBadge'; import ListLink from 'app/components/links/listLink'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; import NavTabs from 'app/components/navTabs'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {t, tct} from 'app/locale'; import TeamStore from 'app/stores/teamStore'; +import {Team} from 'app/types'; import recreateRoute from 'app/utils/recreateRoute'; import withApi from 'app/utils/withApi'; import withTeams from 'app/utils/withTeams'; -import {Team} from 'app/types'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.tsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.tsx index 9b836a48ff2401..cdcf8badf7eca4 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.tsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamMembers.tsx @@ -1,34 +1,34 @@ import React from 'react'; import {RouteComponentProps} from 'react-router'; -import debounce from 'lodash/debounce'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; -import {Panel, PanelItem, PanelHeader} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {joinTeam, leaveTeam} from 'app/actionCreators/teams'; import { openInviteMembersModal, openTeamAccessRequestModal, } from 'app/actionCreators/modal'; -import {t} from 'app/locale'; +import {joinTeam, leaveTeam} from 'app/actionCreators/teams'; +import {Client} from 'app/api'; import UserAvatar from 'app/components/avatar/userAvatar'; import Button from 'app/components/button'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import {Item} from 'app/components/dropdownAutoComplete/types'; import DropdownButton from 'app/components/dropdownButton'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import IdBadge from 'app/components/idBadge'; -import {IconSubtract, IconUser} from 'app/icons'; import Link from 'app/components/links/link'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {Panel, PanelHeader, PanelItem} from 'app/components/panels'; +import {IconSubtract, IconUser} from 'app/icons'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; +import {Config, Member, Organization} from 'app/types'; import withApi from 'app/utils/withApi'; import withConfig from 'app/utils/withConfig'; import withOrganization from 'app/utils/withOrganization'; -import {Client} from 'app/api'; -import {Config, Member, Organization} from 'app/types'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx index b2eb256ebe894b..27b28ea69a4955 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamProjects.jsx @@ -1,26 +1,26 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Panel, PanelHeader, PanelBody, PanelItem} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {sortProjects} from 'app/utils'; -import {IconFlag, IconSubtract} from 'app/icons'; -import {t} from 'app/locale'; +import ProjectActions from 'app/actions/projectActions'; import Button from 'app/components/button'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; import Pagination from 'app/components/pagination'; -import ProjectActions from 'app/actions/projectActions'; -import ProjectListItem from 'app/views/settings/components/settingsProjectItem'; -import SentryTypes from 'app/sentryTypes'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import Tooltip from 'app/components/tooltip'; +import {IconFlag, IconSubtract} from 'app/icons'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {sortProjects} from 'app/utils'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import ProjectListItem from 'app/views/settings/components/settingsProjectItem'; class TeamProjects extends React.Component { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamSettings/index.jsx b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamSettings/index.jsx index f5c57f4db41b60..a84506632abd2b 100644 --- a/src/sentry/static/sentry/app/views/settings/organizationTeams/teamSettings/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/organizationTeams/teamSettings/index.jsx @@ -1,19 +1,19 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {Panel, PanelHeader} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {removeTeam, updateTeamSuccess} from 'app/actionCreators/teams'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import {IconDelete} from 'app/icons'; import Confirm from 'app/components/confirm'; +import {Panel, PanelHeader} from 'app/components/panels'; +import teamSettingsFields from 'app/data/forms/teamSettingsFields'; +import {IconDelete} from 'app/icons'; +import {t, tct} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import AsyncView from 'app/views/asyncView'; import Field from 'app/views/settings/components/forms/field'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import SentryTypes from 'app/sentryTypes'; -import teamSettingsFields from 'app/data/forms/teamSettingsFields'; import TeamModel from './model'; diff --git a/src/sentry/static/sentry/app/views/settings/project/navigationConfiguration.tsx b/src/sentry/static/sentry/app/views/settings/project/navigationConfiguration.tsx index ed84c67736d55f..d548ffdd830efc 100644 --- a/src/sentry/static/sentry/app/views/settings/project/navigationConfiguration.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/navigationConfiguration.tsx @@ -1,6 +1,6 @@ import {t} from 'app/locale'; -import {NavigationSection} from 'app/views/settings/types'; import {Organization, Project} from 'app/types'; +import {NavigationSection} from 'app/views/settings/types'; type ConfigParams = { organization?: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/project/permissionAlert.tsx b/src/sentry/static/sentry/app/views/settings/project/permissionAlert.tsx index bb1881029735e8..26ce30213ba8aa 100644 --- a/src/sentry/static/sentry/app/views/settings/project/permissionAlert.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/permissionAlert.tsx @@ -1,10 +1,10 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; import Access from 'app/components/acl/access'; import Alert from 'app/components/alert'; import {IconWarning} from 'app/icons'; +import {t} from 'app/locale'; type Props = React.ComponentPropsWithoutRef<typeof Alert> & Pick<React.ComponentProps<typeof Access>, 'access'>; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.tsx b/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.tsx index 605e124b038464..7e653ee0a1f510 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectEnvironments.tsx @@ -1,26 +1,26 @@ import React from 'react'; -import styled from '@emotion/styled'; import {WithRouterProps} from 'react-router'; +import styled from '@emotion/styled'; -import {ALL_ENVIRONMENTS_KEY} from 'app/constants'; -import {Panel, PanelHeader, PanelBody, PanelItem} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import Access from 'app/components/acl/access'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import withApi from 'app/utils/withApi'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import ListLink from 'app/components/links/listLink'; import LoadingIndicator from 'app/components/loadingIndicator'; import NavTabs from 'app/components/navTabs'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import recreateRoute from 'app/utils/recreateRoute'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {ALL_ENVIRONMENTS_KEY} from 'app/constants'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; -import {getUrlRoutingName, getDisplayName} from 'app/utils/environment'; import {Environment, Project} from 'app/types'; -import {Client} from 'app/api'; +import {getDisplayName, getUrlRoutingName} from 'app/utils/environment'; +import recreateRoute from 'app/utils/recreateRoute'; +import withApi from 'app/utils/withApi'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.tsx b/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.tsx index d489d6946de9ff..572be2574d1a49 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectFilters/groupTombstones.tsx @@ -2,17 +2,17 @@ import React from 'react'; import styled from '@emotion/styled'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; import Avatar from 'app/components/avatar'; import EventOrGroupHeader from 'app/components/eventOrGroupHeader'; import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; +import {Panel, PanelItem} from 'app/components/panels'; import Tooltip from 'app/components/tooltip'; import {IconDelete} from 'app/icons'; -import {Panel, PanelItem} from 'app/components/panels'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import {GroupTombstone} from 'app/types'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type RowProps = { data: GroupTombstone; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectFilters/index.tsx b/src/sentry/static/sentry/app/views/settings/project/projectFilters/index.tsx index 255c38e7558754..24c156a86e1530 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectFilters/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectFilters/index.tsx @@ -1,19 +1,19 @@ -import {Link} from 'react-router'; import React from 'react'; +import {Link} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; -import {t} from 'app/locale'; -import GroupTombstones from 'app/views/settings/project/projectFilters/groupTombstones'; import NavTabs from 'app/components/navTabs'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import {t} from 'app/locale'; +import {Project} from 'app/types'; +import recreateRoute from 'app/utils/recreateRoute'; +import withProject from 'app/utils/withProject'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import PermissionAlert from 'app/views/settings/project/permissionAlert'; +import GroupTombstones from 'app/views/settings/project/projectFilters/groupTombstones'; import ProjectFiltersChart from 'app/views/settings/project/projectFilters/projectFiltersChart'; import ProjectFiltersSettings from 'app/views/settings/project/projectFilters/projectFiltersSettings'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; -import recreateRoute from 'app/utils/recreateRoute'; -import withProject from 'app/utils/withProject'; -import {Project} from 'app/types'; type Props = { project: Project; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.tsx b/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.tsx index 6c834383b06ef1..bf79a3bec06fc5 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersChart.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import {t} from 'app/locale'; -import withApi from 'app/utils/withApi'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import {Client} from 'app/api'; +import MiniBarChart from 'app/components/charts/miniBarChart'; import LoadingError from 'app/components/loadingError'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import Placeholder from 'app/components/placeholder'; -import MiniBarChart from 'app/components/charts/miniBarChart'; -import {Series} from 'app/types/echarts'; +import {t} from 'app/locale'; import {Project} from 'app/types'; -import {Client} from 'app/api'; +import {Series} from 'app/types/echarts'; import theme from 'app/utils/theme'; +import withApi from 'app/utils/withApi'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersSettings.tsx b/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersSettings.tsx index 389dc2712258c0..60d591f79e49ed 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersSettings.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectFilters/projectFiltersSettings.tsx @@ -1,8 +1,11 @@ -import PropTypes from 'prop-types'; import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {Project} from 'app/types'; +import Access from 'app/components/acl/access'; +import Feature from 'app/components/acl/feature'; +import FeatureDisabled from 'app/components/acl/featureDisabled'; +import AsyncComponent from 'app/components/asyncComponent'; import { Panel, PanelAlert, @@ -10,18 +13,15 @@ import { PanelHeader, PanelItem, } from 'app/components/panels'; +import Switch from 'app/components/switch'; +import filterGroups, {customFilterFields} from 'app/data/forms/inboundFilters'; import {t} from 'app/locale'; -import Access from 'app/components/acl/access'; -import AsyncComponent from 'app/components/asyncComponent'; -import Feature from 'app/components/acl/feature'; -import FeatureDisabled from 'app/components/acl/featureDisabled'; +import HookStore from 'app/stores/hookStore'; +import {Project} from 'app/types'; import FieldFromConfig from 'app/views/settings/components/forms/fieldFromConfig'; import Form from 'app/views/settings/components/forms/form'; import FormField from 'app/views/settings/components/forms/formField'; -import HookStore from 'app/stores/hookStore'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import Switch from 'app/components/switch'; -import filterGroups, {customFilterFields} from 'app/data/forms/inboundFilters'; const LEGACY_BROWSER_SUBFILTERS = { ie_pre_9: { diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/index.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/index.tsx index 300487b3af7c8c..4dc22ec2eb8eae 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/index.tsx @@ -1,14 +1,14 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; import {t} from 'app/locale'; import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; import KeySettings from 'app/views/settings/project/projectKeys/details/keySettings'; import KeyStats from 'app/views/settings/project/projectKeys/details/keyStats'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; type Props = RouteComponentProps< { diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyRateLimitsForm.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyRateLimitsForm.tsx index 148b1b0a744549..361aceab74bcf8 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyRateLimitsForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyRateLimitsForm.tsx @@ -1,18 +1,18 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; -import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; -import {t} from 'app/locale'; import Feature from 'app/components/acl/feature'; import FeatureDisabled from 'app/components/acl/featureDisabled'; -import Form from 'app/views/settings/components/forms/form'; -import FormField from 'app/views/settings/components/forms/formField'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import {IconFlag} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; import InputControl from 'app/views/settings/components/forms/controls/input'; import RangeSlider from 'app/views/settings/components/forms/controls/rangeSlider'; -import space from 'app/styles/space'; +import Form from 'app/views/settings/components/forms/form'; +import FormField from 'app/views/settings/components/forms/formField'; +import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; const RATE_LIMIT_FORMAT_MAP = new Map([ [0, 'None'], diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keySettings.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keySettings.tsx index 2af9354eddc78a..49ead6da431413 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keySettings.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keySettings.tsx @@ -1,30 +1,30 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Client} from 'app/api'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; -import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {t, tct} from 'app/locale'; +import {Client} from 'app/api'; import Access from 'app/components/acl/access'; -import BooleanField from 'app/views/settings/components/forms/booleanField'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; import DateTime from 'app/components/dateTime'; import ExternalLink from 'app/components/links/externalLink'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; +import {IconFlag} from 'app/icons'; +import {t, tct} from 'app/locale'; +import getDynamicText from 'app/utils/getDynamicText'; +import BooleanField from 'app/views/settings/components/forms/booleanField'; import Field from 'app/views/settings/components/forms/field'; import Form from 'app/views/settings/components/forms/form'; -import {IconFlag} from 'app/icons'; -import KeyRateLimitsForm from 'app/views/settings/project/projectKeys/details/keyRateLimitsForm'; -import ProjectKeyCredentials from 'app/views/settings/project/projectKeys/projectKeyCredentials'; import SelectField from 'app/views/settings/components/forms/selectField'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; import TextField from 'app/views/settings/components/forms/textField'; -import getDynamicText from 'app/utils/getDynamicText'; +import KeyRateLimitsForm from 'app/views/settings/project/projectKeys/details/keyRateLimitsForm'; +import ProjectKeyCredentials from 'app/views/settings/project/projectKeys/projectKeyCredentials'; +import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyStats.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyStats.tsx index 8f66e2569ef50b..2fae7f1f814e12 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyStats.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/details/keyStats.tsx @@ -1,15 +1,15 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import theme from 'app/utils/theme'; import {Client} from 'app/api'; -import {Series} from 'app/types/echarts'; +import MiniBarChart from 'app/components/charts/miniBarChart'; +import LoadingError from 'app/components/loadingError'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import Placeholder from 'app/components/placeholder'; import {t} from 'app/locale'; +import {Series} from 'app/types/echarts'; +import theme from 'app/utils/theme'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import LoadingError from 'app/components/loadingError'; -import Placeholder from 'app/components/placeholder'; -import MiniBarChart from 'app/components/charts/miniBarChart'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx index 577d92e92de16d..b2d593ae1057e6 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/index.tsx @@ -1,26 +1,26 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import { - addLoadingMessage, addErrorMessage, + addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {Organization, Project} from 'app/types'; -import {Panel} from 'app/components/panels'; -import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import ExternalLink from 'app/components/links/externalLink'; import Pagination from 'app/components/pagination'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import {Panel} from 'app/components/panels'; +import {IconAdd, IconFlag} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {Organization, Project} from 'app/types'; import routeTitleGen from 'app/utils/routeTitle'; import withOrganization from 'app/utils/withOrganization'; import withProject from 'app/utils/withProject'; -import {IconAdd, IconFlag} from 'app/icons'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; +import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; import KeyRow from './keyRow'; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/keyRow.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/keyRow.tsx index 35c64d211c0da1..244475f50eecb8 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/keyRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/list/keyRow.tsx @@ -1,20 +1,20 @@ +import React from 'react'; import {Link} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; -import React from 'react'; import styled from '@emotion/styled'; import {Client} from 'app/api'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; -import {t} from 'app/locale'; import Button from 'app/components/button'; import ClippedBox from 'app/components/clippedBox'; import Confirm from 'app/components/confirm'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {IconDelete} from 'app/icons'; -import ProjectKeyCredentials from 'app/views/settings/project/projectKeys/projectKeyCredentials'; -import recreateRoute from 'app/utils/recreateRoute'; +import {t} from 'app/locale'; import space from 'app/styles/space'; import {Scope} from 'app/types'; +import recreateRoute from 'app/utils/recreateRoute'; +import ProjectKeyCredentials from 'app/views/settings/project/projectKeys/projectKeyCredentials'; +import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectKeys/projectKeyCredentials.tsx b/src/sentry/static/sentry/app/views/settings/project/projectKeys/projectKeyCredentials.tsx index ff7d2366a2ef2a..81ec97488d5c6a 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectKeys/projectKeyCredentials.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectKeys/projectKeyCredentials.tsx @@ -1,14 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; -import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; -import {t, tct} from 'app/locale'; import ExternalLink from 'app/components/links/externalLink'; import Link from 'app/components/links/link'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import getDynamicText from 'app/utils/getDynamicText'; import Field from 'app/views/settings/components/forms/field'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; -import getDynamicText from 'app/utils/getDynamicText'; -import space from 'app/styles/space'; +import {ProjectKey} from 'app/views/settings/project/projectKeys/types'; const DEFAULT_PROPS = { showDsn: true, diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/index.tsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/index.tsx index 1ffe74dfd6176a..916f1d1222e899 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/index.tsx @@ -1,19 +1,19 @@ import React from 'react'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; +import Button from 'app/components/button'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t, tct} from 'app/locale'; +import {Organization, Project} from 'app/types'; import routeTitleGen from 'app/utils/routeTitle'; import AsyncView from 'app/views/asyncView'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import OwnerInput from 'app/views/settings/project/projectOwnership/ownerInput'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import Button from 'app/components/button'; -import {Organization, Project} from 'app/types'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; +import OwnerInput from 'app/views/settings/project/projectOwnership/ownerInput'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.tsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.tsx index 0c6c91b4323822..ef849185a0a7bb 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/modal.tsx @@ -1,18 +1,18 @@ import React from 'react'; -import uniq from 'lodash/uniq'; import {WithRouterProps} from 'react-router'; +import uniq from 'lodash/uniq'; -import {t} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; -import OwnerInput from 'app/views/settings/project/projectOwnership/ownerInput'; +import {t} from 'app/locale'; import { + Entry, + Frame, Organization, Project, SentryErrorEvent, TagWithTopValues, - Entry, - Frame, } from 'app/types'; +import OwnerInput from 'app/views/settings/project/projectOwnership/ownerInput'; type IssueOwnershipResponse = { raw: string; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ownerInput.tsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ownerInput.tsx index f8575c45664f6d..5c4942ece317d6 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ownerInput.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ownerInput.tsx @@ -1,15 +1,15 @@ import React from 'react'; -import styled from '@emotion/styled'; import TextareaAutosize from 'react-autosize-textarea'; +import styled from '@emotion/styled'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; -import MemberListStore from 'app/stores/memberListStore'; -import ProjectsStore from 'app/stores/projectsStore'; import Button from 'app/components/button'; -import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {t} from 'app/locale'; +import MemberListStore from 'app/stores/memberListStore'; +import ProjectsStore from 'app/stores/projectsStore'; import {inputStyles} from 'app/styles/input'; -import {Project, Organization, Team} from 'app/types'; +import {Organization, Project, Team} from 'app/types'; import theme from 'app/utils/theme'; import RuleBuilder from './ruleBuilder'; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ruleBuilder.tsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ruleBuilder.tsx index 238a93aeaa792b..9828eb995903d1 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ruleBuilder.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/ruleBuilder.tsx @@ -1,19 +1,19 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import MemberListStore from 'app/stores/memberListStore'; +import {addErrorMessage} from 'app/actionCreators/indicator'; import Button from 'app/components/button'; import SelectField from 'app/components/forms/selectField'; import TextOverflow from 'app/components/textOverflow'; import {IconAdd, IconChevron} from 'app/icons'; +import {t} from 'app/locale'; +import MemberListStore from 'app/stores/memberListStore'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; import Input from 'app/views/settings/components/forms/controls/input'; -import {addErrorMessage} from 'app/actionCreators/indicator'; import SelectOwners, { Owner, } from 'app/views/settings/project/projectOwnership/selectOwners'; -import space from 'app/styles/space'; -import {Project, Organization} from 'app/types'; const initialState = { text: '', diff --git a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.tsx b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.tsx index 42ff7f2811aa62..cf0e2c3d02fe0b 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectOwnership/selectOwners.tsx @@ -1,25 +1,25 @@ -import debounce from 'lodash/debounce'; import React from 'react'; import ReactDOM from 'react-dom'; import styled from '@emotion/styled'; +import debounce from 'lodash/debounce'; import isEqual from 'lodash/isEqual'; import {addTeamToProject} from 'app/actionCreators/projects'; -import {t} from 'app/locale'; -import {buildUserId, buildTeamId} from 'app/utils'; import {Client} from 'app/api'; -import MemberListStore from 'app/stores/memberListStore'; -import ProjectsStore from 'app/stores/projectsStore'; -import TeamStore from 'app/stores/teamStore'; -import IdBadge from 'app/components/idBadge'; -import MultiSelectControl from 'app/components/forms/multiSelectControl'; import ActorAvatar from 'app/components/avatar/actorAvatar'; import Button from 'app/components/button'; -import {IconAdd} from 'app/icons'; +import MultiSelectControl from 'app/components/forms/multiSelectControl'; +import IdBadge from 'app/components/idBadge'; import Tooltip from 'app/components/tooltip'; -import withProjects from 'app/utils/withProjects'; -import withApi from 'app/utils/withApi'; +import {IconAdd} from 'app/icons'; +import {t} from 'app/locale'; +import MemberListStore from 'app/stores/memberListStore'; +import ProjectsStore from 'app/stores/projectsStore'; +import TeamStore from 'app/stores/teamStore'; import {Actor, Member, Organization, Project, Team, User} from 'app/types'; +import {buildTeamId, buildUserId} from 'app/utils'; +import withApi from 'app/utils/withApi'; +import withProjects from 'app/utils/withProjects'; export type Owner = { value: string; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.tsx b/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.tsx index 773444221f17f7..4905b20294e6e4 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectProcessingIssues.tsx @@ -1,28 +1,28 @@ import React from 'react'; -import styled from '@emotion/styled'; import {WithRouterProps} from 'react-router'; +import styled from '@emotion/styled'; -import {IconQuestion, IconSettings} from 'app/icons'; -import {Panel, PanelAlert, PanelTable} from 'app/components/panels'; import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; -import {t, tn} from 'app/locale'; +import {Client} from 'app/api'; import Access from 'app/components/acl/access'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import AutoSelectText from 'app/components/autoSelectText'; import Button from 'app/components/button'; import EmptyStateWarning from 'app/components/emptyStateWarning'; -import Form from 'app/views/settings/components/forms/form'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import {Panel, PanelAlert, PanelTable} from 'app/components/panels'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import TimeSince from 'app/components/timeSince'; import formGroups from 'app/data/forms/processingIssues'; +import {IconQuestion, IconSettings} from 'app/icons'; +import {t, tn} from 'app/locale'; +import {Organization, ProcessingIssue, ProcessingIssueItem} from 'app/types'; import withApi from 'app/utils/withApi'; import withOrganization from 'app/utils/withOrganization'; -import {Client} from 'app/api'; -import {Organization, ProcessingIssue, ProcessingIssueItem} from 'app/types'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; const MESSAGES = { native_no_crashed_thread: t('No crashed thread found in crash report'), diff --git a/src/sentry/static/sentry/app/views/settings/project/projectReleaseTracking.tsx b/src/sentry/static/sentry/app/views/settings/project/projectReleaseTracking.tsx index 4342c69a75a6ef..484a4edd26c513 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectReleaseTracking.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectReleaseTracking.tsx @@ -1,24 +1,24 @@ import React from 'react'; import {WithRouterProps} from 'react-router'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; -import {t, tct} from 'app/locale'; import Alert from 'app/components/alert'; -import AsyncView from 'app/views/asyncView'; import AutoSelectText from 'app/components/autoSelectText'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; -import Field from 'app/views/settings/components/forms/field'; -import {IconFlag} from 'app/icons'; import LoadingIndicator from 'app/components/loadingIndicator'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import PluginList from 'app/components/pluginList'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; +import {IconFlag} from 'app/icons'; +import {t, tct} from 'app/locale'; +import {Organization, Plugin, Project} from 'app/types'; import getDynamicText from 'app/utils/getDynamicText'; -import withPlugins from 'app/utils/withPlugins'; import routeTitleGen from 'app/utils/routeTitle'; -import {Organization, Project, Plugin} from 'app/types'; +import withPlugins from 'app/utils/withPlugins'; +import AsyncView from 'app/views/asyncView'; +import Field from 'app/views/settings/components/forms/field'; +import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; const TOKEN_PLACEHOLDER = 'YOUR_TOKEN'; const WEBHOOK_PLACEHOLDER = 'YOUR_WEBHOOK_URL'; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectServiceHookDetails.tsx b/src/sentry/static/sentry/app/views/settings/project/projectServiceHookDetails.tsx index 88f1f00aa97416..5acc8a02fadc0e 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectServiceHookDetails.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectServiceHookDetails.tsx @@ -1,26 +1,26 @@ -import {browserHistory, WithRouterProps} from 'react-router'; import React from 'react'; +import {browserHistory, WithRouterProps} from 'react-router'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import { addErrorMessage, addLoadingMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; import AsyncComponent from 'app/components/asyncComponent'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import MiniBarChart from 'app/components/charts/miniBarChart'; import ErrorBoundary from 'app/components/errorBoundary'; -import Field from 'app/views/settings/components/forms/field'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import {IconFlag} from 'app/icons'; -import ServiceHookSettingsForm from 'app/views/settings/project/serviceHookSettingsForm'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import MiniBarChart from 'app/components/charts/miniBarChart'; -import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; -import getDynamicText from 'app/utils/getDynamicText'; +import {t} from 'app/locale'; import {ServiceHook} from 'app/types'; +import getDynamicText from 'app/utils/getDynamicText'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import Field from 'app/views/settings/components/forms/field'; +import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import ServiceHookSettingsForm from 'app/views/settings/project/serviceHookSettingsForm'; type Params = {orgId: string; projectId: string; hookId: string}; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.tsx b/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.tsx index a341b5200ccd76..03e92613ca9028 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectServiceHooks.tsx @@ -1,23 +1,23 @@ -import {Link, WithRouterProps} from 'react-router'; import React from 'react'; +import {Link, WithRouterProps} from 'react-router'; import PropTypes from 'prop-types'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import { addErrorMessage, addLoadingMessage, clearIndicators, } from 'app/actionCreators/indicator'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import Field from 'app/views/settings/components/forms/field'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import Switch from 'app/components/switch'; import Truncate from 'app/components/truncate'; import {IconAdd, IconFlag} from 'app/icons'; +import {t} from 'app/locale'; import {ServiceHook} from 'app/types'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import Field from 'app/views/settings/components/forms/field'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; type RowProps = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectSettingsLayout.tsx b/src/sentry/static/sentry/app/views/settings/project/projectSettingsLayout.tsx index ab062560d62c60..b50f6d09091eb4 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectSettingsLayout.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectSettingsLayout.tsx @@ -1,11 +1,11 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import {Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; import ProjectContext from 'app/views/projects/projectContext'; -import ProjectSettingsNavigation from 'app/views/settings/project/projectSettingsNavigation'; import SettingsLayout from 'app/views/settings/components/settingsLayout'; -import withOrganization from 'app/utils/withOrganization'; +import ProjectSettingsNavigation from 'app/views/settings/project/projectSettingsNavigation'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectSettingsNavigation.tsx b/src/sentry/static/sentry/app/views/settings/project/projectSettingsNavigation.tsx index 85b4f0ad267e2e..4e94890c8a5ef0 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectSettingsNavigation.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectSettingsNavigation.tsx @@ -1,9 +1,9 @@ import React from 'react'; +import {Organization, Project} from 'app/types'; +import withProject from 'app/utils/withProject'; import SettingsNavigation from 'app/views/settings/components/settingsNavigation'; import getConfiguration from 'app/views/settings/project/navigationConfiguration'; -import withProject from 'app/utils/withProject'; -import {Organization, Project} from 'app/types'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectTeams.tsx b/src/sentry/static/sentry/app/views/settings/project/projectTeams.tsx index b7e6bd559a19dc..a1db45e4e7bcd3 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectTeams.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectTeams.tsx @@ -1,20 +1,20 @@ import React from 'react'; -import styled from '@emotion/styled'; -import {css} from '@emotion/core'; import {WithRouterProps} from 'react-router'; +import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import {addTeamToProject, removeTeamFromProject} from 'app/actionCreators/projects'; import {openCreateTeamModal} from 'app/actionCreators/modal'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; +import {addTeamToProject, removeTeamFromProject} from 'app/actionCreators/projects'; import Link from 'app/components/links/link'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import {Organization, Project, Team} from 'app/types'; -import TeamSelect from 'app/views/settings/components/teamSelect'; import Tooltip from 'app/components/tooltip'; +import {t} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, Project, Team} from 'app/types'; import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TeamSelect from 'app/views/settings/components/teamSelect'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx b/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx index 38c3e746c861be..fed53c07cfc3af 100644 --- a/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/projectUserFeedback.tsx @@ -1,19 +1,19 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; -import {t} from 'app/locale'; import Access from 'app/components/acl/access'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; +import formGroups from 'app/data/forms/userFeedback'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import space from 'app/styles/space'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import formGroups from 'app/data/forms/userFeedback'; -import routeTitleGen from 'app/utils/routeTitle'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/project/serviceHookSettingsForm.tsx b/src/sentry/static/sentry/app/views/settings/project/serviceHookSettingsForm.tsx index 52652bd8685706..ff0752fb1e6ea6 100644 --- a/src/sentry/static/sentry/app/views/settings/project/serviceHookSettingsForm.tsx +++ b/src/sentry/static/sentry/app/views/settings/project/serviceHookSettingsForm.tsx @@ -1,14 +1,14 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t} from 'app/locale'; +import {ServiceHook} from 'app/types'; import ApiForm from 'app/views/settings/components/forms/apiForm'; import BooleanField from 'app/views/settings/components/forms/booleanField'; +import MultipleCheckbox from 'app/views/settings/components/forms/controls/multipleCheckbox'; import FormField from 'app/views/settings/components/forms/formField'; import TextField from 'app/views/settings/components/forms/textField'; -import MultipleCheckbox from 'app/views/settings/components/forms/controls/multipleCheckbox'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import {ServiceHook} from 'app/types'; const EVENT_CHOICES = ['event.alert', 'event.created'].map(e => [e, e]); diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/alertTypeChooser.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/alertTypeChooser.tsx index 3b776eb99990e2..f07b7709dff873 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/alertTypeChooser.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/alertTypeChooser.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; +import Feature from 'app/components/acl/feature'; import Card from 'app/components/card'; -import {t, tct} from 'app/locale'; -import space from 'app/styles/space'; -import Radio from 'app/components/radio'; -import textStyles from 'app/styles/text'; import List from 'app/components/list'; import ListItem from 'app/components/list/listItem'; +import Radio from 'app/components/radio'; import Tooltip from 'app/components/tooltip'; -import Feature from 'app/components/acl/feature'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import textStyles from 'app/styles/text'; import {Organization} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/create.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/create.tsx index 75715b1903d616..c4765bc30a1542 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/create.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/create.tsx @@ -1,19 +1,19 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {Organization, Project} from 'app/types'; -import {PageContent, PageHeader} from 'app/styles/organization'; +import PageHeading from 'app/components/pageHeading'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import {t} from 'app/locale'; +import {PageContent, PageHeader} from 'app/styles/organization'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; import {trackAnalyticsEvent} from 'app/utils/analytics'; +import EventView from 'app/utils/discover/eventView'; import {uniqueId} from 'app/utils/guid'; -import space from 'app/styles/space'; import BuilderBreadCrumbs from 'app/views/alerts/builder/builderBreadCrumbs'; -import EventView from 'app/utils/discover/eventView'; import IncidentRulesCreate from 'app/views/settings/incidentRules/create'; import IssueEditor from 'app/views/settings/projectAlerts/issueEditor'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import PageHeading from 'app/components/pageHeading'; import AlertTypeChooser from './alertTypeChooser'; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/edit.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/edit.tsx index 92dd5e07148d7f..80acb9b2181d4b 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/edit.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/edit.tsx @@ -1,16 +1,16 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {Organization, Project} from 'app/types'; -import {PageContent, PageHeader} from 'app/styles/organization'; +import PageHeading from 'app/components/pageHeading'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import {t} from 'app/locale'; +import {PageContent, PageHeader} from 'app/styles/organization'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; import BuilderBreadCrumbs from 'app/views/alerts/builder/builderBreadCrumbs'; import IncidentRulesDetails from 'app/views/settings/incidentRules/details'; import IssueEditor from 'app/views/settings/projectAlerts/issueEditor'; -import PageHeading from 'app/components/pageHeading'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/index.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/index.tsx index 58231d7aa57e7b..089db3ae337400 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/index.tsx @@ -1,9 +1,9 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; -import {Organization} from 'app/types'; import Access from 'app/components/acl/access'; import Feature from 'app/components/acl/feature'; +import {Organization} from 'app/types'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/index.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/index.tsx index 6b625ffee043d8..9f4247b43e5773 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/index.tsx @@ -1,44 +1,44 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import {browserHistory} from 'react-router'; import React from 'react'; -import classNames from 'classnames'; +import {browserHistory} from 'react-router'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; +import classNames from 'classnames'; import omit from 'lodash/omit'; -import {ALL_ENVIRONMENTS_KEY} from 'app/constants'; -import {Environment, Organization, Project, OnboardingTaskKey} from 'app/types'; -import { - IssueAlertRule, - IssueAlertRuleAction, - IssueAlertRuleActionTemplate, - IssueAlertRuleConditionTemplate, - UnsavedIssueAlertRule, -} from 'app/types/alerts'; -import {IconWarning, IconChevron} from 'app/icons'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import Input from 'app/views/settings/components/forms/controls/input'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {getDisplayName} from 'app/utils/environment'; -import {t, tct} from 'app/locale'; +import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; import Access from 'app/components/acl/access'; import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; import Confirm from 'app/components/confirm'; -import Form from 'app/views/settings/components/forms/form'; import LoadingMask from 'app/components/loadingMask'; -import SelectField from 'app/views/settings/components/forms/selectField'; -import recreateRoute from 'app/utils/recreateRoute'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import {ALL_ENVIRONMENTS_KEY} from 'app/constants'; +import {IconChevron, IconWarning} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Environment, OnboardingTaskKey, Organization, Project} from 'app/types'; +import { + IssueAlertRule, + IssueAlertRuleAction, + IssueAlertRuleActionTemplate, + IssueAlertRuleConditionTemplate, + UnsavedIssueAlertRule, +} from 'app/types/alerts'; +import {getDisplayName} from 'app/utils/environment'; +import recreateRoute from 'app/utils/recreateRoute'; import withOrganization from 'app/utils/withOrganization'; import withProject from 'app/utils/withProject'; -import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; +import AsyncView from 'app/views/asyncView'; +import Input from 'app/views/settings/components/forms/controls/input'; import Field from 'app/views/settings/components/forms/field'; +import Form from 'app/views/settings/components/forms/form'; +import SelectField from 'app/views/settings/components/forms/selectField'; import RuleNodeList from './ruleNodeList'; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/memberTeamFields.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/memberTeamFields.tsx index 875f73c5e1e52c..07a84038e98858 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/memberTeamFields.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/memberTeamFields.tsx @@ -1,12 +1,12 @@ import React from 'react'; import styled from '@emotion/styled'; -import SelectMembers from 'app/components/selectMembers'; import SelectControl from 'app/components/forms/selectControl'; -import {Organization, Project} from 'app/types'; -import {IssueAlertRuleAction, IssueAlertRuleCondition} from 'app/types/alerts'; import {PanelItem} from 'app/components/panels'; +import SelectMembers from 'app/components/selectMembers'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {IssueAlertRuleAction, IssueAlertRuleCondition} from 'app/types/alerts'; interface OptionRecord { value: string; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNode.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNode.tsx index 0e40af1f5f6329..7de1ed56f38a58 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNode.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNode.tsx @@ -1,6 +1,14 @@ import React from 'react'; import styled from '@emotion/styled'; +import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import SelectControl from 'app/components/forms/selectControl'; +import ExternalLink from 'app/components/links/externalLink'; +import {IconDelete} from 'app/icons'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; import { AssigneeTargetType, IssueAlertRuleAction, @@ -9,16 +17,8 @@ import { IssueAlertRuleConditionTemplate, MailActionTargetType, } from 'app/types/alerts'; -import Alert from 'app/components/alert'; -import Button from 'app/components/button'; import Input from 'app/views/settings/components/forms/controls/input'; -import SelectControl from 'app/components/forms/selectControl'; -import space from 'app/styles/space'; -import {t, tct} from 'app/locale'; import MemberTeamFields from 'app/views/settings/projectAlerts/issueEditor/memberTeamFields'; -import ExternalLink from 'app/components/links/externalLink'; -import {Organization, Project} from 'app/types'; -import {IconDelete} from 'app/icons'; type FormField = { // Type of form fields diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx index a7e9c1c3fa48b3..426b61957631a0 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/issueEditor/ruleNodeList.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; +import SelectControl from 'app/components/forms/selectControl'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; import { IssueAlertRuleAction, IssueAlertRuleActionTemplate, IssueAlertRuleCondition, IssueAlertRuleConditionTemplate, } from 'app/types/alerts'; -import SelectControl from 'app/components/forms/selectControl'; -import space from 'app/styles/space'; -import {Organization, Project} from 'app/types'; import RuleNode from './ruleNode'; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/onboardingHovercard.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/onboardingHovercard.tsx index 24c35403e8a8b4..431f42e8073866 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/onboardingHovercard.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/onboardingHovercard.tsx @@ -1,15 +1,15 @@ import React from 'react'; -import {Location} from 'history'; import styled from '@emotion/styled'; +import {Location} from 'history'; +import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; +import {Client} from 'app/api'; import Button from 'app/components/button'; import Hovercard from 'app/components/hovercard'; import {t} from 'app/locale'; import space from 'app/styles/space'; +import {OnboardingTaskKey, Organization} from 'app/types'; import withApi from 'app/utils/withApi'; -import {Client} from 'app/api'; -import {Organization, OnboardingTaskKey} from 'app/types'; -import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; type Props = { api: Client; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRow.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRow.tsx index 7fd79afc1e8c12..1f8d4382d908f7 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRow.tsx @@ -1,19 +1,19 @@ +import React from 'react'; import {Link} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; import {css} from '@emotion/core'; -import PropTypes from 'prop-types'; -import React from 'react'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; +import {t, tct} from 'app/locale'; +import space from 'app/styles/space'; import {IssueAlertRule} from 'app/types/alerts'; +import {getDisplayName} from 'app/utils/environment'; +import recreateRoute from 'app/utils/recreateRoute'; import { - SavedIncidentRule, AlertRuleThresholdType, + SavedIncidentRule, } from 'app/views/settings/incidentRules/types'; -import {getDisplayName} from 'app/utils/environment'; -import {t, tct} from 'app/locale'; -import recreateRoute from 'app/utils/recreateRoute'; -import space from 'app/styles/space'; function isIssueAlert(data: IssueAlertRule | SavedIncidentRule): data is IssueAlertRule { return !data.hasOwnProperty('triggers'); diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/settings.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/settings.tsx index 3701d46db022d0..7952bea21504a7 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/settings.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/settings.tsx @@ -1,20 +1,20 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import {IconMail} from 'app/icons'; +import AlertLink from 'app/components/alertLink'; +import Button from 'app/components/button'; import {PanelAlert} from 'app/components/panels'; +import PluginList from 'app/components/pluginList'; import {fields} from 'app/data/forms/projectAlerts'; +import {IconMail} from 'app/icons'; import {t} from 'app/locale'; -import AlertLink from 'app/components/alertLink'; +import {Organization, Plugin, Project} from 'app/types'; +import routeTitleGen from 'app/utils/routeTitle'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; -import PluginList from 'app/components/pluginList'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import routeTitleGen from 'app/utils/routeTitle'; -import {Organization, Project, Plugin} from 'app/types'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; type RouteParams = {orgId: string; projectId: string}; type Props = RouteComponentProps<RouteParams, {}> & diff --git a/src/sentry/static/sentry/app/views/settings/projectDataForwarding.tsx b/src/sentry/static/sentry/app/views/settings/projectDataForwarding.tsx index 4bf77adcf07114..c08773cf6f0cea 100644 --- a/src/sentry/static/sentry/app/views/settings/projectDataForwarding.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectDataForwarding.tsx @@ -1,25 +1,25 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import {t, tct} from 'app/locale'; +import Feature from 'app/components/acl/feature'; +import FeatureDisabled from 'app/components/acl/featureDisabled'; import Alert from 'app/components/alert'; import AsyncComponent from 'app/components/asyncComponent'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import MiniBarChart from 'app/components/charts/miniBarChart'; import ExternalLink from 'app/components/links/externalLink'; -import Feature from 'app/components/acl/feature'; -import FeatureDisabled from 'app/components/acl/featureDisabled'; -import {IconInfo} from 'app/icons'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import PluginList from 'app/components/pluginList'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import MiniBarChart from 'app/components/charts/miniBarChart'; -import TextBlock from 'app/views/settings/components/text/textBlock'; -import withOrganization from 'app/utils/withOrganization'; -import withProject from 'app/utils/withProject'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import {Series} from 'app/types/echarts'; +import {IconInfo} from 'app/icons'; +import {t, tct} from 'app/locale'; import {Organization, Plugin, Project, TimeseriesValue} from 'app/types'; +import {Series} from 'app/types/echarts'; +import withOrganization from 'app/utils/withOrganization'; +import withProject from 'app/utils/withProject'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; type RouteParams = {projectId: string; orgId: string}; diff --git a/src/sentry/static/sentry/app/views/settings/projectDebugFiles/debugFileRow.tsx b/src/sentry/static/sentry/app/views/settings/projectDebugFiles/debugFileRow.tsx index 535161c9235464..0f7cee986c264e 100644 --- a/src/sentry/static/sentry/app/views/settings/projectDebugFiles/debugFileRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectDebugFiles/debugFileRow.tsx @@ -1,22 +1,22 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; -import TimeSince from 'app/components/timeSince'; -import Tooltip from 'app/components/tooltip'; -import Tag from 'app/components/tagDeprecated'; -import FileSize from 'app/components/fileSize'; -import Button from 'app/components/button'; -import Confirm from 'app/components/confirm'; -import {IconDelete, IconClock, IconDownload} from 'app/icons'; import Access from 'app/components/acl/access'; import Role from 'app/components/acl/role'; +import Button from 'app/components/button'; import ButtonBar from 'app/components/buttonBar'; +import Confirm from 'app/components/confirm'; +import FileSize from 'app/components/fileSize'; +import Tag from 'app/components/tagDeprecated'; +import TimeSince from 'app/components/timeSince'; +import Tooltip from 'app/components/tooltip'; +import {IconClock, IconDelete, IconDownload} from 'app/icons'; +import {t} from 'app/locale'; import overflowEllipsis from 'app/styles/overflowEllipsis'; +import space from 'app/styles/space'; -import {getFileType, getFeatureTooltip} from './utils'; import {DebugFile} from './types'; +import {getFeatureTooltip, getFileType} from './utils'; type Props = { debugFile: DebugFile; diff --git a/src/sentry/static/sentry/app/views/settings/projectDebugFiles/index.tsx b/src/sentry/static/sentry/app/views/settings/projectDebugFiles/index.tsx index 441987b41b0c8b..80ebe5de4e257a 100644 --- a/src/sentry/static/sentry/app/views/settings/projectDebugFiles/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectDebugFiles/index.tsx @@ -1,26 +1,26 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; +import ProjectActions from 'app/actions/projectActions'; +import Checkbox from 'app/components/checkbox'; +import Pagination from 'app/components/pagination'; import {PanelTable} from 'app/components/panels'; +import SearchBar from 'app/components/searchBar'; import {fields} from 'app/data/forms/projectDebugFiles'; import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import routeTitleGen from 'app/utils/routeTitle'; import AsyncView from 'app/views/asyncView'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; -import Pagination from 'app/components/pagination'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import {Organization, Project} from 'app/types'; -import routeTitleGen from 'app/utils/routeTitle'; -import Checkbox from 'app/components/checkbox'; -import SearchBar from 'app/components/searchBar'; -import ProjectActions from 'app/actions/projectActions'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; -import {DebugFile, BuiltinSymbolSource} from './types'; import DebugFileRow from './debugFileRow'; +import {BuiltinSymbolSource, DebugFile} from './types'; type Props = RouteComponentProps<{orgId: string; projectId: string}, {}> & { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx b/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx index 145c41e54a2806..7466d605c027b2 100644 --- a/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectGeneralSettings.jsx @@ -1,33 +1,33 @@ +import React from 'react'; import {browserHistory} from 'react-router'; +import createReactClass from 'create-react-class'; import PropTypes from 'prop-types'; -import React from 'react'; import Reflux from 'reflux'; -import createReactClass from 'create-react-class'; -import {Panel, PanelAlert, PanelHeader} from 'app/components/panels'; import { changeProjectSlug, removeProject, transferProject, } from 'app/actionCreators/projects'; +import ProjectActions from 'app/actions/projectActions'; +import AlertLink from 'app/components/alertLink'; +import Button from 'app/components/button'; +import Confirm from 'app/components/confirm'; +import {Panel, PanelAlert, PanelHeader} from 'app/components/panels'; import {fields} from 'app/data/forms/projectGeneralSettings'; import {t, tct} from 'app/locale'; +import ProjectsStore from 'app/stores/projectsStore'; +import handleXhrErrorResponse from 'app/utils/handleXhrErrorResponse'; +import recreateRoute from 'app/utils/recreateRoute'; +import routeTitleGen from 'app/utils/routeTitle'; import AsyncView from 'app/views/asyncView'; -import Button from 'app/components/button'; -import Confirm from 'app/components/confirm'; import Field from 'app/views/settings/components/forms/field'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; -import ProjectActions from 'app/actions/projectActions'; -import ProjectsStore from 'app/stores/projectsStore'; +import TextField from 'app/views/settings/components/forms/textField'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import TextField from 'app/views/settings/components/forms/textField'; -import handleXhrErrorResponse from 'app/utils/handleXhrErrorResponse'; -import recreateRoute from 'app/utils/recreateRoute'; -import routeTitleGen from 'app/utils/routeTitle'; -import AlertLink from 'app/components/alertLink'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; class ProjectGeneralSettings extends AsyncView { static propTypes = { diff --git a/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/index.tsx b/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/index.tsx index abc380946f551c..81f452545a4c67 100644 --- a/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/index.tsx @@ -1,13 +1,11 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; +import ProjectActions from 'app/actions/projectActions'; +import Feature from 'app/components/acl/feature'; +import ExternalLink from 'app/components/links/externalLink'; import {fields} from 'app/data/forms/projectIssueGrouping'; import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import Form from 'app/views/settings/components/forms/form'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; import { EventGroupingConfig, GroupingEnhancementBase, @@ -15,9 +13,11 @@ import { Project, } from 'app/types'; import routeTitleGen from 'app/utils/routeTitle'; -import ProjectActions from 'app/actions/projectActions'; -import Feature from 'app/components/acl/feature'; -import ExternalLink from 'app/components/links/externalLink'; +import AsyncView from 'app/views/asyncView'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import UpgradeGrouping from './upgradeGrouping'; diff --git a/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/upgradeGrouping.tsx b/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/upgradeGrouping.tsx index 69da2165701aa8..2184761f896228 100644 --- a/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/upgradeGrouping.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/upgradeGrouping.tsx @@ -1,23 +1,23 @@ import React from 'react'; +import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; +import ProjectActions from 'app/actions/projectActions'; +import {Client} from 'app/api'; import Alert from 'app/components/alert'; +import Button from 'app/components/button'; +import Confirm from 'app/components/confirm'; +import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {t, tct} from 'app/locale'; -import TextBlock from 'app/views/settings/components/text/textBlock'; import { EventGroupingConfig, GroupingEnhancementBase, Organization, Project, } from 'app/types'; -import ProjectActions from 'app/actions/projectActions'; -import {addLoadingMessage, clearIndicators} from 'app/actionCreators/indicator'; +import handleXhrErrorResponse from 'app/utils/handleXhrErrorResponse'; import marked from 'app/utils/marked'; -import Button from 'app/components/button'; -import Confirm from 'app/components/confirm'; import Field from 'app/views/settings/components/forms/field'; -import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; -import handleXhrErrorResponse from 'app/utils/handleXhrErrorResponse'; -import {Client} from 'app/api'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import {getGroupingChanges, getGroupingRisk} from './utils'; diff --git a/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/utils.tsx b/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/utils.tsx index e3238a972877c3..33737f29238fff 100644 --- a/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/utils.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectIssueGrouping/utils.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import {t} from 'app/locale'; import Alert from 'app/components/alert'; +import {t} from 'app/locale'; import {EventGroupingConfig, GroupingEnhancementBase, Project} from 'app/types'; export function getGroupingChanges( diff --git a/src/sentry/static/sentry/app/views/settings/projectPlugins/details.tsx b/src/sentry/static/sentry/app/views/settings/projectPlugins/details.tsx index 9e9c1c7c3ae214..ffcfcf02ec92b1 100644 --- a/src/sentry/static/sentry/app/views/settings/projectPlugins/details.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectPlugins/details.tsx @@ -8,16 +8,16 @@ import { addSuccessMessage, } from 'app/actionCreators/indicator'; import {disablePlugin, enablePlugin} from 'app/actionCreators/plugins'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; import ExternalLink from 'app/components/links/externalLink'; import PluginConfig from 'app/components/pluginConfig'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import withPlugins from 'app/utils/withPlugins'; -import {trackIntegrationEvent} from 'app/utils/integrationUtil'; +import {t} from 'app/locale'; import space from 'app/styles/space'; -import {Plugin, Organization, Project} from 'app/types'; +import {Organization, Plugin, Project} from 'app/types'; +import {trackIntegrationEvent} from 'app/utils/integrationUtil'; +import withPlugins from 'app/utils/withPlugins'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; type Props = { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/settings/projectPlugins/index.tsx b/src/sentry/static/sentry/app/views/settings/projectPlugins/index.tsx index 10164ccfdea1a5..3d731dd385e089 100644 --- a/src/sentry/static/sentry/app/views/settings/projectPlugins/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectPlugins/index.tsx @@ -1,15 +1,15 @@ import React from 'react'; import {WithRouterProps} from 'react-router/lib/withRouter'; -import {fetchPlugins, enablePlugin, disablePlugin} from 'app/actionCreators/plugins'; -import {t} from 'app/locale'; +import {disablePlugin, enablePlugin, fetchPlugins} from 'app/actionCreators/plugins'; import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import withPlugins from 'app/utils/withPlugins'; +import {Organization, Plugin, Project} from 'app/types'; import {trackIntegrationEvent} from 'app/utils/integrationUtil'; -import {Plugin, Organization, Project} from 'app/types'; +import withPlugins from 'app/utils/withPlugins'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; import ProjectPlugins from './projectPlugins'; diff --git a/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPluginRow.tsx b/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPluginRow.tsx index b0656750ce9fb6..376f815725f42f 100644 --- a/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPluginRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPluginRow.tsx @@ -1,22 +1,22 @@ -import {css} from '@emotion/core'; +import React from 'react'; import {Link} from 'react-router'; -import PropTypes from 'prop-types'; import {RouteComponentProps} from 'react-router/lib/Router'; -import React from 'react'; +import {css} from '@emotion/core'; import styled from '@emotion/styled'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; -import ExternalLink from 'app/components/links/externalLink'; import Access from 'app/components/acl/access'; +import ExternalLink from 'app/components/links/externalLink'; +import Switch from 'app/components/switch'; +import {t} from 'app/locale'; import PluginIcon from 'app/plugins/components/pluginIcon'; import SentryTypes from 'app/sentryTypes'; -import Switch from 'app/components/switch'; +import {Organization, Plugin, Project} from 'app/types'; import getDynamicText from 'app/utils/getDynamicText'; +import {trackIntegrationEvent} from 'app/utils/integrationUtil'; import recreateRoute from 'app/utils/recreateRoute'; import withOrganization from 'app/utils/withOrganization'; import withProject from 'app/utils/withProject'; -import {trackIntegrationEvent} from 'app/utils/integrationUtil'; -import {Organization, Project, Plugin} from 'app/types'; const grayText = css` color: #979ba0; diff --git a/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.tsx b/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.tsx index 8bd1522b69d0d6..1bed519a34e562 100644 --- a/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectPlugins/projectPlugins.tsx @@ -1,7 +1,10 @@ -import PropTypes from 'prop-types'; import React, {Component} from 'react'; import {WithRouterProps} from 'react-router'; +import PropTypes from 'prop-types'; +import Access from 'app/components/acl/access'; +import Link from 'app/components/links/link'; +import LoadingIndicator from 'app/components/loadingIndicator'; import { Panel, PanelAlert, @@ -10,12 +13,9 @@ import { PanelItem, } from 'app/components/panels'; import {t, tct} from 'app/locale'; -import Access from 'app/components/acl/access'; -import Link from 'app/components/links/link'; -import LoadingIndicator from 'app/components/loadingIndicator'; -import RouteError from 'app/views/routeError'; import SentryTypes from 'app/sentryTypes'; import {Plugin} from 'app/types'; +import RouteError from 'app/views/routeError'; import ProjectPluginRow from './projectPluginRow'; diff --git a/src/sentry/static/sentry/app/views/settings/projectProguard/index.tsx b/src/sentry/static/sentry/app/views/settings/projectProguard/index.tsx index ff8aa5d017535b..43dd7c51b39428 100644 --- a/src/sentry/static/sentry/app/views/settings/projectProguard/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectProguard/index.tsx @@ -1,10 +1,10 @@ import React from 'react'; -import {t} from 'app/locale'; -import {PageContent} from 'app/styles/organization'; -import SentryTypes from 'app/sentryTypes'; import Feature from 'app/components/acl/feature'; import Alert from 'app/components/alert'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; +import {PageContent} from 'app/styles/organization'; import withOrganization from 'app/utils/withOrganization'; import ProjectProguard from './projectProguard'; diff --git a/src/sentry/static/sentry/app/views/settings/projectProguard/projectProguard.tsx b/src/sentry/static/sentry/app/views/settings/projectProguard/projectProguard.tsx index 8f3c5e109f7890..8ad4c34c9aeaf8 100644 --- a/src/sentry/static/sentry/app/views/settings/projectProguard/projectProguard.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectProguard/projectProguard.tsx @@ -1,18 +1,18 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; import React from 'react'; +import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import space from 'app/styles/space'; +import Checkbox from 'app/components/checkbox'; +import Pagination from 'app/components/pagination'; import {PanelTable} from 'app/components/panels'; +import SearchBar from 'app/components/searchBar'; import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import routeTitleGen from 'app/utils/routeTitle'; import AsyncView from 'app/views/asyncView'; -import Pagination from 'app/components/pagination'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; -import {Organization, Project} from 'app/types'; -import routeTitleGen from 'app/utils/routeTitle'; -import Checkbox from 'app/components/checkbox'; -import SearchBar from 'app/components/searchBar'; // TODO(android-mappings): use own components once we decide how this should look like import DebugFileRow from 'app/views/settings/projectDebugFiles/debugFileRow'; import {DebugFile} from 'app/views/settings/projectDebugFiles/types'; diff --git a/src/sentry/static/sentry/app/views/settings/projectSecurityAndPrivacy/index.tsx b/src/sentry/static/sentry/app/views/settings/projectSecurityAndPrivacy/index.tsx index 8d6817e1280f17..7e9b3d6e833008 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSecurityAndPrivacy/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectSecurityAndPrivacy/index.tsx @@ -2,16 +2,16 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import {addErrorMessage} from 'app/actionCreators/indicator'; +import ProjectActions from 'app/actions/projectActions'; import Link from 'app/components/links/link'; -import {t, tct} from 'app/locale'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import Form from 'app/views/settings/components/forms/form'; +import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; import projectSecurityAndPrivacyGroups from 'app/data/forms/projectSecurityAndPrivacyGroups'; -import ProjectActions from 'app/actions/projectActions'; +import {t, tct} from 'app/locale'; import {Organization, Project} from 'app/types'; import withProject from 'app/utils/withProject'; -import SentryDocumentTitle from 'app/components/sentryDocumentTitle'; +import Form from 'app/views/settings/components/forms/form'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import DataScrubbing from '../components/dataScrubbing'; diff --git a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/csp.jsx b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/csp.jsx index 5837357c17a63c..be7b03f72d4301 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/csp.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/csp.jsx @@ -1,19 +1,19 @@ import React from 'react'; +import Access from 'app/components/acl/access'; +import ExternalLink from 'app/components/links/externalLink'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import PreviewFeature from 'app/components/previewFeature'; +import formGroups from 'app/data/forms/cspReports'; import {t, tct} from 'app/locale'; -import Access from 'app/components/acl/access'; +import routeTitleGen from 'app/utils/routeTitle'; import AsyncView from 'app/views/asyncView'; -import ExternalLink from 'app/components/links/externalLink'; import Form from 'app/views/settings/components/forms/form'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; -import PreviewFeature from 'app/components/previewFeature'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import ReportUri, { getSecurityDsn, } from 'app/views/settings/projectSecurityHeaders/reportUri'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import formGroups from 'app/data/forms/cspReports'; -import routeTitleGen from 'app/utils/routeTitle'; export default class ProjectCspReports extends AsyncView { getEndpoints() { diff --git a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/expectCt.jsx b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/expectCt.jsx index 016384977d6042..b24af72d95f5a8 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/expectCt.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/expectCt.jsx @@ -1,15 +1,15 @@ import React from 'react'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import ExternalLink from 'app/components/links/externalLink'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import PreviewFeature from 'app/components/previewFeature'; +import {t, tct} from 'app/locale'; +import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import ReportUri, { getSecurityDsn, } from 'app/views/settings/projectSecurityHeaders/reportUri'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import routeTitleGen from 'app/utils/routeTitle'; export default class ProjectExpectCtReports extends AsyncView { getEndpoints() { diff --git a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/hpkp.jsx b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/hpkp.jsx index 431de3f9cc60c7..891dc5b355fe98 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/hpkp.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/hpkp.jsx @@ -1,15 +1,15 @@ import React from 'react'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import ExternalLink from 'app/components/links/externalLink'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; +import PreviewFeature from 'app/components/previewFeature'; +import {t, tct} from 'app/locale'; +import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import ReportUri, { getSecurityDsn, } from 'app/views/settings/projectSecurityHeaders/reportUri'; -import PreviewFeature from 'app/components/previewFeature'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import routeTitleGen from 'app/utils/routeTitle'; export default class ProjectHpkpReports extends AsyncView { getEndpoints() { diff --git a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/index.jsx b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/index.jsx index 1a7e8fd8d82be7..7b5dcd816e66c0 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/index.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/index.jsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; +import {t, tct} from 'app/locale'; import recreateRoute from 'app/utils/recreateRoute'; import routeTitleGen from 'app/utils/routeTitle'; -import ReportUri from 'app/views/settings/projectSecurityHeaders/reportUri'; +import AsyncView from 'app/views/asyncView'; import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import TextBlock from 'app/views/settings/components/text/textBlock'; +import ReportUri from 'app/views/settings/projectSecurityHeaders/reportUri'; export default class ProjectSecurityHeaders extends AsyncView { getEndpoints() { diff --git a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/reportUri.jsx b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/reportUri.jsx index 484fadb2d8d09c..968c0a37b49e6a 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/reportUri.jsx +++ b/src/sentry/static/sentry/app/views/settings/projectSecurityHeaders/reportUri.jsx @@ -1,11 +1,11 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {Link} from 'react-router'; +import PropTypes from 'prop-types'; +import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; import {tct} from 'app/locale'; -import Field from 'app/views/settings/components/forms/field'; import getDynamicText from 'app/utils/getDynamicText'; -import {Panel, PanelAlert, PanelBody, PanelHeader} from 'app/components/panels'; +import Field from 'app/views/settings/components/forms/field'; import TextCopyInput from 'app/views/settings/components/forms/textCopyInput'; const DEFAULT_ENDPOINT = 'https://sentry.example.com/api/security-report/'; diff --git a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/index.tsx b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/index.tsx index 84e51c8df09d1b..0af35b8bbb581f 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/index.tsx @@ -2,30 +2,30 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import {Organization, Project, Artifact} from 'app/types'; -import routeTitleGen from 'app/utils/routeTitle'; -import SearchBar from 'app/components/searchBar'; -import Pagination from 'app/components/pagination'; -import {PanelTable} from 'app/components/panels'; -import {formatVersion} from 'app/utils/formatters'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import Button from 'app/components/button'; -import ButtonBar from 'app/components/buttonBar'; -import {IconDelete} from 'app/icons'; import { addErrorMessage, addLoadingMessage, addSuccessMessage, } from 'app/actionCreators/indicator'; -import {decodeScalar} from 'app/utils/queryString'; +import Access from 'app/components/acl/access'; +import Button from 'app/components/button'; +import ButtonBar from 'app/components/buttonBar'; import Confirm from 'app/components/confirm'; -import Version from 'app/components/version'; +import Pagination from 'app/components/pagination'; +import {PanelTable} from 'app/components/panels'; +import SearchBar from 'app/components/searchBar'; import TextOverflow from 'app/components/textOverflow'; -import space from 'app/styles/space'; -import Access from 'app/components/acl/access'; import Tooltip from 'app/components/tooltip'; +import Version from 'app/components/version'; +import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Artifact, Organization, Project} from 'app/types'; +import {formatVersion} from 'app/utils/formatters'; +import {decodeScalar} from 'app/utils/queryString'; +import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; import SourceMapsArtifactRow from './sourceMapsArtifactRow'; diff --git a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/sourceMapsArtifactRow.tsx b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/sourceMapsArtifactRow.tsx index cfe4b310e04c2e..43374f067c1bf1 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/sourceMapsArtifactRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/detail/sourceMapsArtifactRow.tsx @@ -1,19 +1,19 @@ import React from 'react'; import styled from '@emotion/styled'; -import {t} from 'app/locale'; -import space from 'app/styles/space'; -import TimeSince from 'app/components/timeSince'; +import Access from 'app/components/acl/access'; +import Role from 'app/components/acl/role'; import Button from 'app/components/button'; -import {IconClock, IconDelete, IconDownload} from 'app/icons'; import ButtonBar from 'app/components/buttonBar'; -import FileSize from 'app/components/fileSize'; -import {Artifact} from 'app/types'; import Confirm from 'app/components/confirm'; -import Access from 'app/components/acl/access'; -import Role from 'app/components/acl/role'; -import Tooltip from 'app/components/tooltip'; +import FileSize from 'app/components/fileSize'; import Tag from 'app/components/tag'; +import TimeSince from 'app/components/timeSince'; +import Tooltip from 'app/components/tooltip'; +import {IconClock, IconDelete, IconDownload} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {Artifact} from 'app/types'; type Props = { artifact: Artifact; diff --git a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/index.tsx b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/index.tsx index 9abb0f193999fd..b86096dab4af54 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/index.tsx @@ -1,8 +1,8 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; -import withOrganization from 'app/utils/withOrganization'; import {Organization, Project} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; type RouteParams = { orgId: string; diff --git a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/index.tsx b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/index.tsx index 9830c517e05231..7e7fbd11030cca 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/index.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/index.tsx @@ -2,23 +2,23 @@ import React from 'react'; import {RouteComponentProps} from 'react-router/lib/Router'; import styled from '@emotion/styled'; -import {t, tct} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import {Organization, Project, SourceMapsArchive} from 'app/types'; -import routeTitleGen from 'app/utils/routeTitle'; -import TextBlock from 'app/views/settings/components/text/textBlock'; -import SearchBar from 'app/components/searchBar'; -import Pagination from 'app/components/pagination'; -import {PanelTable} from 'app/components/panels'; -import {decodeScalar} from 'app/utils/queryString'; import { + addErrorMessage, addLoadingMessage, addSuccessMessage, - addErrorMessage, } from 'app/actionCreators/indicator'; import ExternalLink from 'app/components/links/externalLink'; +import Pagination from 'app/components/pagination'; +import {PanelTable} from 'app/components/panels'; +import SearchBar from 'app/components/searchBar'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; +import {Organization, Project, SourceMapsArchive} from 'app/types'; +import {decodeScalar} from 'app/utils/queryString'; +import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; import SourceMapsArchiveRow from './sourceMapsArchiveRow'; diff --git a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/sourceMapsArchiveRow.tsx b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/sourceMapsArchiveRow.tsx index 6363f5c8bd62bd..9816579cb6ab44 100644 --- a/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/sourceMapsArchiveRow.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectSourceMaps/list/sourceMapsArchiveRow.tsx @@ -1,20 +1,20 @@ import React from 'react'; import styled from '@emotion/styled'; -import {SourceMapsArchive} from 'app/types'; -import {t} from 'app/locale'; +import Access from 'app/components/acl/access'; import Button from 'app/components/button'; -import {IconDelete} from 'app/icons'; import ButtonBar from 'app/components/buttonBar'; -import Version from 'app/components/version'; -import Count from 'app/components/count'; import Confirm from 'app/components/confirm'; +import Count from 'app/components/count'; import DateTime from 'app/components/dateTime'; import Link from 'app/components/links/link'; import TextOverflow from 'app/components/textOverflow'; -import space from 'app/styles/space'; -import Access from 'app/components/acl/access'; import Tooltip from 'app/components/tooltip'; +import Version from 'app/components/version'; +import {IconDelete} from 'app/icons'; +import {t} from 'app/locale'; +import space from 'app/styles/space'; +import {SourceMapsArchive} from 'app/types'; type Props = { archive: SourceMapsArchive; diff --git a/src/sentry/static/sentry/app/views/settings/projectTags.tsx b/src/sentry/static/sentry/app/views/settings/projectTags.tsx index bf987288a3f383..3733ed1fe66e67 100644 --- a/src/sentry/static/sentry/app/views/settings/projectTags.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectTags.tsx @@ -1,23 +1,23 @@ import React from 'react'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; -import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; -import {t, tct} from 'app/locale'; import Access from 'app/components/acl/access'; -import AsyncView from 'app/views/asyncView'; import Button from 'app/components/button'; -import {IconDelete} from 'app/icons'; -import EmptyMessage from 'app/views/settings/components/emptyMessage'; import ExternalLink from 'app/components/links/externalLink'; import LinkWithConfirmation from 'app/components/links/linkWithConfirmation'; -import PermissionAlert from 'app/views/settings/project/permissionAlert'; -import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; -import TextBlock from 'app/views/settings/components/text/textBlock'; +import {Panel, PanelBody, PanelHeader, PanelItem} from 'app/components/panels'; import Tooltip from 'app/components/tooltip'; -import routeTitleGen from 'app/utils/routeTitle'; +import {IconDelete} from 'app/icons'; +import {t, tct} from 'app/locale'; import space from 'app/styles/space'; import {TagWithTopValues} from 'app/types'; +import routeTitleGen from 'app/utils/routeTitle'; +import AsyncView from 'app/views/asyncView'; +import EmptyMessage from 'app/views/settings/components/emptyMessage'; +import SettingsPageHeader from 'app/views/settings/components/settingsPageHeader'; +import TextBlock from 'app/views/settings/components/text/textBlock'; +import PermissionAlert from 'app/views/settings/project/permissionAlert'; type Props = RouteComponentProps<{projectId: string; orgId: string}, {}> & AsyncView['props']; diff --git a/src/sentry/static/sentry/app/views/settings/settingsIndex.tsx b/src/sentry/static/sentry/app/views/settings/settingsIndex.tsx index 74b345b1c3a9fe..4f70fc4933d40c 100644 --- a/src/sentry/static/sentry/app/views/settings/settingsIndex.tsx +++ b/src/sentry/static/sentry/app/views/settings/settingsIndex.tsx @@ -1,26 +1,26 @@ -import {RouteComponentProps} from 'react-router/lib/Router'; -import DocumentTitle from 'react-document-title'; -import PropTypes from 'prop-types'; import React from 'react'; -import styled from '@emotion/styled'; +import DocumentTitle from 'react-document-title'; +import {RouteComponentProps} from 'react-router/lib/Router'; import {css} from '@emotion/core'; +import styled from '@emotion/styled'; import omit from 'lodash/omit'; +import PropTypes from 'prop-types'; -import {t} from 'app/locale'; +import {fetchOrganizationDetails} from 'app/actionCreators/organizations'; import OrganizationAvatar from 'app/components/avatar/organizationAvatar'; import UserAvatar from 'app/components/avatar/userAvatar'; -import ConfigStore from 'app/stores/configStore'; import ExternalLink from 'app/components/links/externalLink'; -import {fetchOrganizationDetails} from 'app/actionCreators/organizations'; import Link from 'app/components/links/link'; import LoadingIndicator from 'app/components/loadingIndicator'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import {IconDocs, IconLock, IconStack, IconSupport} from 'app/icons'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; -import SettingsLayout from 'app/views/settings/components/settingsLayout'; -import withLatestContext from 'app/utils/withLatestContext'; +import ConfigStore from 'app/stores/configStore'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; import {Organization} from 'app/types'; +import withLatestContext from 'app/utils/withLatestContext'; +import SettingsLayout from 'app/views/settings/components/settingsLayout'; const LINKS = { DOCUMENTATION: 'https://docs.sentry.io/', diff --git a/src/sentry/static/sentry/app/views/sharedGroupDetails/index.tsx b/src/sentry/static/sentry/app/views/sharedGroupDetails/index.tsx index fd752bed565455..840eddb5f1800c 100644 --- a/src/sentry/static/sentry/app/views/sharedGroupDetails/index.tsx +++ b/src/sentry/static/sentry/app/views/sharedGroupDetails/index.tsx @@ -1,20 +1,20 @@ import React from 'react'; import DocumentTitle from 'react-document-title'; -import styled from '@emotion/styled'; import {RouteComponentProps} from 'react-router/lib/Router'; +import styled from '@emotion/styled'; -import {t} from 'app/locale'; import {Client} from 'app/api'; -import withApi from 'app/utils/withApi'; +import NotFound from 'app/components/errors/notFound'; import {BorderlessEventEntries} from 'app/components/events/eventEntries'; import Footer from 'app/components/footer'; +import Link from 'app/components/links/link'; import LoadingError from 'app/components/loadingError'; import LoadingIndicator from 'app/components/loadingIndicator'; -import NotFound from 'app/components/errors/notFound'; +import {t} from 'app/locale'; +import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; import {Group} from 'app/types'; -import Link from 'app/components/links/link'; -import SentryTypes from 'app/sentryTypes'; +import withApi from 'app/utils/withApi'; import SharedGroupHeader from './sharedGroupHeader'; diff --git a/src/sentry/static/sentry/app/views/sharedGroupDetails/sharedGroupHeader.tsx b/src/sentry/static/sentry/app/views/sharedGroupDetails/sharedGroupHeader.tsx index 39536b609c5198..6c5357300f8574 100644 --- a/src/sentry/static/sentry/app/views/sharedGroupDetails/sharedGroupHeader.tsx +++ b/src/sentry/static/sentry/app/views/sharedGroupDetails/sharedGroupHeader.tsx @@ -2,9 +2,9 @@ import React from 'react'; import styled from '@emotion/styled'; import EventMessage from 'app/components/events/eventMessage'; +import overflowEllipsis from 'app/styles/overflowEllipsis'; import space from 'app/styles/space'; import {Group} from 'app/types'; -import overflowEllipsis from 'app/styles/overflowEllipsis'; import UnhandledTag, { TagAndMessageWrapper, diff --git a/src/sentry/static/sentry/app/views/teamCreate.tsx b/src/sentry/static/sentry/app/views/teamCreate.tsx index acdf0d0578171b..dccb69ae56013e 100644 --- a/src/sentry/static/sentry/app/views/teamCreate.tsx +++ b/src/sentry/static/sentry/app/views/teamCreate.tsx @@ -1,12 +1,12 @@ -import {withRouter, WithRouterProps} from 'react-router'; import React from 'react'; +import {withRouter, WithRouterProps} from 'react-router'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; import NarrowLayout from 'app/components/narrowLayout'; import CreateTeamForm from 'app/components/teams/createTeamForm'; -import withOrganization from 'app/utils/withOrganization'; +import {t} from 'app/locale'; import {Organization} from 'app/types'; +import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; type Props = WithRouterProps<{orgId: string}, {}> & { organization: Organization; diff --git a/src/sentry/static/sentry/app/views/userFeedback/index.tsx b/src/sentry/static/sentry/app/views/userFeedback/index.tsx index c278b63d620070..83768594985b4d 100644 --- a/src/sentry/static/sentry/app/views/userFeedback/index.tsx +++ b/src/sentry/static/sentry/app/views/userFeedback/index.tsx @@ -1,27 +1,27 @@ +import React from 'react'; import {Link} from 'react-router'; import {RouteComponentProps} from 'react-router/lib/Router'; -import React from 'react'; -import omit from 'lodash/omit'; import styled from '@emotion/styled'; import {withProfiler} from '@sentry/react'; +import omit from 'lodash/omit'; -import {Organization, UserReport} from 'app/types'; -import {PageContent} from 'app/styles/organization'; -import {Panel, PanelBody} from 'app/components/panels'; -import {t} from 'app/locale'; -import AsyncView from 'app/views/asyncView'; -import CompactIssue from 'app/components/issues/compactIssue'; import EventUserFeedback from 'app/components/events/userFeedback'; -import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import CompactIssue from 'app/components/issues/compactIssue'; import LightWeightNoProjectMessage from 'app/components/lightWeightNoProjectMessage'; import LoadingIndicator from 'app/components/loadingIndicator'; +import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; import PageHeading from 'app/components/pageHeading'; import Pagination from 'app/components/pagination'; +import {Panel, PanelBody} from 'app/components/panels'; +import {t} from 'app/locale'; +import {PageContent} from 'app/styles/organization'; import space from 'app/styles/space'; +import {Organization, UserReport} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; +import AsyncView from 'app/views/asyncView'; -import {getQuery} from './utils'; import UserFeedbackEmpty from './userFeedbackEmpty'; +import {getQuery} from './utils'; type State = AsyncView['state'] & { reportList: UserReport[]; diff --git a/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx b/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx index b5821f0f3f8a55..b454a44eff490c 100644 --- a/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx +++ b/src/sentry/static/sentry/app/views/userFeedback/userFeedbackEmpty.tsx @@ -1,15 +1,15 @@ import React from 'react'; import styled from '@emotion/styled'; -import PropTypes from 'prop-types'; import * as Sentry from '@sentry/react'; +import PropTypes from 'prop-types'; -import {Organization, Project} from 'app/types'; -import {t} from 'app/locale'; -import {trackAnalyticsEvent, trackAdhocEvent} from 'app/utils/analytics'; import Button from 'app/components/button'; import EmptyStateWarning from 'app/components/emptyStateWarning'; +import {t} from 'app/locale'; import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; +import {Organization, Project} from 'app/types'; +import {trackAdhocEvent, trackAnalyticsEvent} from 'app/utils/analytics'; import withOrganization from 'app/utils/withOrganization'; import withProjects from 'app/utils/withProjects'; diff --git a/tests/js/sentry-test/enzyme.js b/tests/js/sentry-test/enzyme.js index 4412504b16082d..d5180bd7f8acbd 100644 --- a/tests/js/sentry-test/enzyme.js +++ b/tests/js/sentry-test/enzyme.js @@ -1,8 +1,8 @@ -import {mount, shallow, render} from 'enzyme'; // eslint-disable-line no-restricted-imports +import React from 'react'; import {CacheProvider} from '@emotion/core'; -import {ThemeProvider} from 'emotion-theming'; import {cache} from 'emotion'; // eslint-disable-line emotion/no-vanilla -import React from 'react'; +import {ThemeProvider} from 'emotion-theming'; +import {mount, render, shallow} from 'enzyme'; // eslint-disable-line no-restricted-imports import theme from 'app/utils/theme'; @@ -16,4 +16,4 @@ const mountWithTheme = (tree, opts) => { return mount(tree, {wrappingComponent: WrappingThemeProvider, ...opts}); }; -export {mountWithTheme, mount, shallow, render}; +export {mount, mountWithTheme, render, shallow}; diff --git a/tests/js/sentry-test/fixtures/accessRequest.js b/tests/js/sentry-test/fixtures/accessRequest.js index fdbd9693b72694..5c26b1b5f47e71 100644 --- a/tests/js/sentry-test/fixtures/accessRequest.js +++ b/tests/js/sentry-test/fixtures/accessRequest.js @@ -1,5 +1,5 @@ -import {Team} from './team'; import {Member} from './member'; +import {Team} from './team'; export function AccessRequest(params = {}) { return { diff --git a/tests/js/sentry-test/fixtures/asana.js b/tests/js/sentry-test/fixtures/asana.js index f1f9ac1ed9083b..83d49b6598b3ac 100644 --- a/tests/js/sentry-test/fixtures/asana.js +++ b/tests/js/sentry-test/fixtures/asana.js @@ -74,4 +74,4 @@ function AsanaAutocomplete(type = 'project', values = [DEFAULT_AUTOCOMPLETE]) { return {[type]: values}; } -export {AsanaPlugin, AsanaCreate, AsanaAutocomplete}; +export {AsanaAutocomplete, AsanaCreate, AsanaPlugin}; diff --git a/tests/js/sentry-test/fixtures/phabricator.js b/tests/js/sentry-test/fixtures/phabricator.js index b13beade28daa5..0b32558e3ce802 100644 --- a/tests/js/sentry-test/fixtures/phabricator.js +++ b/tests/js/sentry-test/fixtures/phabricator.js @@ -92,4 +92,4 @@ function PhabricatorAutocomplete(type = 'project', values = null) { return {[type]: values}; } -export {PhabricatorPlugin, PhabricatorCreate, PhabricatorAutocomplete}; +export {PhabricatorAutocomplete, PhabricatorCreate, PhabricatorPlugin}; diff --git a/tests/js/sentry-test/fixtures/userFeedback.js b/tests/js/sentry-test/fixtures/userFeedback.js index 3d3b13fee20126..fe1b73df470217 100644 --- a/tests/js/sentry-test/fixtures/userFeedback.js +++ b/tests/js/sentry-test/fixtures/userFeedback.js @@ -1,5 +1,5 @@ -import {Group} from './group'; import {Event} from './event'; +import {Group} from './group'; import {User} from './user'; export function UserFeedback(params = {}) { diff --git a/tests/js/sentry-test/fixtures/vsts-old.js b/tests/js/sentry-test/fixtures/vsts-old.js index 7e23323fca3544..90dd5b3f4298be 100644 --- a/tests/js/sentry-test/fixtures/vsts-old.js +++ b/tests/js/sentry-test/fixtures/vsts-old.js @@ -52,4 +52,4 @@ function VstsCreate() { ]; } -export {VstsPlugin, VstsCreate}; +export {VstsCreate, VstsPlugin}; diff --git a/tests/js/setup.js b/tests/js/setup.js index 99357aded25e88..8767875b814dd5 100644 --- a/tests/js/setup.js +++ b/tests/js/setup.js @@ -1,10 +1,10 @@ /* global __dirname */ -import jQuery from 'jquery'; -import Adapter from 'enzyme-adapter-react-16'; import Enzyme from 'enzyme'; // eslint-disable-line no-restricted-imports +import Adapter from 'enzyme-adapter-react-16'; +import jQuery from 'jquery'; import MockDate from 'mockdate'; -import PropTypes from 'prop-types'; import fromEntries from 'object.fromentries'; +import PropTypes from 'prop-types'; import ConfigStore from 'app/stores/configStore'; diff --git a/tests/js/spec/actionCreators/events.spec.jsx b/tests/js/spec/actionCreators/events.spec.jsx index 9a3bf194c4a4b6..fa39b2c88727cc 100644 --- a/tests/js/spec/actionCreators/events.spec.jsx +++ b/tests/js/spec/actionCreators/events.spec.jsx @@ -1,5 +1,5 @@ -import {Client} from 'app/api'; import {doEventsRequest} from 'app/actionCreators/events'; +import {Client} from 'app/api'; describe('Events ActionCreator', function () { const api = new Client(); diff --git a/tests/js/spec/actionCreators/globalSelection.spec.jsx b/tests/js/spec/actionCreators/globalSelection.spec.jsx index f7f0fb16b01941..cfca370334a9c3 100644 --- a/tests/js/spec/actionCreators/globalSelection.spec.jsx +++ b/tests/js/spec/actionCreators/globalSelection.spec.jsx @@ -1,10 +1,10 @@ import { initializeUrlState, - updateProjects, - updateEnvironments, updateDateTime, + updateEnvironments, updateParams, updateParamsWithoutHistory, + updateProjects, } from 'app/actionCreators/globalSelection'; import GlobalSelectionActions from 'app/actions/globalSelectionActions'; import localStorage from 'app/utils/localStorage'; diff --git a/tests/js/spec/actionCreators/organization.spec.jsx b/tests/js/spec/actionCreators/organization.spec.jsx index 20ba3e72c23aee..6510dcef2775ff 100644 --- a/tests/js/spec/actionCreators/organization.spec.jsx +++ b/tests/js/spec/actionCreators/organization.spec.jsx @@ -1,8 +1,8 @@ -import * as OrganizationsActionCreator from 'app/actionCreators/organizations'; import {fetchOrganizationDetails} from 'app/actionCreators/organization'; -import TeamStore from 'app/stores/teamStore'; -import ProjectsStore from 'app/stores/projectsStore'; +import * as OrganizationsActionCreator from 'app/actionCreators/organizations'; import OrganizationActions from 'app/actions/organizationActions'; +import ProjectsStore from 'app/stores/projectsStore'; +import TeamStore from 'app/stores/teamStore'; describe('OrganizationActionCreator', function () { const detailedOrg = TestStubs.Organization({ diff --git a/tests/js/spec/actionCreators/projects.spec.jsx b/tests/js/spec/actionCreators/projects.spec.jsx index ee9f6e0e265ad2..142b3b1865d2a6 100644 --- a/tests/js/spec/actionCreators/projects.spec.jsx +++ b/tests/js/spec/actionCreators/projects.spec.jsx @@ -1,5 +1,5 @@ -import {Client} from 'app/api'; import {_debouncedLoadStats} from 'app/actionCreators/projects'; +import {Client} from 'app/api'; describe('Projects ActionCreators', function () { const api = new Client(); diff --git a/tests/js/spec/api.spec.jsx b/tests/js/spec/api.spec.jsx index 2139af18d0794c..f67f038648b136 100644 --- a/tests/js/spec/api.spec.jsx +++ b/tests/js/spec/api.spec.jsx @@ -1,7 +1,7 @@ import $ from 'jquery'; -import {Client, Request, paramsToQueryArgs} from 'app/api'; import GroupActions from 'app/actions/groupActions'; +import {Client, paramsToQueryArgs, Request} from 'app/api'; import {PROJECT_MOVED} from 'app/constants/apiErrorCodes'; jest.unmock('app/api'); diff --git a/tests/js/spec/components/acl/featureDisabled.spec.jsx b/tests/js/spec/components/acl/featureDisabled.spec.jsx index 94178f90c4fad6..e4c8a6571f2767 100644 --- a/tests/js/spec/components/acl/featureDisabled.spec.jsx +++ b/tests/js/spec/components/acl/featureDisabled.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {PanelAlert} from 'app/components/panels'; import FeatureDisabled from 'app/components/acl/featureDisabled'; +import {PanelAlert} from 'app/components/panels'; describe('FeatureDisabled', function () { const routerContext = TestStubs.routerContext(); diff --git a/tests/js/spec/components/activity/note/input.spec.jsx b/tests/js/spec/components/activity/note/input.spec.jsx index 9c7a1ee25e5759..b8088c013223db 100644 --- a/tests/js/spec/components/activity/note/input.spec.jsx +++ b/tests/js/spec/components/activity/note/input.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {mountWithTheme} from 'sentry-test/enzyme'; import changeReactMentionsInput from 'sentry-test/changeReactMentionsInput'; +import {mountWithTheme} from 'sentry-test/enzyme'; import NoteInput from 'app/components/activity/note/input'; diff --git a/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx b/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx index 2fc25cf789f88f..6154005971ddec 100644 --- a/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx +++ b/tests/js/spec/components/activity/note/inputWithStorage.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {mountWithTheme} from 'sentry-test/enzyme'; import changeReactMentionsInput from 'sentry-test/changeReactMentionsInput'; +import {mountWithTheme} from 'sentry-test/enzyme'; import NoteInputWithStorage from 'app/components/activity/note/inputWithStorage'; import localStorage from 'app/utils/localStorage'; diff --git a/tests/js/spec/components/assigneeSelector.spec.jsx b/tests/js/spec/components/assigneeSelector.spec.jsx index 509144c7e54253..33e50550db0c41 100644 --- a/tests/js/spec/components/assigneeSelector.spec.jsx +++ b/tests/js/spec/components/assigneeSelector.spec.jsx @@ -2,17 +2,17 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {openInviteMembersModal} from 'app/actionCreators/modal'; +import {Client} from 'app/api'; import { AssigneeSelectorComponent, putSessionUserFirst, } from 'app/components/assigneeSelector'; -import {Client} from 'app/api'; import ConfigStore from 'app/stores/configStore'; import GroupStore from 'app/stores/groupStore'; import MemberListStore from 'app/stores/memberListStore'; import ProjectsStore from 'app/stores/projectsStore'; import TeamStore from 'app/stores/teamStore'; -import {openInviteMembersModal} from 'app/actionCreators/modal'; jest.mock('app/actionCreators/modal', () => ({ openInviteMembersModal: jest.fn(), diff --git a/tests/js/spec/components/assistant/guideAnchor.spec.jsx b/tests/js/spec/components/assistant/guideAnchor.spec.jsx index 47b0fc96a5c98c..97c707a6db7094 100644 --- a/tests/js/spec/components/assistant/guideAnchor.spec.jsx +++ b/tests/js/spec/components/assistant/guideAnchor.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import GuideAnchor from 'app/components/assistant/guideAnchor'; import GuideActions from 'app/actions/guideActions'; +import GuideAnchor from 'app/components/assistant/guideAnchor'; import ConfigStore from 'app/stores/configStore'; import theme from 'app/utils/theme'; diff --git a/tests/js/spec/components/avatar/actorAvatar.spec.jsx b/tests/js/spec/components/avatar/actorAvatar.spec.jsx index 339471778ef7dd..74ffd97f71c01e 100644 --- a/tests/js/spec/components/avatar/actorAvatar.spec.jsx +++ b/tests/js/spec/components/avatar/actorAvatar.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import {mountWithTheme, mount} from 'sentry-test/enzyme'; +import {mount, mountWithTheme} from 'sentry-test/enzyme'; import ActorAvatar from 'app/components/avatar/actorAvatar'; import MemberListStore from 'app/stores/memberListStore'; diff --git a/tests/js/spec/components/charts/eventsAreaChart.spec.jsx b/tests/js/spec/components/charts/eventsAreaChart.spec.jsx index e3968a069f9f00..8cadfbfc5caf57 100644 --- a/tests/js/spec/components/charts/eventsAreaChart.spec.jsx +++ b/tests/js/spec/components/charts/eventsAreaChart.spec.jsx @@ -1,8 +1,8 @@ import React from 'react'; import {mockZoomRange} from 'sentry-test/charts'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import EventsChart from 'app/components/charts/eventsChart'; diff --git a/tests/js/spec/components/charts/eventsChart.spec.jsx b/tests/js/spec/components/charts/eventsChart.spec.jsx index 8d2b2b415f1516..071e42a36acd4e 100644 --- a/tests/js/spec/components/charts/eventsChart.spec.jsx +++ b/tests/js/spec/components/charts/eventsChart.spec.jsx @@ -1,12 +1,12 @@ import React from 'react'; import {chart, doZoom, mockZoomRange} from 'sentry-test/charts'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import {getUtcToLocalDateObject} from 'app/utils/dates'; -import EventsChart from 'app/components/charts/eventsChart'; import * as globalSelection from 'app/actionCreators/globalSelection'; +import EventsChart from 'app/components/charts/eventsChart'; +import {getUtcToLocalDateObject} from 'app/utils/dates'; jest.mock('app/components/charts/eventsRequest', () => jest.fn(() => null)); jest.spyOn(globalSelection, 'updateDateTime'); diff --git a/tests/js/spec/components/charts/eventsRequest.spec.jsx b/tests/js/spec/components/charts/eventsRequest.spec.jsx index 83ae1f734cf56c..8bf1da7341e30f 100644 --- a/tests/js/spec/components/charts/eventsRequest.spec.jsx +++ b/tests/js/spec/components/charts/eventsRequest.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import EventsRequest from 'app/components/charts/eventsRequest'; import {doEventsRequest} from 'app/actionCreators/events'; +import EventsRequest from 'app/components/charts/eventsRequest'; const COUNT_OBJ = { count: 123, diff --git a/tests/js/spec/components/charts/utils.spec.jsx b/tests/js/spec/components/charts/utils.spec.jsx index 44ad9bb06d97f1..ed9a511a125592 100644 --- a/tests/js/spec/components/charts/utils.spec.jsx +++ b/tests/js/spec/components/charts/utils.spec.jsx @@ -1,7 +1,7 @@ import { canIncludePreviousPeriod, - getInterval, getDiffInMinutes, + getInterval, } from 'app/components/charts/utils'; describe('Chart Utils', function () { diff --git a/tests/js/spec/components/confirm.spec.jsx b/tests/js/spec/components/confirm.spec.jsx index bc5d356eac8ae5..de72d224495dd8 100644 --- a/tests/js/spec/components/confirm.spec.jsx +++ b/tests/js/spec/components/confirm.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import {shallow, mountWithTheme} from 'sentry-test/enzyme'; +import {mountWithTheme, shallow} from 'sentry-test/enzyme'; import Confirm from 'app/components/confirm'; diff --git a/tests/js/spec/components/contextPickerModal.spec.jsx b/tests/js/spec/components/contextPickerModal.spec.jsx index 351359f3c2e5c6..5adf81ec4f2414 100644 --- a/tests/js/spec/components/contextPickerModal.spec.jsx +++ b/tests/js/spec/components/contextPickerModal.spec.jsx @@ -4,8 +4,8 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import {selectByValue} from 'sentry-test/select-new'; import ContextPickerModal from 'app/components/contextPickerModal'; -import OrganizationStore from 'app/stores/organizationStore'; import OrganizationsStore from 'app/stores/organizationsStore'; +import OrganizationStore from 'app/stores/organizationStore'; import ProjectsStore from 'app/stores/projectsStore'; jest.mock('jquery'); diff --git a/tests/js/spec/components/createAlertButton.spec.jsx b/tests/js/spec/components/createAlertButton.spec.jsx index a160126c19b76c..e4a83343e36bc5 100644 --- a/tests/js/spec/components/createAlertButton.spec.jsx +++ b/tests/js/spec/components/createAlertButton.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {DEFAULT_EVENT_VIEW, ALL_VIEWS} from 'app/views/eventsV2/data'; import {CreateAlertFromViewButton} from 'app/components/createAlertButton'; import EventView from 'app/utils/discover/eventView'; +import {ALL_VIEWS, DEFAULT_EVENT_VIEW} from 'app/views/eventsV2/data'; const onIncompatibleQueryMock = jest.fn(); const onCloseMock = jest.fn(); diff --git a/tests/js/spec/components/createSampleEventButton.spec.jsx b/tests/js/spec/components/createSampleEventButton.spec.jsx index cf428558d81322..d16e1655d2e031 100644 --- a/tests/js/spec/components/createSampleEventButton.spec.jsx +++ b/tests/js/spec/components/createSampleEventButton.spec.jsx @@ -1,5 +1,5 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import * as Sentry from '@sentry/react'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/components/discover/transactionsList.spec.jsx b/tests/js/spec/components/discover/transactionsList.spec.jsx index 136ab56ec1cbf0..8fcd04b86ab3e7 100644 --- a/tests/js/spec/components/discover/transactionsList.spec.jsx +++ b/tests/js/spec/components/discover/transactionsList.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {Client} from 'app/api'; import TransactionsList from 'app/components/discover/transactionsList'; diff --git a/tests/js/spec/components/dropdownLink.spec.jsx b/tests/js/spec/components/dropdownLink.spec.jsx index 789e63af56dd99..27da97fc14ce19 100644 --- a/tests/js/spec/components/dropdownLink.spec.jsx +++ b/tests/js/spec/components/dropdownLink.spec.jsx @@ -1,5 +1,5 @@ -import $ from 'jquery'; import React from 'react'; +import $ from 'jquery'; import {mount} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/components/eventOrGroupHeader.spec.jsx b/tests/js/spec/components/eventOrGroupHeader.spec.jsx index 4e64432863cb43..44d571bfdc2421 100644 --- a/tests/js/spec/components/eventOrGroupHeader.spec.jsx +++ b/tests/js/spec/components/eventOrGroupHeader.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme, shallow} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import EventOrGroupHeader from 'app/components/eventOrGroupHeader'; diff --git a/tests/js/spec/components/events/contextSummary.spec.jsx b/tests/js/spec/components/events/contextSummary.spec.jsx index ec8814dd05566c..96a7d6fa5e95b2 100644 --- a/tests/js/spec/components/events/contextSummary.spec.jsx +++ b/tests/js/spec/components/events/contextSummary.spec.jsx @@ -3,10 +3,10 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import ContextSummary from 'app/components/events/contextSummary/contextSummary'; -import {FILTER_MASK} from 'app/constants'; -import ContextSummaryUser from 'app/components/events/contextSummary/contextSummaryUser'; import ContextSummaryGPU from 'app/components/events/contextSummary/contextSummaryGPU'; import ContextSummaryOS from 'app/components/events/contextSummary/contextSummaryOS'; +import ContextSummaryUser from 'app/components/events/contextSummary/contextSummaryUser'; +import {FILTER_MASK} from 'app/constants'; const CONTEXT_USER = { email: '[email protected]', diff --git a/tests/js/spec/components/events/interfaces/breadcrumbs/filter.spec.tsx b/tests/js/spec/components/events/interfaces/breadcrumbs/filter.spec.tsx index dd02661e9ca454..bdc1182951ce5b 100644 --- a/tests/js/spec/components/events/interfaces/breadcrumbs/filter.spec.tsx +++ b/tests/js/spec/components/events/interfaces/breadcrumbs/filter.spec.tsx @@ -2,14 +2,14 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {IconUser, IconLocation, IconSpan, IconSwitch, IconFix, IconFire} from 'app/icons'; import Filter from 'app/components/events/interfaces/breadcrumbs/filter'; -import Level from 'app/components/events/interfaces/breadcrumbs/level'; import Icon from 'app/components/events/interfaces/breadcrumbs/icon'; +import Level from 'app/components/events/interfaces/breadcrumbs/level'; import { - BreadcrumbType, BreadcrumbLevelType, + BreadcrumbType, } from 'app/components/events/interfaces/breadcrumbs/types'; +import {IconFire, IconFix, IconLocation, IconSpan, IconSwitch, IconUser} from 'app/icons'; const options: React.ComponentProps<typeof Filter>['options'] = [ [ diff --git a/tests/js/spec/components/events/interfaces/breadcrumbs/httpRenderer.spec.tsx b/tests/js/spec/components/events/interfaces/breadcrumbs/httpRenderer.spec.tsx index 9d41e650489e0d..3a78db7148312b 100644 --- a/tests/js/spec/components/events/interfaces/breadcrumbs/httpRenderer.spec.tsx +++ b/tests/js/spec/components/events/interfaces/breadcrumbs/httpRenderer.spec.tsx @@ -4,8 +4,8 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import HttpRenderer from 'app/components/events/interfaces/breadcrumbs/data/http'; import { - BreadcrumbType, BreadcrumbLevelType, + BreadcrumbType, } from 'app/components/events/interfaces/breadcrumbs/types'; describe('HttpRenderer', () => { diff --git a/tests/js/spec/components/events/interfaces/openInContextLine.spec.jsx b/tests/js/spec/components/events/interfaces/openInContextLine.spec.jsx index f3b222da04ca46..3b3b5d3690c3d3 100644 --- a/tests/js/spec/components/events/interfaces/openInContextLine.spec.jsx +++ b/tests/js/spec/components/events/interfaces/openInContextLine.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; import {OpenInContextLine} from 'app/components/events/interfaces/openInContextLine'; +import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; describe('OpenInContextLine', function () { const filename = '/sentry/app.py'; diff --git a/tests/js/spec/components/events/interfaces/spanComponents/utils.spec.jsx b/tests/js/spec/components/events/interfaces/spanComponents/utils.spec.jsx index fbfe10208d7f28..43d1375a5c4305 100644 --- a/tests/js/spec/components/events/interfaces/spanComponents/utils.spec.jsx +++ b/tests/js/spec/components/events/interfaces/spanComponents/utils.spec.jsx @@ -1,8 +1,8 @@ -import CHART_PALETTE from 'app/constants/chartPalette'; import { - spanColors, pickSpanBarColour, + spanColors, } from 'app/components/events/interfaces/spans/utils'; +import CHART_PALETTE from 'app/constants/chartPalette'; describe('pickSpanBarColour()', function () { it('returns blue when undefined', function () { diff --git a/tests/js/spec/components/events/interfaces/utils.spec.jsx b/tests/js/spec/components/events/interfaces/utils.spec.jsx index 5851d97736bcc5..55e125761d6e84 100644 --- a/tests/js/spec/components/events/interfaces/utils.spec.jsx +++ b/tests/js/spec/components/events/interfaces/utils.spec.jsx @@ -1,9 +1,9 @@ -import {MetaProxy, withMeta} from 'app/components/events/meta/metaProxy'; import { getCurlCommand, objectToSortedTupleArray, removeFilterMaskedEntries, } from 'app/components/events/interfaces/utils'; +import {MetaProxy, withMeta} from 'app/components/events/meta/metaProxy'; import {FILTER_MASK} from 'app/constants'; describe('components/interfaces/utils', function () { diff --git a/tests/js/spec/components/events/meta/metaData.spec.jsx b/tests/js/spec/components/events/meta/metaData.spec.jsx index f88026ac2cd359..660e05d52da423 100644 --- a/tests/js/spec/components/events/meta/metaData.spec.jsx +++ b/tests/js/spec/components/events/meta/metaData.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import {withMeta} from 'app/components/events/meta/metaProxy'; import MetaData from 'app/components/events/meta/metaData'; +import {withMeta} from 'app/components/events/meta/metaProxy'; describe('MetaData', function () { const exc = TestStubs.ExceptionWithMeta(); diff --git a/tests/js/spec/components/featureTourModal.spec.jsx b/tests/js/spec/components/featureTourModal.spec.jsx index acd0c606700c6f..acedd2d4720910 100644 --- a/tests/js/spec/components/featureTourModal.spec.jsx +++ b/tests/js/spec/components/featureTourModal.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import FeatureTourModal from 'app/components/modals/featureTourModal'; import GlobalModal from 'app/components/globalModal'; +import FeatureTourModal from 'app/components/modals/featureTourModal'; const steps = [ { diff --git a/tests/js/spec/components/forms/formField.spec.jsx b/tests/js/spec/components/forms/formField.spec.jsx index ad4486ddbc16c3..a01e189975b6fa 100644 --- a/tests/js/spec/components/forms/formField.spec.jsx +++ b/tests/js/spec/components/forms/formField.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import TextField from 'app/views/settings/components/forms/textField'; import Form from 'app/views/settings/components/forms/form'; import FormModel from 'app/views/settings/components/forms/model'; +import TextField from 'app/views/settings/components/forms/textField'; describe('FormField + model', function () { let model; diff --git a/tests/js/spec/components/forms/genericField.spec.jsx b/tests/js/spec/components/forms/genericField.spec.jsx index 632b2a09d82c4c..8b899e7a25dd28 100644 --- a/tests/js/spec/components/forms/genericField.spec.jsx +++ b/tests/js/spec/components/forms/genericField.spec.jsx @@ -2,7 +2,7 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {GenericField, FormState} from 'app/components/forms'; +import {FormState, GenericField} from 'app/components/forms'; describe('GenericField', function () { it('renders text as TextInput', function () { diff --git a/tests/js/spec/components/forms/jsonForm.spec.tsx b/tests/js/spec/components/forms/jsonForm.spec.tsx index 059e7d19fc35f7..bafbb81dba9345 100644 --- a/tests/js/spec/components/forms/jsonForm.spec.tsx +++ b/tests/js/spec/components/forms/jsonForm.spec.tsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import JsonForm from 'app/views/settings/components/forms/jsonForm'; import accountDetailsFields from 'app/data/forms/accountDetails'; import {fields} from 'app/data/forms/projectGeneralSettings'; +import JsonForm from 'app/views/settings/components/forms/jsonForm'; // @ts-expect-error const user = TestStubs.User({}); diff --git a/tests/js/spec/components/forms/numberField.spec.jsx b/tests/js/spec/components/forms/numberField.spec.jsx index 321134b6e69af7..29c2388c3639f0 100644 --- a/tests/js/spec/components/forms/numberField.spec.jsx +++ b/tests/js/spec/components/forms/numberField.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import {mountWithTheme, mount} from 'sentry-test/enzyme'; +import {mount, mountWithTheme} from 'sentry-test/enzyme'; import {NumberField} from 'app/components/forms'; import Form from 'app/components/forms/form'; diff --git a/tests/js/spec/components/forms/radioBooleanField.spec.jsx b/tests/js/spec/components/forms/radioBooleanField.spec.jsx index cfc25e037a6e07..b2be660364e57f 100644 --- a/tests/js/spec/components/forms/radioBooleanField.spec.jsx +++ b/tests/js/spec/components/forms/radioBooleanField.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import {mountWithTheme, mount} from 'sentry-test/enzyme'; +import {mount, mountWithTheme} from 'sentry-test/enzyme'; import {RadioBooleanField} from 'app/components/forms'; import NewRadioBooleanField from 'app/views/settings/components/forms/radioBooleanField'; diff --git a/tests/js/spec/components/globalModal.spec.jsx b/tests/js/spec/components/globalModal.spec.jsx index 854f139542deb8..d0278252149f56 100644 --- a/tests/js/spec/components/globalModal.spec.jsx +++ b/tests/js/spec/components/globalModal.spec.jsx @@ -1,9 +1,9 @@ import React from 'react'; -import {mountWithTheme, mount} from 'sentry-test/enzyme'; +import {mount, mountWithTheme} from 'sentry-test/enzyme'; +import {closeModal, openModal} from 'app/actionCreators/modal'; import GlobalModal from 'app/components/globalModal'; -import {openModal, closeModal} from 'app/actionCreators/modal'; describe('GlobalModal', function () { it('renders', function () { diff --git a/tests/js/spec/components/group/releaseStats.spec.jsx b/tests/js/spec/components/group/releaseStats.spec.jsx index 5b805571d031a9..18903a7bbd8d14 100644 --- a/tests/js/spec/components/group/releaseStats.spec.jsx +++ b/tests/js/spec/components/group/releaseStats.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import ConfigStore from 'app/stores/configStore'; import GroupReleaseStats from 'app/components/group/releaseStats'; +import ConfigStore from 'app/stores/configStore'; describe('GroupReleaseStats', function () { const {organization, project, routerContext} = initializeOrg(); diff --git a/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx b/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx index 0899c4263bd718..6a9e0a2fe3eaae 100644 --- a/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx +++ b/tests/js/spec/components/group/sentryAppExternalIssueForm.spec.jsx @@ -1,11 +1,11 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {selectByValue, changeInputValue} from 'sentry-test/select-new'; +import {changeInputValue, selectByValue} from 'sentry-test/select-new'; import {Client} from 'app/api'; -import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; import SentryAppExternalIssueForm from 'app/components/group/sentryAppExternalIssueForm'; +import {addQueryParamsToExistingUrl} from 'app/utils/queryString'; const optionLabelSelector = label => `[label="${label}"]`; diff --git a/tests/js/spec/components/group/sidebar.spec.jsx b/tests/js/spec/components/group/sidebar.spec.jsx index e7777916e87da3..caaaa39c9145d3 100644 --- a/tests/js/spec/components/group/sidebar.spec.jsx +++ b/tests/js/spec/components/group/sidebar.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import GroupSidebar from 'app/components/group/sidebar'; diff --git a/tests/js/spec/components/group/suggestedOwners.spec.jsx b/tests/js/spec/components/group/suggestedOwners.spec.jsx index d5b050818c0034..4edec29873444f 100644 --- a/tests/js/spec/components/group/suggestedOwners.spec.jsx +++ b/tests/js/spec/components/group/suggestedOwners.spec.jsx @@ -2,10 +2,10 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {Client} from 'app/api'; import SuggestedOwners from 'app/components/group/suggestedOwners/suggestedOwners'; -import MemberListStore from 'app/stores/memberListStore'; import CommitterStore from 'app/stores/committerStore'; -import {Client} from 'app/api'; +import MemberListStore from 'app/stores/memberListStore'; describe('SuggestedOwners', function () { const user = TestStubs.User(); diff --git a/tests/js/spec/components/indicators.spec.jsx b/tests/js/spec/components/indicators.spec.jsx index d3092f11bbd68d..23022a2845ecf2 100644 --- a/tests/js/spec/components/indicators.spec.jsx +++ b/tests/js/spec/components/indicators.spec.jsx @@ -2,14 +2,14 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import Indicators from 'app/components/indicators'; -import IndicatorStore from 'app/stores/indicatorStore'; import { - clearIndicators, - addSuccessMessage, addErrorMessage, addMessage, + addSuccessMessage, + clearIndicators, } from 'app/actionCreators/indicator'; +import Indicators from 'app/components/indicators'; +import IndicatorStore from 'app/stores/indicatorStore'; // Make sure we use `duration: null` to test add/remove jest.useFakeTimers(); diff --git a/tests/js/spec/components/issueSyncListElement.spec.jsx b/tests/js/spec/components/issueSyncListElement.spec.jsx index 8a1d93067c5c6c..f382d222596aee 100644 --- a/tests/js/spec/components/issueSyncListElement.spec.jsx +++ b/tests/js/spec/components/issueSyncListElement.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import {mountWithTheme, mount} from 'sentry-test/enzyme'; +import {mount, mountWithTheme} from 'sentry-test/enzyme'; import IssueSyncListElement from 'app/components/issueSyncListElement'; diff --git a/tests/js/spec/components/modals/commandPaletteModal.spec.jsx b/tests/js/spec/components/modals/commandPaletteModal.spec.jsx index 8d8678537fd082..4b9757fa679b03 100644 --- a/tests/js/spec/components/modals/commandPaletteModal.spec.jsx +++ b/tests/js/spec/components/modals/commandPaletteModal.spec.jsx @@ -3,9 +3,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {openCommandPalette} from 'app/actionCreators/modal'; -import App from 'app/views/app'; -import FormSearchStore from 'app/stores/formSearchStore'; import {navigateTo} from 'app/actionCreators/navigation'; +import FormSearchStore from 'app/stores/formSearchStore'; +import App from 'app/views/app'; jest.mock('jquery'); jest.mock('app/actionCreators/formSearch'); diff --git a/tests/js/spec/components/modals/createTeamModal.spec.jsx b/tests/js/spec/components/modals/createTeamModal.spec.jsx index b29be35a1901b6..0b09c7cdce6021 100644 --- a/tests/js/spec/components/modals/createTeamModal.spec.jsx +++ b/tests/js/spec/components/modals/createTeamModal.spec.jsx @@ -1,5 +1,5 @@ -import {Modal} from 'react-bootstrap'; import React from 'react'; +import {Modal} from 'react-bootstrap'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/components/modals/inviteMembersModal.spec.jsx b/tests/js/spec/components/modals/inviteMembersModal.spec.jsx index b397bf626e459b..5907c5f415b4ba 100644 --- a/tests/js/spec/components/modals/inviteMembersModal.spec.jsx +++ b/tests/js/spec/components/modals/inviteMembersModal.spec.jsx @@ -1,5 +1,5 @@ -import {Modal} from 'react-bootstrap'; import React from 'react'; +import {Modal} from 'react-bootstrap'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/components/modals/recoveryOptionsModal.spec.jsx b/tests/js/spec/components/modals/recoveryOptionsModal.spec.jsx index 76e562db9cc70e..346155d18a01f6 100644 --- a/tests/js/spec/components/modals/recoveryOptionsModal.spec.jsx +++ b/tests/js/spec/components/modals/recoveryOptionsModal.spec.jsx @@ -1,5 +1,5 @@ -import {Modal} from 'react-bootstrap'; import React from 'react'; +import {Modal} from 'react-bootstrap'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/components/modals/redirectToProject.spec.jsx b/tests/js/spec/components/modals/redirectToProject.spec.jsx index 1fc0ec8fff37e7..9ac99d464cc562 100644 --- a/tests/js/spec/components/modals/redirectToProject.spec.jsx +++ b/tests/js/spec/components/modals/redirectToProject.spec.jsx @@ -1,5 +1,5 @@ -import {Modal} from 'react-bootstrap'; import React from 'react'; +import {Modal} from 'react-bootstrap'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/components/modals/sudoModal.spec.jsx b/tests/js/spec/components/modals/sudoModal.spec.jsx index 723d8b759e8526..2eb57a363e04f7 100644 --- a/tests/js/spec/components/modals/sudoModal.spec.jsx +++ b/tests/js/spec/components/modals/sudoModal.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {Client} from 'app/api'; -import App from 'app/views/app'; import ConfigStore from 'app/stores/configStore'; +import App from 'app/views/app'; jest.mock('jquery'); diff --git a/tests/js/spec/components/modals/teamAccessRequestModal.spec.jsx b/tests/js/spec/components/modals/teamAccessRequestModal.spec.jsx index 7e4e23f7e3f60b..cd75f268ff8fc2 100644 --- a/tests/js/spec/components/modals/teamAccessRequestModal.spec.jsx +++ b/tests/js/spec/components/modals/teamAccessRequestModal.spec.jsx @@ -1,5 +1,5 @@ -import {Modal} from 'react-bootstrap'; import React from 'react'; +import {Modal} from 'react-bootstrap'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/components/multipleCheckbox.spec.js b/tests/js/spec/components/multipleCheckbox.spec.js index cab692e9da678a..72952d8c7b83ef 100644 --- a/tests/js/spec/components/multipleCheckbox.spec.js +++ b/tests/js/spec/components/multipleCheckbox.spec.js @@ -1,6 +1,6 @@ import React from 'react'; -import {mountWithTheme, mount} from 'sentry-test/enzyme'; +import {mount, mountWithTheme} from 'sentry-test/enzyme'; import MultipleCheckbox from 'app/views/settings/components/forms/controls/multipleCheckbox'; diff --git a/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx b/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx index e4bc4be9006e4d..406e7fdfac8e7a 100644 --- a/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx +++ b/tests/js/spec/components/organizations/globalSelectionHeader.spec.jsx @@ -1,15 +1,15 @@ import React from 'react'; +import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {mockRouterPush} from 'sentry-test/mockRouterPush'; -import {mountWithTheme} from 'sentry-test/enzyme'; -import ConfigStore from 'app/stores/configStore'; +import * as globalActions from 'app/actionCreators/globalSelection'; +import OrganizationActions from 'app/actions/organizationActions'; import GlobalSelectionHeader from 'app/components/organizations/globalSelectionHeader'; +import ConfigStore from 'app/stores/configStore'; import GlobalSelectionStore from 'app/stores/globalSelectionStore'; -import OrganizationActions from 'app/actions/organizationActions'; import ProjectsStore from 'app/stores/projectsStore'; -import * as globalActions from 'app/actionCreators/globalSelection'; import {getItem} from 'app/utils/localStorage'; const changeQuery = (routerContext, query) => ({ diff --git a/tests/js/spec/components/organizations/multipleEnvironmentSelector.spec.jsx b/tests/js/spec/components/organizations/multipleEnvironmentSelector.spec.jsx index fde5f844c79b8c..12fcf416789646 100644 --- a/tests/js/spec/components/organizations/multipleEnvironmentSelector.spec.jsx +++ b/tests/js/spec/components/organizations/multipleEnvironmentSelector.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import ConfigStore from 'app/stores/configStore'; import MultipleEnvironmentSelector from 'app/components/organizations/multipleEnvironmentSelector'; import {ALL_ACCESS_PROJECTS} from 'app/constants/globalSelectionHeader'; +import ConfigStore from 'app/stores/configStore'; describe('MultipleEnvironmentSelector', function () { let wrapper; diff --git a/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx b/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx index 54613a2fb3a433..0d8e7de93479d1 100644 --- a/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx +++ b/tests/js/spec/components/organizations/timeRangeSelector/dateRange.spec.jsx @@ -3,8 +3,8 @@ import MockDate from 'mockdate'; import {mount} from 'sentry-test/enzyme'; -import ConfigStore from 'app/stores/configStore'; import DateRange from 'app/components/organizations/timeRangeSelector/dateRange'; +import ConfigStore from 'app/stores/configStore'; // 2017-10-14T02:38:00.000Z // 2017-10-17T02:38:00.000Z diff --git a/tests/js/spec/components/organizations/timeRangeSelector/index.spec.jsx b/tests/js/spec/components/organizations/timeRangeSelector/index.spec.jsx index 3f087460004ff2..9f6006b61a417f 100644 --- a/tests/js/spec/components/organizations/timeRangeSelector/index.spec.jsx +++ b/tests/js/spec/components/organizations/timeRangeSelector/index.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import ConfigStore from 'app/stores/configStore'; import TimeRangeSelector from 'app/components/organizations/timeRangeSelector'; +import ConfigStore from 'app/stores/configStore'; describe('TimeRangeSelector', function () { let wrapper; diff --git a/tests/js/spec/components/platformPicker.spec.jsx b/tests/js/spec/components/platformPicker.spec.jsx index 9ea53b28697e1b..00fbb1e49bedaf 100644 --- a/tests/js/spec/components/platformPicker.spec.jsx +++ b/tests/js/spec/components/platformPicker.spec.jsx @@ -1,6 +1,6 @@ import React from 'react'; -import {shallow, mountWithTheme} from 'sentry-test/enzyme'; +import {mountWithTheme, shallow} from 'sentry-test/enzyme'; import {Client} from 'app/api'; import PlatformPicker from 'app/components/platformPicker'; diff --git a/tests/js/spec/components/search/sources/formSource.spec.jsx b/tests/js/spec/components/search/sources/formSource.spec.jsx index a935c087e6e022..7b24d41c725b59 100644 --- a/tests/js/spec/components/search/sources/formSource.spec.jsx +++ b/tests/js/spec/components/search/sources/formSource.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import FormSource from 'app/components/search/sources/formSource'; -import FormSearchActions from 'app/actions/formSearchActions'; import * as ActionCreators from 'app/actionCreators/formSearch'; +import FormSearchActions from 'app/actions/formSearchActions'; +import FormSource from 'app/components/search/sources/formSource'; describe('FormSource', function () { let wrapper; diff --git a/tests/js/spec/components/seenByList.spec.jsx b/tests/js/spec/components/seenByList.spec.jsx index 28558cd63c84c0..de0578cad588e4 100644 --- a/tests/js/spec/components/seenByList.spec.jsx +++ b/tests/js/spec/components/seenByList.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import ConfigStore from 'app/stores/configStore'; import SeenByList from 'app/components/seenByList'; +import ConfigStore from 'app/stores/configStore'; describe('SeenByList', function () { beforeEach(function () { diff --git a/tests/js/spec/components/sidebar/index.spec.jsx b/tests/js/spec/components/sidebar/index.spec.jsx index 207dd5c5826ece..ce992f39b8d256 100644 --- a/tests/js/spec/components/sidebar/index.spec.jsx +++ b/tests/js/spec/components/sidebar/index.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import ConfigStore from 'app/stores/configStore'; -import SidebarContainer, {Sidebar} from 'app/components/sidebar'; import * as incidentActions from 'app/actionCreators/serviceIncidents'; +import SidebarContainer, {Sidebar} from 'app/components/sidebar'; +import ConfigStore from 'app/stores/configStore'; jest.mock('app/actionCreators/serviceIncidents'); diff --git a/tests/js/spec/components/streamGroup.spec.jsx b/tests/js/spec/components/streamGroup.spec.jsx index 58b8fe2af3863e..6cb46faae3f832 100644 --- a/tests/js/spec/components/streamGroup.spec.jsx +++ b/tests/js/spec/components/streamGroup.spec.jsx @@ -1,10 +1,10 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import GroupStore from 'app/stores/groupStore'; import StreamGroup from 'app/components/stream/group'; +import GroupStore from 'app/stores/groupStore'; describe('StreamGroup', function () { let GROUP_1; diff --git a/tests/js/spec/components/tag.spec.jsx b/tests/js/spec/components/tag.spec.jsx index 0a20e351e96e61..af7f7295b39546 100644 --- a/tests/js/spec/components/tag.spec.jsx +++ b/tests/js/spec/components/tag.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {IconFire} from 'app/icons'; import Tag from 'app/components/tag'; +import {IconFire} from 'app/icons'; describe('Tag', function () { it('basic', function () { diff --git a/tests/js/spec/helpers/formatters.spec.jsx b/tests/js/spec/helpers/formatters.spec.jsx index 30e5326b88b59b..131472869adf5f 100644 --- a/tests/js/spec/helpers/formatters.spec.jsx +++ b/tests/js/spec/helpers/formatters.spec.jsx @@ -1,4 +1,4 @@ -import {userDisplayName, getExactDuration} from 'app/utils/formatters'; +import {getExactDuration, userDisplayName} from 'app/utils/formatters'; describe('formatters', function () { describe('userDisplayName', function () { diff --git a/tests/js/spec/stores/globalSelectionStore.spec.jsx b/tests/js/spec/stores/globalSelectionStore.spec.jsx index 3dac8fad3ee51c..8772201f9e769b 100644 --- a/tests/js/spec/stores/globalSelectionStore.spec.jsx +++ b/tests/js/spec/stores/globalSelectionStore.spec.jsx @@ -1,9 +1,9 @@ -import GlobalSelectionStore from 'app/stores/globalSelectionStore'; import { - updateProjects, updateDateTime, updateEnvironments, + updateProjects, } from 'app/actionCreators/globalSelection'; +import GlobalSelectionStore from 'app/stores/globalSelectionStore'; jest.mock('app/utils/localStorage', () => ({ getItem: () => JSON.stringify({projects: [5], environments: ['staging']}), diff --git a/tests/js/spec/stores/groupingStore.spec.jsx b/tests/js/spec/stores/groupingStore.spec.jsx index 96f8888ab841a4..6b204968e32355 100644 --- a/tests/js/spec/stores/groupingStore.spec.jsx +++ b/tests/js/spec/stores/groupingStore.spec.jsx @@ -1,5 +1,5 @@ -import GroupingStore from 'app/stores/groupingStore'; import {Client, mergeMock} from 'app/api'; +import GroupingStore from 'app/stores/groupingStore'; describe('Grouping Store', function () { let trigger; diff --git a/tests/js/spec/stores/guideStore.spec.jsx b/tests/js/spec/stores/guideStore.spec.jsx index a1102eebf88c1d..c278a01a147400 100644 --- a/tests/js/spec/stores/guideStore.spec.jsx +++ b/tests/js/spec/stores/guideStore.spec.jsx @@ -1,6 +1,6 @@ -import {trackAnalyticsEvent} from 'app/utils/analytics'; import ConfigStore from 'app/stores/configStore'; import GuideStore from 'app/stores/guideStore'; +import {trackAnalyticsEvent} from 'app/utils/analytics'; jest.mock('app/utils/analytics'); diff --git a/tests/js/spec/stores/organizationStore.spec.jsx b/tests/js/spec/stores/organizationStore.spec.jsx index 5ae4e4bfb41aaf..241442cad37c6f 100644 --- a/tests/js/spec/stores/organizationStore.spec.jsx +++ b/tests/js/spec/stores/organizationStore.spec.jsx @@ -1,8 +1,8 @@ -import OrganizationStore from 'app/stores/organizationStore'; +import {updateOrganization} from 'app/actionCreators/organizations'; import OrganizationActions from 'app/actions/organizationActions'; -import TeamActions from 'app/actions/teamActions'; import ProjectActions from 'app/actions/projectActions'; -import {updateOrganization} from 'app/actionCreators/organizations'; +import TeamActions from 'app/actions/teamActions'; +import OrganizationStore from 'app/stores/organizationStore'; describe('OrganizationStore', function () { beforeEach(function () { diff --git a/tests/js/spec/stores/pluginsStore.spec.jsx b/tests/js/spec/stores/pluginsStore.spec.jsx index cb581482b72e8d..2006316473fd63 100644 --- a/tests/js/spec/stores/pluginsStore.spec.jsx +++ b/tests/js/spec/stores/pluginsStore.spec.jsx @@ -1,5 +1,5 @@ -import PluginsStore from 'app/stores/pluginsStore'; import PluginActions from 'app/actions/pluginActions'; +import PluginsStore from 'app/stores/pluginsStore'; describe('PluginsStore', function () { beforeAll(function () { diff --git a/tests/js/spec/stores/projectsStore.spec.jsx b/tests/js/spec/stores/projectsStore.spec.jsx index 4060984e1dfd6f..a132218ecccd0e 100644 --- a/tests/js/spec/stores/projectsStore.spec.jsx +++ b/tests/js/spec/stores/projectsStore.spec.jsx @@ -1,6 +1,6 @@ -import ProjectsStore from 'app/stores/projectsStore'; import ProjectActions from 'app/actions/projectActions'; import TeamActions from 'app/actions/teamActions'; +import ProjectsStore from 'app/stores/projectsStore'; describe('ProjectsStore', function () { const teamFoo = TestStubs.Team({ diff --git a/tests/js/spec/stores/savedSearchesStore.spec.jsx b/tests/js/spec/stores/savedSearchesStore.spec.jsx index eab2fee75903c7..48e1783175df8c 100644 --- a/tests/js/spec/stores/savedSearchesStore.spec.jsx +++ b/tests/js/spec/stores/savedSearchesStore.spec.jsx @@ -1,11 +1,11 @@ -import SavedSearchesStore from 'app/stores/savedSearchesStore'; import { - fetchSavedSearches, deleteSavedSearch, + fetchSavedSearches, pinSearch, unpinSearch, } from 'app/actionCreators/savedSearches'; import {Client} from 'app/api'; +import SavedSearchesStore from 'app/stores/savedSearchesStore'; describe('SavedSearchesStore', function () { let api; diff --git a/tests/js/spec/utils/dates.spec.jsx b/tests/js/spec/utils/dates.spec.jsx index 83429700728e7f..c801b92a28da51 100644 --- a/tests/js/spec/utils/dates.spec.jsx +++ b/tests/js/spec/utils/dates.spec.jsx @@ -1,11 +1,11 @@ +import ConfigStore from 'app/stores/configStore'; import { - setDateToTime, + getTimeFormat, intervalToMilliseconds, parsePeriodToHours, + setDateToTime, use24Hours, - getTimeFormat, } from 'app/utils/dates'; -import ConfigStore from 'app/stores/configStore'; describe('utils.dates', function () { describe('setDateToTime', function () { diff --git a/tests/js/spec/utils/discover/charts.spec.jsx b/tests/js/spec/utils/discover/charts.spec.jsx index 83c4a96dd1b1f9..fe3400d336c559 100644 --- a/tests/js/spec/utils/discover/charts.spec.jsx +++ b/tests/js/spec/utils/discover/charts.spec.jsx @@ -1,4 +1,4 @@ -import {tooltipFormatter, axisLabelFormatter} from 'app/utils/discover/charts'; +import {axisLabelFormatter, tooltipFormatter} from 'app/utils/discover/charts'; describe('tooltipFormatter()', function () { it('formats values', function () { diff --git a/tests/js/spec/utils/discover/discoverQuery.spec.jsx b/tests/js/spec/utils/discover/discoverQuery.spec.jsx index 53a3d86b87d382..8ffdcb4641ebbc 100644 --- a/tests/js/spec/utils/discover/discoverQuery.spec.jsx +++ b/tests/js/spec/utils/discover/discoverQuery.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; import {Client} from 'app/api'; -import EventView from 'app/utils/discover/eventView'; import DiscoverQuery from 'app/utils/discover/discoverQuery'; +import EventView from 'app/utils/discover/eventView'; describe('DiscoverQuery', function () { let location, api, eventView; diff --git a/tests/js/spec/utils/discover/eventView.spec.jsx b/tests/js/spec/utils/discover/eventView.spec.jsx index 7f5ebe9c593def..a339be5787cb55 100644 --- a/tests/js/spec/utils/discover/eventView.spec.jsx +++ b/tests/js/spec/utils/discover/eventView.spec.jsx @@ -1,12 +1,12 @@ +import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable/utils'; import EventView, { isAPIPayloadSimilar, pickRelevantLocationQueryStrings, } from 'app/utils/discover/eventView'; -import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable/utils'; import { CHART_AXIS_OPTIONS, - DisplayModes, DISPLAY_MODE_OPTIONS, + DisplayModes, } from 'app/utils/discover/types'; const generateFields = fields => diff --git a/tests/js/spec/utils/discover/fields.spec.jsx b/tests/js/spec/utils/discover/fields.spec.jsx index a01c50ab0451c1..abb78118c8b46c 100644 --- a/tests/js/spec/utils/discover/fields.spec.jsx +++ b/tests/js/spec/utils/discover/fields.spec.jsx @@ -1,12 +1,12 @@ import { + aggregateMultiPlotType, + aggregateOutputType, + explodeField, + generateAggregateFields, getAggregateAlias, isAggregateField, isMeasurement, measurementType, - explodeField, - aggregateOutputType, - aggregateMultiPlotType, - generateAggregateFields, } from 'app/utils/discover/fields'; describe('getAggregateAlias', function () { diff --git a/tests/js/spec/utils/formatters.spec.jsx b/tests/js/spec/utils/formatters.spec.jsx index 8fc7ff9b527f4f..0f5b038e8aeb8b 100644 --- a/tests/js/spec/utils/formatters.spec.jsx +++ b/tests/js/spec/utils/formatters.spec.jsx @@ -1,6 +1,6 @@ import { - formatFloat, formatAbbreviatedNumber, + formatFloat, formatPercentage, getDuration, } from 'app/utils/formatters'; diff --git a/tests/js/spec/utils/projects.spec.jsx b/tests/js/spec/utils/projects.spec.jsx index 058f225d209bf4..ded02ef258ffa7 100644 --- a/tests/js/spec/utils/projects.spec.jsx +++ b/tests/js/spec/utils/projects.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import Projects from 'app/utils/projects'; -import ProjectsStore from 'app/stores/projectsStore'; import ProjectActions from 'app/actions/projectActions'; +import ProjectsStore from 'app/stores/projectsStore'; +import Projects from 'app/utils/projects'; describe('utils.projects', function () { const renderer = jest.fn(() => null); diff --git a/tests/js/spec/utils/stream.spec.jsx b/tests/js/spec/utils/stream.spec.jsx index 00a41b8de4e795..ed014433ddf25c 100644 --- a/tests/js/spec/utils/stream.spec.jsx +++ b/tests/js/spec/utils/stream.spec.jsx @@ -1,4 +1,4 @@ -import {queryToObj, objToQuery} from 'app/utils/stream'; +import {objToQuery, queryToObj} from 'app/utils/stream'; describe('utils/stream', function () { describe('queryToObj()', function () { diff --git a/tests/js/spec/utils/tokenizeSearch.spec.jsx b/tests/js/spec/utils/tokenizeSearch.spec.jsx index 1d5d3feb66e75d..e30e8720c3a72e 100644 --- a/tests/js/spec/utils/tokenizeSearch.spec.jsx +++ b/tests/js/spec/utils/tokenizeSearch.spec.jsx @@ -1,7 +1,7 @@ import { - tokenizeSearch, - stringifyQueryObject, QueryResults, + stringifyQueryObject, + tokenizeSearch, TokenType, } from 'app/utils/tokenizeSearch'; diff --git a/tests/js/spec/utils/utils.spec.jsx b/tests/js/spec/utils/utils.spec.jsx index 06ef7d821cd8ab..b7d1b99c4bd2b7 100644 --- a/tests/js/spec/utils/utils.spec.jsx +++ b/tests/js/spec/utils/utils.spec.jsx @@ -1,12 +1,12 @@ import { - valueIsEqual, + deepFreeze, + descopeFeatureName, + escapeDoubleQuotes, + explodeSlug, extractMultilineFields, parseRepo, - explodeSlug, sortProjects, - descopeFeatureName, - deepFreeze, - escapeDoubleQuotes, + valueIsEqual, } from 'app/utils'; describe('utils.valueIsEqual', function () { diff --git a/tests/js/spec/utils/withExperiment.spec.jsx b/tests/js/spec/utils/withExperiment.spec.jsx index e7f40fa51a6c9d..8e2c7dacb5bd6d 100644 --- a/tests/js/spec/utils/withExperiment.spec.jsx +++ b/tests/js/spec/utils/withExperiment.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import withExperiment from 'app/utils/withExperiment'; import ConfigStore from 'app/stores/configStore'; import {logExperiment} from 'app/utils/analytics'; +import withExperiment from 'app/utils/withExperiment'; jest.mock('app/utils/analytics', () => ({ logExperiment: jest.fn(), diff --git a/tests/js/spec/utils/withIssueTags.spec.jsx b/tests/js/spec/utils/withIssueTags.spec.jsx index 9d40bebef9b191..15eee79603150f 100644 --- a/tests/js/spec/utils/withIssueTags.spec.jsx +++ b/tests/js/spec/utils/withIssueTags.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import TagStore from 'app/stores/tagStore'; import MemberListStore from 'app/stores/memberListStore'; +import TagStore from 'app/stores/tagStore'; import withIssueTags from 'app/utils/withIssueTags'; describe('withIssueTags HoC', function () { diff --git a/tests/js/spec/utils/withTeamsForUser.spec.jsx b/tests/js/spec/utils/withTeamsForUser.spec.jsx index c00ca60e25a371..d759c61ecdf94a 100644 --- a/tests/js/spec/utils/withTeamsForUser.spec.jsx +++ b/tests/js/spec/utils/withTeamsForUser.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import TeamActions from 'app/actions/teamActions'; import ProjectActions from 'app/actions/projectActions'; +import TeamActions from 'app/actions/teamActions'; import withTeamsForUser from 'app/utils/withTeamsForUser'; describe('withUserTeams HoC', function () { diff --git a/tests/js/spec/views/acceptOrganizationInvite.spec.jsx b/tests/js/spec/views/acceptOrganizationInvite.spec.jsx index e499bb2fe64669..8142f56dd20106 100644 --- a/tests/js/spec/views/acceptOrganizationInvite.spec.jsx +++ b/tests/js/spec/views/acceptOrganizationInvite.spec.jsx @@ -1,5 +1,5 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/accountAuthorization.spec.jsx b/tests/js/spec/views/accountAuthorization.spec.jsx index 71805f879ecd3e..c354f3926c6d7d 100644 --- a/tests/js/spec/views/accountAuthorization.spec.jsx +++ b/tests/js/spec/views/accountAuthorization.spec.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/accountSecurityDetails.spec.jsx b/tests/js/spec/views/accountSecurityDetails.spec.jsx index 3ef9b191535f1d..36fe692e27f886 100644 --- a/tests/js/spec/views/accountSecurityDetails.spec.jsx +++ b/tests/js/spec/views/accountSecurityDetails.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {Client} from 'app/api'; import AccountSecurityDetails from 'app/views/settings/account/accountSecurity/accountSecurityDetails'; diff --git a/tests/js/spec/views/accountSubscriptions.spec.jsx b/tests/js/spec/views/accountSubscriptions.spec.jsx index 64127166d3b420..8c14fe82901a82 100644 --- a/tests/js/spec/views/accountSubscriptions.spec.jsx +++ b/tests/js/spec/views/accountSubscriptions.spec.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/alerts/details/activity.spec.jsx b/tests/js/spec/views/alerts/details/activity.spec.jsx index f25b78d08b5dcc..99377ad89a458b 100644 --- a/tests/js/spec/views/alerts/details/activity.spec.jsx +++ b/tests/js/spec/views/alerts/details/activity.spec.jsx @@ -1,8 +1,8 @@ import React from 'react'; +import changeReactMentionsInput from 'sentry-test/changeReactMentionsInput'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import changeReactMentionsInput from 'sentry-test/changeReactMentionsInput'; import IncidentActivity from 'app/views/alerts/details/activity'; diff --git a/tests/js/spec/views/alerts/details/index.spec.jsx b/tests/js/spec/views/alerts/details/index.spec.jsx index fb412fb99b5a62..95bfd0e3462bf7 100644 --- a/tests/js/spec/views/alerts/details/index.spec.jsx +++ b/tests/js/spec/views/alerts/details/index.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import IncidentDetails from 'app/views/alerts/details'; import ProjectsStore from 'app/stores/projectsStore'; +import IncidentDetails from 'app/views/alerts/details'; describe('IncidentDetails', function () { const params = {orgId: 'org-slug', alertId: '123'}; diff --git a/tests/js/spec/views/alerts/list/index.spec.jsx b/tests/js/spec/views/alerts/list/index.spec.jsx index 2b59892aa51c45..3bc13e5e22cd6c 100644 --- a/tests/js/spec/views/alerts/list/index.spec.jsx +++ b/tests/js/spec/views/alerts/list/index.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import IncidentsList from 'app/views/alerts/list'; import ProjectsStore from 'app/stores/projectsStore'; +import IncidentsList from 'app/views/alerts/list'; describe('IncidentsList', function () { const {routerContext, organization} = initializeOrg({ diff --git a/tests/js/spec/views/alerts/rules/index.spec.jsx b/tests/js/spec/views/alerts/rules/index.spec.jsx index 5356a74492c45e..460ee7b7b19d05 100644 --- a/tests/js/spec/views/alerts/rules/index.spec.jsx +++ b/tests/js/spec/views/alerts/rules/index.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import AlertRulesList from 'app/views/alerts/rules'; import ProjectsStore from 'app/stores/projectsStore'; +import AlertRulesList from 'app/views/alerts/rules'; describe('OrganizationRuleList', () => { const {routerContext, organization} = initializeOrg(); diff --git a/tests/js/spec/views/alerts/utils.spec.jsx b/tests/js/spec/views/alerts/utils.spec.jsx index 27653d7a2932d7..6d48ab61c47f94 100644 --- a/tests/js/spec/views/alerts/utils.spec.jsx +++ b/tests/js/spec/views/alerts/utils.spec.jsx @@ -1,7 +1,7 @@ import {initializeOrg} from 'sentry-test/initializeOrg'; -import {Dataset} from 'app/views/settings/incidentRules/types'; import {getIncidentDiscoverUrl} from 'app/views/alerts/utils/getIncidentDiscoverUrl'; +import {Dataset} from 'app/views/settings/incidentRules/types'; describe('Alert utils', function () { const {org, projects} = initializeOrg(); diff --git a/tests/js/spec/views/app.spec.jsx b/tests/js/spec/views/app.spec.jsx index 02fac6f639ede4..4d4ddfbbe6affb 100644 --- a/tests/js/spec/views/app.spec.jsx +++ b/tests/js/spec/views/app.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import App from 'app/views/app'; import ConfigStore from 'app/stores/configStore'; +import App from 'app/views/app'; jest.mock('jquery'); diff --git a/tests/js/spec/views/auth/loginForm.spec.jsx b/tests/js/spec/views/auth/loginForm.spec.jsx index 25abbfbe57912d..48a152919c49d6 100644 --- a/tests/js/spec/views/auth/loginForm.spec.jsx +++ b/tests/js/spec/views/auth/loginForm.spec.jsx @@ -1,5 +1,5 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/auth/registerForm.spec.jsx b/tests/js/spec/views/auth/registerForm.spec.jsx index c63f500a69f811..29e9a466ba8690 100644 --- a/tests/js/spec/views/auth/registerForm.spec.jsx +++ b/tests/js/spec/views/auth/registerForm.spec.jsx @@ -1,5 +1,5 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import {mount} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/auth/ssoForm.spec.jsx b/tests/js/spec/views/auth/ssoForm.spec.jsx index 3e0a33016ea2cf..98589464305031 100644 --- a/tests/js/spec/views/auth/ssoForm.spec.jsx +++ b/tests/js/spec/views/auth/ssoForm.spec.jsx @@ -1,5 +1,5 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import {mount} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/dashboards/dashboard.spec.jsx b/tests/js/spec/views/dashboards/dashboard.spec.jsx index 91a0935b30bcb2..89851d5542c0eb 100644 --- a/tests/js/spec/views/dashboards/dashboard.spec.jsx +++ b/tests/js/spec/views/dashboards/dashboard.spec.jsx @@ -1,12 +1,12 @@ import React from 'react'; +import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {mockRouterPush} from 'sentry-test/mockRouterPush'; -import {mountWithTheme} from 'sentry-test/enzyme'; -import Dashboard from 'app/views/dashboards/dashboard'; -import OrganizationDashboardContainer from 'app/views/dashboards'; import ProjectsStore from 'app/stores/projectsStore'; +import OrganizationDashboardContainer from 'app/views/dashboards'; +import Dashboard from 'app/views/dashboards/dashboard'; jest.mock('app/utils/withLatestContext'); diff --git a/tests/js/spec/views/dashboards/discoverQuery.spec.jsx b/tests/js/spec/views/dashboards/discoverQuery.spec.jsx index 8fcace7ee4b286..da6606e98ad8f4 100644 --- a/tests/js/spec/views/dashboards/discoverQuery.spec.jsx +++ b/tests/js/spec/views/dashboards/discoverQuery.spec.jsx @@ -4,8 +4,8 @@ import {mount} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {mockRouterPush} from 'sentry-test/mockRouterPush'; -import DiscoverQuery from 'app/views/dashboards/discoverQuery'; import ProjectsStore from 'app/stores/projectsStore'; +import DiscoverQuery from 'app/views/dashboards/discoverQuery'; describe('DiscoverQuery', function () { const {organization, router, routerContext} = initializeOrg({ diff --git a/tests/js/spec/views/dashboards/overviewDashboard.spec.jsx b/tests/js/spec/views/dashboards/overviewDashboard.spec.jsx index e355f82863aa2a..80e557bcf8728c 100644 --- a/tests/js/spec/views/dashboards/overviewDashboard.spec.jsx +++ b/tests/js/spec/views/dashboards/overviewDashboard.spec.jsx @@ -1,12 +1,12 @@ import React from 'react'; +import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {mockRouterPush} from 'sentry-test/mockRouterPush'; -import {mountWithTheme} from 'sentry-test/enzyme'; +import ProjectsStore from 'app/stores/projectsStore'; import DashboardsContainer from 'app/views/dashboards'; import OverviewDashboard from 'app/views/dashboards/overviewDashboard'; -import ProjectsStore from 'app/stores/projectsStore'; jest.mock('app/utils/withLatestContext'); diff --git a/tests/js/spec/views/discover/aggregations/utils.spec.jsx b/tests/js/spec/views/discover/aggregations/utils.spec.jsx index 55518bc04d6620..645907976658aa 100644 --- a/tests/js/spec/views/discover/aggregations/utils.spec.jsx +++ b/tests/js/spec/views/discover/aggregations/utils.spec.jsx @@ -1,6 +1,6 @@ import { - getInternal, getExternal, + getInternal, isValidAggregation, } from 'app/views/discover/aggregations/utils'; import {COLUMNS} from 'app/views/discover/data'; diff --git a/tests/js/spec/views/discover/analytics.spec.jsx b/tests/js/spec/views/discover/analytics.spec.jsx index b1eb2557fb5f72..c1f028be7ca344 100644 --- a/tests/js/spec/views/discover/analytics.spec.jsx +++ b/tests/js/spec/views/discover/analytics.spec.jsx @@ -1,5 +1,5 @@ -import {trackQuery} from 'app/views/discover/analytics'; import {analytics} from 'app/utils/analytics'; +import {trackQuery} from 'app/views/discover/analytics'; jest.mock('app/utils/analytics'); diff --git a/tests/js/spec/views/discover/conditions/utils.spec.jsx b/tests/js/spec/views/discover/conditions/utils.spec.jsx index cd8ca943ea5c7f..7b4822b2ec734b 100644 --- a/tests/js/spec/views/discover/conditions/utils.spec.jsx +++ b/tests/js/spec/views/discover/conditions/utils.spec.jsx @@ -1,8 +1,8 @@ import { - getInternal, getExternal, - isValidCondition, + getInternal, ignoreCase, + isValidCondition, } from 'app/views/discover/conditions/utils'; import {COLUMNS} from 'app/views/discover/data'; diff --git a/tests/js/spec/views/discover/discover.spec.jsx b/tests/js/spec/views/discover/discover.spec.jsx index 8c6eb5faf4dc54..bf7d2e9f391cbd 100644 --- a/tests/js/spec/views/discover/discover.spec.jsx +++ b/tests/js/spec/views/discover/discover.spec.jsx @@ -1,12 +1,12 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import ConfigStore from 'app/stores/configStore'; -import Discover from 'app/views/discover/discover'; import GlobalSelectionStore from 'app/stores/globalSelectionStore'; +import Discover from 'app/views/discover/discover'; import createQueryBuilder from 'app/views/discover/queryBuilder'; describe('Discover', function () { diff --git a/tests/js/spec/views/discover/queryBuilder.spec.jsx b/tests/js/spec/views/discover/queryBuilder.spec.jsx index 84ad0a7fba90f9..5f0d6e86387784 100644 --- a/tests/js/spec/views/discover/queryBuilder.spec.jsx +++ b/tests/js/spec/views/discover/queryBuilder.spec.jsx @@ -1,6 +1,6 @@ -import createQueryBuilder from 'app/views/discover/queryBuilder'; import {openModal} from 'app/actionCreators/modal'; import ConfigStore from 'app/stores/configStore'; +import createQueryBuilder from 'app/views/discover/queryBuilder'; jest.mock('app/actionCreators/modal'); diff --git a/tests/js/spec/views/discover/result/index.spec.jsx b/tests/js/spec/views/discover/result/index.spec.jsx index e8e8ed4da6e71e..e64fd0524a1191 100644 --- a/tests/js/spec/views/discover/result/index.spec.jsx +++ b/tests/js/spec/views/discover/result/index.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import Result from 'app/views/discover/result'; import createQueryBuilder from 'app/views/discover/queryBuilder'; +import Result from 'app/views/discover/result'; describe('Result', function () { describe('New query', function () { diff --git a/tests/js/spec/views/discover/result/utils.spec.jsx b/tests/js/spec/views/discover/result/utils.spec.jsx index 3902061c0d704d..6c37ce7dfd5a55 100644 --- a/tests/js/spec/views/discover/result/utils.spec.jsx +++ b/tests/js/spec/views/discover/result/utils.spec.jsx @@ -1,12 +1,12 @@ import {mount} from 'sentry-test/enzyme'; import { + downloadAsCsv, getChartData, - getChartDataForWidget, getChartDataByDay, - getDisplayValue, + getChartDataForWidget, getDisplayText, - downloadAsCsv, + getDisplayValue, } from 'app/views/discover/result/utils'; describe('Utils', function () { diff --git a/tests/js/spec/views/discover/resultManager.spec.jsx b/tests/js/spec/views/discover/resultManager.spec.jsx index 4b91b605380fac..c3f422de969562 100644 --- a/tests/js/spec/views/discover/resultManager.spec.jsx +++ b/tests/js/spec/views/discover/resultManager.spec.jsx @@ -1,5 +1,5 @@ -import createResultManager from 'app/views/discover/resultManager'; import createQueryBuilder from 'app/views/discover/queryBuilder'; +import createResultManager from 'app/views/discover/resultManager'; describe('Result manager', function () { let resultManager, queryBuilder, discoverMock, discoverByDayMock; diff --git a/tests/js/spec/views/discover/utils.spec.jsx b/tests/js/spec/views/discover/utils.spec.jsx index 808d0df4269b7d..a9aa48a1df8a4f 100644 --- a/tests/js/spec/views/discover/utils.spec.jsx +++ b/tests/js/spec/views/discover/utils.spec.jsx @@ -1,13 +1,13 @@ +import {COLUMNS} from 'app/views/discover/data'; +import createQueryBuilder from 'app/views/discover/queryBuilder'; import { + generateQueryName, + getOrderbyFields, getQueryFromQueryString, getQueryStringFromQuery, - queryHasChanged, - getOrderbyFields, parseSavedQuery, - generateQueryName, + queryHasChanged, } from 'app/views/discover/utils'; -import createQueryBuilder from 'app/views/discover/queryBuilder'; -import {COLUMNS} from 'app/views/discover/data'; const queryString = '?aggregations=%5B%5B%22count()%22%2Cnull%2C%22count%22%5D%2C%5B%22uniq%22%2C%22os_build%22%2C%22uniq_os_build%22%5D%5D&conditions=%5B%5D&end=%222018-07-10T01%3A18%3A04%22&fields=%5B%22id%22%2C%22timestamp%22%5D&limit=1000&orderby=%22-timestamp%22&projects=%5B8%5D&start=%222018-06-26T01%3A18%3A04%22'; diff --git a/tests/js/spec/views/events/events.spec.jsx b/tests/js/spec/views/events/events.spec.jsx index 756597e99944a4..526a042e49be13 100644 --- a/tests/js/spec/views/events/events.spec.jsx +++ b/tests/js/spec/views/events/events.spec.jsx @@ -1,15 +1,15 @@ -import {withRouter, browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory, withRouter} from 'react-router'; import {chart, doZoom} from 'sentry-test/charts'; +import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {mockRouterPush} from 'sentry-test/mockRouterPush'; -import {mountWithTheme} from 'sentry-test/enzyme'; +import ProjectsStore from 'app/stores/projectsStore'; import {getUtcToLocalDateObject} from 'app/utils/dates'; -import Events, {parseRowFromLinks} from 'app/views/events/events'; import EventsContainer from 'app/views/events'; -import ProjectsStore from 'app/stores/projectsStore'; +import Events, {parseRowFromLinks} from 'app/views/events/events'; jest.mock('app/utils/withLatestContext'); diff --git a/tests/js/spec/views/events/index.spec.jsx b/tests/js/spec/views/events/index.spec.jsx index b1dfefec14f70d..71051c6f5eac25 100644 --- a/tests/js/spec/views/events/index.spec.jsx +++ b/tests/js/spec/views/events/index.spec.jsx @@ -1,13 +1,13 @@ import React from 'react'; +import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {mockRouterPush} from 'sentry-test/mockRouterPush'; -import {mountWithTheme} from 'sentry-test/enzyme'; import {setActiveOrganization} from 'app/actionCreators/organizations'; import GlobalSelectionStore from 'app/stores/globalSelectionStore'; -import EventsContainer from 'app/views/events'; import ProjectsStore from 'app/stores/projectsStore'; +import EventsContainer from 'app/views/events'; describe('EventsContainer', function () { let wrapper; diff --git a/tests/js/spec/views/events/searchBar.spec.jsx b/tests/js/spec/views/events/searchBar.spec.jsx index 40aa84ccc10b95..13d6a7f3070da4 100644 --- a/tests/js/spec/views/events/searchBar.spec.jsx +++ b/tests/js/spec/views/events/searchBar.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import SearchBar from 'app/views/events/searchBar'; import TagStore from 'app/stores/tagStore'; +import SearchBar from 'app/views/events/searchBar'; const focusInput = el => el.find('input[name="query"]').simulate('focus'); const selectFirstAutocompleteItem = async el => { diff --git a/tests/js/spec/views/eventsV2/eventDetails.spec.jsx b/tests/js/spec/views/eventsV2/eventDetails.spec.jsx index e1a25ff58e8288..40ff4389726bde 100644 --- a/tests/js/spec/views/eventsV2/eventDetails.spec.jsx +++ b/tests/js/spec/views/eventsV2/eventDetails.spec.jsx @@ -3,9 +3,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import EventDetails from 'app/views/eventsV2/eventDetails'; -import {ALL_VIEWS, DEFAULT_EVENT_VIEW} from 'app/views/eventsV2/data'; import EventView from 'app/utils/discover/eventView'; +import {ALL_VIEWS, DEFAULT_EVENT_VIEW} from 'app/views/eventsV2/data'; +import EventDetails from 'app/views/eventsV2/eventDetails'; describe('EventsV2 > EventDetails', function () { const allEventsView = EventView.fromSavedQuery(DEFAULT_EVENT_VIEW); diff --git a/tests/js/spec/views/eventsV2/results.spec.jsx b/tests/js/spec/views/eventsV2/results.spec.jsx index 925223966aafed..cf613c949a5030 100644 --- a/tests/js/spec/views/eventsV2/results.spec.jsx +++ b/tests/js/spec/views/eventsV2/results.spec.jsx @@ -1,8 +1,8 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import ProjectsStore from 'app/stores/projectsStore'; import Results from 'app/views/eventsV2/results'; diff --git a/tests/js/spec/views/eventsV2/savedQuery/index.spec.jsx b/tests/js/spec/views/eventsV2/savedQuery/index.spec.jsx index 381f34c268fbb1..eb62accf7be44b 100644 --- a/tests/js/spec/views/eventsV2/savedQuery/index.spec.jsx +++ b/tests/js/spec/views/eventsV2/savedQuery/index.spec.jsx @@ -2,11 +2,11 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import SavedQueryButtonGroup from 'app/views/eventsV2/savedQuery'; -import {ALL_VIEWS} from 'app/views/eventsV2/data'; import EventView from 'app/utils/discover/eventView'; +import {ALL_VIEWS} from 'app/views/eventsV2/data'; +import SavedQueryButtonGroup from 'app/views/eventsV2/savedQuery'; import * as utils from 'app/views/eventsV2/savedQuery/utils'; -import {setBannerHidden, isBannerHidden} from 'app/views/eventsV2/utils'; +import {isBannerHidden, setBannerHidden} from 'app/views/eventsV2/utils'; const SELECTOR_BUTTON_SAVE_AS = 'ButtonSaveAs'; const SELECTOR_BUTTON_SAVED = '[data-test-id="discover2-savedquery-button-saved"]'; diff --git a/tests/js/spec/views/eventsV2/savedQuery/utils.spec.jsx b/tests/js/spec/views/eventsV2/savedQuery/utils.spec.jsx index 0c96557c050503..599f0e3c911741 100644 --- a/tests/js/spec/views/eventsV2/savedQuery/utils.spec.jsx +++ b/tests/js/spec/views/eventsV2/savedQuery/utils.spec.jsx @@ -1,10 +1,10 @@ -import {ALL_VIEWS} from 'app/views/eventsV2/data'; import EventView from 'app/utils/discover/eventView'; +import {ALL_VIEWS} from 'app/views/eventsV2/data'; import { handleCreateQuery, + handleDeleteQuery, handleUpdateQuery, handleUpdateQueryName, - handleDeleteQuery, } from 'app/views/eventsV2/savedQuery/utils'; describe('SavedQueries API helpers', () => { diff --git a/tests/js/spec/views/eventsV2/table/cellAction.spec.jsx b/tests/js/spec/views/eventsV2/table/cellAction.spec.jsx index c7be682ba7c9fc..bf6d08011559be 100644 --- a/tests/js/spec/views/eventsV2/table/cellAction.spec.jsx +++ b/tests/js/spec/views/eventsV2/table/cellAction.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import CellAction, {Actions, updateQuery} from 'app/views/eventsV2/table/cellAction'; import EventView from 'app/utils/discover/eventView'; import {QueryResults} from 'app/utils/tokenizeSearch'; +import CellAction, {Actions, updateQuery} from 'app/views/eventsV2/table/cellAction'; const defaultData = { transaction: 'best-transaction', diff --git a/tests/js/spec/views/eventsV2/table/columnEditModal.spec.js b/tests/js/spec/views/eventsV2/table/columnEditModal.spec.js index 1fec1c135b3eb2..5db7bd88c613bc 100644 --- a/tests/js/spec/views/eventsV2/table/columnEditModal.spec.js +++ b/tests/js/spec/views/eventsV2/table/columnEditModal.spec.js @@ -2,7 +2,7 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import {selectByLabel, openMenu} from 'sentry-test/select-new'; +import {openMenu, selectByLabel} from 'sentry-test/select-new'; import ColumnEditModal from 'app/views/eventsV2/table/columnEditModal'; diff --git a/tests/js/spec/views/eventsV2/table/tableView.spec.jsx b/tests/js/spec/views/eventsV2/table/tableView.spec.jsx index b2fc4f46730968..8f5595fc3c74b5 100644 --- a/tests/js/spec/views/eventsV2/table/tableView.spec.jsx +++ b/tests/js/spec/views/eventsV2/table/tableView.spec.jsx @@ -1,8 +1,8 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import EventView from 'app/utils/discover/eventView'; import TableView from 'app/views/eventsV2/table/tableView'; diff --git a/tests/js/spec/views/eventsV2/tags.spec.jsx b/tests/js/spec/views/eventsV2/tags.spec.jsx index a7166dd4bd6b91..d2cdb40c6d7666 100644 --- a/tests/js/spec/views/eventsV2/tags.spec.jsx +++ b/tests/js/spec/views/eventsV2/tags.spec.jsx @@ -4,8 +4,8 @@ import {mount} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {Client} from 'app/api'; -import {Tags} from 'app/views/eventsV2/tags'; import EventView from 'app/utils/discover/eventView'; +import {Tags} from 'app/views/eventsV2/tags'; describe('Tags', function () { function generateUrl(key, value) { diff --git a/tests/js/spec/views/eventsV2/utils.spec.jsx b/tests/js/spec/views/eventsV2/utils.spec.jsx index 0758fb680d0ebc..c5568a9d78b13b 100644 --- a/tests/js/spec/views/eventsV2/utils.spec.jsx +++ b/tests/js/spec/views/eventsV2/utils.spec.jsx @@ -1,13 +1,13 @@ import {browserHistory} from 'react-router'; +import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable'; import EventView from 'app/utils/discover/eventView'; import { decodeColumnOrder, - pushEventViewToLocation, - getExpandedResults, downloadAsCsv, + getExpandedResults, + pushEventViewToLocation, } from 'app/views/eventsV2/utils'; -import {COL_WIDTH_UNDEFINED} from 'app/components/gridEditable'; describe('decodeColumnOrder', function () { it('can decode 0 elements', function () { diff --git a/tests/js/spec/views/inviteMember/inviteMember.spec.jsx b/tests/js/spec/views/inviteMember/inviteMember.spec.jsx index 4fca42930e4f4c..171063af2e8cbd 100644 --- a/tests/js/spec/views/inviteMember/inviteMember.spec.jsx +++ b/tests/js/spec/views/inviteMember/inviteMember.spec.jsx @@ -1,10 +1,10 @@ import React from 'react'; import cloneDeep from 'lodash/cloneDeep'; -import {shallow, mountWithTheme} from 'sentry-test/enzyme'; +import {mountWithTheme, shallow} from 'sentry-test/enzyme'; -import {InviteMember} from 'app/views/settings/organizationMembers/inviteMember'; import ConfigStore from 'app/stores/configStore'; +import {InviteMember} from 'app/views/settings/organizationMembers/inviteMember'; jest.mock('app/api'); jest.mock('jquery'); diff --git a/tests/js/spec/views/issueList/actions.spec.jsx b/tests/js/spec/views/issueList/actions.spec.jsx index 1893e12c700c0c..50a7de4c3684b1 100644 --- a/tests/js/spec/views/issueList/actions.spec.jsx +++ b/tests/js/spec/views/issueList/actions.spec.jsx @@ -1,11 +1,11 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {selectByLabel} from 'sentry-test/select'; -import {IssueListActions} from 'app/views/issueList/actions'; import SelectedGroupStore from 'app/stores/selectedGroupStore'; +import {IssueListActions} from 'app/views/issueList/actions'; describe('IssueListActions', function () { let actions; diff --git a/tests/js/spec/views/issueList/noGroupsHandler/noUnresolvedIssues.spec.jsx b/tests/js/spec/views/issueList/noGroupsHandler/noUnresolvedIssues.spec.jsx index 7d44bee7771f7c..d469687cb1d37d 100644 --- a/tests/js/spec/views/issueList/noGroupsHandler/noUnresolvedIssues.spec.jsx +++ b/tests/js/spec/views/issueList/noGroupsHandler/noUnresolvedIssues.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import NoUnresolvedIssues from 'app/views/issueList/noGroupsHandler/noUnresolvedIssues'; import CongratsRobotsVideo from 'app/views/issueList/noGroupsHandler/congratsRobots'; +import NoUnresolvedIssues from 'app/views/issueList/noGroupsHandler/noUnresolvedIssues'; // Mocking this because of https://github.com/airbnb/enzyme/issues/2326 jest.mock('app/views/issueList/noGroupsHandler/congratsRobots', () => diff --git a/tests/js/spec/views/issueList/overview.polling.spec.jsx b/tests/js/spec/views/issueList/overview.polling.spec.jsx index 1abac70878f362..792b335f865348 100644 --- a/tests/js/spec/views/issueList/overview.polling.spec.jsx +++ b/tests/js/spec/views/issueList/overview.polling.spec.jsx @@ -1,11 +1,11 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import IssueList from 'app/views/issueList/overview'; import StreamGroup from 'app/components/stream/group'; import TagStore from 'app/stores/tagStore'; +import IssueList from 'app/views/issueList/overview'; // Mock <IssueListSidebar> (need <IssueListActions> to toggling real time polling) jest.mock('app/views/issueList/sidebar', () => jest.fn(() => null)); diff --git a/tests/js/spec/views/issueList/overview.spec.jsx b/tests/js/spec/views/issueList/overview.spec.jsx index ddf2fe13fd42eb..871da766e7428a 100644 --- a/tests/js/spec/views/issueList/overview.spec.jsx +++ b/tests/js/spec/views/issueList/overview.spec.jsx @@ -1,15 +1,15 @@ +import React from 'react'; import {browserHistory} from 'react-router'; import cloneDeep from 'lodash/cloneDeep'; -import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme, shallow} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import ErrorRobot from 'app/components/errorRobot'; -import GroupStore from 'app/stores/groupStore'; -import IssueListWithStores, {IssueListOverview} from 'app/views/issueList/overview'; import StreamGroup from 'app/components/stream/group'; +import GroupStore from 'app/stores/groupStore'; import TagStore from 'app/stores/tagStore'; +import IssueListWithStores, {IssueListOverview} from 'app/views/issueList/overview'; // Mock <IssueListSidebar> and <IssueListActions> jest.mock('app/views/issueList/sidebar', () => jest.fn(() => null)); diff --git a/tests/js/spec/views/issueList/searchBar.spec.jsx b/tests/js/spec/views/issueList/searchBar.spec.jsx index a7040f3bf144ca..c3004a754d08e2 100644 --- a/tests/js/spec/views/issueList/searchBar.spec.jsx +++ b/tests/js/spec/views/issueList/searchBar.spec.jsx @@ -1,10 +1,10 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import IssueListSearchBar from 'app/views/issueList/searchBar'; import TagStore from 'app/stores/tagStore'; +import IssueListSearchBar from 'app/views/issueList/searchBar'; describe('IssueListSearchBar', function () { let tagValuePromise; diff --git a/tests/js/spec/views/onboarding/onboarding.spec.jsx b/tests/js/spec/views/onboarding/onboarding.spec.jsx index b66788d501c547..c14cb95c853644 100644 --- a/tests/js/spec/views/onboarding/onboarding.spec.jsx +++ b/tests/js/spec/views/onboarding/onboarding.spec.jsx @@ -1,11 +1,11 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import Onboarding, {stepPropTypes} from 'app/views/onboarding/onboarding'; import ProjectsStore from 'app/stores/projectsStore'; +import Onboarding, {stepPropTypes} from 'app/views/onboarding/onboarding'; const MockStep = ({ name, diff --git a/tests/js/spec/views/onboarding/platform.spec.jsx b/tests/js/spec/views/onboarding/platform.spec.jsx index ebbe2835530ac3..5d71c9fce9d537 100644 --- a/tests/js/spec/views/onboarding/platform.spec.jsx +++ b/tests/js/spec/views/onboarding/platform.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {createProject} from 'app/actionCreators/projects'; -import OnboardingPlatform from 'app/views/onboarding/platform'; import TeamStore from 'app/stores/teamStore'; +import OnboardingPlatform from 'app/views/onboarding/platform'; jest.mock('app/actionCreators/projects'); diff --git a/tests/js/spec/views/onboarding/welcome.spec.jsx b/tests/js/spec/views/onboarding/welcome.spec.jsx index 1d979a3685fed5..2d054543666593 100644 --- a/tests/js/spec/views/onboarding/welcome.spec.jsx +++ b/tests/js/spec/views/onboarding/welcome.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import OnboardingWelcome from 'app/views/onboarding/welcome'; import ConfigStore from 'app/stores/configStore'; +import OnboardingWelcome from 'app/views/onboarding/welcome'; describe('OnboardingWelcome', function () { it('renders', function () { diff --git a/tests/js/spec/views/organizationContext.spec.jsx b/tests/js/spec/views/organizationContext.spec.jsx index fd62a1723d2ac8..d367b3b74521d3 100644 --- a/tests/js/spec/views/organizationContext.spec.jsx +++ b/tests/js/spec/views/organizationContext.spec.jsx @@ -5,10 +5,10 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import {openSudo} from 'app/actionCreators/modal'; import * as OrganizationActionCreator from 'app/actionCreators/organization'; import ConfigStore from 'app/stores/configStore'; -import {OrganizationContext} from 'app/views/organizationContext'; +import OrganizationStore from 'app/stores/organizationStore'; import ProjectsStore from 'app/stores/projectsStore'; import TeamStore from 'app/stores/teamStore'; -import OrganizationStore from 'app/stores/organizationStore'; +import {OrganizationContext} from 'app/views/organizationContext'; jest.mock('app/stores/configStore', () => ({ get: jest.fn(), diff --git a/tests/js/spec/views/organizationDetails/organizationsDetails.spec.jsx b/tests/js/spec/views/organizationDetails/organizationsDetails.spec.jsx index eaec05106307c4..cc60249d174c9a 100644 --- a/tests/js/spec/views/organizationDetails/organizationsDetails.spec.jsx +++ b/tests/js/spec/views/organizationDetails/organizationsDetails.spec.jsx @@ -2,11 +2,11 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; +import OrganizationStore from 'app/stores/organizationStore'; +import ProjectsStore from 'app/stores/projectsStore'; import OrganizationDetails, { LightWeightOrganizationDetails, } from 'app/views/organizationDetails'; -import OrganizationStore from 'app/stores/organizationStore'; -import ProjectsStore from 'app/stores/projectsStore'; let wrapper; diff --git a/tests/js/spec/views/organizationGroupDetails/actions.spec.jsx b/tests/js/spec/views/organizationGroupDetails/actions.spec.jsx index 0aaf6ac9ecf4b9..cd9dc715b6bc96 100644 --- a/tests/js/spec/views/organizationGroupDetails/actions.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/actions.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import GroupActions from 'app/views/organizationGroupDetails/actions'; import ConfigStore from 'app/stores/configStore'; +import GroupActions from 'app/views/organizationGroupDetails/actions'; describe('GroupActions', function () { beforeEach(function () { diff --git a/tests/js/spec/views/organizationGroupDetails/groupActivity.spec.jsx b/tests/js/spec/views/organizationGroupDetails/groupActivity.spec.jsx index 5586b2117d36e4..ea6a52cbf476f6 100644 --- a/tests/js/spec/views/organizationGroupDetails/groupActivity.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/groupActivity.spec.jsx @@ -1,13 +1,13 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import {GroupActivity} from 'app/views/organizationGroupDetails/groupActivity'; +import NoteInput from 'app/components/activity/note/input'; import ConfigStore from 'app/stores/configStore'; import GroupStore from 'app/stores/groupStore'; -import NoteInput from 'app/components/activity/note/input'; import ProjectsStore from 'app/stores/projectsStore'; +import {GroupActivity} from 'app/views/organizationGroupDetails/groupActivity'; describe('GroupActivity', function () { const project = TestStubs.Project(); diff --git a/tests/js/spec/views/organizationGroupDetails/groupDetails.spec.jsx b/tests/js/spec/views/organizationGroupDetails/groupDetails.spec.jsx index 5b6d039f25825e..17e4add9f73caf 100644 --- a/tests/js/spec/views/organizationGroupDetails/groupDetails.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/groupDetails.spec.jsx @@ -1,13 +1,13 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import GlobalSelectionStore from 'app/stores/globalSelectionStore'; -import GroupDetails from 'app/views/organizationGroupDetails'; -import ProjectsStore from 'app/stores/projectsStore'; import GroupStore from 'app/stores/groupStore'; +import ProjectsStore from 'app/stores/projectsStore'; +import GroupDetails from 'app/views/organizationGroupDetails'; jest.unmock('app/utils/recreateRoute'); diff --git a/tests/js/spec/views/organizationGroupDetails/groupMergedView.spec.jsx b/tests/js/spec/views/organizationGroupDetails/groupMergedView.spec.jsx index 1bda797c550915..b7f60349b43fce 100644 --- a/tests/js/spec/views/organizationGroupDetails/groupMergedView.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/groupMergedView.spec.jsx @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {GroupMergedView} from 'app/views/organizationGroupDetails/groupMerged'; import {Client} from 'app/api'; +import {GroupMergedView} from 'app/views/organizationGroupDetails/groupMerged'; jest.mock('app/api'); diff --git a/tests/js/spec/views/organizationGroupDetails/groupSimilarIssues.spec.jsx b/tests/js/spec/views/organizationGroupDetails/groupSimilarIssues.spec.jsx index 681d1416a42509..58043534bd2d6a 100644 --- a/tests/js/spec/views/organizationGroupDetails/groupSimilarIssues.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/groupSimilarIssues.spec.jsx @@ -1,5 +1,5 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/organizationGroupDetails/groupTagValues.spec.jsx b/tests/js/spec/views/organizationGroupDetails/groupTagValues.spec.jsx index fe7dc8719839dd..8b0576df5f9084 100644 --- a/tests/js/spec/views/organizationGroupDetails/groupTagValues.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/groupTagValues.spec.jsx @@ -1,10 +1,10 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import GroupTagValues from 'app/views/organizationGroupDetails/groupTagValues'; import DetailedError from 'app/components/errors/detailedError'; +import GroupTagValues from 'app/views/organizationGroupDetails/groupTagValues'; describe('GroupTagValues', () => { const {routerContext, router} = initializeOrg({}); diff --git a/tests/js/spec/views/organizationGroupDetails/groupTags.spec.jsx b/tests/js/spec/views/organizationGroupDetails/groupTags.spec.jsx index eded2843c814d7..16bc2559fdf3d9 100644 --- a/tests/js/spec/views/organizationGroupDetails/groupTags.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/groupTags.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import GroupTags from 'app/views/organizationGroupDetails/groupTags'; diff --git a/tests/js/spec/views/organizationGroupDetails/organizationGroupEvents.spec.jsx b/tests/js/spec/views/organizationGroupDetails/organizationGroupEvents.spec.jsx index dca27a2d5a44fd..5efb6e29722bf7 100644 --- a/tests/js/spec/views/organizationGroupDetails/organizationGroupEvents.spec.jsx +++ b/tests/js/spec/views/organizationGroupDetails/organizationGroupEvents.spec.jsx @@ -1,8 +1,8 @@ import React from 'react'; -import PropTypes from 'prop-types'; import {browserHistory} from 'react-router'; +import PropTypes from 'prop-types'; -import {shallow, mountWithTheme} from 'sentry-test/enzyme'; +import {mountWithTheme, shallow} from 'sentry-test/enzyme'; import {GroupEvents} from 'app/views/organizationGroupDetails/groupEvents'; diff --git a/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js b/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js index 7fdbbca4812cf5..26d4e7cb637226 100644 --- a/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js +++ b/tests/js/spec/views/organizationIntegrations/pluginDetailedView.spec.js @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; +import * as modal from 'app/actionCreators/modal'; import {Client} from 'app/api'; import PluginDetailedView from 'app/views/organizationIntegrations/pluginDetailedView'; -import * as modal from 'app/actionCreators/modal'; const mockResponse = mocks => { mocks.forEach(([url, body]) => diff --git a/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx b/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx index f0bb65f187cfd4..54b28f65b9ef61 100644 --- a/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx +++ b/tests/js/spec/views/organizationIntegrations/sentryAppDetailedView.spec.jsx @@ -1,8 +1,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {mockRouterPush} from 'sentry-test/mockRouterPush'; import {initializeOrg} from 'sentry-test/initializeOrg'; +import {mockRouterPush} from 'sentry-test/mockRouterPush'; import {Client} from 'app/api'; import SentryAppDetailedView from 'app/views/organizationIntegrations/sentryAppDetailedView'; diff --git a/tests/js/spec/views/organizationRoot.spec.jsx b/tests/js/spec/views/organizationRoot.spec.jsx index 93d0a7e1c7ba67..2434147b9ce2a4 100644 --- a/tests/js/spec/views/organizationRoot.spec.jsx +++ b/tests/js/spec/views/organizationRoot.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; -import {OrganizationRoot} from 'app/views/organizationRoot'; -import {setActiveProject} from 'app/actionCreators/projects'; import {setLastRoute} from 'app/actionCreators/navigation'; +import {setActiveProject} from 'app/actionCreators/projects'; +import {OrganizationRoot} from 'app/views/organizationRoot'; jest.mock('app/actionCreators/projects', () => ({ setActiveProject: jest.fn(), diff --git a/tests/js/spec/views/ownershipInput.spec.jsx b/tests/js/spec/views/ownershipInput.spec.jsx index 9ec6c46342ee3a..28b3185a726dd7 100644 --- a/tests/js/spec/views/ownershipInput.spec.jsx +++ b/tests/js/spec/views/ownershipInput.spec.jsx @@ -1,10 +1,10 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {openMenu, findOption} from 'sentry-test/select'; +import {findOption, openMenu} from 'sentry-test/select'; -import OwnerInput from 'app/views/settings/project/projectOwnership/ownerInput'; import MemberListStore from 'app/stores/memberListStore'; +import OwnerInput from 'app/views/settings/project/projectOwnership/ownerInput'; jest.mock('jquery'); describe('Project Ownership Input', function () { diff --git a/tests/js/spec/views/performance/landing.spec.jsx b/tests/js/spec/views/performance/landing.spec.jsx index 8790ac27e13b33..5a73412acc775e 100644 --- a/tests/js/spec/views/performance/landing.spec.jsx +++ b/tests/js/spec/views/performance/landing.spec.jsx @@ -1,12 +1,12 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; +import * as globalSelection from 'app/actionCreators/globalSelection'; import ProjectsStore from 'app/stores/projectsStore'; import PerformanceLanding, {FilterViews} from 'app/views/performance/landing'; -import * as globalSelection from 'app/actionCreators/globalSelection'; import {DEFAULT_MAX_DURATION} from 'app/views/performance/trends/utils'; const FEATURES = ['transaction-event', 'performance-view']; diff --git a/tests/js/spec/views/performance/transactionSummary.spec.jsx b/tests/js/spec/views/performance/transactionSummary.spec.jsx index ea27c0a0c76046..984091fc4af65e 100644 --- a/tests/js/spec/views/performance/transactionSummary.spec.jsx +++ b/tests/js/spec/views/performance/transactionSummary.spec.jsx @@ -1,8 +1,8 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import ProjectsStore from 'app/stores/projectsStore'; import TransactionSummary from 'app/views/performance/transactionSummary'; diff --git a/tests/js/spec/views/performance/transactionVitals.spec.jsx b/tests/js/spec/views/performance/transactionVitals.spec.jsx index 3b1246921be6aa..da4aa30555eefb 100644 --- a/tests/js/spec/views/performance/transactionVitals.spec.jsx +++ b/tests/js/spec/views/performance/transactionVitals.spec.jsx @@ -1,8 +1,8 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import ProjectsStore from 'app/stores/projectsStore'; import TransactionVitals from 'app/views/performance/transactionVitals'; diff --git a/tests/js/spec/views/performance/trends.spec.jsx b/tests/js/spec/views/performance/trends.spec.jsx index bf8f7d00f00e4d..59b6ed7da9eaf9 100644 --- a/tests/js/spec/views/performance/trends.spec.jsx +++ b/tests/js/spec/views/performance/trends.spec.jsx @@ -1,15 +1,15 @@ import React from 'react'; import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import PerformanceLanding from 'app/views/performance/landing'; import ProjectsStore from 'app/stores/projectsStore'; +import PerformanceLanding from 'app/views/performance/landing'; import { + CONFIDENCE_LEVELS, DEFAULT_MAX_DURATION, TRENDS_FUNCTIONS, - CONFIDENCE_LEVELS, } from 'app/views/performance/trends/utils'; const trendsViewQuery = { diff --git a/tests/js/spec/views/projectInstall/createProject.spec.jsx b/tests/js/spec/views/projectInstall/createProject.spec.jsx index 317234ffa64511..2abc709ea44e93 100644 --- a/tests/js/spec/views/projectInstall/createProject.spec.jsx +++ b/tests/js/spec/views/projectInstall/createProject.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {MOCK_RESP_VERBOSE} from 'sentry-test/fixtures/ruleConditions'; -import {CreateProject} from 'app/views/projectInstall/createProject'; import {openCreateTeamModal} from 'app/actionCreators/modal'; +import {CreateProject} from 'app/views/projectInstall/createProject'; jest.mock('app/actionCreators/modal'); diff --git a/tests/js/spec/views/projectInstall/issueAlertOptions.spec.jsx b/tests/js/spec/views/projectInstall/issueAlertOptions.spec.jsx index 19246c485948ca..87949cf8dbfd90 100644 --- a/tests/js/spec/views/projectInstall/issueAlertOptions.spec.jsx +++ b/tests/js/spec/views/projectInstall/issueAlertOptions.spec.jsx @@ -1,13 +1,13 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import { - MOCK_RESP_VERBOSE, MOCK_RESP_INCONSISTENT_INTERVALS, MOCK_RESP_INCONSISTENT_PLACEHOLDERS, MOCK_RESP_ONLY_IGNORED_CONDITIONS_INVALID, + MOCK_RESP_VERBOSE, } from 'sentry-test/fixtures/ruleConditions'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import IssueAlertOptions from 'app/views/projectInstall/issueAlertOptions'; diff --git a/tests/js/spec/views/projectInstall/newProject.spec.jsx b/tests/js/spec/views/projectInstall/newProject.spec.jsx index fb04b124ab37da..ff3aef1fefffb6 100644 --- a/tests/js/spec/views/projectInstall/newProject.spec.jsx +++ b/tests/js/spec/views/projectInstall/newProject.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {Client} from 'app/api'; import NewProject from 'app/views/projectInstall/newProject'; diff --git a/tests/js/spec/views/projectInstall/platform.spec.jsx b/tests/js/spec/views/projectInstall/platform.spec.jsx index ed02a03d403849..45516c0bb0df1e 100644 --- a/tests/js/spec/views/projectInstall/platform.spec.jsx +++ b/tests/js/spec/views/projectInstall/platform.spec.jsx @@ -1,5 +1,5 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/projectPlugins/index.spec.jsx b/tests/js/spec/views/projectPlugins/index.spec.jsx index c6b213a9024bea..9584197b4ca8ca 100644 --- a/tests/js/spec/views/projectPlugins/index.spec.jsx +++ b/tests/js/spec/views/projectPlugins/index.spec.jsx @@ -2,8 +2,8 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; +import {disablePlugin, enablePlugin, fetchPlugins} from 'app/actionCreators/plugins'; import ProjectPlugins from 'app/views/settings/projectPlugins'; -import {fetchPlugins, enablePlugin, disablePlugin} from 'app/actionCreators/plugins'; jest.mock('app/actionCreators/plugins', () => ({ fetchPlugins: jest.fn().mockResolvedValue([]), diff --git a/tests/js/spec/views/projectTeams.spec.jsx b/tests/js/spec/views/projectTeams.spec.jsx index f152b6ce5a4fb4..58e9ca31e3e9ea 100644 --- a/tests/js/spec/views/projectTeams.spec.jsx +++ b/tests/js/spec/views/projectTeams.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; +import * as modals from 'app/actionCreators/modal'; import App from 'app/views/app'; import ProjectTeams from 'app/views/settings/project/projectTeams'; -import * as modals from 'app/actionCreators/modal'; jest.unmock('app/actionCreators/modal'); diff --git a/tests/js/spec/views/projectsDashboard/index.spec.jsx b/tests/js/spec/views/projectsDashboard/index.spec.jsx index ea95cfab101234..19d35a9d5ab7c4 100644 --- a/tests/js/spec/views/projectsDashboard/index.spec.jsx +++ b/tests/js/spec/views/projectsDashboard/index.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {Dashboard} from 'app/views/projectsDashboard'; -import ProjectsStatsStore from 'app/stores/projectsStatsStore'; import * as projectsActions from 'app/actionCreators/projects'; +import ProjectsStatsStore from 'app/stores/projectsStatsStore'; +import {Dashboard} from 'app/views/projectsDashboard'; jest.unmock('lodash/debounce'); jest.mock('lodash/debounce', () => { diff --git a/tests/js/spec/views/ruleBuilder.spec.jsx b/tests/js/spec/views/ruleBuilder.spec.jsx index 664b4f83d3a602..f7b04944516e4d 100644 --- a/tests/js/spec/views/ruleBuilder.spec.jsx +++ b/tests/js/spec/views/ruleBuilder.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import MemberListStore from 'app/stores/memberListStore'; -import TeamStore from 'app/stores/teamStore'; import ProjectsStore from 'app/stores/projectsStore'; +import TeamStore from 'app/stores/teamStore'; import RuleBuilder from 'app/views/settings/project/projectOwnership/ruleBuilder'; jest.mock('jquery'); diff --git a/tests/js/spec/views/settings/account/apiApplications.spec.jsx b/tests/js/spec/views/settings/account/apiApplications.spec.jsx index c9ec526462db38..c9ec301d0e25c8 100644 --- a/tests/js/spec/views/settings/account/apiApplications.spec.jsx +++ b/tests/js/spec/views/settings/account/apiApplications.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import ApiApplications from 'app/views/settings/account/apiApplications'; diff --git a/tests/js/spec/views/settings/components/dataScrubbing/addModal.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/addModal.spec.tsx index 65d831f330e2c6..b7ba334e18ae88 100644 --- a/tests/js/spec/views/settings/components/dataScrubbing/addModal.spec.tsx +++ b/tests/js/spec/views/settings/components/dataScrubbing/addModal.spec.tsx @@ -3,10 +3,10 @@ import sortBy from 'lodash/sortBy'; import {mountWithTheme} from 'sentry-test/enzyme'; -import GlobalModal from 'app/components/globalModal'; import {openModal} from 'app/actionCreators/modal'; -import Add from 'app/views/settings/components/dataScrubbing/modals/add'; +import GlobalModal from 'app/components/globalModal'; import convertRelayPiiConfig from 'app/views/settings/components/dataScrubbing/convertRelayPiiConfig'; +import Add from 'app/views/settings/components/dataScrubbing/modals/add'; import {MethodType, RuleType} from 'app/views/settings/components/dataScrubbing/types'; import { getMethodLabel, diff --git a/tests/js/spec/views/settings/components/dataScrubbing/dataScrubbing.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/dataScrubbing.spec.tsx index 2a4d0ffbba03ad..0436a34369e79e 100644 --- a/tests/js/spec/views/settings/components/dataScrubbing/dataScrubbing.spec.tsx +++ b/tests/js/spec/views/settings/components/dataScrubbing/dataScrubbing.spec.tsx @@ -2,10 +2,10 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import DataScrubbing from 'app/views/settings/components/dataScrubbing'; -import {ProjectId} from 'app/views/settings/components/dataScrubbing/types'; import {addSuccessMessage} from 'app/actionCreators/indicator'; import {openModal} from 'app/actionCreators/modal'; +import DataScrubbing from 'app/views/settings/components/dataScrubbing'; +import {ProjectId} from 'app/views/settings/components/dataScrubbing/types'; jest.mock('app/actionCreators/modal'); diff --git a/tests/js/spec/views/settings/components/dataScrubbing/editModal.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/editModal.spec.tsx index 35c05e09131591..0acb9f6831a51f 100644 --- a/tests/js/spec/views/settings/components/dataScrubbing/editModal.spec.tsx +++ b/tests/js/spec/views/settings/components/dataScrubbing/editModal.spec.tsx @@ -3,17 +3,17 @@ import sortBy from 'lodash/sortBy'; import {mountWithTheme} from 'sentry-test/enzyme'; -import GlobalModal from 'app/components/globalModal'; import {openModal} from 'app/actionCreators/modal'; -import Edit from 'app/views/settings/components/dataScrubbing/modals/edit'; +import GlobalModal from 'app/components/globalModal'; import convertRelayPiiConfig from 'app/views/settings/components/dataScrubbing/convertRelayPiiConfig'; +import Edit from 'app/views/settings/components/dataScrubbing/modals/edit'; +import submitRules from 'app/views/settings/components/dataScrubbing/submitRules'; import {MethodType, RuleType} from 'app/views/settings/components/dataScrubbing/types'; import { getMethodLabel, getRuleLabel, valueSuggestions, } from 'app/views/settings/components/dataScrubbing/utils'; -import submitRules from 'app/views/settings/components/dataScrubbing/submitRules'; // @ts-expect-error const relayPiiConfig = TestStubs.DataScrubbingRelayPiiConfig(); diff --git a/tests/js/spec/views/settings/components/dataScrubbing/eventIdField.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/eventIdField.spec.tsx index 70f97c0a3f7d09..17e606a82f5234 100644 --- a/tests/js/spec/views/settings/components/dataScrubbing/eventIdField.spec.tsx +++ b/tests/js/spec/views/settings/components/dataScrubbing/eventIdField.spec.tsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import EventIdField from 'app/views/settings/components/dataScrubbing/modals/form/eventIdField'; -import {EventIdStatus, EventId} from 'app/views/settings/components/dataScrubbing/types'; import theme from 'app/utils/theme'; +import EventIdField from 'app/views/settings/components/dataScrubbing/modals/form/eventIdField'; +import {EventId, EventIdStatus} from 'app/views/settings/components/dataScrubbing/types'; const handleUpdateEventId = jest.fn(); const eventIdValue = '887ab369df634e74aea708bcafe1a175'; diff --git a/tests/js/spec/views/settings/components/dataScrubbing/rules.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/rules.spec.tsx index b5616faccab6ef..9518ef4d7933c4 100644 --- a/tests/js/spec/views/settings/components/dataScrubbing/rules.spec.tsx +++ b/tests/js/spec/views/settings/components/dataScrubbing/rules.spec.tsx @@ -2,8 +2,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import Rules from 'app/views/settings/components/dataScrubbing/rules'; import convertRelayPiiConfig from 'app/views/settings/components/dataScrubbing/convertRelayPiiConfig'; +import Rules from 'app/views/settings/components/dataScrubbing/rules'; // @ts-expect-error const relayPiiConfig = TestStubs.DataScrubbingRelayPiiConfig(); diff --git a/tests/js/spec/views/settings/components/settingsBreadcrumb/breadcrumbTitle.spec.jsx b/tests/js/spec/views/settings/components/settingsBreadcrumb/breadcrumbTitle.spec.jsx index f63bf8a9cbd8e9..4176448d97fde8 100644 --- a/tests/js/spec/views/settings/components/settingsBreadcrumb/breadcrumbTitle.spec.jsx +++ b/tests/js/spec/views/settings/components/settingsBreadcrumb/breadcrumbTitle.spec.jsx @@ -2,10 +2,10 @@ import React from 'react'; import {mount} from 'sentry-test/enzyme'; +import SettingsBreadcrumbStore from 'app/stores/settingsBreadcrumbStore'; +import SettingsBreadcrumb from 'app/views/settings/components/settingsBreadcrumb'; import BreadcrumbTitle from 'app/views/settings/components/settingsBreadcrumb/breadcrumbTitle'; import Crumb from 'app/views/settings/components/settingsBreadcrumb/crumb'; -import SettingsBreadcrumb from 'app/views/settings/components/settingsBreadcrumb'; -import SettingsBreadcrumbStore from 'app/stores/settingsBreadcrumbStore'; describe('BreadcrumbTitle', function () { const routes = [ diff --git a/tests/js/spec/views/settings/components/settingsBreadcrumb/organizationCrumb.spec.jsx b/tests/js/spec/views/settings/components/settingsBreadcrumb/organizationCrumb.spec.jsx index 7117035a0f4f93..2174870282092c 100644 --- a/tests/js/spec/views/settings/components/settingsBreadcrumb/organizationCrumb.spec.jsx +++ b/tests/js/spec/views/settings/components/settingsBreadcrumb/organizationCrumb.spec.jsx @@ -1,8 +1,8 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import OrganizationCrumb from 'app/views/settings/components/settingsBreadcrumb/organizationCrumb'; diff --git a/tests/js/spec/views/settings/components/settingsSearch/index.spec.jsx b/tests/js/spec/views/settings/components/settingsSearch/index.spec.jsx index a12d38ca3f3f7b..beb0c6422871dd 100644 --- a/tests/js/spec/views/settings/components/settingsSearch/index.spec.jsx +++ b/tests/js/spec/views/settings/components/settingsSearch/index.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {SettingsSearch} from 'app/views/settings/components/settingsSearch'; -import FormSearchStore from 'app/stores/formSearchStore'; import {navigateTo} from 'app/actionCreators/navigation'; +import FormSearchStore from 'app/stores/formSearchStore'; +import {SettingsSearch} from 'app/views/settings/components/settingsSearch'; jest.mock('jquery'); jest.mock('app/actionCreators/formSearch'); diff --git a/tests/js/spec/views/settings/incidentRules/constants.spec.jsx b/tests/js/spec/views/settings/incidentRules/constants.spec.jsx index 22b77f8e026e1a..149724765308b2 100644 --- a/tests/js/spec/views/settings/incidentRules/constants.spec.jsx +++ b/tests/js/spec/views/settings/incidentRules/constants.spec.jsx @@ -1,6 +1,6 @@ -import {Dataset} from 'app/views/settings/incidentRules/types'; import EventView from 'app/utils/discover/eventView'; import {createRuleFromEventView} from 'app/views/settings/incidentRules/constants'; +import {Dataset} from 'app/views/settings/incidentRules/types'; describe('createRuleFromEventView()', () => { it('sets transaction dataset from event.type:transaction', () => { diff --git a/tests/js/spec/views/settings/incidentRules/details.spec.jsx b/tests/js/spec/views/settings/incidentRules/details.spec.jsx index b447d4ff4541d0..0db0a07d169d09 100644 --- a/tests/js/spec/views/settings/incidentRules/details.spec.jsx +++ b/tests/js/spec/views/settings/incidentRules/details.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import GlobalModal from 'app/components/globalModal'; import IncidentRulesDetails from 'app/views/settings/incidentRules/details'; diff --git a/tests/js/spec/views/settings/incidentRules/metricField.spec.jsx b/tests/js/spec/views/settings/incidentRules/metricField.spec.jsx index 298a4f51ba6514..aca049ef86f281 100644 --- a/tests/js/spec/views/settings/incidentRules/metricField.spec.jsx +++ b/tests/js/spec/views/settings/incidentRules/metricField.spec.jsx @@ -1,8 +1,8 @@ import React from 'react'; -import {openMenu, selectByLabel} from 'sentry-test/select-new'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; +import {openMenu, selectByLabel} from 'sentry-test/select-new'; import Form from 'app/views/settings/components/forms/form'; import MetricField from 'app/views/settings/incidentRules/metricField'; diff --git a/tests/js/spec/views/settings/incidentRules/ruleForm.spec.jsx b/tests/js/spec/views/settings/incidentRules/ruleForm.spec.jsx index 6c3d9715c71cc8..df5b06094774c9 100644 --- a/tests/js/spec/views/settings/incidentRules/ruleForm.spec.jsx +++ b/tests/js/spec/views/settings/incidentRules/ruleForm.spec.jsx @@ -4,8 +4,8 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {addErrorMessage} from 'app/actionCreators/indicator'; -import RuleFormContainer from 'app/views/settings/incidentRules/ruleForm'; import FormModel from 'app/views/settings/components/forms/model'; +import RuleFormContainer from 'app/views/settings/incidentRules/ruleForm'; jest.mock('app/actionCreators/indicator'); diff --git a/tests/js/spec/views/settings/incidentRules/triggersChart.spec.jsx b/tests/js/spec/views/settings/incidentRules/triggersChart.spec.jsx index df68076e79be00..767cc537325ac8 100644 --- a/tests/js/spec/views/settings/incidentRules/triggersChart.spec.jsx +++ b/tests/js/spec/views/settings/incidentRules/triggersChart.spec.jsx @@ -4,8 +4,8 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; import {Client} from 'app/api'; -import TriggersChart from 'app/views/settings/incidentRules/triggers/chart'; import LineChart from 'app/components/charts/lineChart'; +import TriggersChart from 'app/views/settings/incidentRules/triggers/chart'; jest.mock('app/components/charts/lineChart'); diff --git a/tests/js/spec/views/settings/organizationApiKeyDetailsView.spec.jsx b/tests/js/spec/views/settings/organizationApiKeyDetailsView.spec.jsx index c7ccd973176edd..76d4e0eecfcae9 100644 --- a/tests/js/spec/views/settings/organizationApiKeyDetailsView.spec.jsx +++ b/tests/js/spec/views/settings/organizationApiKeyDetailsView.spec.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/settings/organizationDeveloperSettings/index.spec.jsx b/tests/js/spec/views/settings/organizationDeveloperSettings/index.spec.jsx index ba197f1770323c..40261090f8507c 100644 --- a/tests/js/spec/views/settings/organizationDeveloperSettings/index.spec.jsx +++ b/tests/js/spec/views/settings/organizationDeveloperSettings/index.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {Client} from 'app/api'; -import OrganizationDeveloperSettings from 'app/views/settings/organizationDeveloperSettings/index'; import App from 'app/views/app'; +import OrganizationDeveloperSettings from 'app/views/settings/organizationDeveloperSettings/index'; describe('Organization Developer Settings', function () { const org = TestStubs.Organization(); diff --git a/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx b/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx index 32215257b77533..ab1cf5a0347123 100644 --- a/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx +++ b/tests/js/spec/views/settings/organizationDeveloperSettings/permissionSelection.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {selectByValue, openMenu} from 'sentry-test/select'; +import {openMenu, selectByValue} from 'sentry-test/select'; import FormModel from 'app/views/settings/components/forms/model'; import PermissionSelection from 'app/views/settings/organizationDeveloperSettings/permissionSelection'; diff --git a/tests/js/spec/views/settings/organizationDeveloperSettings/sentryApplicationDetails.spec.jsx b/tests/js/spec/views/settings/organizationDeveloperSettings/sentryApplicationDetails.spec.jsx index b4991079ab04d3..ae2c19ddade5f6 100644 --- a/tests/js/spec/views/settings/organizationDeveloperSettings/sentryApplicationDetails.spec.jsx +++ b/tests/js/spec/views/settings/organizationDeveloperSettings/sentryApplicationDetails.spec.jsx @@ -4,9 +4,9 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import {selectByValue} from 'sentry-test/select'; import {Client} from 'app/api'; -import SentryApplicationDetails from 'app/views/settings/organizationDeveloperSettings/sentryApplicationDetails'; import JsonForm from 'app/views/settings/components/forms/jsonForm'; import PermissionsObserver from 'app/views/settings/organizationDeveloperSettings/permissionsObserver'; +import SentryApplicationDetails from 'app/views/settings/organizationDeveloperSettings/sentryApplicationDetails'; describe('Sentry Application Details', function () { let org; diff --git a/tests/js/spec/views/settings/organizationGeneralSettings/index.spec.jsx b/tests/js/spec/views/settings/organizationGeneralSettings/index.spec.jsx index df7676b48de4c2..7b6182a8cabd56 100644 --- a/tests/js/spec/views/settings/organizationGeneralSettings/index.spec.jsx +++ b/tests/js/spec/views/settings/organizationGeneralSettings/index.spec.jsx @@ -1,8 +1,8 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import OrganizationGeneralSettings from 'app/views/settings/organizationGeneralSettings'; diff --git a/tests/js/spec/views/settings/organizationMembers/organizationMembersList.spec.jsx b/tests/js/spec/views/settings/organizationMembers/organizationMembersList.spec.jsx index 57ac1465c1474b..e9bb8bc700ec2b 100644 --- a/tests/js/spec/views/settings/organizationMembers/organizationMembersList.spec.jsx +++ b/tests/js/spec/views/settings/organizationMembers/organizationMembersList.spec.jsx @@ -3,11 +3,11 @@ import {browserHistory} from 'react-router'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {addErrorMessage, addSuccessMessage} from 'app/actionCreators/indicator'; import {Client} from 'app/api'; import ConfigStore from 'app/stores/configStore'; -import OrganizationMembersList from 'app/views/settings/organizationMembers/organizationMembersList'; import OrganizationsStore from 'app/stores/organizationsStore'; -import {addSuccessMessage, addErrorMessage} from 'app/actionCreators/indicator'; +import OrganizationMembersList from 'app/views/settings/organizationMembers/organizationMembersList'; jest.mock('app/api'); jest.mock('app/actionCreators/indicator'); diff --git a/tests/js/spec/views/settings/organizationMembers/organizationRequestsView.spec.jsx b/tests/js/spec/views/settings/organizationMembers/organizationRequestsView.spec.jsx index d43fc63511b882..0a4faf507889ac 100644 --- a/tests/js/spec/views/settings/organizationMembers/organizationRequestsView.spec.jsx +++ b/tests/js/spec/views/settings/organizationMembers/organizationRequestsView.spec.jsx @@ -4,8 +4,8 @@ import {mountWithTheme} from 'sentry-test/enzyme'; import {selectByValue} from 'sentry-test/select'; import {trackAnalyticsEvent} from 'app/utils/analytics'; -import OrganizationRequestsView from 'app/views/settings/organizationMembers/organizationRequestsView'; import OrganizationMembersWrapper from 'app/views/settings/organizationMembers/organizationMembersWrapper'; +import OrganizationRequestsView from 'app/views/settings/organizationMembers/organizationRequestsView'; jest.mock('app/utils/analytics', () => ({ trackAnalyticsEvent: jest.fn(), diff --git a/tests/js/spec/views/settings/organizationPerformance.spec.jsx b/tests/js/spec/views/settings/organizationPerformance.spec.jsx index 14d20992bf2d2f..f1a3c807fe7edc 100644 --- a/tests/js/spec/views/settings/organizationPerformance.spec.jsx +++ b/tests/js/spec/views/settings/organizationPerformance.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {Client} from 'app/api'; import OrganizationStore from 'app/stores/organizationStore'; diff --git a/tests/js/spec/views/settings/organizationRepositoriesContainer.spec.jsx b/tests/js/spec/views/settings/organizationRepositoriesContainer.spec.jsx index 7b177382a2eac5..90f95018a0ec58 100644 --- a/tests/js/spec/views/settings/organizationRepositoriesContainer.spec.jsx +++ b/tests/js/spec/views/settings/organizationRepositoriesContainer.spec.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/settings/organizationSecurityAndPrivacy.spec.jsx b/tests/js/spec/views/settings/organizationSecurityAndPrivacy.spec.jsx index 4a29bd3e879d00..03fca3e2d9fbec 100644 --- a/tests/js/spec/views/settings/organizationSecurityAndPrivacy.spec.jsx +++ b/tests/js/spec/views/settings/organizationSecurityAndPrivacy.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import OrganizationSecurityAndPrivacy from 'app/views/settings/organizationSecurityAndPrivacy'; diff --git a/tests/js/spec/views/settings/organizationTeams.spec.jsx b/tests/js/spec/views/settings/organizationTeams.spec.jsx index a915451a70704e..e4388b6725d11f 100644 --- a/tests/js/spec/views/settings/organizationTeams.spec.jsx +++ b/tests/js/spec/views/settings/organizationTeams.spec.jsx @@ -1,11 +1,11 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {openCreateTeamModal} from 'app/actionCreators/modal'; -import OrganizationTeams from 'app/views/settings/organizationTeams/organizationTeams'; import recreateRoute from 'app/utils/recreateRoute'; +import OrganizationTeams from 'app/views/settings/organizationTeams/organizationTeams'; recreateRoute.mockReturnValue(''); diff --git a/tests/js/spec/views/settings/projectAlerts/create.spec.jsx b/tests/js/spec/views/settings/projectAlerts/create.spec.jsx index d480a0b09e5a26..a15f22facbb4c8 100644 --- a/tests/js/spec/views/settings/projectAlerts/create.spec.jsx +++ b/tests/js/spec/views/settings/projectAlerts/create.spec.jsx @@ -1,15 +1,15 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {selectByValue} from 'sentry-test/select-new'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {mockRouterPush} from 'sentry-test/mockRouterPush'; +import {selectByValue} from 'sentry-test/select-new'; import * as memberActionCreators from 'app/actionCreators/members'; -import ProjectAlertsCreate from 'app/views/settings/projectAlerts/create'; +import ProjectsStore from 'app/stores/projectsStore'; import AlertsContainer from 'app/views/alerts'; import AlertBuilderProjectProvider from 'app/views/alerts/builder/projectProvider'; -import ProjectsStore from 'app/stores/projectsStore'; +import ProjectAlertsCreate from 'app/views/settings/projectAlerts/create'; jest.unmock('app/utils/recreateRoute'); diff --git a/tests/js/spec/views/settings/projectAlerts/issueEditor.spec.jsx b/tests/js/spec/views/settings/projectAlerts/issueEditor.spec.jsx index 6a7a1f95eb914c..fd40f226a716ad 100644 --- a/tests/js/spec/views/settings/projectAlerts/issueEditor.spec.jsx +++ b/tests/js/spec/views/settings/projectAlerts/issueEditor.spec.jsx @@ -1,13 +1,13 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {selectByValue} from 'sentry-test/select-new'; +import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; import ProjectAlerts from 'app/views/settings/projectAlerts'; import IssueEditor from 'app/views/settings/projectAlerts/issueEditor'; -import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; jest.unmock('app/utils/recreateRoute'); jest.mock('app/actionCreators/onboardingTasks'); diff --git a/tests/js/spec/views/settings/projectAlerts/onboardingHovercard.spec.js b/tests/js/spec/views/settings/projectAlerts/onboardingHovercard.spec.js index e95017f6ab78fe..5c70bcbbc97297 100644 --- a/tests/js/spec/views/settings/projectAlerts/onboardingHovercard.spec.js +++ b/tests/js/spec/views/settings/projectAlerts/onboardingHovercard.spec.js @@ -1,10 +1,10 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; -import OnboardingHovercard from 'app/views/settings/projectAlerts/onboardingHovercard'; import {updateOnboardingTask} from 'app/actionCreators/onboardingTasks'; +import OnboardingHovercard from 'app/views/settings/projectAlerts/onboardingHovercard'; jest.mock('app/actionCreators/onboardingTasks'); diff --git a/tests/js/spec/views/settings/projectAlerts/settings.spec.jsx b/tests/js/spec/views/settings/projectAlerts/settings.spec.jsx index eb2d9e9d5527a9..c4497e2476aac0 100644 --- a/tests/js/spec/views/settings/projectAlerts/settings.spec.jsx +++ b/tests/js/spec/views/settings/projectAlerts/settings.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {Client} from 'app/api'; import Settings from 'app/views/settings/projectAlerts/settings'; diff --git a/tests/js/spec/views/settings/projectEnvironments.spec.jsx b/tests/js/spec/views/settings/projectEnvironments.spec.jsx index 029aba3fdffcdd..6bab37a0c7488f 100644 --- a/tests/js/spec/views/settings/projectEnvironments.spec.jsx +++ b/tests/js/spec/views/settings/projectEnvironments.spec.jsx @@ -2,9 +2,9 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import ProjectEnvironments from 'app/views/settings/project/projectEnvironments'; -import recreateRoute from 'app/utils/recreateRoute'; import {ALL_ENVIRONMENTS_KEY} from 'app/constants'; +import recreateRoute from 'app/utils/recreateRoute'; +import ProjectEnvironments from 'app/views/settings/project/projectEnvironments'; jest.mock('app/utils/recreateRoute'); recreateRoute.mockReturnValue('/org-slug/project-slug/settings/environments/'); diff --git a/tests/js/spec/views/settings/projectGeneralSettings.spec.jsx b/tests/js/spec/views/settings/projectGeneralSettings.spec.jsx index 1e9f60513b190f..79f04eb76530dc 100644 --- a/tests/js/spec/views/settings/projectGeneralSettings.spec.jsx +++ b/tests/js/spec/views/settings/projectGeneralSettings.spec.jsx @@ -1,12 +1,12 @@ -import {browserHistory} from 'react-router'; import React from 'react'; +import {browserHistory} from 'react-router'; import {mountWithTheme} from 'sentry-test/enzyme'; import {selectByValue} from 'sentry-test/select'; +import ProjectsStore from 'app/stores/projectsStore'; import ProjectContext from 'app/views/projects/projectContext'; import ProjectGeneralSettings from 'app/views/settings/projectGeneralSettings'; -import ProjectsStore from 'app/stores/projectsStore'; jest.mock('jquery'); diff --git a/tests/js/spec/views/settings/projectKeys/details/index.spec.jsx b/tests/js/spec/views/settings/projectKeys/details/index.spec.jsx index 405178d8d679a4..2a411062226985 100644 --- a/tests/js/spec/views/settings/projectKeys/details/index.spec.jsx +++ b/tests/js/spec/views/settings/projectKeys/details/index.spec.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/settings/projectKeys/list/index.spec.jsx b/tests/js/spec/views/settings/projectKeys/list/index.spec.jsx index 09eb34331e4159..0b87227d032482 100644 --- a/tests/js/spec/views/settings/projectKeys/list/index.spec.jsx +++ b/tests/js/spec/views/settings/projectKeys/list/index.spec.jsx @@ -1,5 +1,5 @@ -import PropTypes from 'prop-types'; import React from 'react'; +import PropTypes from 'prop-types'; import {mountWithTheme} from 'sentry-test/enzyme'; diff --git a/tests/js/spec/views/settings/projectReleaseTracking.spec.jsx b/tests/js/spec/views/settings/projectReleaseTracking.spec.jsx index 8f43f22779493b..37bcef4c037cf5 100644 --- a/tests/js/spec/views/settings/projectReleaseTracking.spec.jsx +++ b/tests/js/spec/views/settings/projectReleaseTracking.spec.jsx @@ -2,10 +2,10 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {fetchPlugins} from 'app/actionCreators/plugins'; import ProjectReleaseTrackingContainer, { ProjectReleaseTracking, } from 'app/views/settings/project/projectReleaseTracking'; -import {fetchPlugins} from 'app/actionCreators/plugins'; jest.mock('app/actionCreators/plugins', () => ({ fetchPlugins: jest.fn().mockResolvedValue([]), diff --git a/tests/js/spec/views/settings/projectSourceMaps.spec.jsx b/tests/js/spec/views/settings/projectSourceMaps.spec.jsx index 96e3d51fa2b1fd..e6836e758e8d25 100644 --- a/tests/js/spec/views/settings/projectSourceMaps.spec.jsx +++ b/tests/js/spec/views/settings/projectSourceMaps.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import ProjectSourceMaps from 'app/views/settings/projectSourceMaps/list'; import ProjectSourceMapsDetail from 'app/views/settings/projectSourceMaps/detail'; +import ProjectSourceMaps from 'app/views/settings/projectSourceMaps/list'; describe('ProjectSourceMaps', function () { const {organization, project, routerContext, router} = initializeOrg({}); diff --git a/tests/js/spec/views/settings/settingsIndex.spec.jsx b/tests/js/spec/views/settings/settingsIndex.spec.jsx index 4f865175ab68e1..2cf39aca86c919 100644 --- a/tests/js/spec/views/settings/settingsIndex.spec.jsx +++ b/tests/js/spec/views/settings/settingsIndex.spec.jsx @@ -3,8 +3,8 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; import * as OrgActions from 'app/actionCreators/organizations'; -import {SettingsIndex} from 'app/views/settings/settingsIndex'; import ConfigStore from 'app/stores/configStore'; +import {SettingsIndex} from 'app/views/settings/settingsIndex'; describe('SettingsIndex', function () { let wrapper; diff --git a/tests/js/spec/views/teamCreate.spec.jsx b/tests/js/spec/views/teamCreate.spec.jsx index 253ab794e63b6a..93f5aec23c6de6 100644 --- a/tests/js/spec/views/teamCreate.spec.jsx +++ b/tests/js/spec/views/teamCreate.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme, shallow} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import {TeamCreate} from 'app/views/teamCreate'; diff --git a/tests/js/spec/views/teamMembers.spec.jsx b/tests/js/spec/views/teamMembers.spec.jsx index c66f03adfd5a63..869f37501fbbed 100644 --- a/tests/js/spec/views/teamMembers.spec.jsx +++ b/tests/js/spec/views/teamMembers.spec.jsx @@ -2,11 +2,11 @@ import React from 'react'; import {mountWithTheme} from 'sentry-test/enzyme'; -import {Client} from 'app/api'; import { openInviteMembersModal, openTeamAccessRequestModal, } from 'app/actionCreators/modal'; +import {Client} from 'app/api'; import TeamMembers from 'app/views/settings/organizationTeams/teamMembers'; jest.mock('app/actionCreators/modal', () => ({ diff --git a/tests/js/spec/views/userFeedback/index.spec.jsx b/tests/js/spec/views/userFeedback/index.spec.jsx index 51d5204c07835a..12899d41e44cd0 100644 --- a/tests/js/spec/views/userFeedback/index.spec.jsx +++ b/tests/js/spec/views/userFeedback/index.spec.jsx @@ -1,7 +1,7 @@ import React from 'react'; -import {initializeOrg} from 'sentry-test/initializeOrg'; import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; import ProjectsStore from 'app/stores/projectsStore'; import UserFeedback from 'app/views/userFeedback'; diff --git a/yarn.lock b/yarn.lock index a8f9e07d7157d4..427ed6cca34f91 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6572,6 +6572,11 @@ eslint-plugin-sentry@^1.44.0: dependencies: requireindex "~1.1.0" +eslint-plugin-simple-import-sort@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-6.0.0.tgz#036346edede70afab8928cc4c4b5ae3bd8db7f01" + integrity sha512-YEx+2Zli3mw4mzLzotZSeor4GqdjFWv6S7LcQeKsoXWD4GzMtP42WCz40kAlB35ehxf7PR5V/4f8g8l9aqWGsg== + eslint-scope@^4.0.0, eslint-scope@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
8df8f1e36c2739c424fed9ff2d04e2ecab7770dc
2023-12-23 01:52:14
anthony sottile
ref: add minimal stubs for ua_parser (#62280)
false
add minimal stubs for ua_parser (#62280)
ref
diff --git a/fixtures/stubs-for-mypy/ua_parser/__init__.pyi b/fixtures/stubs-for-mypy/ua_parser/__init__.pyi new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/fixtures/stubs-for-mypy/ua_parser/user_agent_parser.pyi b/fixtures/stubs-for-mypy/ua_parser/user_agent_parser.pyi new file mode 100644 index 00000000000000..db462ad9db22ba --- /dev/null +++ b/fixtures/stubs-for-mypy/ua_parser/user_agent_parser.pyi @@ -0,0 +1,27 @@ +from typing import TypedDict + +class _ParseUserAgentResult(TypedDict): + family: str + major: str | None + minor: str | None + patch: str | None + +class _ParseOsResult(TypedDict): + family: str + major: str | None + minor: str | None + patch: str | None + patch_minor: str | None + +class _ParseDeviceResult(TypedDict): + family: str + brand: str | None + model: str | None + +class _ParseResult(TypedDict): + user_agent: _ParseUserAgentResult + os: _ParseOsResult + device: _ParseDeviceResult + string: str + +def Parse(user_agent_string: str) -> _ParseResult: ... diff --git a/pyproject.toml b/pyproject.toml index 299e086a1e5cdf..7752c0d48db379 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,7 +116,6 @@ module = [ "sqlparse.*", "statsd.*", "u2flib_server.model.*", - "ua_parser.user_agent_parser.*", "unidiff.*", ] ignore_missing_imports = true diff --git a/src/sentry/plugins/sentry_useragents/models.py b/src/sentry/plugins/sentry_useragents/models.py index fa55c85d02316a..1c209ef61221a2 100644 --- a/src/sentry/plugins/sentry_useragents/models.py +++ b/src/sentry/plugins/sentry_useragents/models.py @@ -31,10 +31,7 @@ def get_tag_values(self, event): for key, value in headers: if key != "User-Agent": continue - ua = Parse(value) - if not ua: - continue - result = self.get_tag_from_ua(ua) + result = self.get_tag_from_ua(Parse(value)) if result: output.append(result) return output
8fd244d10a3152732e4a10e5fd510db0408f5899
2018-04-05 03:41:34
Lyn Nagara
style: Use panels for issue lists (#7914)
false
Use panels for issue lists (#7914)
style
diff --git a/src/sentry/static/sentry/app/components/compactIssue.jsx b/src/sentry/static/sentry/app/components/compactIssue.jsx index 015115f2876ce4..908a0ec49f7897 100644 --- a/src/sentry/static/sentry/app/components/compactIssue.jsx +++ b/src/sentry/static/sentry/app/components/compactIssue.jsx @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import createReactClass from 'create-react-class'; import Reflux from 'reflux'; +import {Flex, Box} from 'grid-emotion'; import ApiMixin from '../mixins/apiMixin'; import IndicatorStore from '../stores/indicatorStore'; @@ -12,6 +13,7 @@ import GroupStore from '../stores/groupStore'; import Link from './link'; import ProjectLink from './projectLink'; import {t} from '../locale'; +import {PanelItem} from './panels'; class CompactIssueHeader extends React.Component { static propTypes = { @@ -68,15 +70,19 @@ class CompactIssueHeader extends React.Component { styles = {color: '#57be8c'}; } return ( - <div> - <span className="error-level truncate" title={data.level} /> - <h3 className="truncate"> - <ProjectLink to={`/${orgId}/${projectId}/issues/${data.id}/`}> - <span className="icon icon-soundoff" /> - <span className="icon icon-star-solid" /> - {this.getTitle()} - </ProjectLink> - </h3> + <React.Fragment> + <Flex align="center"> + <Box mr={1}> + <span className="error-level truncate" title={data.level} /> + </Box> + <h3 className="truncate"> + <ProjectLink to={`/${orgId}/${projectId}/issues/${data.id}/`}> + <span className="icon icon-soundoff" /> + <span className="icon icon-star-solid" /> + {this.getTitle()} + </ProjectLink> + </h3> + </Flex> <div className="event-extra"> <span className="project-name"> <ProjectLink to={`/${orgId}/${projectId}/`}>{data.project.slug}</ProjectLink> @@ -94,7 +100,7 @@ class CompactIssueHeader extends React.Component { )} <span className="culprit">{this.getMessage()}</span> </div> - </div> + </React.Fragment> ); } } @@ -194,7 +200,7 @@ const CompactIssue = createReactClass({ let title = <span className="icon-more" />; return ( - <li className={className} onClick={this.toggleSelect}> + <PanelItem className={className} onClick={this.toggleSelect} direction="column"> <CompactIssueHeader data={issue} orgId={orgId} projectId={projectId} /> {this.props.statsPeriod && ( <div className="event-graph"> @@ -248,7 +254,7 @@ const CompactIssue = createReactClass({ </div> )} {this.props.children} - </li> + </PanelItem> ); }, }); diff --git a/src/sentry/static/sentry/app/components/emptyStateWarning.jsx b/src/sentry/static/sentry/app/components/emptyStateWarning.jsx new file mode 100644 index 00000000000000..e6584dbdfacb06 --- /dev/null +++ b/src/sentry/static/sentry/app/components/emptyStateWarning.jsx @@ -0,0 +1,37 @@ +import React from 'react'; +import styled from 'react-emotion'; + +class EmptyStateWarning extends React.Component { + render() { + return ( + <EmptyStreamWrapper> + <Icon className="icon icon-exclamation" /> + {this.props.children} + </EmptyStreamWrapper> + ); + } +} + +const EmptyStreamWrapper = styled.div` + text-align: center; + font-size: 22px; + padding: 48px 0; + + p { + line-height: 1.2; + margin: 0 auto 20px; + &:last-child { + margin-bottom: 0; + } + } +`; + +const Icon = styled.div` + display: block; + font-size: 54px; + color: ${p => p.theme.gray2} + margin-bottom: 20px; + opacity: 0.45; +`; + +export default EmptyStateWarning; diff --git a/src/sentry/static/sentry/app/components/groupList.jsx b/src/sentry/static/sentry/app/components/groupList.jsx index 10b5066f47ebb8..6b2fe5d26643f9 100644 --- a/src/sentry/static/sentry/app/components/groupList.jsx +++ b/src/sentry/static/sentry/app/components/groupList.jsx @@ -6,14 +6,16 @@ import jQuery from 'jquery'; import SentryTypes from '../proptypes'; import ApiMixin from '../mixins/apiMixin'; -import GroupListHeader from '../components/groupListHeader'; +import GroupListHeader from './groupListHeader'; import GroupStore from '../stores/groupStore'; -import LoadingError from '../components/loadingError'; -import LoadingIndicator from '../components/loadingIndicator'; +import LoadingError from './loadingError'; +import LoadingIndicator from './loadingIndicator'; import ProjectState from '../mixins/projectState'; -import StreamGroup from '../components/stream/group'; +import StreamGroup from './stream/group'; import utils from '../utils'; import {t} from '../locale'; +import {Panel, PanelBody} from './panels'; +import EmptyStateWarning from '../components/emptyStateWarning'; const GroupList = createReactClass({ displayName: 'GroupList', @@ -129,10 +131,13 @@ const GroupList = createReactClass({ else if (this.state.error) return <LoadingError onRetry={this.fetchData} />; else if (this.state.groupIds.length === 0) return ( - <div className="box empty-stream"> - <span className="icon icon-exclamation" /> - <p>{t("There doesn't seem to be any events fitting the query.")}</p> - </div> + <Panel> + <PanelBody> + <EmptyStateWarning> + {t("There doesn't seem to be any events fitting the query.")} + </EmptyStateWarning> + </PanelBody> + </Panel> ); let wrapperClass; diff --git a/src/sentry/static/sentry/app/components/issueList.jsx b/src/sentry/static/sentry/app/components/issueList.jsx index 0cf8a677022148..1b008b5756c9f7 100644 --- a/src/sentry/static/sentry/app/components/issueList.jsx +++ b/src/sentry/static/sentry/app/components/issueList.jsx @@ -3,6 +3,7 @@ import React from 'react'; import createReactClass from 'create-react-class'; +import {Panel, PanelBody} from './panels'; import ApiMixin from '../mixins/apiMixin'; import CompactIssue from './compactIssue'; import LoadingError from './loadingError'; @@ -20,6 +21,7 @@ const IssueList = createReactClass({ renderEmpty: PropTypes.func, statsPeriod: PropTypes.string, showActions: PropTypes.bool, + noBorder: PropTypes.bool, }, mixins: [ApiMixin], @@ -28,6 +30,7 @@ const IssueList = createReactClass({ return { pagination: true, query: {}, + noBorder: false, }; }, @@ -90,26 +93,30 @@ const IssueList = createReactClass({ renderResults() { let body; - let params = this.props.params; + const {params, noBorder} = this.props; if (this.state.loading) body = this.renderLoading(); else if (this.state.error) body = <LoadingError onRetry={this.fetchData} />; else if (this.state.issueIds.length > 0) { + const panelStyle = noBorder ? {border: 0, borderRadius: 0} : {}; + body = ( - <ul className="issue-list"> - {this.state.data.map(issue => { - return ( - <CompactIssue - key={issue.id} - id={issue.id} - data={issue} - orgId={params.orgId} - statsPeriod={this.props.statsPeriod} - showActions={this.props.showActions} - /> - ); - })} - </ul> + <Panel style={panelStyle}> + <PanelBody className="issue-list"> + {this.state.data.map(issue => { + return ( + <CompactIssue + key={issue.id} + id={issue.id} + data={issue} + orgId={params.orgId} + statsPeriod={this.props.statsPeriod} + showActions={this.props.showActions} + /> + ); + })} + </PanelBody> + </Panel> ); } else body = (this.props.renderEmpty || this.renderEmpty)(); @@ -130,13 +137,13 @@ const IssueList = createReactClass({ render() { return ( - <div> + <React.Fragment> {this.renderResults()} {this.props.pagination && this.state.pageLinks && ( <Pagination pageLinks={this.state.pageLinks} {...this.props} /> )} - </div> + </React.Fragment> ); }, }); diff --git a/src/sentry/static/sentry/app/components/sidebar/index.jsx b/src/sentry/static/sentry/app/components/sidebar/index.jsx index 862d7d9dce7c1e..9a151322b51eab 100644 --- a/src/sentry/static/sentry/app/components/sidebar/index.jsx +++ b/src/sentry/static/sentry/app/components/sidebar/index.jsx @@ -267,6 +267,7 @@ const Sidebar = createReactClass({ ref="issueList" showActions={false} params={{orgId: org.slug}} + noBorder /> </SidebarPanel> )} @@ -289,6 +290,7 @@ const Sidebar = createReactClass({ ref="issueList" showActions={false} params={{orgId: org.slug}} + noBorder /> </SidebarPanel> )} diff --git a/src/sentry/static/sentry/app/views/organizationDashboard.jsx b/src/sentry/static/sentry/app/views/organizationDashboard.jsx index 4637858eba6a05..facd859c5e87ea 100644 --- a/src/sentry/static/sentry/app/views/organizationDashboard.jsx +++ b/src/sentry/static/sentry/app/views/organizationDashboard.jsx @@ -24,6 +24,7 @@ import CommitLink from '../components/commitLink'; import {t, tct} from '../locale'; import {sortArray} from '../utils'; +import {Panel, PanelBody, PanelItem} from '../components/panels'; class UnreleasedChanges extends AsyncComponent { getEndpoints() { @@ -125,7 +126,15 @@ class AssignedIssues extends React.Component { }; renderEmpty = () => { - return <div className="box empty">{t('No issues have been assigned to you.')}</div>; + return ( + <Panel> + <PanelBody> + <PanelItem justify="center"> + {t('No issues have been assigned to you.')} + </PanelItem> + </PanelBody> + </Panel> + ); }; refresh = () => { @@ -177,9 +186,13 @@ class NewIssues extends React.Component { renderEmpty = () => { return ( - <div className="box empty"> - {t('No new issues have been seen in the last week.')} - </div> + <Panel> + <PanelBody> + <PanelItem justify="center"> + {t('No new issues have been seen in the last week.')} + </PanelItem> + </PanelBody> + </Panel> ); }; diff --git a/src/sentry/static/sentry/app/views/projectUserReports.jsx b/src/sentry/static/sentry/app/views/projectUserReports.jsx index d93be0d5437d31..ff88e81ebbcbc4 100644 --- a/src/sentry/static/sentry/app/views/projectUserReports.jsx +++ b/src/sentry/static/sentry/app/views/projectUserReports.jsx @@ -12,6 +12,8 @@ import LoadingIndicator from '../components/loadingIndicator'; import Pagination from '../components/pagination'; import CompactIssue from '../components/compactIssue'; import EventUserReport from '../components/events/userReport'; +import {Panel, PanelBody} from '../components/panels'; +import EmptyStateWarning from '../components/emptyStateWarning'; import {t, tct} from '../locale'; import withEnvironmentInQueryString from '../utils/withEnvironmentInQueryString'; @@ -144,32 +146,24 @@ const ProjectUserReports = createReactClass({ }, renderStreamBody() { - let body; - - if (this.state.loading) body = this.renderLoading(); - else if (this.state.error) body = <LoadingError onRetry={this.fetchData} />; - else if (this.state.reportList.length > 0) body = this.renderResults(); - else if (this.state.query && this.state.query !== this.props.defaultQuery) - body = this.renderNoQueryResults(); - else body = this.renderEmpty(); - - return body; - }, - - renderLoading() { - return ( - <div className="box"> - <LoadingIndicator /> - </div> - ); + if (this.state.loading) { + return <LoadingIndicator />; + } else if (this.state.error) { + return <LoadingError onRetry={this.fetchData} />; + } else if (this.state.reportList.length > 0) { + return this.renderResults(); + } else if (this.state.query && this.state.query !== this.props.defaultQuery) { + return this.renderNoQueryResults(); + } else { + return this.renderEmpty(); + } }, renderNoQueryResults() { return ( - <div className="box empty-stream"> - <span className="icon icon-exclamation" /> + <EmptyStateWarning> <p>{t('Sorry, no results match your search query.')}</p> - </div> + </EmptyStateWarning> ); }, @@ -181,23 +175,22 @@ const ProjectUserReports = createReactClass({ }) : t('No user reports have been collected.'); return ( - <div className="box empty-stream"> - <span className="icon icon-exclamation" /> + <EmptyStateWarning> <p>{message}</p> <p> <Link to={this.getUserReportsUrl()}> {t('Learn how to integrate User Feedback')} </Link> </p> - </div> + </EmptyStateWarning> ); }, renderResults() { - let {orgId, projectId} = this.props.params; + const {orgId, projectId} = this.props.params; - let children = this.state.reportList.map((item, itemIdx) => { - let issue = item.issue; + const children = this.state.reportList.map(item => { + const issue = item.issue; return ( <CompactIssue @@ -217,7 +210,7 @@ const ProjectUserReports = createReactClass({ ); }); - return <ul className="issue-list">{children}</ul>; + return <div className="issue-list">{children}</div>; }, render() { @@ -248,7 +241,9 @@ const ProjectUserReports = createReactClass({ </div> </div> </div> - {this.renderStreamBody()} + <Panel> + <PanelBody>{this.renderStreamBody()}</PanelBody> + </Panel> <Pagination pageLinks={this.state.pageLinks} /> </div> ); diff --git a/src/sentry/static/sentry/app/views/releases/releaseOverview.jsx b/src/sentry/static/sentry/app/views/releases/releaseOverview.jsx index 77c1e7595082e9..9bf1e84f6ce2ba 100644 --- a/src/sentry/static/sentry/app/views/releases/releaseOverview.jsx +++ b/src/sentry/static/sentry/app/views/releases/releaseOverview.jsx @@ -19,6 +19,7 @@ import ApiMixin from '../../mixins/apiMixin'; import {t} from '../../locale'; import SentryTypes from '../../proptypes'; import OrganizationState from '../../mixins/organizationState'; +import {Panel, PanelBody, PanelItem} from '../../components/panels'; const ReleaseOverview = createReactClass({ displayName: 'ReleaseOverview', @@ -203,9 +204,13 @@ const ReleaseOverview = createReactClass({ query={query} pagination={false} renderEmpty={() => ( - <div className="box empty m-b-2" key="none"> - {t('No issues resolved')} - </div> + <Panel> + <PanelBody> + <PanelItem key="none" justify="center"> + {t('No issues resolved')} + </PanelItem> + </PanelBody> + </Panel> )} ref="issueList" showActions={false} @@ -223,9 +228,11 @@ const ReleaseOverview = createReactClass({ statsPeriod="0" pagination={false} renderEmpty={() => ( - <div className="box empty m-b-2" key="none"> - {t('No new issues')} - </div> + <Panel> + <PanelBody> + <PanelItem justify="center">{t('No new issues')}</PanelItem> + </PanelBody> + </Panel> )} ref="issueList" showActions={false} diff --git a/src/sentry/static/sentry/less/organization.less b/src/sentry/static/sentry/less/organization.less index dec31c639805d7..e4d7fbf5f03a36 100644 --- a/src/sentry/static/sentry/less/organization.less +++ b/src/sentry/static/sentry/less/organization.less @@ -32,11 +32,6 @@ } } - .box, - .issue-list { - margin-bottom: 25px; - } - .nav-header { padding: 0 0 10px; margin: 0; diff --git a/src/sentry/static/sentry/less/stream.less b/src/sentry/static/sentry/less/stream.less index 0ce4a6dfc03782..e525b6eedc37cc 100644 --- a/src/sentry/static/sentry/less/stream.less +++ b/src/sentry/static/sentry/less/stream.less @@ -712,16 +712,8 @@ */ .issue-list { - .list-unstyled; - border: 1px solid @trim; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); - + padding: 0; .issue { - padding: 12px 40px 5px 35px; - border-bottom: 1px solid lighten(@trim, 5); - position: relative; - h3 { .icon-star-solid, .icon-soundoff { @@ -780,11 +772,14 @@ .error-level { .square(12px); border-radius: 50%; - position: absolute; top: 13px; left: 12px; } + .event-type { + position: absolute; + } + h3 { font-size: 16px; margin: 0; @@ -798,6 +793,7 @@ } .event-extra { + padding-left: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; diff --git a/tests/js/spec/views/__snapshots__/projectUserReports.spec.jsx.snap b/tests/js/spec/views/__snapshots__/projectUserReports.spec.jsx.snap index 4326001d7e97a8..0a424a509340c7 100644 --- a/tests/js/spec/views/__snapshots__/projectUserReports.spec.jsx.snap +++ b/tests/js/spec/views/__snapshots__/projectUserReports.spec.jsx.snap @@ -48,58 +48,18 @@ exports[`projectUserReports renders 1`] = ` </div> </div> </div> - <ul - className="issue-list" - > - <CompactIssue - data={ - Object { - "assignedTo": null, - "id": "1", - "project": Object { - "id": "2", - "slug": "project-slug", - }, - "stats": Object { - "24h": Array [ - Array [ - 1517281200, - 2, - ], - Array [ - 1517310000, - 1, - ], - ], - "30d": Array [ - Array [ - 1514764800, - 1, - ], - Array [ - 1515024000, - 122, - ], - ], - }, - "tags": Array [], - } - } - id="1" - key="123" - orgId="org-slug" - projectId="project-slug" + <Panel> + <PanelBody + direction="column" + disablePadding={true} + flex={false} > - <EventUserReport - issueId="1" - orgId="org-slug" - projectId="project-slug" - report={ - Object { - "comments": "Something bad happened", - "email": "[email protected]", - "id": "123", - "issue": Object { + <div + className="issue-list" + > + <CompactIssue + data={ + Object { "assignedTo": null, "id": "1", "project": Object { @@ -129,13 +89,61 @@ exports[`projectUserReports renders 1`] = ` ], }, "tags": Array [], - }, - "name": "Lyn", + } } - } - /> - </CompactIssue> - </ul> + id="1" + key="123" + orgId="org-slug" + projectId="project-slug" + > + <EventUserReport + issueId="1" + orgId="org-slug" + projectId="project-slug" + report={ + Object { + "comments": "Something bad happened", + "email": "[email protected]", + "id": "123", + "issue": Object { + "assignedTo": null, + "id": "1", + "project": Object { + "id": "2", + "slug": "project-slug", + }, + "stats": Object { + "24h": Array [ + Array [ + 1517281200, + 2, + ], + Array [ + 1517310000, + 1, + ], + ], + "30d": Array [ + Array [ + 1514764800, + 1, + ], + Array [ + 1515024000, + 122, + ], + ], + }, + "tags": Array [], + }, + "name": "Lyn", + } + } + /> + </CompactIssue> + </div> + </PanelBody> + </Panel> <Pagination onCursor={[Function]} />
37f7a52db315bd25af094e3e964b55a11e508457
2025-01-10 23:41:14
Michelle Fu
chore(auth): fully remove AuthProviderDefaultTeamsModel (#83239)
false
fully remove AuthProviderDefaultTeamsModel (#83239)
chore
diff --git a/migrations_lockfile.txt b/migrations_lockfile.txt index 2f879cd5647768..00fe08614bfda1 100644 --- a/migrations_lockfile.txt +++ b/migrations_lockfile.txt @@ -15,7 +15,7 @@ remote_subscriptions: 0003_drop_remote_subscription replays: 0004_index_together -sentry: 0810_add_project_has_flag +sentry: 0811_fully_delete_auth_provider_default_teams social_auth: 0002_default_auto_field diff --git a/src/sentry/migrations/0811_fully_delete_auth_provider_default_teams.py b/src/sentry/migrations/0811_fully_delete_auth_provider_default_teams.py new file mode 100644 index 00000000000000..754f8ca67cd6ce --- /dev/null +++ b/src/sentry/migrations/0811_fully_delete_auth_provider_default_teams.py @@ -0,0 +1,28 @@ +# Generated by Django 5.1.4 on 2025-01-10 17:34 +from sentry.new_migrations.migrations import CheckedMigration +from sentry.new_migrations.monkey.models import SafeDeleteModel +from sentry.new_migrations.monkey.state import DeletionAction + + +class Migration(CheckedMigration): + # This flag is used to mark that a migration shouldn't be automatically run in production. + # This should only be used for operations where it's safe to run the migration after your + # code has deployed. So this should not be used for most operations that alter the schema + # of a table. + # Here are some things that make sense to mark as post deployment: + # - Large data migrations. Typically we want these to be run manually so that they can be + # monitored and not block the deploy for a long period of time while they run. + # - Adding indexes to large tables. Since this can take a long time, we'd generally prefer to + # run this outside deployments so that we don't block them. Note that while adding an index + # is a schema change, it's completely safe to run the operation after the code has deployed. + # Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment + + is_post_deployment = False + + dependencies = [ + ("sentry", "0810_add_project_has_flag"), + ] + + operations = [ + SafeDeleteModel(name="AuthProviderDefaultTeams", deletion_action=DeletionAction.DELETE) + ]
32ba16058d8990e3a2aab3e97deb7de58517539d
2023-06-07 22:36:50
Lyn Nagara
fix: Metrics indexer drops any inflight messages on join (#50468)
false
Metrics indexer drops any inflight messages on join (#50468)
fix
diff --git a/src/sentry/runner/commands/run.py b/src/sentry/runner/commands/run.py index 591a06d7e5e829..bd20031006bf2f 100644 --- a/src/sentry/runner/commands/run.py +++ b/src/sentry/runner/commands/run.py @@ -649,7 +649,6 @@ def occurrences_ingest_consumer(**options): @click.option("--output-block-size", type=int, default=DEFAULT_BLOCK_SIZE) @click.option("--ingest-profile", required=True) @click.option("--indexer-db", default="postgres") [email protected]("--join-timeout", type=int, help="Join timeout in seconds.", default=10) @click.option("max_msg_batch_size", "--max-msg-batch-size", type=int, default=50) @click.option("max_msg_batch_time", "--max-msg-batch-time-ms", type=int, default=10000) @click.option("max_parallel_batch_size", "--max-parallel-batch-size", type=int, default=50) diff --git a/src/sentry/sentry_metrics/consumers/indexer/parallel.py b/src/sentry/sentry_metrics/consumers/indexer/parallel.py index 04d23833085959..1f845018dd1319 100644 --- a/src/sentry/sentry_metrics/consumers/indexer/parallel.py +++ b/src/sentry/sentry_metrics/consumers/indexer/parallel.py @@ -182,7 +182,6 @@ def get_parallel_metrics_consumer( group_id: str, auto_offset_reset: str, strict_offset_reset: bool, - join_timeout: int, indexer_profile: MetricsIngestConfiguration, slicing_router: Optional[SlicingRouter], ) -> StreamProcessor[KafkaPayload]: @@ -210,5 +209,7 @@ def get_parallel_metrics_consumer( Topic(indexer_profile.input_topic), processing_factory, ONCE_PER_SECOND, - join_timeout=join_timeout, + # We drop any in flight messages in processing step prior to produce. + # The SimpleProduceStep has a hardcoded join timeout of 5 seconds. + join_timeout=0.0, )
6f853c71033d4783b2a35a84c3f9b10dd7a0cb27
2020-11-17 18:58:44
Matej Minar
feat(ui): Rename stacktrace to stack trace (#22048)
false
Rename stacktrace to stack trace (#22048)
feat
diff --git a/src/sentry/static/sentry/app/api.tsx b/src/sentry/static/sentry/app/api.tsx index 8cb9439534db23..254716708b5934 100644 --- a/src/sentry/static/sentry/app/api.tsx +++ b/src/sentry/static/sentry/app/api.tsx @@ -362,7 +362,7 @@ export class Client { : any > { // Create an error object here before we make any async calls so - // that we have a helpful stacktrace if it errors + // that we have a helpful stack trace if it errors // // This *should* get logged to Sentry only if the promise rejection is not handled // (since SDK captures unhandled rejections). Ideally we explicitly ignore rejection diff --git a/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx b/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx index c29606ac4c6a87..71d89577e45f81 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/exceptionStacktraceContent.tsx @@ -42,7 +42,7 @@ const ExceptionStacktraceContent = ({ <Panel dashedBorder> <EmptyMessage icon={<IconWarning size="xs" />} - title="No app only stacktrace has been found!" + title="No app only stack trace has been found!" /> </Panel> ); @@ -56,9 +56,9 @@ const ExceptionStacktraceContent = ({ * Armin, Markus: * If all frames are in app, then no frame is in app. * This normally does not matter for the UI but when chained exceptions - * are used this causes weird behavior where one exception appears to not have a stacktrace. + * are used this causes weird behavior where one exception appears to not have a stack trace. * - * It is easier to fix the UI logic to show a non-empty stacktrace for chained exceptions + * It is easier to fix the UI logic to show a non-empty stack trace for chained exceptions */ return ( diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx index 35be6d2526ffc7..d6e52228cba2bb 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/line.tsx @@ -104,7 +104,7 @@ export class Line extends React.Component<Props, State> { getPlatform() { // prioritize the frame platform but fall back to the platform - // of the stacktrace / exception + // of the stack trace / exception return getPlatform(this.props.data.platform, this.props.platform ?? 'other'); } diff --git a/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx b/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx index 0a828cec97dced..1f69212a505114 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/frame/utils.tsx @@ -13,7 +13,7 @@ export function trimPackage(pkg: string) { export function getPlatform(dataPlatform: PlatformType | null, platform: string) { // prioritize the frame platform but fall back to the platform - // of the stacktrace / exception + // of the stack trace / exception return dataPlatform || platform; } diff --git a/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx b/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx index 5af554a760319e..dd68fd07374c96 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/stacktrace.tsx @@ -80,7 +80,7 @@ class StacktraceInterface extends React.Component<Props, State> { type={type} title={ <CrashTitle - title={t('Stacktrace')} + title={t('Stack Trace')} hideGuide={hideGuide} newestFirst={newestFirst} onChange={this.handleChangeNewestFirst} diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getRelevantFrame.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getRelevantFrame.tsx index 433922b8a25649..205ae228cea417 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getRelevantFrame.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threadSelector/getRelevantFrame.tsx @@ -1,6 +1,6 @@ import {Frame} from 'app/types'; -// TODO(ts): define correct stacktrace type +// TODO(ts): define correct stack trace type function getRelevantFrame(stacktrace: any): Frame { if (!stacktrace.hasSystemFrames) { return stacktrace.frames[stacktrace.frames.length - 1]; diff --git a/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.tsx b/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.tsx index a9b9f971c27d94..dce9452080eac8 100644 --- a/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.tsx +++ b/src/sentry/static/sentry/app/components/events/interfaces/threads/threads.tsx @@ -130,7 +130,7 @@ class ThreadInterface extends React.Component<Props, State> { /> ) : ( <CrashTitle - title={t('Stacktrace')} + title={t('Stack Trace')} newestFirst={newestFirst} hideGuide={hideGuide} onChange={this.handleChangeNewestFirst} diff --git a/src/sentry/static/sentry/app/components/issueDiff/index.tsx b/src/sentry/static/sentry/app/components/issueDiff/index.tsx index ef59cdae273dba..da0abe1928258a 100644 --- a/src/sentry/static/sentry/app/components/issueDiff/index.tsx +++ b/src/sentry/static/sentry/app/components/issueDiff/index.tsx @@ -132,7 +132,7 @@ class IssueDiff extends React.Component<Props, State> { <HeaderWrapper> <ButtonBar merged active={groupingDiff ? 'grouping' : 'event'}> <Button barId="event" size="small" onClick={this.toggleDiffMode}> - {t('Diff stacktrace and message')} + {t('Diff stack trace and message')} </Button> <Button barId="grouping" size="small" onClick={this.toggleDiffMode}> {t('Diff grouping information')} diff --git a/src/sentry/static/sentry/app/components/similarScoreCard.tsx b/src/sentry/static/sentry/app/components/similarScoreCard.tsx index fd07923b679f87..c69dedf36691c2 100644 --- a/src/sentry/static/sentry/app/components/similarScoreCard.tsx +++ b/src/sentry/static/sentry/app/components/similarScoreCard.tsx @@ -6,7 +6,7 @@ import space from 'app/styles/space'; const scoreComponents = { 'exception:message:character-shingles': t('Exception Message'), - 'exception:stacktrace:pairs': t('Stacktrace Frames'), + 'exception:stacktrace:pairs': t('Stack Trace Frames'), 'message:message:character-shingles': t('Log Message'), }; diff --git a/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx b/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx index 0a4e24f96f916b..4abcf98057beea 100644 --- a/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx +++ b/src/sentry/static/sentry/app/data/forms/accountPreferences.tsx @@ -25,7 +25,7 @@ const formGroups: JsonFormObject[] = [ ['2', t('Most recent call first')], ], label: t('Stack Trace Order'), - help: t('Choose the default ordering of frames in stacktraces'), + help: t('Choose the default ordering of frames in stack traces'), getData: transformOptions, }, { diff --git a/src/sentry/static/sentry/app/utils/requestError/createRequestError.tsx b/src/sentry/static/sentry/app/utils/requestError/createRequestError.tsx index fdd7d9ef462466..e13d0e841f206b 100644 --- a/src/sentry/static/sentry/app/utils/requestError/createRequestError.tsx +++ b/src/sentry/static/sentry/app/utils/requestError/createRequestError.tsx @@ -19,7 +19,7 @@ const ERROR_MAP = { * Create a RequestError whose name is equal to HTTP status text defined above * * @param {Object} resp A XHR response object - * @param {String} stack The stacktrace to use. Helpful for async calls and we want to preserve a different stack. + * @param {String} stack The stack trace to use. Helpful for async calls and we want to preserve a different stack. */ export default function createRequestError( resp: JQueryXHR, diff --git a/src/sentry/static/sentry/app/utils/requestError/requestError.tsx b/src/sentry/static/sentry/app/utils/requestError/requestError.tsx index d521204e27741c..de58303c3828ba 100644 --- a/src/sentry/static/sentry/app/utils/requestError/requestError.tsx +++ b/src/sentry/static/sentry/app/utils/requestError/requestError.tsx @@ -41,11 +41,11 @@ export default class RequestError extends Error { } removeFrames(numLinesToRemove) { - // Drop some frames so stacktrace starts at callsite + // Drop some frames so stack trace starts at callsite // // Note that babel will add a call to support extending Error object - // Old browsers may not have stacktrace + // Old browsers may not have stack trace if (!this.stack) { return; }
a6f4bb7a82c47fb9fedceee3a0d3cd4e6a00882b
2023-12-19 21:25:17
getsentry-bot
release: 23.12.0
false
23.12.0
release
diff --git a/CHANGES b/CHANGES index 3b143ed4f384f8..b7c0acf1d5f3e4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,35 @@ +23.12.0 +------- + +### Various fixes & improvements + +- fix(craft): Set craft artifact provider to none (#62001) by @hubertdeng123 +- fix(starfish): Obey `utc` URL parameter (#61963) by @gggritso +- ref(stats-detectors): Move classes for better imports (#61959) by @Zylphrex +- feat(devserver) Bake in options to streamline devserver + ngrok (#61953) by @markstory +- feat(replays): Remove scalar query optimization (#61815) by @cmanallen +- fix(ddm): display all code locations (#61994) by @obostjancic +- ref: upgrade to python 3.9 (#36860) by @asottile-sentry +- feat(ddm): Move feedback button to header (#61997) by @ArthurKnaus +- feat(inbound-filters): Relax pattern for matching ChunkLoadError(s) (#61988) by @iambriccardo +- feat(discover): Add support for p90 in discover (#61990) by @iambriccardo +- feat(ddm): Rename ddm to metrics (#61993) by @matejminar +- fix(ddm): code location copy event propagation (#61987) by @obostjancic +- feat(alerts): fade out custom percentiles (#61926) by @obostjancic +- Fix Craft publish (#61982) by @chadwhitacre +- ref(crons): Move tolerance fields out in monitor form (#61807) by @davidenwang +- fix(replay): Fix alignment of FeatureBadge in Replay Details tabs (#61970) by @ryan953 +- feat(backup): Add creator/owner email/username to GET /relocations/ (#61969) by @azaslavsky +- feat(crons): Sort DISABLED monitors to the end (#61950) by @evanpurkhiser +- nit: Allow skipping scope_list argument in util func (#61967) by @schew2381 +- feat(staff): Create initial staff class for _admin mode (#61653) by @schew2381 +- Revert "ref: remove self-hosted cloudbuild (#61727)" (ae39b423) by @getsentry-bot +- feat(spans): Groundwork for indexed spans tests (#61766) by @wmak +- fix(user token): Stop leaking API token (#61941) by @ykamo001 +- fix(slack); Check for existence of org_context (#61966) by @ceorourke + +_Plus 934 more_ + 23.11.2 ------- diff --git a/setup.cfg b/setup.cfg index 44a0bd63271bc0..dc4371a91c1f3f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = sentry -version = 23.12.0.dev0 +version = 23.12.0 description = A realtime logging and aggregation server. long_description = file: README.md long_description_content_type = text/markdown
3cb05506d746bda4f76d6b891093bdf6cc8a65c2
2020-04-22 20:24:34
Billy Vong
ref(ts): Adjust types for `actionCreators/globalSelection` (#18387)
false
Adjust types for `actionCreators/globalSelection` (#18387)
ref
diff --git a/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx b/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx index 0cf4f5b5b86301..5c034f323ba093 100644 --- a/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx +++ b/src/sentry/static/sentry/app/actionCreators/globalSelection.tsx @@ -45,8 +45,8 @@ type DateTimeObject = { * Discover v1 uses a different interface, and passes slightly different datatypes e.g. Date for dates */ type UrlParams = { - project?: ProjectId[]; - environment?: EnvironmentId[]; + project?: ProjectId[] | null; + environment?: EnvironmentId[] | null; } & DateTimeObject & { // TODO(discoverv1): This can be back to `ParamValue` when we remove Discover [others: string]: any; @@ -119,7 +119,7 @@ export function updateDateTime( * @param {String[]} [options.resetParams] List of parameters to remove when changing URL params */ export function updateEnvironments( - environment: EnvironmentId[], + environment: EnvironmentId[] | null, router?: Router, options?: Options ) {
fdba72bd7c96f6b340c5d3e2cc7439f61f400020
2020-07-09 18:51:47
Markus Unterwaditzer
ref: Remove Python store view (#19135)
false
Remove Python store view (#19135)
ref
diff --git a/.eslintignore b/.eslintignore index a9302d11ca9cd7..747c7c68781a82 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,6 @@ **/dist/**/* **/vendor/**/* -**/tests/sentry/lang/javascript/fixtures/**/* -**/tests/sentry/lang/javascript/example-project/**/* +**/tests/**/lang/javascript/fixtures/**/* +**/tests/**/lang/javascript/example-project/**/* /examples/ /scripts/ diff --git a/conftest.py b/conftest.py index c3827628eb90fd..bc1cc7a28453b9 100644 --- a/conftest.py +++ b/conftest.py @@ -22,14 +22,6 @@ def pytest_configure(config): # always install plugins for the tests install_sentry_plugins() - # add custom test markers - config.addinivalue_line( - "markers", - "sentry_store_integration: mark test as using the sentry store endpoint and therefore using legacy code", - ) - config.addinivalue_line( - "markers", "relay_store_integration: mark test as using the relay store endpoint" - ) config.addinivalue_line("markers", "obsolete: mark test as obsolete and soon to be removed") diff --git a/requirements-base.txt b/requirements-base.txt index 66d0a3ec1d2f8a..b539945f97429c 100644 --- a/requirements-base.txt +++ b/requirements-base.txt @@ -43,7 +43,6 @@ python3-saml>=1.4.0,<1.5 python-u2flib-server>=5.0.0,<6.0.0 PyYAML>=5.3,<5.4 qrcode>=6.1.0,<6.2.0 -querystring_parser>=1.2.3,<2.0.0 rb>=1.7.0,<2.0.0 redis-py-cluster==1.3.6 redis==2.10.6 diff --git a/src/sentry/api/base.py b/src/sentry/api/base.py index 2765179cf2a3c9..f94820b6b04235 100644 --- a/src/sentry/api/base.py +++ b/src/sentry/api/base.py @@ -9,6 +9,7 @@ from datetime import datetime, timedelta from django.conf import settings from django.utils.http import urlquote +from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from enum import Enum from pytz import utc @@ -23,11 +24,10 @@ from sentry.models import Environment from sentry.utils.cursors import Cursor from sentry.utils.dates import to_datetime -from sentry.utils.http import absolute_uri, is_valid_origin +from sentry.utils.http import absolute_uri, is_valid_origin, origin_from_request from sentry.utils.audit import create_audit_entry from sentry.utils.sdk import capture_exception from sentry.utils import json -from sentry.web.api import allow_cors_options from .authentication import ApiKeyAuthentication, TokenAuthentication @@ -49,6 +49,51 @@ audit_logger = logging.getLogger("sentry.audit.api") +def allow_cors_options(func): + """ + Decorator that adds automatic handling of OPTIONS requests for CORS + + If the request is OPTIONS (i.e. pre flight CORS) construct a OK (200) response + in which we explicitly enable the caller and add the custom headers that we support + For other requests just add the appropriate CORS headers + + :param func: the original request handler + :return: a request handler that shortcuts OPTIONS requests and just returns an OK (CORS allowed) + """ + + @functools.wraps(func) + def allow_cors_options_wrapper(self, request, *args, **kwargs): + + if request.method == "OPTIONS": + response = HttpResponse(status=200) + response["Access-Control-Max-Age"] = "3600" # don't ask for options again for 1 hour + else: + response = func(self, request, *args, **kwargs) + + allow = ", ".join(self._allowed_methods()) + response["Allow"] = allow + response["Access-Control-Allow-Methods"] = allow + response["Access-Control-Allow-Headers"] = ( + "X-Sentry-Auth, X-Requested-With, Origin, Accept, " + "Content-Type, Authentication, Authorization, Content-Encoding" + ) + response["Access-Control-Expose-Headers"] = "X-Sentry-Error, Retry-After" + + if request.META.get("HTTP_ORIGIN") == "null": + origin = "null" # if ORIGIN header is explicitly specified as 'null' leave it alone + else: + origin = origin_from_request(request) + + if origin is None or origin == "null": + response["Access-Control-Allow-Origin"] = "*" + else: + response["Access-Control-Allow-Origin"] = origin + + return response + + return allow_cors_options_wrapper + + class DocSection(Enum): ACCOUNTS = "Accounts" EVENTS = "Events" diff --git a/src/sentry/api/endpoints/project_filter_details.py b/src/sentry/api/endpoints/project_filter_details.py index 48a04ff4a73dce..69001cbb428ce5 100644 --- a/src/sentry/api/endpoints/project_filter_details.py +++ b/src/sentry/api/endpoints/project_filter_details.py @@ -19,14 +19,14 @@ def put(self, request, project, filter_id): """ current_filter = None - for flt in message_filters.get_all_filters(): - if flt.spec.id == filter_id: + for flt in message_filters.get_all_filter_specs(): + if flt.id == filter_id: current_filter = flt break else: raise ResourceDoesNotExist # could not find filter with the requested id - serializer = current_filter.spec.serializer_cls(data=request.data, partial=True) + serializer = current_filter.serializer_cls(data=request.data, partial=True) if not serializer.is_valid(): return Response(serializer.errors, status=400) diff --git a/src/sentry/api/endpoints/project_filters.py b/src/sentry/api/endpoints/project_filters.py index cee5013afea373..d56051f348bdfa 100644 --- a/src/sentry/api/endpoints/project_filters.py +++ b/src/sentry/api/endpoints/project_filters.py @@ -17,17 +17,16 @@ def get(self, request, project): """ results = [] - for flt in message_filters.get_all_filters(): - filter_spec = flt.spec + for flt in message_filters.get_all_filter_specs(): results.append( { - "id": filter_spec.id, + "id": flt.id, # 'active' will be either a boolean or list for the legacy browser filters # all other filters will be boolean - "active": message_filters.get_filter_state(filter_spec.id, project), - "description": filter_spec.description, - "name": filter_spec.name, - "hello": filter_spec.id + " - " + filter_spec.name, + "active": message_filters.get_filter_state(flt.id, project), + "description": flt.description, + "name": flt.name, + "hello": flt.id + " - " + flt.name, } ) results.sort(key=lambda x: x["name"]) diff --git a/src/sentry/coreapi.py b/src/sentry/coreapi.py index 819520616e9e72..7f2a88edb6471f 100644 --- a/src/sentry/coreapi.py +++ b/src/sentry/coreapi.py @@ -3,29 +3,15 @@ # metadata (rather than generic log messages which aren't useful). from __future__ import absolute_import, print_function -import abc -import base64 import logging import re -import six -import zlib -from django.core.exceptions import SuspiciousOperation -from django.utils.crypto import constant_time_compare -from gzip import GzipFile -from six import BytesIO from time import time from sentry.attachments import attachment_cache from sentry.cache import default_cache -from sentry.models import ProjectKey from sentry.tasks.store import preprocess_event, preprocess_event_from_reprocessing -from sentry.utils import json -from sentry.utils.auth import parse_auth_header from sentry.utils.cache import cache_key_for_event -from sentry.utils.http import origin_from_request -from sentry.utils.strings import decompress -from sentry.utils.sdk import configure_scope, set_current_project from sentry.utils.canonical import CANONICAL_TYPES @@ -57,259 +43,33 @@ class APIForbidden(APIError): http_status = 403 -class APIRateLimited(APIError): - http_status = 429 - msg = "Creation of this event was denied due to rate limiting" - name = "rate_limit" +def insert_data_to_database_legacy( + data, start_time=None, from_reprocessing=False, attachments=None +): + """ + Yet another "fast path" to ingest an event without making it go + through Relay. Please consider using functions from the ingest consumer + instead, or, if you're within tests, to use `TestCase.store_event`. + """ - def __init__(self, retry_after=None): - self.retry_after = retry_after + # XXX(markus): Delete this function and merge with ingest consumer logic. + if start_time is None: + start_time = time() -class Auth(object): - def __init__( - self, client=None, version=None, secret_key=None, public_key=None, is_public=False - ): - self.client = client - self.version = version - self.secret_key = secret_key - self.public_key = public_key - self.is_public = is_public + # we might be passed some subclasses of dict that fail dumping + if isinstance(data, CANONICAL_TYPES): + data = dict(data.items()) + cache_timeout = 3600 + cache_key = cache_key_for_event(data) + default_cache.set(cache_key, data, cache_timeout) -class ClientContext(object): - def __init__(self, agent=None, version=None, project_id=None, ip_address=None): - # user-agent (i.e. raven-python) - self.agent = agent - # protocol version - self.version = version - # project instance - self.project_id = project_id - self.project = None - self.ip_address = ip_address + # Attachments will be empty or None if the "event-attachments" feature + # is turned off. For native crash reports it will still contain the + # crash dump (e.g. minidump) so we can load it during processing. + if attachments is not None: + attachment_cache.set(cache_key, attachments, cache_timeout) - def bind_project(self, project): - self.project = project - self.project_id = project.id - set_current_project(project.id) - - def bind_auth(self, auth): - self.agent = auth.client - self.version = auth.version - - with configure_scope() as scope: - scope.set_tag("agent", self.agent) - scope.set_tag("protocol", self.version) - - -class ClientApiHelper(object): - def __init__(self, agent=None, version=None, project_id=None, ip_address=None): - self.context = ClientContext( - agent=agent, version=version, project_id=project_id, ip_address=ip_address - ) - - def project_key_from_auth(self, auth): - if not auth.public_key: - raise APIUnauthorized("Invalid api key") - - # Make sure the key even looks valid first, since it's - # possible to get some garbage input here causing further - # issues trying to query it from cache or the database. - if not ProjectKey.looks_like_api_key(auth.public_key): - raise APIUnauthorized("Invalid api key") - - try: - pk = ProjectKey.objects.get_from_cache(public_key=auth.public_key) - except ProjectKey.DoesNotExist: - raise APIUnauthorized("Invalid api key") - - # a secret key may not be present which will be validated elsewhere - if not constant_time_compare(pk.secret_key, auth.secret_key or pk.secret_key): - raise APIUnauthorized("Invalid api key") - - if not pk.is_active: - raise APIUnauthorized("API key is disabled") - - if not pk.roles.store: - raise APIUnauthorized("Key does not allow event storage access") - - return pk - - def project_id_from_auth(self, auth): - return self.project_key_from_auth(auth).project_id - - def insert_data_to_database( - self, data, start_time=None, from_reprocessing=False, attachments=None - ): - if start_time is None: - start_time = time() - - # we might be passed some subclasses of dict that fail dumping - if isinstance(data, CANONICAL_TYPES): - data = dict(data.items()) - - cache_timeout = 3600 - cache_key = cache_key_for_event(data) - default_cache.set(cache_key, data, cache_timeout) - - # Attachments will be empty or None if the "event-attachments" feature - # is turned off. For native crash reports it will still contain the - # crash dump (e.g. minidump) so we can load it during processing. - if attachments is not None: - attachment_cache.set(cache_key, attachments, cache_timeout) - - task = from_reprocessing and preprocess_event_from_reprocessing or preprocess_event - task.delay(cache_key=cache_key, start_time=start_time, event_id=data["event_id"]) - - [email protected]_metaclass(abc.ABCMeta) -class AbstractAuthHelper(object): - @abc.abstractmethod - def auth_from_request(cls, request): - pass - - @abc.abstractmethod - def origin_from_request(cls, request): - pass - - -class ClientAuthHelper(AbstractAuthHelper): - @classmethod - def auth_from_request(cls, request): - result = {k: request.GET[k] for k in six.iterkeys(request.GET) if k[:7] == "sentry_"} - - if request.META.get("HTTP_X_SENTRY_AUTH", "")[:7].lower() == "sentry ": - if result: - raise SuspiciousOperation("Multiple authentication payloads were detected.") - result = parse_auth_header(request.META["HTTP_X_SENTRY_AUTH"]) - elif request.META.get("HTTP_AUTHORIZATION", "")[:7].lower() == "sentry ": - if result: - raise SuspiciousOperation("Multiple authentication payloads were detected.") - result = parse_auth_header(request.META["HTTP_AUTHORIZATION"]) - - if not result: - raise APIUnauthorized("Unable to find authentication information") - - origin = cls.origin_from_request(request) - auth = Auth( - client=result.get("sentry_client"), - version=six.text_type(result.get("sentry_version")), - secret_key=result.get("sentry_secret"), - public_key=result.get("sentry_key"), - is_public=bool(origin), - ) - # default client to user agent - if not auth.client: - auth.client = request.META.get("HTTP_USER_AGENT") - if isinstance(auth.client, bytes): - auth.client = auth.client.decode("latin1") - return auth - - @classmethod - def origin_from_request(cls, request): - """ - Returns either the Origin or Referer value from the request headers. - """ - if request.META.get("HTTP_ORIGIN") == "null": - return "null" - return origin_from_request(request) - - -class MinidumpAuthHelper(AbstractAuthHelper): - @classmethod - def origin_from_request(cls, request): - # We don't use an origin here - return None - - @classmethod - def auth_from_request(cls, request): - key = request.GET.get("sentry_key") - if not key: - raise APIUnauthorized("Unable to find authentication information") - - # Minidump requests are always "trusted". We at this point only - # use is_public to identify requests that have an origin set (via - # CORS) - auth = Auth(public_key=key, client="sentry-minidump", is_public=False) - return auth - - -class SecurityAuthHelper(AbstractAuthHelper): - @classmethod - def origin_from_request(cls, request): - # In the case of security reports, the origin is not available at the - # dispatch() stage, as we need to parse it out of the request body, so - # we do our own CORS check once we have parsed it. - return None - - @classmethod - def auth_from_request(cls, request): - key = request.GET.get("sentry_key") - if not key: - raise APIUnauthorized("Unable to find authentication information") - - auth = Auth(public_key=key, is_public=True) - auth.client = request.META.get("HTTP_USER_AGENT") - return auth - - -def decompress_deflate(encoded_data): - try: - return zlib.decompress(encoded_data).decode("utf-8") - except Exception as e: - # This error should be caught as it suggests that there's a - # bug somewhere in the client's code. - logger.debug(six.text_type(e), exc_info=True) - raise APIError("Bad data decoding request (%s, %s)" % (type(e).__name__, e)) - - -def decompress_gzip(encoded_data): - try: - fp = BytesIO(encoded_data) - try: - f = GzipFile(fileobj=fp) - return f.read().decode("utf-8") - finally: - f.close() - except Exception as e: - # This error should be caught as it suggests that there's a - # bug somewhere in the client's code. - logger.debug(six.text_type(e), exc_info=True) - raise APIError("Bad data decoding request (%s, %s)" % (type(e).__name__, e)) - - -def decode_and_decompress_data(encoded_data): - try: - try: - return decompress(encoded_data).decode("utf-8") - except zlib.error: - return base64.b64decode(encoded_data).decode("utf-8") - except Exception as e: - # This error should be caught as it suggests that there's a - # bug somewhere in the client's code. - logger.debug(six.text_type(e), exc_info=True) - raise APIError("Bad data decoding request (%s, %s)" % (type(e).__name__, e)) - - -def decode_data(encoded_data): - try: - return encoded_data.decode("utf-8") - except UnicodeDecodeError as e: - # This error should be caught as it suggests that there's a - # bug somewhere in the client's code. - logger.debug(six.text_type(e), exc_info=True) - raise APIError("Bad data decoding request (%s, %s)" % (type(e).__name__, e)) - - -def safely_load_json_string(json_string): - try: - if isinstance(json_string, six.binary_type): - json_string = json_string.decode("utf-8") - obj = json.loads(json_string) - assert isinstance(obj, dict) - except Exception as e: - # This error should be caught as it suggests that there's a - # bug somewhere in the client's code. - logger.debug(six.text_type(e), exc_info=True) - raise APIError("Bad data reconstructing object (%s, %s)" % (type(e).__name__, e)) - return obj + task = from_reprocessing and preprocess_event_from_reprocessing or preprocess_event + task.delay(cache_key=cache_key, start_time=start_time, event_id=data["event_id"]) diff --git a/src/sentry/event_manager.py b/src/sentry/event_manager.py index f15b48d796ae75..6ec3a175099f98 100644 --- a/src/sentry/event_manager.py +++ b/src/sentry/event_manager.py @@ -4,7 +4,6 @@ import time import ipaddress -import jsonschema import six from datetime import timedelta @@ -23,7 +22,6 @@ MAX_SECS_IN_FUTURE, MAX_SECS_IN_PAST, ) -from sentry.message_filters import should_filter_event from sentry.grouping.api import ( get_grouping_config_dict_for_project, get_grouping_config_dict_for_event_data, @@ -32,16 +30,6 @@ get_fingerprinting_config_for_project, GroupingConfigNotFound, ) -from sentry.coreapi import ( - APIError, - APIForbidden, - decompress_gzip, - decompress_deflate, - decode_and_decompress_data, - decode_data, - safely_load_json_string, -) -from sentry.interfaces.base import get_interface from sentry.lang.native.utils import STORE_CRASH_REPORTS_ALL, convert_crashreport_count from sentry.models import ( Activity, @@ -75,12 +63,7 @@ from sentry.tasks.integrations import kick_off_status_syncs from sentry.utils import json, metrics from sentry.utils.canonical import CanonicalKeyDict -from sentry.utils.data_filters import ( - is_valid_ip, - is_valid_release, - is_valid_error_message, - FilterStatKeys, -) +from sentry.utils.data_filters import FilterStatKeys from sentry.utils.dates import to_timestamp, to_datetime from sentry.utils.outcomes import Outcome, track_outcome from sentry.utils.safe import safe_execute, trim, get_path, setdefault_path @@ -137,19 +120,6 @@ def validate_and_set_timestamp(data, timestamp): data["timestamp"] = float(timestamp) -def parse_client_as_sdk(value): - if not value: - return {} - try: - name, version = value.split("/", 1) - except ValueError: - try: - name, version = value.split(" ", 1) - except ValueError: - return {} - return {"name": name, "version": version} - - def plugin_is_regression(group, event): project = event.project for plugin in plugins.for_project(project): @@ -237,36 +207,6 @@ def as_sql(self, compiler, connection, function=None, template=None): return (sql, []) -def add_meta_errors(errors, meta): - for field_meta in meta: - original_value = field_meta.get().get("val") - - for i, (err_type, err_data) in enumerate(field_meta.iter_errors()): - error = dict(err_data) - error["type"] = err_type - if field_meta.path: - error["name"] = field_meta.path - if i == 0 and original_value is not None: - error["value"] = original_value - errors.append(error) - - -def _decode_event(data, content_encoding): - if isinstance(data, six.binary_type): - if content_encoding == "gzip": - data = decompress_gzip(data) - elif content_encoding == "deflate": - data = decompress_deflate(data) - elif data[0] != b"{": - data = decode_and_decompress_data(data) - else: - data = decode_data(data) - if isinstance(data, six.text_type): - data = safely_load_json_string(data) - - return CanonicalKeyDict(data) - - class EventManager(object): """ Handles normalization in both the store endpoint and the save task. The @@ -289,7 +229,7 @@ def __init__( project_config=None, sent_at=None, ): - self._data = _decode_event(data, content_encoding=content_encoding) + self._data = CanonicalKeyDict(data) self.version = version self._project = project # if not explicitly specified try to get the grouping from project_config @@ -310,51 +250,6 @@ def __init__( self.project_config = project_config self.sent_at = sent_at - def process_csp_report(self): - """Only called from the CSP report endpoint.""" - data = self._data - - try: - interface = get_interface(data.pop("interface")) - report = data.pop("report") - except KeyError: - raise APIForbidden("No report or interface data") - - # To support testing, we can either accept a built interface instance, or the raw data in - # which case we build the instance ourselves - try: - instance = report if isinstance(report, interface) else interface.from_raw(report) - except jsonschema.ValidationError as e: - raise APIError("Invalid security report: %s" % str(e).splitlines()[0]) - - def clean(d): - return dict([x for x in d.items() if x[1]]) - - data.update( - { - "logger": "csp", - "message": instance.get_message(), - "culprit": instance.get_culprit(), - instance.path: instance.to_json(), - "tags": instance.get_tags(), - "errors": [], - "user": {"ip_address": self._client_ip}, - # Construct a faux Http interface based on the little information we have - # This is a bit weird, since we don't have nearly enough - # information to create an Http interface, but - # this automatically will pick up tags for the User-Agent - # which is actually important here for CSP - "request": { - "url": instance.get_origin(), - "headers": clean( - {"User-Agent": self._user_agent, "Referer": instance.get_referrer()} - ), - }, - } - ) - - self._data = data - def normalize(self, project_id=None): with metrics.timer("events.store.normalize.duration"): self._normalize_impl(project_id=project_id) @@ -388,41 +283,6 @@ def _normalize_impl(self, project_id=None): self._data = CanonicalKeyDict(rust_normalizer.normalize_event(dict(self._data))) - def should_filter(self): - """ - returns (result: bool, reason: string or None) - Result is True if an event should be filtered - The reason for filtering is passed along as a string - so that we can store it in metrics - """ - for name in SECURITY_REPORT_INTERFACES: - if name in self._data: - interface = get_interface(name) - if interface.to_python(self._data[name]).should_filter(self._project): - return (True, FilterStatKeys.INVALID_CSP) - - if self._client_ip and not is_valid_ip(self.project_config, self._client_ip): - return (True, FilterStatKeys.IP_ADDRESS) - - release = self._data.get("release") - if release and not is_valid_release(self.project_config, release): - return (True, FilterStatKeys.RELEASE_VERSION) - - error_message = ( - get_path(self._data, "logentry", "formatted") - or get_path(self._data, "logentry", "message") - or "" - ) - if error_message and not is_valid_error_message(self.project_config, error_message): - return (True, FilterStatKeys.ERROR_MESSAGE) - - for exc in get_path(self._data, "exception", "values", filter=True, default=[]): - message = u": ".join([_f for _f in map(exc.get, ["type", "value"]) if _f]) - if message and not is_valid_error_message(self.project_config, message): - return (True, FilterStatKeys.ERROR_MESSAGE) - - return should_filter_event(self.project_config, self._data) - def get_data(self): return self._data diff --git a/src/sentry/integrations/vercel/uihook.py b/src/sentry/integrations/vercel/uihook.py index 4b28b3fc708920..ed9ea5524cdb64 100644 --- a/src/sentry/integrations/vercel/uihook.py +++ b/src/sentry/integrations/vercel/uihook.py @@ -6,11 +6,10 @@ from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt -from sentry.api.base import Endpoint +from sentry.api.base import Endpoint, allow_cors_options from sentry.constants import ObjectStatus from sentry.models import Integration, Organization, OrganizationIntegration, OrganizationStatus from sentry.utils.http import absolute_uri -from sentry.web.api import allow_cors_options from sentry.web.helpers import render_to_response logger = logging.getLogger("sentry.integrations.vercel") diff --git a/src/sentry/interfaces/schemas.py b/src/sentry/interfaces/schemas.py index 653a8c7a4bc09f..cb761db8278dff 100644 --- a/src/sentry/interfaces/schemas.py +++ b/src/sentry/interfaces/schemas.py @@ -266,6 +266,7 @@ def apierror(message="Invalid data"): TAGS_SCHEMA = {"anyOf": [TAGS_DICT_SCHEMA, TAGS_TUPLES_SCHEMA]} +# XXX(markus): Remove in favor of Relay's schema definition EVENT_SCHEMA = { "type": "object", "properties": { diff --git a/src/sentry/interfaces/security.py b/src/sentry/interfaces/security.py index f73a4f903101f0..303fecf5328542 100644 --- a/src/sentry/interfaces/security.py +++ b/src/sentry/interfaces/security.py @@ -11,7 +11,6 @@ from sentry.interfaces.schemas import validate_and_default_interface, INPUT_SCHEMAS from sentry.utils import json from sentry.utils.cache import memoize -from sentry.utils.http import is_valid_origin from sentry.utils.safe import trim from sentry.web.helpers import render_to_string @@ -81,16 +80,6 @@ class SecurityReport(Interface): title = None - @classmethod - def from_raw(cls, raw): - """ - Constructs the interface from a raw security report request body - - This is usually slightly different than to_python as it needs to - do some extra validation, data extraction / default setting. - """ - raise NotImplementedError - @classmethod def to_python(cls, data): # TODO(markus): Relay does not validate security interfaces yet @@ -106,15 +95,6 @@ def get_culprit(self): def get_message(self): raise NotImplementedError - def get_tags(self): - raise NotImplementedError - - def get_title(self): - return self.title - - def should_filter(self, project=None): - raise NotImplementedError - def get_origin(self): """ The document URL that generated this report @@ -167,13 +147,6 @@ def get_culprit(self): def get_message(self): return u"Public key pinning validation failed for '{self.hostname}'".format(self=self) - def get_tags(self): - return [ - ("port", six.text_type(self.port)), - ("include-subdomains", json.dumps(self.include_subdomains)), - ("hostname", self.hostname), - ] - def get_origin(self): # not quite origin, but the domain that failed pinning return self.hostname @@ -181,9 +154,6 @@ def get_origin(self): def get_referrer(self): return None - def should_filter(self, project=None): - return False - class ExpectStaple(SecurityReport): """ @@ -208,34 +178,12 @@ class ExpectStaple(SecurityReport): title = "Expect-Staple Report" - @classmethod - def from_raw(cls, raw): - # Validate the raw data against the input schema (raises on failure) - schema = INPUT_SCHEMAS[cls.path] - jsonschema.validate(raw, schema) - - # For Expect-Staple, the values we want are nested under the - # 'expect-staple-report' key. - raw = raw["expect-staple-report"] - # Trim values and convert keys to use underscores - kwargs = {k.replace("-", "_"): trim(v, 1024) for k, v in six.iteritems(raw)} - - return cls.to_python(kwargs) - def get_culprit(self): return self.hostname def get_message(self): return u"Expect-Staple failed for '{self.hostname}'".format(self=self) - def get_tags(self): - return ( - ("port", six.text_type(self.port)), - ("hostname", self.hostname), - ("response_status", self.response_status), - ("cert_status", self.cert_status), - ) - def get_origin(self): # not quite origin, but the domain that failed pinning return self.hostname @@ -243,9 +191,6 @@ def get_origin(self): def get_referrer(self): return None - def should_filter(self, project=None): - return False - class ExpectCT(SecurityReport): """ @@ -268,28 +213,12 @@ class ExpectCT(SecurityReport): title = "Expect-CT Report" - @classmethod - def from_raw(cls, raw): - # Validate the raw data against the input schema (raises on failure) - schema = INPUT_SCHEMAS[cls.path] - jsonschema.validate(raw, schema) - - # For Expect-CT, the values we want are nested under the 'expect-ct-report' key. - raw = raw["expect-ct-report"] - # Trim values and convert keys to use underscores - kwargs = {k.replace("-", "_"): trim(v, 1024) for k, v in six.iteritems(raw)} - - return cls.to_python(kwargs) - def get_culprit(self): return self.hostname def get_message(self): return u"Expect-CT failed for '{self.hostname}'".format(self=self) - def get_tags(self): - return (("port", six.text_type(self.port)), ("hostname", self.hostname)) - def get_origin(self): # not quite origin, but the domain that failed pinning return self.hostname @@ -297,9 +226,6 @@ def get_origin(self): def get_referrer(self): return None - def should_filter(self, project=None): - return False - class Csp(SecurityReport): """ @@ -321,31 +247,6 @@ class Csp(SecurityReport): title = "CSP Report" - @classmethod - def from_raw(cls, raw): - # Firefox doesn't send effective-directive, so parse it from - # violated-directive but prefer effective-directive when present - # - # refs: https://bugzil.la/1192684#c8 - try: - report = raw["csp-report"] - report["effective-directive"] = report.get( - "effective-directive", report["violated-directive"].split(None, 1)[0] - ) - except (KeyError, IndexError): - pass - - # Validate the raw data against the input schema (raises on failure) - schema = INPUT_SCHEMAS[cls.path] - jsonschema.validate(raw, schema) - - # For CSP, the values we want are nested under the 'csp-report' key. - raw = raw["csp-report"] - # Trim values and convert keys to use underscores - kwargs = {k.replace("-", "_"): trim(v, 1024) for k, v in six.iteritems(raw)} - - return cls.to_python(kwargs) - def get_message(self): templates = { "child-src": (u"Blocked 'child' from '{uri}'", "Blocked inline 'child'"), @@ -396,12 +297,6 @@ def get_culprit(self): bits = [d for d in self.violated_directive.split(" ") if d] return " ".join([bits[0]] + [self._normalize_value(b) for b in bits[1:]]) - def get_tags(self): - return [ - ("effective-directive", self.effective_directive), - ("blocked-uri", self._sanitized_blocked_uri()), - ] - def get_origin(self): return self.document_uri @@ -416,21 +311,6 @@ def to_email_html(self, event, **kwargs): "sentry/partial/interfaces/csp_email.html", {"data": self.get_api_context()} ) - def should_filter(self, project=None): - disallowed = () - paths = ["blocked_uri", "source_file"] - uris = [getattr(self, path) for path in paths if hasattr(self, path)] - - if project is None or bool(project.get_option("sentry:csp_ignored_sources_defaults", True)): - disallowed += DEFAULT_DISALLOWED_SOURCES - if project is not None: - disallowed += tuple(project.get_option("sentry:csp_ignored_sources", [])) - - if disallowed and any(is_valid_origin(uri, allowed=disallowed) for uri in uris): - return True - - return False - def _sanitized_blocked_uri(self): # HACK: This is 100% to work around Stripe urls # that will casually put extremely sensitive information diff --git a/src/sentry/lang/native/error.py b/src/sentry/lang/native/error.py index c46e73f6b5c57c..5fb31126eb6429 100644 --- a/src/sentry/lang/native/error.py +++ b/src/sentry/lang/native/error.py @@ -4,8 +4,7 @@ import six from sentry.utils.compat import implements_to_string -from sentry.lang.native.minidump import is_minidump_event -from sentry.lang.native.utils import image_name +from sentry.lang.native.utils import image_name, is_minidump_event from sentry.models import EventError from sentry.reprocessing import report_processing_issue diff --git a/src/sentry/lang/native/minidump.py b/src/sentry/lang/native/minidump.py deleted file mode 100644 index aeb123720b3c34..00000000000000 --- a/src/sentry/lang/native/minidump.py +++ /dev/null @@ -1,128 +0,0 @@ -from __future__ import absolute_import - -import logging - -import dateutil.parser as dp -from msgpack import unpack, Unpacker, UnpackException, ExtraData - -from sentry.utils.safe import get_path, setdefault_path - -minidumps_logger = logging.getLogger("sentry.minidumps") - -# Attachment type used for minidump files -MINIDUMP_ATTACHMENT_TYPE = "event.minidump" - -MAX_MSGPACK_BREADCRUMB_SIZE_BYTES = 50000 -MAX_MSGPACK_EVENT_SIZE_BYTES = 100000 - - -def write_minidump_placeholder(data): - """ - Writes a placeholder to indicate that this event has an associated minidump. - - This will indicate to the ingestion pipeline that this event will need to be - processed. The payload can be checked via ``is_minidump_event``. - """ - # Minidump events must be native platform. - data["platform"] = "native" - - # Assume that this minidump is the result of a crash and assign the fatal - # level. Note that the use of `setdefault` here doesn't generally allow the - # user to override the minidump's level as processing will overwrite it - # later. - setdefault_path(data, "level", value="fatal") - - # Create a placeholder exception. This signals normalization that this is an - # error event and also serves as a placeholder if processing of the minidump - # fails. - exception = { - "type": "Minidump", - "value": "Invalid Minidump", - "mechanism": {"type": "minidump", "handled": False, "synthetic": True}, - } - data["exception"] = {"values": [exception]} - - -def is_minidump_event(data): - """ - Checks whether an event indicates that it has an associated minidump. - - This requires the event to have a special marker payload. It is written by - ``write_minidump_placeholder``. - """ - exceptions = get_path(data, "exception", "values", filter=True) - return get_path(exceptions, 0, "mechanism", "type") == "minidump" - - -def merge_attached_event(mpack_event, data): - """ - Merges an event payload attached in the ``__sentry-event`` attachment. - """ - size = mpack_event.size - if size == 0 or size > MAX_MSGPACK_EVENT_SIZE_BYTES: - return - - try: - event = unpack(mpack_event) - except (TypeError, ValueError, UnpackException, ExtraData) as e: - minidumps_logger.exception(e) - return - - for key in event: - value = event.get(key) - if value is not None: - data[key] = value - - -def merge_attached_breadcrumbs(mpack_breadcrumbs, data): - """ - Merges breadcrumbs attached in the ``__sentry-breadcrumbs`` attachment(s). - """ - size = mpack_breadcrumbs.size - if size == 0 or size > MAX_MSGPACK_BREADCRUMB_SIZE_BYTES: - return - - try: - unpacker = Unpacker(mpack_breadcrumbs) - breadcrumbs = list(unpacker) - except (TypeError, ValueError, UnpackException, ExtraData) as e: - minidumps_logger.exception(e) - return - - if not breadcrumbs: - return - - current_crumbs = data.get("breadcrumbs") - if not current_crumbs: - data["breadcrumbs"] = breadcrumbs - return - - current_crumb = next( - ( - c - for c in reversed(current_crumbs) - if isinstance(c, dict) and c.get("timestamp") is not None - ), - None, - ) - new_crumb = next( - ( - c - for c in reversed(breadcrumbs) - if isinstance(c, dict) and c.get("timestamp") is not None - ), - None, - ) - - # cap the breadcrumbs to the highest count of either file - cap = max(len(current_crumbs), len(breadcrumbs)) - - if current_crumb is not None and new_crumb is not None: - if dp.parse(current_crumb["timestamp"]) > dp.parse(new_crumb["timestamp"]): - data["breadcrumbs"] = breadcrumbs + current_crumbs - else: - data["breadcrumbs"] = current_crumbs + breadcrumbs - else: - data["breadcrumbs"] = current_crumbs + breadcrumbs - - data["breadcrumbs"] = data["breadcrumbs"][-cap:] diff --git a/src/sentry/lang/native/plugin.py b/src/sentry/lang/native/plugin.py index 7c91f7fd49340a..b395deb09e449d 100644 --- a/src/sentry/lang/native/plugin.py +++ b/src/sentry/lang/native/plugin.py @@ -5,9 +5,7 @@ process_minidump, process_payload, ) -from sentry.lang.native.minidump import is_minidump_event -from sentry.lang.native.utils import is_native_event -from sentry.lang.native.unreal import is_applecrashreport_event +from sentry.lang.native.utils import is_native_event, is_minidump_event, is_applecrashreport_event from sentry.plugins.base.v2 import Plugin2 diff --git a/src/sentry/lang/native/processing.py b/src/sentry/lang/native/processing.py index 4d1af51f5a8fde..f4bbe0ae4cc717 100644 --- a/src/sentry/lang/native/processing.py +++ b/src/sentry/lang/native/processing.py @@ -6,10 +6,10 @@ from sentry.event_manager import validate_and_set_timestamp from sentry.lang.native.error import write_error, SymbolicationFailed -from sentry.lang.native.minidump import MINIDUMP_ATTACHMENT_TYPE, is_minidump_event from sentry.lang.native.symbolicator import Symbolicator -from sentry.lang.native.unreal import APPLECRASHREPORT_ATTACHMENT_TYPE, is_applecrashreport_event from sentry.lang.native.utils import ( + is_minidump_event, + is_applecrashreport_event, get_sdk_from_event, native_images_from_data, is_native_platform, @@ -31,6 +31,12 @@ IMAGE_STATUS_FIELDS = frozenset(("unwind_status", "debug_status")) +# Attachment type used for minidump files +MINIDUMP_ATTACHMENT_TYPE = "event.minidump" + +# Attachment type used for Apple Crash Reports +APPLECRASHREPORT_ATTACHMENT_TYPE = "event.applecrashreport" + def _merge_frame(new_frame, symbolicated): if symbolicated.get("function"): diff --git a/src/sentry/lang/native/unreal.py b/src/sentry/lang/native/unreal.py deleted file mode 100644 index adbe470d3682b5..00000000000000 --- a/src/sentry/lang/native/unreal.py +++ /dev/null @@ -1,143 +0,0 @@ -from __future__ import absolute_import - -from sentry.models import UserReport -from sentry.lang.native.minidump import MINIDUMP_ATTACHMENT_TYPE -from sentry.utils.safe import get_path, set_path, setdefault_path - - -# Attachment type used for Apple Crash Reports -APPLECRASHREPORT_ATTACHMENT_TYPE = "event.applecrashreport" - - -def write_applecrashreport_placeholder(data): - """ - Writes a placeholder to indicate that this event has an apple crash report. - - This will indicate to the ingestion pipeline that this event will need to be - processed. The payload can be checked via ``is_applecrashreport_event``. - """ - # Apple crash report events must be native platform for processing. - data["platform"] = "native" - - # Assume that this minidump is the result of a crash and assign the fatal - # level. Note that the use of `setdefault` here doesn't generally allow the - # user to override the minidump's level as processing will overwrite it - # later. - setdefault_path(data, "level", value="fatal") - - # Create a placeholder exception. This signals normalization that this is an - # error event and also serves as a placeholder if processing of the minidump - # fails. - exception = { - "type": "AppleCrashReport", - "value": "Invalid Apple Crash Report", - "mechanism": {"type": "applecrashreport", "handled": False, "synthetic": True}, - } - data["exception"] = {"values": [exception]} - - -def is_applecrashreport_event(data): - """ - Checks whether an event indicates that it has an apple crash report. - - This requires the event to have a special marker payload. It is written by - ``write_applecrashreport_placeholder``. - """ - exceptions = get_path(data, "exception", "values", filter=True) - return get_path(exceptions, 0, "mechanism", "type") == "applecrashreport" - - -def merge_unreal_user(event, user_id): - """ - Merges user information from the unreal "UserId" into the event payload. - """ - - # https://github.com/EpicGames/UnrealEngine/blob/f509bb2d6c62806882d9a10476f3654cf1ee0634/Engine/Source/Programs/CrashReportClient/Private/CrashUpload.cpp#L769 - parts = user_id.split("|", 2) - login_id, epic_account_id, machine_id = parts + [""] * (3 - len(parts)) - event["user"] = {"id": login_id if login_id else user_id} - if epic_account_id: - set_path(event, "tags", "epic_account_id", value=epic_account_id) - if machine_id: - set_path(event, "tags", "machine_id", value=machine_id) - - -def unreal_attachment_type(unreal_file): - """Returns the `attachment_type` for the - unreal file type or None if not recognized""" - if unreal_file.type == "minidump": - return MINIDUMP_ATTACHMENT_TYPE - if unreal_file.type == "applecrashreport": - return APPLECRASHREPORT_ATTACHMENT_TYPE - - -def merge_unreal_context_event(unreal_context, event, project): - """Merges the context from an Unreal Engine 4 crash - with the given event.""" - runtime_prop = unreal_context.get("runtime_properties") - if runtime_prop is None: - return - - message = runtime_prop.pop("error_message", None) - if message is not None: - event["message"] = message - - username = runtime_prop.pop("username", None) - if username is not None: - set_path(event, "user", "username", value=username) - - memory_physical = runtime_prop.pop("memory_stats_total_physical", None) - if memory_physical is not None: - set_path(event, "contexts", "device", "memory_size", value=memory_physical) - - # Likely overwritten by minidump processing - os_major = runtime_prop.pop("misc_os_version_major", None) - if os_major is not None: # i.e: Windows 10 - set_path(event, "contexts", "os", "name", value=os_major) - - gpu_brand = runtime_prop.pop("misc_primary_cpu_brand", None) - if gpu_brand is not None: - set_path(event, "contexts", "gpu", "name", value=gpu_brand) - - user_desc = runtime_prop.pop("user_description", None) - if user_desc is not None: - feedback_user = "unknown" - if username is not None: - feedback_user = username - - UserReport.objects.create( - project=project, - event_id=event["event_id"], - name=feedback_user, - email="", - comments=user_desc, - ) - - # drop modules. minidump processing adds 'images loaded' - runtime_prop.pop("modules", None) - - # add everything else as extra - set_path(event, "contexts", "unreal", "type", value="unreal") - event["contexts"]["unreal"].update(**runtime_prop) - - # add sdk info - event["sdk"] = { - "name": "sentry.unreal.crashreporter", - "version": runtime_prop.pop("crash_reporter_client_version", "0.0.0"), - } - - -def merge_unreal_logs_event(unreal_logs, event): - setdefault_path(event, "breadcrumbs", "values", value=[]) - breadcrumbs = event["breadcrumbs"]["values"] - - for log in unreal_logs: - message = log.get("message") - if message: - breadcrumbs.append( - { - "timestamp": log.get("timestamp"), - "category": log.get("component"), - "message": message, - } - ) diff --git a/src/sentry/lang/native/utils.py b/src/sentry/lang/native/utils.py index 74470545913a96..1cab9650d447cb 100644 --- a/src/sentry/lang/native/utils.py +++ b/src/sentry/lang/native/utils.py @@ -11,9 +11,6 @@ logger = logging.getLogger(__name__) -# Regex to parse OS versions from a minidump OS string. -VERSION_RE = re.compile(r"(\d+\.\d+\.\d+)\s+(.*)") - # Regex to guess whether we're dealing with Windows or Unix paths. WINDOWS_PATH_RE = re.compile(r"^([a-z]:\\|\\\\)", re.IGNORECASE) @@ -133,3 +130,25 @@ def convert_crashreport_count(value): if value is None: return STORE_CRASH_REPORTS_DEFAULT return int(value) + + +def is_minidump_event(data): + """ + Checks whether an event indicates that it has an associated minidump. + + This requires the event to have a special marker payload. It is written by + ``write_minidump_placeholder``. + """ + exceptions = get_path(data, "exception", "values", filter=True) + return get_path(exceptions, 0, "mechanism", "type") == "minidump" + + +def is_applecrashreport_event(data): + """ + Checks whether an event indicates that it has an apple crash report. + + This requires the event to have a special marker payload. It is written by + ``write_applecrashreport_placeholder``. + """ + exceptions = get_path(data, "exception", "values", filter=True) + return get_path(exceptions, 0, "mechanism", "type") == "applecrashreport" diff --git a/src/sentry/message_filters.py b/src/sentry/message_filters.py index b60b7e940b33c5..985c6772228619 100644 --- a/src/sentry/message_filters.py +++ b/src/sentry/message_filters.py @@ -1,43 +1,16 @@ -# TODO RaduW 8.06.2019 remove the sentry.filters package and rename this module to filters from __future__ import absolute_import -import collections -from collections import namedtuple -import re - from rest_framework import serializers -from six.moves.urllib.parse import urlparse -from ua_parser.user_agent_parser import Parse from sentry.api.fields.multiplechoice import MultipleChoiceField from sentry.models.projectoption import ProjectOption from sentry.signals import inbound_filter_toggled from sentry.utils.data_filters import FilterStatKeys, get_filter_key -from sentry.utils.safe import get_path - - -EventFilteredRet = namedtuple("EventFilteredRet", "should_filter reason") - - -def should_filter_event(project_config, data): - """ - Checks if an event should be filtered - - :param project_config: relay config for the request (for the project really) - :param data: the event data - :return: an EventFilteredRet explaining if the event should be filtered and, if it should the reason - for filtering - """ - for event_filter in get_all_filters(): - if _is_filter_enabled(project_config, event_filter) and event_filter(project_config, data): - return EventFilteredRet(should_filter=True, reason=event_filter.spec.id) - - return EventFilteredRet(should_filter=False, reason=None) -def get_all_filters(): +def get_all_filter_specs(): """ - Returns a list of the existing event filters + Return metadata about the filters known by Sentry. An event filter is a function that receives a project_config and an event data payload and returns a tuple (should_filter:bool, filter_reason: string | None) representing @@ -107,7 +80,7 @@ def get_filter_state(filter_id, project): raise FilterNotRegistered(filter_id) filter_state = ProjectOption.objects.get_value( - project=project, key=u"filters:{}".format(flt.spec.id) + project=project, key=u"filters:{}".format(flt.id) ) if filter_state is None: @@ -137,8 +110,8 @@ def _filter_from_filter_id(filter_id): """ Returns the corresponding filter for a filter id or None if no filter with the given id found """ - for flt in get_all_filters(): - if flt.spec.id == filter_id: + for flt in get_all_filter_specs(): + if flt.id == filter_id: return flt return None @@ -175,200 +148,18 @@ def _get_filter_settings(project_config, flt): return filter_settings.get(get_filter_key(flt), None) -def _is_filter_enabled(project_config, flt): - filter_options = _get_filter_settings(project_config, flt) - - if filter_options is None: - raise ValueError("unknown filter", flt.spec.id) - - return filter_options["isEnabled"] - - -# ************* local host filter ************* -_LOCAL_IPS = frozenset(["127.0.0.1", "::1"]) -_LOCAL_DOMAINS = frozenset(["127.0.0.1", "localhost"]) - - -def _localhost_filter(project_config, data): - ip_address = get_path(data, "user", "ip_address") or "" - url = get_path(data, "request", "url") or "" - domain = urlparse(url).hostname - - return ip_address in _LOCAL_IPS or domain in _LOCAL_DOMAINS - - -_localhost_filter.spec = _FilterSpec( +_localhost_filter = _FilterSpec( id=FilterStatKeys.LOCALHOST, name="Filter out events coming from localhost", description="This applies to both IPv4 (``127.0.0.1``) and IPv6 (``::1``) addresses.", ) -# ************* browser extensions filter ************* -_EXTENSION_EXC_VALUES = re.compile( - "|".join( - ( - re.escape(x) - for x in ( - # Random plugins/extensions - "top.GLOBALS", - # See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html - "originalCreateNotification", - "canvas.contentDocument", - "MyApp_RemoveAllHighlights", - "http://tt.epicplay.com", - "Can't find variable: ZiteReader", - "jigsaw is not defined", - "ComboSearch is not defined", - "http://loading.retry.widdit.com/", - "atomicFindClose", - # Facebook borked - "fb_xd_fragment", - # ISP "optimizing" proxy - `Cache-Control: no-transform` seems to - # reduce this. (thanks @acdha) - # See http://stackoverflow.com/questions/4113268 - "bmi_SafeAddOnload", - "EBCallBackMessageReceived", - # See - # https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/7VU0_VvC7mE - "_gCrWeb", - # See http://toolbar.conduit.com/Debveloper/HtmlAndGadget/Methods/JSInjection.aspx - "conduitPage", - # Google Search app (iOS) - # See: https://github.com/getsentry/raven-js/issues/756 - "null is not an object (evaluating 'elt.parentNode')", - # Dragon Web Extension from Nuance Communications - # See: https://forum.sentry.io/t/error-in-raven-js-plugin-setsuspendstate/481/ - "plugin.setSuspendState is not a function", - # lastpass - "should_do_lastpass_here", - # google translate - # see https://medium.com/@amir.harel/a-b-target-classname-indexof-is-not-a-function-at-least-not-mine-8e52f7be64ca - "a[b].target.className.indexOf is not a function", - ) - ) - ), - re.I, -) - -_EXTENSION_EXC_SOURCES = re.compile( - "|".join( - ( - # Facebook flakiness - r"graph\.facebook\.com", - # Facebook blocked - r"connect\.facebook\.net", - # Woopra flakiness - r"eatdifferent\.com\.woopra-ns\.com", - r"static\.woopra\.com\/js\/woopra\.js", - # Chrome extensions - r"^chrome(?:-extension)?:\/\/", - # Firefox extensions - r"^moz-extension:\/\/", - # Safari extensions - r"^safari-extension:\/\/", - # Cacaoweb - r"127\.0\.0\.1:4001\/isrunning", - # Other - r"webappstoolbarba\.texthelp\.com\/", - r"metrics\.itunes\.apple\.com\.edgesuite\.net\/", - # Kaspersky Protection browser extension - r"kaspersky-labs\.com", - # Google ad server (see http://whois.domaintools.com/2mdn.net) - r"2mdn\.net", - ) - ), - re.I, -) - - -def _browser_extensions_filter(project_config, data): - if data.get("platform") != "javascript": - return False - - # get exception value - try: - exc_value = data["exception"]["values"][0]["value"] - except (LookupError, TypeError): - exc_value = "" - if exc_value: - if _EXTENSION_EXC_VALUES.search(exc_value): - return True - - # get exception source - try: - exc_source = data["exception"]["values"][0]["stacktrace"]["frames"][-1]["abs_path"] - except (LookupError, TypeError): - exc_source = "" - if exc_source: - if _EXTENSION_EXC_SOURCES.search(exc_source): - return True - - return False - - -_browser_extensions_filter.spec = _FilterSpec( +_browser_extensions_filter = _FilterSpec( id=FilterStatKeys.BROWSER_EXTENSION, name="Filter out errors known to be caused by browser extensions", description="Certain browser extensions will inject inline scripts and are known to cause errors.", ) -# ************* legacy browsers filter ************* -MIN_VERSIONS = { - "Chrome": 0, - "IE": 10, - "Firefox": 0, - "Safari": 6, - "Edge": 0, - "Opera": 15, - "Android": 4, - "Opera Mini": 8, -} - - -def _legacy_browsers_filter(project_config, data): - def get_user_agent(data): - try: - for key, value in get_path(data, "request", "headers", filter=True) or (): - if key.lower() == "user-agent": - return value - except LookupError: - return "" - - if data.get("platform") != "javascript": - return False - - value = get_user_agent(data) - if not value: - return False - - ua = Parse(value) - if not ua: - return False - - browser = ua["user_agent"] - - if not browser["family"]: - return False - - # IE Desktop and IE Mobile use the same engines, therefore we can treat them as one - if browser["family"] == "IE Mobile": - browser["family"] = "IE" - - filter_settings = _get_filter_settings(project_config, _legacy_browsers_filter) - - # handle old style config - if filter_settings is None: - return _filter_default(browser) - - enabled_sub_filters = filter_settings.get("options") - if isinstance(enabled_sub_filters, collections.Sequence): - for sub_filter_name in enabled_sub_filters: - sub_filter = _legacy_browsers_sub_filters.get(sub_filter_name) - if sub_filter is not None and sub_filter(browser): - return True - - return False - class _LegacyBrowserFilterSerializer(serializers.Serializer): active = serializers.BooleanField() @@ -386,7 +177,7 @@ class _LegacyBrowserFilterSerializer(serializers.Serializer): ) -_legacy_browsers_filter.spec = _FilterSpec( +_legacy_browsers_filter = _FilterSpec( id=FilterStatKeys.LEGACY_BROWSER, name="Filter out known errors from legacy browsers", description="Older browsers often give less accurate information, and while they may report valid issues, " @@ -395,185 +186,7 @@ class _LegacyBrowserFilterSerializer(serializers.Serializer): ) -def _filter_default(browser): - """ - Legacy filter - new users specify individual filters - """ - try: - minimum_version = MIN_VERSIONS[browser["family"]] - except KeyError: - return False - - try: - major_browser_version = int(browser["major"]) - except (TypeError, ValueError): - return False - - if minimum_version > major_browser_version: - return True - - return False - - -def _filter_opera_pre_15(browser): - if not browser["family"] == "Opera": - return False - - try: - major_browser_version = int(browser["major"]) - except (TypeError, ValueError): - return False - - if major_browser_version < 15: - return True - - return False - - -def _filter_safari_pre_6(browser): - if not browser["family"] == "Safari": - return False - - try: - major_browser_version = int(browser["major"]) - except (TypeError, ValueError): - return False - - if major_browser_version < 6: - return True - - return False - - -def _filter_android_pre_4(browser): - if not browser["family"] == "Android": - return False - - try: - major_browser_version = int(browser["major"]) - except (TypeError, ValueError): - return False - - if major_browser_version < 4: - return True - - return False - - -def _filter_opera_mini_pre_8(browser): - if not browser["family"] == "Opera Mini": - return False - - try: - major_browser_version = int(browser["major"]) - except (TypeError, ValueError): - return False - - if major_browser_version < 8: - return True - - return False - - -def _filter_ie11(browser): - return _filter_ie_internal(browser, lambda major_ver: major_ver == 11) - - -def _filter_ie10(browser): - return _filter_ie_internal(browser, lambda major_ver: major_ver == 10) - - -def _filter_ie9(browser): - return _filter_ie_internal(browser, lambda major_ver: major_ver == 9) - - -def _filter_ie_pre_9(browser): - return _filter_ie_internal(browser, lambda major_ver: major_ver <= 8) - - -def _filter_ie_internal(browser, compare_version): - if not browser["family"] == "IE": - return False - - try: - major_browser_version = int(browser["major"]) - except (TypeError, ValueError): - return False - - return compare_version(major_browser_version) - - -# list all browser specific sub filters that should be called -_legacy_browsers_sub_filters = { - "default": _filter_default, - "opera_pre_15": _filter_opera_pre_15, - "safari_pre_6": _filter_safari_pre_6, - "android_pre_4": _filter_android_pre_4, - "opera_mini_pre_8": _filter_opera_mini_pre_8, - "ie9": _filter_ie9, - "ie10": _filter_ie10, - "ie11": _filter_ie11, - "ie_pre_9": _filter_ie_pre_9, -} - -# ************* web crawler filter ************* - -# not all of these agents are guaranteed to execute JavaScript, but to avoid -# overhead of identifying which ones do, and which ones will over time we simply -# target all of the major ones -_CRAWLERS = re.compile( - r"|".join( - ( - # Google spiders (Adsense and others) - # https://support.google.com/webmasters/answer/1061943?hl=en - r"Mediapartners\-Google", - r"AdsBot\-Google", - r"Googlebot", - r"FeedFetcher\-Google", - # Bing search - r"BingBot", - r"BingPreview", - # Baidu search - r"Baiduspider", - # Yahoo - r"Slurp", - # Sogou - r"Sogou", - # facebook - r"facebook", - # Alexa - r"ia_archiver", - # Generic bot - r"bots?[\/\s\)\;]", - # Generic spider - r"spider[\/\s\)\;]", - # Slack - see https://api.slack.com/robots - r"Slack", - # Google indexing bot - r"Calypso AppCrawler", - # Pingdom - r"pingdom", - # Lytics - r"lyticsbot", - ) - ), - re.I, -) - - -def _web_crawlers_filter(project_config, data): - try: - for key, value in get_path(data, "request", "headers", filter=True) or (): - if key.lower() == "user-agent": - if not value: - return False - return bool(_CRAWLERS.search(value)) - return False - except LookupError: - return False - - -_web_crawlers_filter.spec = _FilterSpec( +_web_crawlers_filter = _FilterSpec( id=FilterStatKeys.WEB_CRAWLER, name="Filter out known web crawlers", description="Some crawlers may execute pages in incompatible ways which then cause errors that" diff --git a/src/sentry/models/monitor.py b/src/sentry/models/monitor.py index 863b292730e8ba..dc41820d56f627 100644 --- a/src/sentry/models/monitor.py +++ b/src/sentry/models/monitor.py @@ -166,7 +166,7 @@ def get_next_scheduled_checkin(self, last_checkin=None): return next_checkin + timedelta(minutes=int(self.config.get("checkin_margin") or 0)) def mark_failed(self, last_checkin=None, reason=MonitorFailure.UNKNOWN): - from sentry.coreapi import ClientApiHelper + from sentry.coreapi import insert_data_to_database_legacy from sentry.event_manager import EventManager from sentry.models import Project from sentry.signals import monitor_failed @@ -201,7 +201,6 @@ def mark_failed(self, last_checkin=None, reason=MonitorFailure.UNKNOWN): ) event_manager.normalize() data = event_manager.get_data() - helper = ClientApiHelper(project_id=self.project_id) - helper.insert_data_to_database(data) + insert_data_to_database_legacy(data) monitor_failed.send(monitor=self, sender=type(self)) return True diff --git a/src/sentry/models/projectkey.py b/src/sentry/models/projectkey.py index 82f2d250625206..3d74737bf190a9 100644 --- a/src/sentry/models/projectkey.py +++ b/src/sentry/models/projectkey.py @@ -194,37 +194,23 @@ def dsn_public(self): def csp_endpoint(self): endpoint = self.get_endpoint() - return "%s%s?sentry_key=%s" % ( - endpoint, - reverse("sentry-api-csp-report", args=[self.project_id]), - self.public_key, - ) + return "%s/api/%s/csp-report/?sentry_key=%s" % (endpoint, self.project_id, self.public_key) @property def security_endpoint(self): endpoint = self.get_endpoint() - return "%s%s?sentry_key=%s" % ( - endpoint, - reverse("sentry-api-security-report", args=[self.project_id]), - self.public_key, - ) + return "%s/api/%s/security/?sentry_key=%s" % (endpoint, self.project_id, self.public_key) @property def minidump_endpoint(self): endpoint = self.get_endpoint() - return "%s%s/?sentry_key=%s" % ( - endpoint, - reverse("sentry-api-minidump", args=[self.project_id]), - self.public_key, - ) + return "%s/api/%s/minidump/?sentry_key=%s" % (endpoint, self.project_id, self.public_key) @property def unreal_endpoint(self): - return self.get_endpoint() + reverse( - "sentry-api-unreal", args=[self.project_id, self.public_key] - ) + return "%s/api/%s/unreal/%s/" % (self.get_endpoint(), self.project_id, self.public_key) @property def js_sdk_loader_cdn_url(self): diff --git a/src/sentry/relay/config.py b/src/sentry/relay/config.py index 206b673560422d..f742f964df5f25 100644 --- a/src/sentry/relay/config.py +++ b/src/sentry/relay/config.py @@ -12,7 +12,7 @@ from sentry.constants import ObjectStatus from sentry.grouping.api import get_grouping_config_dict_for_project from sentry.interfaces.security import DEFAULT_DISALLOWED_SOURCES -from sentry.message_filters import get_all_filters +from sentry.message_filters import get_all_filter_specs from sentry.utils.data_filters import FilterTypes, FilterStatKeys, get_filter_key from sentry.utils.http import get_origins from sentry.utils.sdk import configure_scope @@ -45,7 +45,7 @@ def get_public_key_configs(project, full_config, project_keys=None): def get_filter_settings(project): filter_settings = {} - for flt in get_all_filters(): + for flt in get_all_filter_specs(): filter_id = get_filter_key(flt) settings = _load_filter_settings(flt, project) filter_settings[filter_id] = settings @@ -267,7 +267,7 @@ def _load_filter_settings(flt, project): If the project does not explicitly specify the filter options then the default options for the filter will be returned """ - filter_id = flt.spec.id + filter_id = flt.id filter_key = u"filters:{}".format(filter_id) setting = project.get_option(filter_key) @@ -285,9 +285,7 @@ def _filter_option_to_config_setting(flt, setting): if setting is None: raise ValueError( "Could not find filter state for filter {0}." - " You need to register default filter state in projectoptions.defaults.".format( - flt.spec.id - ) + " You need to register default filter state in projectoptions.defaults.".format(flt.id) ) is_enabled = setting != "0" @@ -296,7 +294,7 @@ def _filter_option_to_config_setting(flt, setting): # special case for legacy browser. # If the number of special cases increases we'll have to factor this functionality somewhere - if flt.spec.id == FilterStatKeys.LEGACY_BROWSER: + if flt.id == FilterStatKeys.LEGACY_BROWSER: if is_enabled: if setting == "1": ret_val["options"] = ["default"] diff --git a/src/sentry/tasks/reprocessing.py b/src/sentry/tasks/reprocessing.py index f88b92941bb067..4dd235e4406232 100644 --- a/src/sentry/tasks/reprocessing.py +++ b/src/sentry/tasks/reprocessing.py @@ -15,7 +15,7 @@ @instrumented_task(name="sentry.tasks.reprocess_events", queue="events.reprocess_events") def reprocess_events(project_id, **kwargs): from sentry.models import ProcessingIssue - from sentry.coreapi import ClientApiHelper + from sentry.coreapi import insert_data_to_database_legacy from sentry import app lock_key = "events:reprocess_events:%s" % project_id @@ -26,9 +26,8 @@ def reprocess_events(project_id, **kwargs): with lock.acquire(): raw_events, have_more = ProcessingIssue.objects.find_resolved(project_id) if raw_events: - helper = ClientApiHelper() for raw_event in raw_events: - helper.insert_data_to_database(raw_event.data.data, from_reprocessing=True) + insert_data_to_database_legacy(raw_event.data.data, from_reprocessing=True) create_reprocessing_report(project_id=project_id, event_id=raw_event.event_id) # Here we only delete the raw event but leave the # reprocessing report alive. When the queue diff --git a/src/sentry/testutils/cases.py b/src/sentry/testutils/cases.py index 2354677d359a77..ae59df97428dd6 100644 --- a/src/sentry/testutils/cases.py +++ b/src/sentry/testutils/cases.py @@ -86,7 +86,6 @@ from .helpers import ( AuthProvider, Feature, - get_auth_header, TaskRunner, override_options, parse_queries, @@ -228,126 +227,6 @@ def _makeMessage(self, data): def _makePostMessage(self, data): return base64.b64encode(self._makeMessage(data)) - def _postWithHeader(self, data, key=None, secret=None, protocol=None, **extra): - if key is None: - key = self.projectkey.public_key - secret = self.projectkey.secret_key - - message = self._makePostMessage(data) - with self.tasks(): - resp = self.client.post( - reverse("sentry-api-store"), - message, - content_type="application/octet-stream", - HTTP_X_SENTRY_AUTH=get_auth_header("_postWithHeader/0.0.0", key, secret, protocol), - **extra - ) - return resp - - def _postCspWithHeader(self, data, key=None, **extra): - if isinstance(data, dict): - body = json.dumps({"csp-report": data}) - elif isinstance(data, six.string_types): - body = data - path = reverse("sentry-api-csp-report", kwargs={"project_id": self.project.id}) - path += "?sentry_key=%s" % self.projectkey.public_key - with self.tasks(): - return self.client.post( - path, - data=body, - content_type="application/csp-report", - HTTP_USER_AGENT=DEFAULT_USER_AGENT, - **extra - ) - - def _postMinidumpWithHeader( - self, upload_file_minidump, data=None, key=None, raw=False, **extra - ): - if raw: - data = upload_file_minidump.read() - extra.setdefault("content_type", "application/octet-stream") - else: - data = dict(data or {}) - data["upload_file_minidump"] = upload_file_minidump - - path = reverse("sentry-api-minidump", kwargs={"project_id": self.project.id}) - path += "?sentry_key=%s" % self.projectkey.public_key - with self.tasks(): - return self.client.post(path, data=data, HTTP_USER_AGENT=DEFAULT_USER_AGENT, **extra) - - def _postUnrealWithHeader(self, upload_unreal_crash, data=None, key=None, **extra): - path = reverse( - "sentry-api-unreal", - kwargs={"project_id": self.project.id, "sentry_key": self.projectkey.public_key}, - ) - with self.tasks(): - return self.client.post( - path, - data=upload_unreal_crash, - content_type="application/octet-stream", - HTTP_USER_AGENT=DEFAULT_USER_AGENT, - **extra - ) - - def _postEventAttachmentWithHeader(self, attachment, **extra): - path = reverse( - "sentry-api-event-attachment", - kwargs={"project_id": self.project.id, "event_id": self.event.event_id}, - ) - - key = self.projectkey.public_key - secret = self.projectkey.secret_key - - with self.tasks(): - return self.client.post( - path, - attachment, - # HTTP_USER_AGENT=DEFAULT_USER_AGENT, - HTTP_X_SENTRY_AUTH=get_auth_header("_postWithHeader/0.0.0", key, secret, 7), - **extra - ) - - def _getWithReferer(self, data, key=None, referer="sentry.io", protocol="4"): - if key is None: - key = self.projectkey.public_key - - headers = {} - if referer is not None: - headers["HTTP_REFERER"] = referer - - message = self._makeMessage(data) - qs = { - "sentry_version": protocol, - "sentry_client": "raven-js/lol", - "sentry_key": key, - "sentry_data": message, - } - with self.tasks(): - resp = self.client.get( - "%s?%s" % (reverse("sentry-api-store", args=(self.project.pk,)), urlencode(qs)), - **headers - ) - return resp - - def _postWithReferer(self, data, key=None, referer="sentry.io", protocol="4"): - if key is None: - key = self.projectkey.public_key - - headers = {} - if referer is not None: - headers["HTTP_REFERER"] = referer - - message = self._makeMessage(data) - qs = {"sentry_version": protocol, "sentry_client": "raven-js/lol", "sentry_key": key} - with self.tasks(): - resp = self.client.post( - "%s?%s" % (reverse("sentry-api-store", args=(self.project.pk,)), urlencode(qs)), - data=message, - content_type="application/json", - **headers - ) - return resp - def options(self, options): """ A context manager that temporarily sets a global option and reverts @@ -355,9 +234,6 @@ def options(self, options): """ return override_options(options) - _postWithSignature = _postWithHeader - _postWithNewSignature = _postWithHeader - def assert_valid_deleted_log(self, deleted_log, original_object): assert deleted_log is not None assert original_object.name == deleted_log.name diff --git a/src/sentry/testutils/relay.py b/src/sentry/testutils/relay.py index d975f8a7f885f7..ca71e7180d0bbc 100644 --- a/src/sentry/testutils/relay.py +++ b/src/sentry/testutils/relay.py @@ -1,7 +1,5 @@ from __future__ import absolute_import -import json - import pytest import requests import responses @@ -62,31 +60,14 @@ def adjust_settings_for_relay_tests(settings): settings.SENTRY_RELAY_WHITELIST_PK = ["SMSesqan65THCV6M4qs4kBzPai60LzuDn-xNsvYpuP8"] -class SentryStoreHelper(object): - """ - Unit tests that post to the store entry point should use this - helper class (together with RelayStoreHelper) to check the functionality - with both posting to the Sentry Store and the Relay Store. - """ - - def use_relay(self): - return False - - def post_and_retrieve_event(self, data): - resp = self._postWithHeader(data) - assert resp.status_code == 200 - event_id = json.loads(resp.content)["id"] - - event = eventstore.get_event_by_id(self.project.id, event_id) - assert event is not None - return event - - class RelayStoreHelper(object): """ - Unit tests that post to the store entry point should use this - helper class (together with RelayStoreHelper) to check the functionality - with both posting to the Sentry Store and the Relay Store. + Tests that post to the store entry point should use this helper class + (together with RelayStoreHelper) to check the functionality with relay. + + Note that any methods defined on this mixin are very slow. Consider whether + your test really needs to test the entire ingestion pipeline or whether + it's fine to call the regular `store_event` or `create_event`. """ def use_relay(self): @@ -118,14 +99,56 @@ def post_and_try_retrieve_event(self, data): except AssertionError: return None - def setUp(self): # NOQA + def post_and_retrieve_minidump(self, files, data): + url = self.get_relay_minidump_url(self.project.id, self.projectkey.public_key) + responses.add_passthru(url) + + resp = requests.post(url, files=dict(files or ()), data=dict(data or ()),) + + assert resp.ok + event_id = resp.text.strip().replace("-", "") + + event = self.wait_for_ingest_consumer( + lambda: eventstore.get_event_by_id(self.project.id, event_id) + ) + # check that we found it in Snuba + assert event is not None + return event + + def post_and_retrieve_unreal(self, payload): + url = self.get_relay_unreal_url(self.project.id, self.projectkey.public_key) + responses.add_passthru(url) + + resp = requests.post(url, data=payload,) + + assert resp.ok + event_id = resp.text.strip().replace("-", "") + + event = self.wait_for_ingest_consumer( + lambda: eventstore.get_event_by_id(self.project.id, event_id) + ) + # check that we found it in Snuba + assert event is not None + return event + + @pytest.fixture(autouse=True) + def relay_setup_fixtures( + self, + settings, + live_server, + get_relay_store_url, + get_relay_minidump_url, + get_relay_unreal_url, + wait_for_ingest_consumer, + ): self.auth_header = get_auth_header( "TEST_USER_AGENT/0.0.0", self.projectkey.public_key, self.projectkey.secret_key, "7" ) - adjust_settings_for_relay_tests(self.settings) - @pytest.fixture(autouse=True) - def setup_fixtures(self, settings, live_server, get_relay_store_url, wait_for_ingest_consumer): + adjust_settings_for_relay_tests(settings) + self.settings = settings self.get_relay_store_url = get_relay_store_url # noqa + self.get_relay_minidump_url = get_relay_minidump_url # noqa + self.get_relay_unreal_url = get_relay_unreal_url # noqa self.wait_for_ingest_consumer = wait_for_ingest_consumer(settings) # noqa diff --git a/src/sentry/utils/auth.py b/src/sentry/utils/auth.py index ea421dee9382da..eace2f9ffd6f81 100644 --- a/src/sentry/utils/auth.py +++ b/src/sentry/utils/auth.py @@ -11,7 +11,6 @@ from time import time from sentry.models import User, Authenticator -from sentry.utils.compat import map logger = logging.getLogger("sentry.auth") @@ -27,19 +26,6 @@ def __init__(self, user): self.user = user -def _make_key_value(val): - return val.strip().split(u"=", 1) - - -def parse_auth_header(header): - if isinstance(header, bytes): - header = header.decode("latin1") - try: - return dict(map(_make_key_value, header.split(u" ", 1)[1].split(u","))) - except Exception: - return {} - - def get_auth_providers(): return [ key diff --git a/src/sentry/utils/data_filters.py b/src/sentry/utils/data_filters.py index f2cf95d0f6554c..8d4db3f0535a45 100644 --- a/src/sentry/utils/data_filters.py +++ b/src/sentry/utils/data_filters.py @@ -1,13 +1,6 @@ from __future__ import absolute_import -import fnmatch -import ipaddress -import six - -from django.utils.encoding import force_text - from sentry import tsdb -from sentry.utils.safe import get_path from sentry.relay.utils import to_camel_case_name @@ -49,76 +42,5 @@ class FilterTypes(object): RELEASES = "releases" -def is_valid_ip(project_config, ip_address): - """ - Verify that an IP address is not being blacklisted - for the given project. - """ - blacklist = get_path(project_config.config, "filterSettings", "clientIps", "blacklistedIps") - if not blacklist: - return True - - for addr in blacklist: - # We want to error fast if it's an exact match - if ip_address == addr: - return False - - # Check to make sure it's actually a range before - try: - if "/" in addr and ( - ipaddress.ip_address(six.text_type(ip_address)) - in ipaddress.ip_network(six.text_type(addr), strict=False) - ): - return False - except ValueError: - # Ignore invalid values here - pass - - return True - - -def is_valid_release(project_config, release): - """ - Verify that a release is not being filtered - for the given project. - """ - invalid_versions = get_path(project_config.config, "filterSettings", "releases", "releases") - - if not invalid_versions: - return True - - release = force_text(release).lower() - - for version in invalid_versions: - if fnmatch.fnmatch(release, version.lower()): - return False - - return True - - -def is_valid_error_message(project_config, message): - """ - Verify that an error message is not being filtered - for the given project. - """ - filtered_errors = get_path(project_config.config["filterSettings"], "errorMessages", "patterns") - - if not filtered_errors: - return True - - message = force_text(message).lower() - - for error in filtered_errors: - try: - if fnmatch.fnmatch(message, error.lower()): - return False - except Exception: - # fnmatch raises a string when the pattern is bad. - # Patterns come from end users and can be full of mistakes. - pass - - return True - - def get_filter_key(flt): - return to_camel_case_name(flt.spec.id.replace("-", "_")) + return to_camel_case_name(flt.id.replace("-", "_")) diff --git a/src/sentry/utils/pytest/kafka.py b/src/sentry/utils/pytest/kafka.py index 0cfc06b9c0e7cf..69b6977607d0c6 100644 --- a/src/sentry/utils/pytest/kafka.py +++ b/src/sentry/utils/pytest/kafka.py @@ -118,22 +118,15 @@ def scope_consumers(): """ all_consumers = { - "ingest_events": None, - "ingest_transactions": None, - "ingest_attachments": None, + # Relay is configured to use this topic for all ingest messages. See + # `templates/config.yml`. + "ingest-events": None, "outcomes": None, } + yield all_consumers - for (consumer, consumer_name) in ( - (all_consumers.get(consumer_name), consumer_name) - for consumer_name in ( - "ingest_events", - "ingest_transactions", - "ingest_attachments", - "outcomes", - ) - ): + for consumer_name, consumer in six.iteritems(all_consumers): if consumer is not None: try: # stop the consumer @@ -148,7 +141,7 @@ def session_ingest_consumer(scope_consumers, kafka_admin, task_runner): """ Returns a factory for a session ingest consumer. - Note/Warning: Once an inject consumer is created it will be reused by all tests in the session. + Note/Warning: Once an ingest consumer is created it will be reused by all tests in the session. The ingest consumer is created the first time with the provided settings and then reused. If you don't want this behaviour DO NOT USE this fixture (create a fixture, similar with this one, that returns a new consumer at each invocation rather then reusing it) @@ -157,30 +150,36 @@ def session_ingest_consumer(scope_consumers, kafka_admin, task_runner): """ def ingest_consumer(settings): - from sentry.ingest.ingest_consumer import ConsumerType, get_ingest_consumer + from sentry.ingest.ingest_consumer import ( + create_batching_kafka_consumer, + IngestConsumerWorker, + ) + + # Relay is configured to use this topic for all ingest messages. See + # `templates/config.yml`. + topic_event_name = "ingest-events" - if scope_consumers["ingest_events"] is not None: - return scope_consumers[ - "ingest_events" - ] # reuse whatever was already created (will ignore the settings) + if scope_consumers[topic_event_name] is not None: + # reuse whatever was already created (will ignore the settings) + return scope_consumers[topic_event_name] # first time the consumer is requested, create it using settings - topic_event_name = ConsumerType.get_topic_name(ConsumerType.Events) admin = kafka_admin(settings) admin.delete_topic(topic_event_name) # simulate the event ingestion task group_id = "test-consumer" - consumer = get_ingest_consumer( + consumer = create_batching_kafka_consumer( + topic_names=[topic_event_name], + worker=IngestConsumerWorker(concurrency=None), max_batch_size=1, max_batch_time=10, group_id=group_id, - consumer_types=[ConsumerType.Events], auto_offset_reset="earliest", ) - scope_consumers["ingest_events"] = consumer + scope_consumers[topic_event_name] = consumer return consumer @@ -207,8 +206,8 @@ def wait_for_ingest_consumer(session_ingest_consumer, task_runner): assert result == expected_result """ - def factory(settings): - consumer = session_ingest_consumer(settings) + def factory(settings, **kwargs): + consumer = session_ingest_consumer(settings, **kwargs) def waiter(exit_predicate, max_time=MAX_SECONDS_WAITING_FOR_EVENT): """ diff --git a/src/sentry/utils/pytest/relay.py b/src/sentry/utils/pytest/relay.py index 281ed1373b0a6c..436713305412dd 100644 --- a/src/sentry/utils/pytest/relay.py +++ b/src/sentry/utils/pytest/relay.py @@ -139,7 +139,23 @@ def relay_server(relay_server_setup): @pytest.fixture def get_relay_store_url(relay_server): - def relay_store_url(project_id): + def inner(project_id): return "{}/api/{}/store/".format(relay_server["url"], project_id) - return relay_store_url + return inner + + [email protected] +def get_relay_minidump_url(relay_server): + def inner(project_id, key): + return "{}/api/{}/minidump/?sentry_key={}".format(relay_server["url"], project_id, key) + + return inner + + [email protected] +def get_relay_unreal_url(relay_server): + def inner(project_id, key): + return "{}/api/{}/unreal/{}/".format(relay_server["url"], project_id, key) + + return inner diff --git a/src/sentry/utils/pytest/template/config.yml b/src/sentry/utils/pytest/template/config.yml index 6a9c563a367fa4..5ddfcb1d6f63eb 100644 --- a/src/sentry/utils/pytest/template/config.yml +++ b/src/sentry/utils/pytest/template/config.yml @@ -11,4 +11,9 @@ processing: enabled: true kafka_config: - {name: "bootstrap.servers", value: "${KAFKA_HOST}:9093"} + topics: + events: ingest-events + attachments: ingest-events + transactions: ingest-events + outcomes: outcomes redis: redis://${REDIS_HOST}:6379 diff --git a/src/sentry/web/api.py b/src/sentry/web/api.py index c72ff9c00c6540..c638f542863426 100644 --- a/src/sentry/web/api.py +++ b/src/sentry/web/api.py @@ -1,1066 +1,14 @@ from __future__ import absolute_import, print_function -import base64 -import math - -import io -import jsonschema -import logging -import random -import six -import traceback -import uuid - -from time import time - -from django.conf import settings -from django.contrib.auth.models import AnonymousUser -from django.core.cache import cache -from django.core.urlresolvers import reverse -from django.core.files import uploadhandler -from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed -from django.http.multipartparser import MultiPartParser -from django.utils.encoding import force_bytes -from django.views.decorators.cache import never_cache, cache_control -from django.views.decorators.csrf import csrf_exempt +from django.http import HttpResponse +from django.views.decorators.cache import cache_control from django.views.generic.base import View as BaseView -from functools import wraps -from querystring_parser import parser -from symbolic import ProcessMinidumpError, Unreal4Crash, Unreal4Error -from sentry_relay import ProcessingErrorInvalidTransaction - -from sentry import features, options, quotas -from sentry.attachments import CachedAttachment -from sentry.constants import DataCategory, ObjectStatus -from sentry.coreapi import ( - Auth, - APIError, - APIForbidden, - APIRateLimited, - ClientApiHelper, - ClientAuthHelper, - SecurityAuthHelper, - MinidumpAuthHelper, - safely_load_json_string, - logger as api_logger, -) -from sentry.event_manager import EventManager -from sentry.interfaces import schemas -from sentry.interfaces.base import get_interface -from sentry.lang.native.unreal import ( - merge_unreal_user, - unreal_attachment_type, - merge_unreal_context_event, - merge_unreal_logs_event, - write_applecrashreport_placeholder, -) -from sentry.lang.native.minidump import ( - merge_attached_event, - merge_attached_breadcrumbs, - write_minidump_placeholder, - MINIDUMP_ATTACHMENT_TYPE, -) -from sentry.models import Project, File, EventAttachment, Organization -from sentry.signals import event_accepted, event_received -from sentry.quotas.base import RateLimit -from sentry.utils import json, metrics -from sentry.utils.data_filters import FilterStatKeys -from sentry.utils.http import is_valid_origin, get_origins, is_same_domain, origin_from_request -from sentry.utils.outcomes import Outcome, track_outcome -from sentry.utils.pubsub import QueuedPublisherService, KafkaPublisher -from sentry.utils.safe import safe_execute -from sentry.utils.sdk import configure_scope +from sentry.models import Project +from sentry.utils import json +from sentry.utils.http import get_origins from sentry.web.helpers import render_to_response from sentry.web.client_config import get_client_config -from sentry.relay.config import get_project_config -from sentry.datascrubbing import scrub_data - -logger = logging.getLogger("sentry") -minidumps_logger = logging.getLogger("sentry.minidumps") - -# Transparent 1x1 gif -# See http://probablyprogramming.com/2009/03/15/the-tiniest-gif-ever -PIXEL = base64.b64decode("R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=") - -PROTOCOL_VERSIONS = frozenset(("2.0", "3", "4", "5", "6", "7")) - -kafka_publisher = ( - QueuedPublisherService( - KafkaPublisher( - getattr(settings, "KAFKA_RAW_EVENTS_PUBLISHER_CONNECTION", None), asynchronous=False - ) - ) - if getattr(settings, "KAFKA_RAW_EVENTS_PUBLISHER_ENABLED", False) - else None -) - - -def allow_cors_options(func): - """ - Decorator that adds automatic handling of OPTIONS requests for CORS - - If the request is OPTIONS (i.e. pre flight CORS) construct a OK (200) response - in which we explicitly enable the caller and add the custom headers that we support - For other requests just add the appropriate CORS headers - - :param func: the original request handler - :return: a request handler that shortcuts OPTIONS requests and just returns an OK (CORS allowed) - """ - - @wraps(func) - def allow_cors_options_wrapper(self, request, *args, **kwargs): - - if request.method == "OPTIONS": - response = HttpResponse(status=200) - response["Access-Control-Max-Age"] = "3600" # don't ask for options again for 1 hour - else: - response = func(self, request, *args, **kwargs) - - allow = ", ".join(self._allowed_methods()) - response["Allow"] = allow - response["Access-Control-Allow-Methods"] = allow - response["Access-Control-Allow-Headers"] = ( - "X-Sentry-Auth, X-Requested-With, Origin, Accept, " - "Content-Type, Authentication, Authorization, Content-Encoding" - ) - response["Access-Control-Expose-Headers"] = "X-Sentry-Error, Retry-After" - - if request.META.get("HTTP_ORIGIN") == "null": - origin = "null" # if ORIGIN header is explicitly specified as 'null' leave it alone - else: - origin = origin_from_request(request) - - if origin is None or origin == "null": - response["Access-Control-Allow-Origin"] = "*" - else: - response["Access-Control-Allow-Origin"] = origin - - return response - - return allow_cors_options_wrapper - - -def disable_transaction_events(): - """ - Do not send a transaction event for the current transaction. - - This is used in StoreView to prevent infinite recursion. - """ - with configure_scope() as scope: - if scope.span: - scope.span.sampled = False - - -def api(func): - @wraps(func) - def wrapped(request, *args, **kwargs): - data = func(request, *args, **kwargs) - if request.is_ajax(): - response = HttpResponse(data) - response["Content-Type"] = "application/json" - else: - ref = request.META.get("HTTP_REFERER") - if ref is None or not is_same_domain(ref, request.build_absolute_uri()): - ref = reverse("sentry") - return HttpResponseRedirect(ref) - return response - - return wrapped - - -def _get_project_id_from_request(project_id, request, auth_helper_cls, helper): - """ - Tries to return the project id (as a string) from the request params or from the auth info - - :param project_id: the project id from the url (or None if not specified) - :param request: the HTTP request - :param auth_helper_cls: Authentication helper class (from APIView) - :param helper: client API helper - :return: the project id (as string) if found raises if not found - - :raises APIUnauthorized if bad Authorization header detected or the key is not usable (e.g. disabled) - """ - if project_id is not None: - # we have an explicit project id, just return it - return six.text_type(project_id) - else: # look in the authentication information for the project id - auth = auth_helper_cls.auth_from_request(request) - return helper.project_id_from_auth(auth) - - -def process_event(event_manager, project, key, remote_addr, helper, attachments, project_config): - event_received.send_robust(ip=remote_addr, project=project, sender=process_event) - - start_time = time() - - data = event_manager.get_data() - should_filter, filter_reason = event_manager.should_filter() - del event_manager - - event_id = data["event_id"] - data_category = DataCategory.from_event_type(data.get("type")) - - if should_filter: - track_outcome( - project_config.organization_id, - project_config.project_id, - key.id, - Outcome.FILTERED, - filter_reason, - event_id=event_id, - category=data_category, - ) - metrics.incr("events.blacklisted", tags={"reason": filter_reason}, skip_internal=False) - - # relay will no longer be able to provide information about filter - # status so to see the impact we're adding a way to turn on relay - # like behavior here. - if options.get("store.lie-about-filter-status"): - return event_id - - raise APIForbidden("Event dropped due to filter: %s" % (filter_reason,)) - - # TODO: improve this API (e.g. make RateLimit act on __ne__) - rate_limit = safe_execute( - quotas.is_rate_limited, project=project, key=key, _with_transaction=False - ) - if isinstance(rate_limit, bool): - rate_limit = RateLimit(is_limited=rate_limit, retry_after=None) - - # XXX(dcramer): when the rate limiter fails we drop events to ensure - # it cannot cascade - if rate_limit is None or rate_limit.is_limited: - if rate_limit is None: - api_logger.debug("Dropped event due to error with rate limiter") - - reason = rate_limit.reason_code if rate_limit else None - track_outcome( - project_config.organization_id, - project_config.project_id, - key.id, - Outcome.RATE_LIMITED, - reason, - event_id=event_id, - category=data_category, - ) - metrics.incr("events.dropped", tags={"reason": reason or "unknown"}, skip_internal=False) - - if rate_limit is not None: - raise APIRateLimited(rate_limit.retry_after) - - # TODO(dcramer): ideally we'd only validate this if the event_id was - # supplied by the user - cache_key = "ev:%s:%s" % (project_config.project_id, event_id) - - # XXX(markus): I believe this code is extremely broken: - # - # * it practically uses memcached in prod which has no consistency - # guarantees (no idea how we don't run into issues there) - # - # * a TTL of 1h basically doesn't guarantee any deduplication at all. It - # just guarantees a good error message... for one hour. - if cache.get(cache_key) is not None: - track_outcome( - project_config.organization_id, - project_config.project_id, - key.id, - Outcome.INVALID, - "duplicate", - event_id=event_id, - category=data_category, - ) - raise APIForbidden("An event with the same ID already exists (%s)" % (event_id,)) - - data = scrub_data(project, dict(data)) - - # mutates data (strips a lot of context if not queued) - helper.insert_data_to_database(data, start_time=start_time, attachments=attachments) - - cache.set(cache_key, "", 60 * 60) # Cache for 1 hour - - api_logger.debug("New event received (%s)", event_id) - - event_accepted.send_robust(ip=remote_addr, data=data, project=project, sender=process_event) - - return event_id - - -class APIView(BaseView): - auth_helper_cls = ClientAuthHelper - - def _get_project_from_id(self, project_id): - if not project_id: - return - if not project_id.isdigit(): - track_outcome(0, 0, None, Outcome.INVALID, "project_id") - raise APIError("Invalid project_id: %r" % project_id) - try: - project = Project.objects.get_from_cache(id=project_id) - except Project.DoesNotExist: - track_outcome(0, 0, None, Outcome.INVALID, "project_id") - raise APIError("Invalid project_id: %r" % project_id) - else: - if project.status != ObjectStatus.VISIBLE: - track_outcome(0, 0, None, Outcome.INVALID, "project_id") - raise APIError("Invalid project_id: %r" % project_id) - return project - - def _parse_header(self, request, project_config): - auth = self.auth_helper_cls.auth_from_request(request) - - if auth.version not in PROTOCOL_VERSIONS: - track_outcome( - project_config.organization_id, - project_config.project_id, - None, - Outcome.INVALID, - "auth_version", - ) - raise APIError( - "Client using unsupported server protocol version (%r)" - % six.text_type(auth.version or "") - ) - - if not auth.client: - track_outcome( - project_config.organization_id, - project_config.project_id, - None, - Outcome.INVALID, - "auth_client", - ) - raise APIError("Client did not send 'client' identifier") - - return auth - - def _publish_to_kafka(self, request, project_config): - """ - Sends raw event data to Kafka for later offline processing. - """ - try: - raw_event_sample_rate = options.get("kafka-publisher.raw-event-sample-rate") - - # Early return if sampling is disabled - if raw_event_sample_rate == 0: - return - - # This may fail when we e.g. send a multipart form. We ignore those errors for now. - data = request.body - - if not data or len(data) > options.get("kafka-publisher.max-event-size"): - return - - # Sampling - if random.random() >= raw_event_sample_rate: - return - - # We want to send only serializable items from request.META - meta = {} - for key, value in request.META.items(): - try: - json.dumps([key, value]) - meta[key] = value - except (TypeError, ValueError): - pass - - meta["SENTRY_API_VIEW_NAME"] = self.__class__.__name__ - - kafka_publisher.publish( - channel=getattr(settings, "KAFKA_RAW_EVENTS_PUBLISHER_TOPIC", "raw-store-events"), - value=json.dumps([meta, base64.b64encode(data), project_config.to_dict()]), - ) - except Exception as e: - logger.debug("Cannot publish event to Kafka: {}".format(six.text_type(e))) - - @csrf_exempt - @never_cache - @allow_cors_options - def dispatch(self, request, project_id=None, *args, **kwargs): - helper = None - try: - helper = ClientApiHelper( - agent=request.META.get("HTTP_USER_AGENT"), - project_id=project_id, - ip_address=request.META["REMOTE_ADDR"], - ) - - # if the project id is not directly specified get it from the authentication information - project_id = _get_project_id_from_request( - project_id, request, self.auth_helper_cls, helper - ) - - project = self._get_project_from_id(six.text_type(project_id)) - - # Explicitly bind Organization so we don't implicitly query it later - # this just allows us to comfortably assure that `project.organization` is safe. - # This also allows us to pull the object from cache, instead of being - # implicitly fetched from database. - project.organization = Organization.objects.get_from_cache(id=project.organization_id) - - # XXX: This never returns a disabled project since visibility of the - # project is already verified in `self._get_project_from_id`. - project_config = get_project_config(project) - - helper.context.bind_project(project_config.project) - - if kafka_publisher is not None: - self._publish_to_kafka(request, project_config) - - origin = self.auth_helper_cls.origin_from_request(request) - - response = self._dispatch( - request, helper, project_config, origin=origin, *args, **kwargs - ) - except APIError as e: - context = {"error": force_bytes(e.msg, errors="replace")} - if e.name: - context["error_name"] = e.name - - response = HttpResponse( - json.dumps(context), content_type="application/json", status=e.http_status - ) - # Set X-Sentry-Error as in many cases it is easier to inspect the headers - response["X-Sentry-Error"] = context["error"] - - if isinstance(e, APIRateLimited) and e.retry_after is not None: - response["Retry-After"] = six.text_type(int(math.ceil(e.retry_after))) - - except Exception as e: - # TODO(dcramer): test failures are not outputting the log message - # here - if settings.DEBUG: - content = traceback.format_exc() - else: - content = "" - logger.exception(e) - response = HttpResponse(content, content_type="text/plain", status=500) - - # TODO(dcramer): it'd be nice if we had an incr_multi method so - # tsdb could optimize this - metrics.incr("client-api.all-versions.requests", skip_internal=False) - metrics.incr( - "client-api.all-versions.responses.%s" % (response.status_code,), skip_internal=False - ) - metrics.incr( - "client-api.all-versions.responses.%sxx" % (six.text_type(response.status_code)[0],), - skip_internal=False, - ) - - if helper is not None and helper.context is not None and helper.context.version: - metrics.incr("client-api.v%s.requests" % (helper.context.version,), skip_internal=False) - metrics.incr( - "client-api.v%s.responses.%s" % (helper.context.version, response.status_code), - skip_internal=False, - ) - metrics.incr( - "client-api.v%s.responses.%sxx" - % (helper.context.version, six.text_type(response.status_code)[0]), - skip_internal=False, - ) - - return response - - def _dispatch(self, request, helper, project_config, origin=None, *args, **kwargs): - request.user = AnonymousUser() - - project = project_config.project - config = project_config.config - allowed = config.get("allowedDomains") - - if origin is not None: - if not is_valid_origin(origin, allowed=allowed): - track_outcome( - project_config.organization_id, - project_config.project_id, - None, - Outcome.INVALID, - FilterStatKeys.CORS, - ) - raise APIForbidden("Invalid origin: %s" % (origin,)) - - auth = self._parse_header(request, project_config) - - key = helper.project_key_from_auth(auth) - - # Legacy API was /api/store/ and the project ID was only available elsewhere - if six.text_type(key.project_id) != six.text_type(project_config.project_id): - raise APIError("Two different projects were specified") - - helper.context.bind_auth(auth) - - response = super(APIView, self).dispatch( - request=request, - project=project, - auth=auth, - helper=helper, - key=key, - project_config=project_config, - **kwargs - ) - return response - - # XXX: backported from Django 1.5 - def _allowed_methods(self): - return [m.upper() for m in self.http_method_names if hasattr(self, m)] - - def options(self, request, *args, **kwargs): - """ - Serves requests for OPTIONS - - NOTE: This function is not called since it is shortcut by the @allow_cors_options descriptor. - It is nevertheless used to construct the allowed http methods and it should not be removed. - """ - raise NotImplementedError( - "Options request should have been handled by @allow_cors_options.\n" - "If dispatch was overridden either decorate it with @allow_cors_options or provide " - "a valid implementation for options." - ) - - -class StoreView(APIView): - """ - The primary endpoint for storing new events. - - This will validate the client's authentication and data, and if - successful pass on the payload to the internal database handler. - - Authentication works in three flavors: - - 1. Explicit signed requests - - These are implemented using the documented signed request protocol, and - require an authentication header which is signed using with the project - member's secret key. - - 2. CORS Secured Requests - - Generally used for communications with client-side platforms (such as - JavaScript in the browser), they require a standard header, excluding - the signature and timestamp requirements, and must be listed in the - origins for the given project (or the global origins). - - 3. Implicit trusted requests - - Used by the Sentry core, they are only available from same-domain requests - and do not require any authentication information. They only require that - the user be authenticated, and a project_id be sent in the GET variables. - - """ - - type_name = "store" - - def post(self, request, **kwargs): - try: - data = request.body - except Exception as e: - logger.exception(e) - # We were unable to read the body. - # This would happen if a request were submitted - # as a multipart form for example, where reading - # body yields an Exception. There's also not a more - # sane exception to catch here. This will ultimately - # bubble up as an APIError. - data = None - - event_id = self.process(request, data=data, **kwargs) - return HttpResponse(json.dumps({"id": event_id}), content_type="application/json") - - def get(self, request, **kwargs): - data = request.GET.get("sentry_data", "") - event_id = self.process(request, data=data, **kwargs) - - # Return a simple 1x1 gif for browser so they don't throw a warning - response = HttpResponse(PIXEL, "image/gif") - response["X-Sentry-ID"] = event_id - return response - - def pre_normalize(self, data, helper): - """Mutate the given EventManager. Hook for subtypes of StoreView (CSP)""" - pass - - def process( - self, request, project, key, auth, helper, data, project_config, attachments=None, **kwargs - ): - disable_transaction_events() - metrics.incr("events.total", skip_internal=False) - - project_id = project_config.project_id - organization_id = project_config.organization_id - - if not data: - track_outcome(organization_id, project_id, key.id, Outcome.INVALID, "no_data") - raise APIError("No JSON data was found") - - remote_addr = request.META["REMOTE_ADDR"] - - event_manager = EventManager( - data, - project=project, - key=key, - auth=auth, - client_ip=remote_addr, - user_agent=helper.context.agent, - version=auth.version, - content_encoding=request.META.get("HTTP_CONTENT_ENCODING", ""), - project_config=project_config, - ) - del data - - self.pre_normalize(event_manager, helper) - - try: - event_manager.normalize() - except ProcessingErrorInvalidTransaction as e: - track_outcome( - organization_id, - project_id, - key.id, - Outcome.INVALID, - "invalid_transaction", - category=DataCategory.TRANSACTION, - ) - raise APIError(six.text_type(e).split("\n", 1)[0]) - - data = event_manager.get_data() - dict_data = dict(data) - data_size = len(json.dumps(dict_data)) - - if data_size > 10000000: - metrics.timing("events.size.rejected", data_size) - track_outcome( - organization_id, - project_id, - key.id, - Outcome.INVALID, - "too_large", - event_id=dict_data.get("event_id"), - category=DataCategory.from_event_type(dict_data.get("type")), - ) - raise APIForbidden("Event size exceeded 10MB after normalization.") - - metrics.timing("events.size.data.post_storeendpoint", data_size) - - return process_event( - event_manager, project, key, remote_addr, helper, attachments, project_config - ) - - -class EventAttachmentStoreView(StoreView): - def post(self, request, project, event_id, project_config, **kwargs): - if not features.has( - "organizations:event-attachments", project.organization, actor=request.user - ): - raise APIForbidden("Event attachments are not enabled for this organization.") - - project_id = project_config.project_id - - if len(request.FILES) == 0: - return HttpResponse(status=400) - - for name, uploaded_file in six.iteritems(request.FILES): - file = File.objects.create( - name=uploaded_file.name, - type="event.attachment", - headers={"Content-Type": uploaded_file.content_type}, - ) - file.putfile(uploaded_file) - - EventAttachment.objects.create( - project_id=project_id, event_id=event_id, name=uploaded_file.name, file=file - ) - - return HttpResponse(status=201) - - -class MinidumpView(StoreView): - auth_helper_cls = MinidumpAuthHelper - dump_types = ("application/octet-stream", "application/x-dmp") - content_types = ("multipart/form-data",) + dump_types - - def _dispatch( - self, request, helper, project_config, origin=None, config_flags=None, *args, **kwargs - ): - - # TODO(ja): Refactor shared code with CspReportView. Especially, look at - # the sentry_key override and test it. - - # A minidump submission as implemented by Breakpad and Crashpad or any - # other library following the Mozilla Soccorro protocol is a POST request - # without Origin or Referer headers. Therefore, we cannot validate the - # origin of the request, but we *can* validate the "prod" key in future. - if request.method != "POST": - track_outcome(0, 0, None, Outcome.INVALID, "disallowed_method") - return HttpResponseNotAllowed(["POST"]) - - content_type = request.META.get("CONTENT_TYPE") - # In case of multipart/form-data, the Content-Type header also includes - # a boundary. Therefore, we cannot check for an exact match. - if content_type is None or not content_type.startswith(self.content_types): - track_outcome(0, 0, None, Outcome.INVALID, "content_type") - raise APIError("Invalid Content-Type") - - request.user = AnonymousUser() - - project_id = project_config.project_id - project = project_config.project - - # This is yanking the auth from the querystring since it's not - # in the POST body. This means we expect a `sentry_key` and - # `sentry_version` to be set in querystring - auth = self.auth_helper_cls.auth_from_request(request) - - key = helper.project_key_from_auth(auth) - if key.project_id != project_id: - track_outcome( - project_config.organization_id, - project_id, - None, - Outcome.INVALID, - "multi_project_id", - ) - raise APIError("Two different projects were specified") - - helper.context.bind_auth(auth) - - return super(APIView, self).dispatch( - request=request, - project=project, - auth=auth, - helper=helper, - key=key, - project_config=project_config, - **kwargs - ) - - def post(self, request, project, project_config, **kwargs): - # Minidump request payloads do not have the same structure as usual - # events from other SDKs. The minidump can either be transmitted as - # request body, or as `upload_file_minidump` in a multipart formdata - # request. Optionally, an event payload can be sent in the `sentry` form - # field, either as JSON or as nested form data. - - request_files = request.FILES or {} - content_type = request.META.get("CONTENT_TYPE") - - # Track these submissions statically as ERROR. Relay infers properly. - data_category = DataCategory.ERROR - - if content_type in self.dump_types: - minidump = io.BytesIO(request.body) - minidump_name = "Minidump" - data = {} - else: - minidump = request_files.get("upload_file_minidump") - minidump_name = minidump and minidump.name or None - - if any(key.startswith("sentry[") for key in request.POST): - # First, try to parse the nested form syntax `sentry[key][key]` - # This is required for the Breakpad client library, which only - # supports string values of up to 64 characters. - extra = parser.parse(request.POST.urlencode()) - data = extra.pop("sentry", {}) - else: - # Custom clients can submit longer payloads and should JSON - # encode event data into the optional `sentry` field. - extra = request.POST.dict() - json_data = extra.pop("sentry", None) - try: - data = json.loads(json_data) if json_data else {} - except ValueError: - data = {} - - if not isinstance(data, dict): - data = {} - - # Merge additional form fields from the request with `extra` data - # from the event payload and set defaults for processing. This is - # sent by clients like Breakpad or Crashpad. - extra.update(data.get("extra") or ()) - data["extra"] = extra - - if not minidump: - track_outcome( - project_config.organization_id, - project_config.project_id, - None, - Outcome.INVALID, - "missing_minidump_upload", - category=data_category, - ) - raise APIError("Missing minidump upload") - - # Breakpad on linux sometimes stores the entire HTTP request body as - # dump file instead of just the minidump. The Electron SDK then for - # example uploads a multipart formdata body inside the minidump file. - # It needs to be re-parsed, to extract the actual minidump before - # continuing. - minidump.seek(0) - if minidump.read(2) == b"--": - # The remaining bytes of the first line are the form boundary. We - # have already read two bytes, the remainder is the form boundary - # (excluding the initial '--'). - boundary = minidump.readline().rstrip() - minidump.seek(0) - - # Next, we have to fake a HTTP request by specifying the form - # boundary and the content length, or otherwise Django will not try - # to parse our form body. Also, we need to supply new upload - # handlers since they cannot be reused from the current request. - meta = { - "CONTENT_TYPE": b"multipart/form-data; boundary=%s" % boundary, - "CONTENT_LENGTH": minidump.size, - } - handlers = [ - uploadhandler.load_handler(handler, request) - for handler in settings.FILE_UPLOAD_HANDLERS - ] - - _, inner_files = MultiPartParser(meta, minidump, handlers).parse() - try: - minidump = inner_files["upload_file_minidump"] - minidump_name = minidump.name - except KeyError: - track_outcome( - project_config.organization_id, - project_config.project_id, - None, - Outcome.INVALID, - "missing_minidump_upload", - category=data_category, - ) - raise APIError("Missing minidump upload") - - minidump.seek(0) - if minidump.read(4) != "MDMP": - track_outcome( - project_config.organization_id, - project_config.project_id, - None, - Outcome.INVALID, - "invalid_minidump", - category=data_category, - ) - raise APIError("Uploaded file was not a minidump") - - # Always store the minidump in attachments so we can access it during - # processing, regardless of the event-attachments feature. This is - # required to process the minidump with debug information. - attachments = [] - - # The minidump attachment is special. It has its own attachment type to - # distinguish it from regular attachments for processing. Also, it might - # not be part of `request_files` if it has been uploaded as raw request - # body instead of a multipart formdata request. - minidump.seek(0) - attachments.append( - CachedAttachment( - name=minidump_name, - content_type="application/octet-stream", - data=minidump.read(), - type=MINIDUMP_ATTACHMENT_TYPE, - ) - ) - - # Append all other files as generic attachments. - # RaduW 4 Jun 2019 always sent attachments for minidump (does not use - # event-attachments feature) - for name, file in six.iteritems(request_files): - if name == "upload_file_minidump": - continue - - # Known attachment: msgpack event - if name == "__sentry-event": - merge_attached_event(file, data) - continue - if name in ("__sentry-breadcrumb1", "__sentry-breadcrumb2"): - merge_attached_breadcrumbs(file, data) - continue - - # Add any other file as attachment - attachments.append(CachedAttachment.from_upload(file)) - - # Assign our own UUID so we can track this minidump. We cannot trust - # the uploaded filename, and if reading the minidump fails there is - # no way we can ever retrieve the original UUID from the minidump. - event_id = data.get("event_id") or uuid.uuid4().hex - data["event_id"] = event_id - - # Write a minimal event payload that is required to kick off native - # event processing. It is also used as fallback if processing of the - # minidump fails. - # NB: This occurs after merging attachments to overwrite potentially - # contradicting payloads transmitted in __sentry_event. - write_minidump_placeholder(data) - - event_id = self.process( - request, - attachments=attachments, - data=data, - project=project, - project_config=project_config, - **kwargs - ) - - # Return the formatted UUID of the generated event. This is - # expected by the Electron http uploader on Linux and doesn't - # break the default Breakpad client library. - return HttpResponse(six.text_type(uuid.UUID(event_id)), content_type="text/plain") - - -# Endpoint used by the Unreal Engine 4 (UE4) Crash Reporter. -class UnrealView(StoreView): - content_types = ("application/octet-stream",) - required_attachments = ("minidump", "applecrashreport") - - def _dispatch( - self, - request, - helper, - project_config, - sentry_key, - origin=None, - config_flags=None, - *args, - **kwargs - ): - if request.method != "POST": - track_outcome(0, 0, None, Outcome.INVALID, "disallowed_method") - return HttpResponseNotAllowed(["POST"]) - - content_type = request.META.get("CONTENT_TYPE") - if content_type is None or not content_type.startswith(self.content_types): - track_outcome(0, 0, None, Outcome.INVALID, "content_type") - raise APIError("Invalid Content-Type") - - request.user = AnonymousUser() - - project = project_config.project - project_id = project_config.project_id - - auth = Auth(public_key=sentry_key, is_public=False) - auth.client = "sentry.unreal_engine" - - key = helper.project_key_from_auth(auth) - if key.project_id != project_id: - track_outcome( - project_config.organization_id, - project_id, - None, - Outcome.INVALID, - "multi_project_id", - ) - raise APIError("Two different projects were specified") - - helper.context.bind_auth(auth) - return super(APIView, self).dispatch( - request=request, - project=project, - auth=auth, - helper=helper, - key=key, - project_config=project_config, - **kwargs - ) - - def post(self, request, project, project_config, **kwargs): - # Track these submissions statically as ERROR. Relay infers properly. - data_category = DataCategory.ERROR - - attachments_enabled = features.has( - "organizations:event-attachments", project.organization, actor=request.user - ) - - attachments = [] - event = {"event_id": uuid.uuid4().hex, "environment": request.GET.get("AppEnvironment")} - - user_id = request.GET.get("UserID") - if user_id: - merge_unreal_user(event, user_id) - - try: - unreal = Unreal4Crash.from_bytes(request.body) - except (ProcessMinidumpError, Unreal4Error) as e: - minidumps_logger.exception(e) - track_outcome( - project_config.organization_id, - project_config.project_id, - None, - Outcome.INVALID, - "process_unreal", - category=data_category, - ) - raise APIError(six.text_type(e).split("\n", 1)[0]) - - try: - unreal_context = unreal.get_context() - except Unreal4Error as e: - # we'll continue without the context data - unreal_context = None - minidumps_logger.exception(e) - else: - if unreal_context is not None: - merge_unreal_context_event(unreal_context, event, project) - - try: - unreal_logs = unreal.get_logs() - except Unreal4Error as e: - # we'll continue without the breadcrumbs - minidumps_logger.exception(e) - else: - if unreal_logs is not None: - merge_unreal_logs_event(unreal_logs, event) - - is_minidump = False - is_applecrashreport = False - - for file in unreal.files(): - # Known attachment: msgpack event - if file.name == "__sentry-event": - merge_attached_event(file.open_stream(), event) - continue - if file.name in ("__sentry-breadcrumb1", "__sentry-breadcrumb2"): - merge_attached_breadcrumbs(file.open_stream(), event) - continue - - if file.type == "minidump": - is_minidump = True - if file.type == "applecrashreport": - is_applecrashreport = True - - # Always store attachments that can be processed, regardless of the - # event-attachments feature. - if file.type in self.required_attachments or attachments_enabled: - attachments.append( - CachedAttachment( - name=file.name, - data=file.open_stream().read(), - type=unreal_attachment_type(file), - ) - ) - - if is_minidump: - write_minidump_placeholder(event) - elif is_applecrashreport: - write_applecrashreport_placeholder(event) - - event_id = self.process( - request, - attachments=attachments, - data=event, - project=project, - project_config=project_config, - **kwargs - ) - - # The return here is only useful for consistency - # because the UE4 crash reporter doesn't care about it. - return HttpResponse(six.text_type(uuid.UUID(event_id)), content_type="text/plain") - - -class StoreSchemaView(BaseView): - def get(self, request, **kwargs): - return HttpResponse(json.dumps(schemas.EVENT_SCHEMA), content_type="application/json") class ClientConfigView(BaseView): @@ -1068,142 +16,6 @@ def get(self, request): return HttpResponse(json.dumps(get_client_config(request)), content_type="application/json") -class SecurityReportView(StoreView): - auth_helper_cls = SecurityAuthHelper - content_types = ( - "application/csp-report", - "application/json", - "application/expect-ct-report", - "application/expect-ct-report+json", - "application/expect-staple-report", - ) - - def _dispatch( - self, request, helper, project_config, origin=None, config_flags=None, *args, **kwargs - ): - # A CSP report is sent as a POST request with no Origin or Referer - # header. What we're left with is a 'document-uri' key which is - # inside of the JSON body of the request. This 'document-uri' value - # should be treated as an origin check since it refers to the page - # that triggered the report. The Content-Type is supposed to be - # `application/csp-report`, but FireFox sends it as `application/json`. - if request.method != "POST": - track_outcome(0, 0, None, Outcome.INVALID, "disallowed_method") - return HttpResponseNotAllowed(["POST"]) - - if request.META.get("CONTENT_TYPE") not in self.content_types: - track_outcome(0, 0, None, Outcome.INVALID, "content_type") - raise APIError("Invalid Content-Type") - - request.user = AnonymousUser() - - project = project_config.project - project_id = project_config.project_id - - # This is yanking the auth from the querystring since it's not - # in the POST body. This means we expect a `sentry_key` and - # `sentry_version` to be set in querystring - auth = self.auth_helper_cls.auth_from_request(request) - - key = helper.project_key_from_auth(auth) - if key.project_id != project_id: - track_outcome( - project.organization_id, project.id, None, Outcome.INVALID, "multi_project_id" - ) - raise APIError("Two different projects were specified") - - helper.context.bind_auth(auth) - - return super(APIView, self).dispatch( - request=request, - project=project, - auth=auth, - helper=helper, - key=key, - project_config=project_config, - **kwargs - ) - - def post(self, request, project, helper, key, project_config, **kwargs): - # This endpoint only accepts security reports. - data_category = DataCategory.SECURITY - - json_body = safely_load_json_string(request.body) - report_type = self.security_report_type(json_body) - if report_type is None: - track_outcome( - project_config.organization_id, - project_config.project_id, - key.id, - Outcome.INVALID, - "security_report_type", - category=data_category, - ) - raise APIError("Unrecognized security report type") - interface = get_interface(report_type) - - try: - instance = interface.from_raw(json_body) - except jsonschema.ValidationError as e: - track_outcome( - project_config.organization_id, - project_config.project_id, - key.id, - Outcome.INVALID, - "security_report", - category=data_category, - ) - raise APIError("Invalid security report: %s" % str(e).splitlines()[0]) - - # Do origin check based on the `document-uri` key as explained in `_dispatch`. - origin = instance.get_origin() - if not is_valid_origin(origin, project): - track_outcome( - project_config.organization_id, - project_config.project_id, - key.id, - Outcome.INVALID, - FilterStatKeys.CORS, - category=data_category, - ) - raise APIForbidden("Invalid origin") - - data = { - "interface": interface.path, - "report": instance, - "release": request.GET.get("sentry_release"), - "environment": request.GET.get("sentry_environment"), - } - - self.process( - request, - project=project, - helper=helper, - data=data, - key=key, - project_config=project_config, - **kwargs - ) - - return HttpResponse(content_type="application/javascript", status=201) - - def security_report_type(self, body): - report_type_for_key = { - "csp-report": "csp", - "expect-ct-report": "expectct", - "expect-staple-report": "expectstaple", - "known-pins": "hpkp", - } - if isinstance(body, dict): - for k in report_type_for_key: - if k in body: - return report_type_for_key[k] - return None - - def pre_normalize(self, data, helper): - data.process_csp_report() - - @cache_control(max_age=3600, public=True) def robots_txt(request): return HttpResponse("User-agent: *\nDisallow: /\n", content_type="text/plain") diff --git a/src/sentry/web/urls.py b/src/sentry/web/urls.py index d351ce764cb513..68a07ad87b0410 100644 --- a/src/sentry/web/urls.py +++ b/src/sentry/web/urls.py @@ -71,40 +71,11 @@ ] urlpatterns += [ - # Store endpoints first since they are the most active - url(r"^api/store/$", api.StoreView.as_view(), name="sentry-api-store"), - url(r"^api/(?P<project_id>[\w_-]+)/store/$", api.StoreView.as_view(), name="sentry-api-store"), - url( - r"^api/(?P<project_id>[\w_-]+)/minidump/?$", - api.MinidumpView.as_view(), - name="sentry-api-minidump", - ), - url( - r"^api/(?P<project_id>[\w_-]+)/events/(?P<event_id>[\w-]+)/attachments/$", - api.EventAttachmentStoreView.as_view(), - name="sentry-api-event-attachment", - ), - url( - r"^api/(?P<project_id>[\w_-]+)/unreal/(?P<sentry_key>\w+)/$", - api.UnrealView.as_view(), - name="sentry-api-unreal", - ), - url( - r"^api/(?P<project_id>\d+)/security/$", - api.SecurityReportView.as_view(), - name="sentry-api-security-report", - ), - url( # This URL to be deprecated - r"^api/(?P<project_id>\d+)/csp-report/$", - api.SecurityReportView.as_view(), - name="sentry-api-csp-report", - ), url( r"^api/(?P<project_id>[\w_-]+)/crossdomain\.xml$", api.crossdomain_xml, name="sentry-api-crossdomain-xml", ), - url(r"^api/store/schema$", api.StoreSchemaView.as_view(), name="sentry-api-store-schema"), # Frontend client config url(r"^api/client-config/?$", api.ClientConfigView.as_view(), name="sentry-api-client-config"), # The static version is either a 10 digit timestamp, a sha1, or md5 hash diff --git a/tests/integration/fixtures/csp/chrome_blocked_asset_input.json b/tests/integration/fixtures/csp/chrome_blocked_asset_input.json deleted file mode 100644 index f394476069a3c4..00000000000000 --- a/tests/integration/fixtures/csp/chrome_blocked_asset_input.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "csp-report": { - "document-uri": "http://notlocalhost:8000/", - "referrer": "", - "violated-directive": "style-src cdn.example.com", - "effective-directive": "style-src", - "original-policy": "default-src 'none'; style-src cdn.example.com; report-uri http://requestb.in/1im8m061", - "blocked-uri": "http://notlocalhost:8000/lol.css", - "status-code": 200 - } -} diff --git a/tests/integration/fixtures/csp/chrome_blocked_asset_output.json b/tests/integration/fixtures/csp/chrome_blocked_asset_output.json deleted file mode 100644 index b4c88c9debe8de..00000000000000 --- a/tests/integration/fixtures/csp/chrome_blocked_asset_output.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "message": "Blocked 'style' from 'notlocalhost:8000'", - "tags": { - "logger": "csp", - "effective-directive": "style-src", - "blocked-uri": "http://notlocalhost:8000/lol.css" - }, - "data": { - "sentry.interfaces.User": {"ip_address": "127.0.0.1"}, - "sentry.interfaces.Csp": { - "blocked_uri": "http://notlocalhost:8000/lol.css", - "status_code": 200, - "violated_directive": "style-src cdn.example.com", - "document_uri": "http://notlocalhost:8000/", - "original_policy": "default-src 'none'; style-src cdn.example.com; report-uri http://requestb.in/1im8m061", - "effective_directive": "style-src", - "referrer": "" - }, - "sentry.interfaces.Http": { - "url": "http://notlocalhost:8000/", - "headers": [["User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"]] - } - } -} diff --git a/tests/integration/fixtures/csp/firefox_blocked_asset_input.json b/tests/integration/fixtures/csp/firefox_blocked_asset_input.json deleted file mode 100644 index b3bb9c19e04fa9..00000000000000 --- a/tests/integration/fixtures/csp/firefox_blocked_asset_input.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "csp-report": { - "blocked-uri": "http://notlocalhost:8000/lol.css", - "document-uri": "http://notlocalhost:8000/", - "original-policy": "default-src 'none'; style-src http://cdn.example.com; report-uri http://requestb.in/1im8m061", - "referrer": "", - "violated-directive": "style-src http://cdn.example.com" - } -} diff --git a/tests/integration/fixtures/csp/firefox_blocked_asset_output.json b/tests/integration/fixtures/csp/firefox_blocked_asset_output.json deleted file mode 100644 index 2c3f1dec52a891..00000000000000 --- a/tests/integration/fixtures/csp/firefox_blocked_asset_output.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "message": "Blocked 'style' from 'notlocalhost:8000'", - "tags": { - "logger": "csp", - "effective-directive": "style-src", - "blocked-uri": "http://notlocalhost:8000/lol.css" - }, - "data": { - "sentry.interfaces.User": {"ip_address": "127.0.0.1"}, - "sentry.interfaces.Csp": { - "blocked_uri": "http://notlocalhost:8000/lol.css", - "violated_directive": "style-src http://cdn.example.com", - "document_uri": "http://notlocalhost:8000/", - "original_policy": "default-src 'none'; style-src http://cdn.example.com; report-uri http://requestb.in/1im8m061", - "effective_directive": "style-src", - "referrer": "" - }, - "sentry.interfaces.Http": { - "url": "http://notlocalhost:8000/", - "headers": [["User-Agent", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"]] - } - } -} diff --git a/tests/integration/test_message_filters.py b/tests/integration/test_message_filters.py deleted file mode 100644 index 1776692f2f34e7..00000000000000 --- a/tests/integration/test_message_filters.py +++ /dev/null @@ -1,137 +0,0 @@ -from __future__ import absolute_import - -import pytest - -from sentry.models.projectoption import ProjectOption -from sentry.testutils import TestCase -from sentry.utils.safe import set_path -from sentry.message_filters import ( - _localhost_filter, - _browser_extensions_filter, - _web_crawlers_filter, - _legacy_browsers_filter, -) - - [email protected]( - "Unit tests in Relay, in the filters implementation files.", "relay-filter/..." -) -class FilterTests(TestCase): - def _get_message(self): - return {} - - def _set_filter_state(self, flt, state): - ProjectOption.objects.set_value( - project=self.project, key=u"filters:{}".format(flt.spec.id), value=state - ) - - def _get_message_with_bad_ip(self): - message = self._get_message() - set_path(message, "user", "ip_address", value="127.0.0.1") - return message - - def test_should_not_filter_simple_messages(self): - # baseline test (so we know everything works as expected) - message = self._get_message() - resp = self._postWithHeader(message) - assert resp.status_code < 400 # no http error - - def test_should_filter_local_ip_addresses_when_enabled(self): - self._set_filter_state(_localhost_filter, "1") - message = self._get_message_with_bad_ip() - resp = self._postWithHeader(message) - assert resp.status_code >= 400 # some http error - - def test_should_not_filter_bad_ip_addresses_when_disabled(self): - self._set_filter_state(_localhost_filter, "0") - message = self._get_message_with_bad_ip() - resp = self._postWithHeader(message) - assert resp.status_code < 400 # no http error - - def _get_message_with_bad_extension(self): - message = self._get_message() - set_path(message, "platform", value="javascript") - set_path( - message, - "exception", - value={"values": [{"type": "Error", "value": "http://loading.retry.widdit.com/"}]}, - ) - return message - - def test_should_filter_browser_extensions_when_enabled(self): - self._set_filter_state(_browser_extensions_filter, "1") - message = self._get_message_with_bad_extension() - resp = self._postWithHeader(message) - assert resp.status_code >= 400 # some http error - - def test_should_not_filter_browser_extensions_when_disabled(self): - self._set_filter_state(_browser_extensions_filter, "0") - message = self._get_message_with_bad_extension() - resp = self._postWithHeader(message) - assert resp.status_code < 400 # no http error - - def _get_message_from_webcrawler(self): - message = self._get_message() - set_path( - message, - "request", - value={ - "url": "http://example.com", - "method": "GET", - "headers": [["User-Agent", "Mediapartners-Google"]], - }, - ) - return message - - def test_should_filter_web_crawlers_when_enabled(self): - self._set_filter_state(_web_crawlers_filter, "1") - message = self._get_message_from_webcrawler() - resp = self._postWithHeader(message) - assert resp.status_code >= 400 # some http error - - def test_should_not_filter_web_crawlers_when_disabled(self): - self._set_filter_state(_web_crawlers_filter, "0") - message = self._get_message_from_webcrawler() - resp = self._postWithHeader(message) - assert resp.status_code < 400 # no http error - - def _get_message_from_legacy_browser(self): - ie_5_user_agent = ( - "Mozilla/4.0 (compatible; MSIE 5.50; Windows NT; SiteKiosk 4.9; SiteCoach 1.0)" - ) - message = self._get_message() - set_path(message, "platform", value="javascript") - set_path( - message, - "request", - value={ - "url": "http://example.com", - "method": "GET", - "headers": [["User-Agent", ie_5_user_agent]], - }, - ) - return message - - def test_should_filter_legacy_browsers_all_enabled(self): - self._set_filter_state(_legacy_browsers_filter, "1") - message = self._get_message_from_legacy_browser() - resp = self._postWithHeader(message) - assert resp.status_code >= 400 # some http error - - def test_should_filter_legacy_browsers_specific_browsers(self): - self._set_filter_state(_legacy_browsers_filter, {"ie_pre_9", "safari_5"}) - message = self._get_message_from_legacy_browser() - resp = self._postWithHeader(message) - assert resp.status_code >= 400 # some http error - - def test_should_not_filter_legacy_browsers_when_disabled(self): - self._set_filter_state(_legacy_browsers_filter, "0") - message = self._get_message_from_legacy_browser() - resp = self._postWithHeader(message) - assert resp.status_code < 400 # no http error - - def test_should_not_filter_legacy_browsers_when_current_browser_check_disabled(self): - self._set_filter_state(_legacy_browsers_filter, {"safari_5"}) - message = self._get_message_from_legacy_browser() - resp = self._postWithHeader(message) - assert resp.status_code < 400 # no http error diff --git a/tests/integration/tests.py b/tests/integration/tests.py index 540529e15573d5..39ba1d7f47a3f6 100644 --- a/tests/integration/tests.py +++ b/tests/integration/tests.py @@ -2,37 +2,11 @@ from __future__ import absolute_import, print_function -import os -import datetime -import json -import logging -import six -from time import sleep -import zlib -import pytest - from sentry.utils.compat import mock -from sentry import eventstore, tagstore from django.conf import settings -from django.core.urlresolvers import reverse -from django.test.utils import override_settings -from django.utils import timezone -from exam import fixture -from gzip import GzipFile -from sentry_sdk import Hub, Client -from sentry_sdk.integrations.celery import CeleryIntegration -from sentry_sdk.integrations.django import DjangoIntegration -from six import StringIO -from werkzeug.test import Client as WerkzeugClient -from sentry.models import Group -from sentry.testutils import SnubaTestCase, TestCase, TransactionTestCase -from sentry.testutils.helpers import get_auth_header -from sentry.testutils.helpers.datetime import iso_format, before_now +from sentry.testutils import TestCase from sentry.utils.settings import validate_settings, ConfigurationError, import_string -from sentry.utils.sdk import configure_scope -from sentry.web.api import disable_transaction_events -from sentry.wsgi import application DEPENDENCY_TEST_DATA = { "postgresql": ( @@ -78,457 +52,6 @@ } -def get_fixture_path(name): - return os.path.join(os.path.dirname(__file__), "fixtures", name) - - -def load_fixture(name): - with open(get_fixture_path(name)) as fp: - return fp.read() - - [email protected]("Remove, behaviour changed, new behaviour tested in Relay") -class RavenIntegrationTest(TransactionTestCase): - """ - This mocks the test server and specifically tests behavior that would - happen between Raven <--> Sentry over HTTP communication. - """ - - def setUp(self): - self.user = self.create_user("[email protected]") - self.project = self.create_project() - self.pk = self.project.key_set.get_or_create()[0] - - self.configure_sentry_errors() - - def configure_sentry_errors(self): - # delay raising of assertion errors to make sure they do not get - # swallowed again - failures = [] - - class AssertHandler(logging.Handler): - def emit(self, entry): - failures.append(entry) - - assert_handler = AssertHandler() - - for name in "sentry.errors", "sentry_sdk.errors": - sentry_errors = logging.getLogger(name) - sentry_errors.addHandler(assert_handler) - sentry_errors.setLevel(logging.DEBUG) - - @self.addCleanup - def remove_handler(sentry_errors=sentry_errors): - sentry_errors.handlers.pop(sentry_errors.handlers.index(assert_handler)) - - @self.addCleanup - def reraise_failures(): - for entry in failures: - raise AssertionError(entry.message) - - def send_event(self, method, url, body, headers): - from sentry.app import buffer - - with self.tasks(): - content_type = headers.pop("Content-Type", None) - headers = {"HTTP_" + k.replace("-", "_").upper(): v for k, v in six.iteritems(headers)} - resp = self.client.post( - reverse("sentry-api-store", args=[self.pk.project_id]), - data=body, - content_type=content_type, - **headers - ) - assert resp.status_code == 200 - - buffer.process_pending() - - @mock.patch("urllib3.PoolManager.request") - def test_basic(self, request): - requests = [] - - def queue_event(method, url, body, headers): - requests.append((method, url, body, headers)) - - request.side_effect = queue_event - - hub = Hub( - Client( - "http://%s:%s@localhost:8000/%s" - % (self.pk.public_key, self.pk.secret_key, self.pk.project_id), - default_integrations=False, - ) - ) - - hub.capture_message("foo") - hub.client.close() - - for _request in requests: - self.send_event(*_request) - - assert request.call_count == 1 - assert Group.objects.count() == 1 - group = Group.objects.get() - assert group.data["title"] == "foo" - - -class SentryRemoteTest(TestCase): - @fixture - def path(self): - return reverse("sentry-api-store") - - def get_event(self, event_id): - instance = eventstore.get_event_by_id(self.project.id, event_id) - return instance - - def test_minimal(self): - event_data = { - "message": "hello", - "tags": {"foo": "bar"}, - "timestamp": iso_format(before_now(seconds=1)), - } - - event = self.store_event(event_data, self.project.id) - - assert event is not None - instance = self.get_event(event.event_id) - - assert instance.message == "hello" - assert instance.data["logentry"] == {"formatted": "hello"} - assert instance.title == instance.data["title"] == "hello" - assert instance.location is instance.data.get("location", None) is None - - assert tagstore.get_tag_key(self.project.id, None, "foo") is not None - assert tagstore.get_tag_value(self.project.id, None, "foo", "bar") is not None - assert ( - tagstore.get_group_tag_key(self.project.id, instance.group_id, None, "foo") is not None - ) - assert ( - tagstore.get_group_tag_value(instance.project_id, instance.group_id, None, "foo", "bar") - is not None - ) - - def test_exception(self): - event_data = { - "exception": { - "type": "ZeroDivisionError", - "value": "cannot divide by zero", - "stacktrace": { - "frames": [ - { - "filename": "utils.py", - "in_app": False, - "function": "raise_it", - "module": "utils", - }, - { - "filename": "main.py", - "in_app": True, - "function": "fail_it", - "module": "main", - }, - ] - }, - }, - "tags": {"foo": "bar"}, - "timestamp": iso_format(before_now(seconds=1)), - } - - event = self.store_event(event_data, self.project.id) - - assert event is not None - instance = self.get_event(event.event_id) - - assert len(instance.data["exception"]) == 1 - assert ( - instance.title == instance.data["title"] == "ZeroDivisionError: cannot divide by zero" - ) - assert instance.location == instance.data["location"] == "main.py" - assert instance.culprit == instance.data["culprit"] == "main in fail_it" - - assert tagstore.get_tag_key(self.project.id, None, "foo") is not None - assert tagstore.get_tag_value(self.project.id, None, "foo", "bar") is not None - assert ( - tagstore.get_group_tag_key(self.project.id, instance.group_id, None, "foo") is not None - ) - assert ( - tagstore.get_group_tag_value(instance.project_id, instance.group_id, None, "foo", "bar") - is not None - ) - - def test_timestamp(self): - timestamp = timezone.now().replace(microsecond=0, tzinfo=timezone.utc) - datetime.timedelta( - hours=1 - ) - event_data = {u"message": "hello", "timestamp": float(timestamp.strftime("%s.%f"))} - - event = self.store_event(event_data, self.project.id) - - assert event is not None - instance = self.get_event(event.event_id) - - assert instance.message == "hello" - assert instance.datetime == timestamp - group = instance.group - assert group.first_seen == timestamp - assert group.last_seen == timestamp - - @pytest.mark.obsolete("Test in relay") - @override_settings(SENTRY_ALLOW_ORIGIN="sentry.io") - def test_correct_data_with_get(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - resp = self._getWithReferer(kwargs) - assert resp.status_code == 200, resp.content - event_id = resp["X-Sentry-ID"] - instance = self.get_event(event_id) - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - @override_settings(SENTRY_ALLOW_ORIGIN="*") - def test_get_without_referer_allowed(self): - self.project.update_option("sentry:origins", "") - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - resp = self._getWithReferer(kwargs, referer=None, protocol="4") - assert resp.status_code == 200, resp.content - - @pytest.mark.obsolete("Test in relay") - @override_settings(SENTRY_ALLOW_ORIGIN="sentry.io") - def test_correct_data_with_post_referer(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - resp = self._postWithReferer(kwargs) - assert resp.status_code == 200, resp.content - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - @override_settings(SENTRY_ALLOW_ORIGIN="sentry.io") - def test_post_without_referer(self): - self.project.update_option("sentry:origins", "") - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - resp = self._postWithReferer(kwargs, referer=None, protocol="4") - assert resp.status_code == 200, resp.content - - @pytest.mark.obsolete("Test in relay") - @override_settings(SENTRY_ALLOW_ORIGIN="*") - def test_post_without_referer_allowed(self): - self.project.update_option("sentry:origins", "") - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - resp = self._postWithReferer(kwargs, referer=None, protocol="4") - assert resp.status_code == 200, resp.content - - @pytest.mark.obsolete("Test in relay") - @override_settings(SENTRY_ALLOW_ORIGIN="google.com") - def test_post_with_invalid_origin(self): - self.project.update_option("sentry:origins", "sentry.io") - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - resp = self._postWithReferer(kwargs, referer="https://getsentry.net", protocol="4") - assert resp.status_code == 403, resp.content - - @pytest.mark.obsolete("Test in relay") - def test_content_encoding_deflate(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - message = zlib.compress(json.dumps(kwargs)) - - key = self.projectkey.public_key - secret = self.projectkey.secret_key - - with self.tasks(): - resp = self.client.post( - self.path, - message, - content_type="application/octet-stream", - HTTP_CONTENT_ENCODING="deflate", - HTTP_X_SENTRY_AUTH=get_auth_header("_postWithHeader", key, secret), - ) - - assert resp.status_code == 200, resp.content - - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - def test_content_encoding_gzip(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - - message = json.dumps(kwargs) - - fp = StringIO() - - try: - f = GzipFile(fileobj=fp, mode="w") - f.write(message) - finally: - f.close() - - key = self.projectkey.public_key - secret = self.projectkey.secret_key - - with self.tasks(): - resp = self.client.post( - self.path, - fp.getvalue(), - content_type="application/octet-stream", - HTTP_CONTENT_ENCODING="gzip", - HTTP_X_SENTRY_AUTH=get_auth_header("_postWithHeader", key, secret), - ) - - assert resp.status_code == 200, resp.content - - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - def test_protocol_v2_0_without_secret_key(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - - resp = self._postWithHeader(data=kwargs, key=self.projectkey.public_key, protocol="2.0") - - assert resp.status_code == 200, resp.content - - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - def test_protocol_v3(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - - resp = self._postWithHeader( - data=kwargs, - key=self.projectkey.public_key, - secret=self.projectkey.secret_key, - protocol="3", - ) - - assert resp.status_code == 200, resp.content - - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - def test_protocol_v4(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - - resp = self._postWithHeader( - data=kwargs, - key=self.projectkey.public_key, - secret=self.projectkey.secret_key, - protocol="4", - ) - - assert resp.status_code == 200, resp.content - - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - def test_protocol_v5(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - - resp = self._postWithHeader( - data=kwargs, - key=self.projectkey.public_key, - secret=self.projectkey.secret_key, - protocol="5", - ) - - assert resp.status_code == 200, resp.content - - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - - assert instance.message == "hello" - - @pytest.mark.obsolete("Test in relay") - def test_protocol_v6(self): - kwargs = {"message": "hello", "timestamp": iso_format(before_now(seconds=1))} - - resp = self._postWithHeader( - data=kwargs, - key=self.projectkey.public_key, - secret=self.projectkey.secret_key, - protocol="6", - ) - - assert resp.status_code == 200, resp.content - - event_id = json.loads(resp.content)["id"] - instance = self.get_event(event_id) - - assert instance.message == "hello" - - [email protected]("Functionality not relevant in Relay store") -class SentryWsgiRemoteTest(TransactionTestCase): - @override_settings(ALLOWED_HOSTS=["localhost"]) - def test_traceparent_header_wsgi(self): - # Assert that posting something to store will not create another - # (transaction) event under any circumstances. - # - # We use Werkzeug's test client because Django's test client bypasses a - # lot of request handling code that we want to test implicitly (such as - # all our WSGI middlewares and the entire Django instrumentation by - # sentry-sdk). - # - # XXX(markus): Ideally methods such as `_postWithHeader` would always - # call the WSGI application => swap out Django's test client with e.g. - # Werkzeug's. - client = WerkzeugClient(application) - - calls = [] - - def new_disable_transaction_events(): - with configure_scope() as scope: - assert scope.transaction - assert scope.transaction.sampled - disable_transaction_events() - assert not scope.transaction.sampled - - calls.append(1) - - events = [] - - auth = get_auth_header( - "_postWithWerkzeug/0.0.0", self.projectkey.public_key, self.projectkey.secret_key, "7" - ) - - with mock.patch( - "sentry.web.api.disable_transaction_events", new_disable_transaction_events - ): - with self.tasks(): - with Hub( - Client( - transport=events.append, - integrations=[CeleryIntegration(), DjangoIntegration()], - ) - ): - app_iter, status, headers = client.post( - reverse("sentry-api-store"), - data=b'{"message": "hello"}', - headers={ - "x-sentry-auth": auth, - "sentry-trace": "1", - "content-type": "application/octet-stream", - }, - environ_base={"REMOTE_ADDR": "127.0.0.1"}, - ) - - body = "".join(app_iter) - - assert status == "200 OK", body - assert set(e.get("transaction") for e in events) == {"rule_processor_apply"} - assert calls == [1] - - class DependencyTest(TestCase): def raise_import_error(self, package): def callable(package_name): @@ -557,56 +80,3 @@ def test_validate_fails_on_memcache(self): def test_validate_fails_on_pylibmc(self): self.validate_dependency(*DEPENDENCY_TEST_DATA["pylibmc"]) - - -def get_fixtures(name): - path = os.path.join(os.path.dirname(__file__), "fixtures/csp", name) - try: - with open(path + "_input.json", "rb") as fp1: - input = fp1.read() - except IOError: - input = None - - try: - with open(path + "_output.json", "rb") as fp2: - output = json.load(fp2) - except IOError: - output = None - - return input, output - - -class CspReportTest(TestCase, SnubaTestCase): - def assertReportCreated(self, input, output): - resp = self._postCspWithHeader(input) - assert resp.status_code == 201, resp.content - # XXX: there appears to be a race condition between the 201 return and get_events, - # leading this test to sometimes fail. .5s seems to be sufficient. - # Modifying the timestamp of store_event, like how it's done in other snuba tests, - # doesn't work here because the event isn't created directly by this test. - sleep(0.5) - events = eventstore.get_events( - filter=eventstore.Filter( - project_ids=[self.project.id], conditions=[["type", "=", "csp"]] - ) - ) - assert len(events) == 1 - e = events[0] - assert output["message"] == e.data["logentry"]["formatted"] - for key, value in six.iteritems(output["tags"]): - assert e.get_tag(key) == value - for key, value in six.iteritems(output["data"]): - assert e.data[key] == value - - def assertReportRejected(self, input): - resp = self._postCspWithHeader(input) - assert resp.status_code in (400, 403), resp.content - - def test_invalid_report(self): - self.assertReportRejected("") - - def test_chrome_blocked_asset(self): - self.assertReportCreated(*get_fixtures("chrome_blocked_asset")) - - def test_firefox_missing_effective_uri(self): - self.assertReportCreated(*get_fixtures("firefox_blocked_asset")) diff --git a/tests/relay_integration/lang/java/test_plugin.py b/tests/relay_integration/lang/java/test_plugin.py index d4395572546e47..1be0454a9cf5f3 100644 --- a/tests/relay_integration/lang/java/test_plugin.py +++ b/tests/relay_integration/lang/java/test_plugin.py @@ -1,12 +1,313 @@ from __future__ import absolute_import -import pytest -from tests.sentry.lang.java.test_plugin import BasicResolvingIntegrationTest +import zipfile +from six import BytesIO + +from django.core.urlresolvers import reverse +from django.core.files.uploadedfile import SimpleUploadedFile + from sentry.testutils import RelayStoreHelper, TransactionTestCase +from sentry.testutils.helpers.datetime import before_now, iso_format + +PROGUARD_UUID = "6dc7fdb0-d2fb-4c8e-9d6b-bb1aa98929b1" +PROGUARD_SOURCE = b"""\ +org.slf4j.helpers.Util$ClassContextSecurityManager -> org.a.b.g$a: + 65:65:void <init>() -> <init> + 67:67:java.lang.Class[] getClassContext() -> a + 69:69:java.lang.Class[] getExtraClassContext() -> a + 65:65:void <init>(org.slf4j.helpers.Util$1) -> <init> +""" +PROGUARD_INLINE_UUID = "d748e578-b3d1-5be5-b0e5-a42e8c9bf8e0" +PROGUARD_INLINE_SOURCE = b"""\ +# compiler: R8 +# compiler_version: 2.0.74 +# min_api: 16 +# pg_map_id: 5b46fdc +# common_typos_disable +$r8$backportedMethods$utility$Objects$2$equals -> a: + boolean equals(java.lang.Object,java.lang.Object) -> a +$r8$twr$utility -> b: + void $closeResource(java.lang.Throwable,java.lang.Object) -> a +android.support.v4.app.RemoteActionCompatParcelizer -> android.support.v4.app.RemoteActionCompatParcelizer: + 1:1:void <init>():11:11 -> <init> +io.sentry.sample.-$$Lambda$r3Avcbztes2hicEObh02jjhQqd4 -> e.a.c.a: + io.sentry.sample.MainActivity f$0 -> b +io.sentry.sample.MainActivity -> io.sentry.sample.MainActivity: + 1:1:void <init>():15:15 -> <init> + 1:1:boolean onCreateOptionsMenu(android.view.Menu):60:60 -> onCreateOptionsMenu + 1:1:boolean onOptionsItemSelected(android.view.MenuItem):69:69 -> onOptionsItemSelected + 2:2:boolean onOptionsItemSelected(android.view.MenuItem):76:76 -> onOptionsItemSelected + 1:1:void bar():54:54 -> t + 1:1:void foo():44 -> t + 1:1:void onClickHandler(android.view.View):40 -> t +""" +PROGUARD_BUG_UUID = "071207ac-b491-4a74-957c-2c94fd9594f2" +PROGUARD_BUG_SOURCE = b"x" + + +class BasicResolvingIntegrationTest(RelayStoreHelper, TransactionTestCase): + def test_basic_resolving(self): + url = reverse( + "sentry-api-0-dsym-files", + kwargs={ + "organization_slug": self.project.organization.slug, + "project_slug": self.project.slug, + }, + ) + + self.login_as(user=self.user) + + out = BytesIO() + f = zipfile.ZipFile(out, "w") + f.writestr("proguard/%s.txt" % PROGUARD_UUID, PROGUARD_SOURCE) + f.writestr("ignored-file.txt", b"This is just some stuff") + f.close() + + response = self.client.post( + url, + { + "file": SimpleUploadedFile( + "symbols.zip", out.getvalue(), content_type="application/zip" + ) + }, + format="multipart", + ) + assert response.status_code == 201, response.content + assert len(response.data) == 1 + + event_data = { + "user": {"ip_address": "31.172.207.97"}, + "extra": {}, + "project": self.project.id, + "platform": "java", + "debug_meta": {"images": [{"type": "proguard", "uuid": PROGUARD_UUID}]}, + "exception": { + "values": [ + { + "stacktrace": { + "frames": [ + { + "function": "a", + "abs_path": None, + "module": "org.a.b.g$a", + "filename": None, + "lineno": 67, + }, + { + "function": "a", + "abs_path": None, + "module": "org.a.b.g$a", + "filename": None, + "lineno": 69, + }, + ] + }, + "module": "org.a.b", + "type": "g$a", + "value": "Shit broke yo", + } + ] + }, + "timestamp": iso_format(before_now(seconds=1)), + } + + event = self.post_and_retrieve_event(event_data) + if not self.use_relay(): + # We measure the number of queries after an initial post, + # because there are many queries polluting the array + # before the actual "processing" happens (like, auth_user) + with self.assertWriteQueries( + { + "nodestore_node": 2, + "sentry_eventuser": 1, + "sentry_groupedmessage": 1, + "sentry_userreport": 1, + } + ): + self.post_and_retrieve_event(event_data) + + exc = event.interfaces["exception"].values[0] + bt = exc.stacktrace + frames = bt.frames + + assert exc.type == "Util$ClassContextSecurityManager" + assert exc.module == "org.slf4j.helpers" + assert frames[0].function == "getClassContext" + assert frames[0].module == "org.slf4j.helpers.Util$ClassContextSecurityManager" + assert frames[1].function == "getExtraClassContext" + assert frames[1].module == "org.slf4j.helpers.Util$ClassContextSecurityManager" + + assert event.culprit == ( + "org.slf4j.helpers.Util$ClassContextSecurityManager " "in getExtraClassContext" + ) + + def test_resolving_inline(self): + url = reverse( + "sentry-api-0-dsym-files", + kwargs={ + "organization_slug": self.project.organization.slug, + "project_slug": self.project.slug, + }, + ) + + self.login_as(user=self.user) + + out = BytesIO() + f = zipfile.ZipFile(out, "w") + f.writestr("proguard/%s.txt" % PROGUARD_INLINE_UUID, PROGUARD_INLINE_SOURCE) + f.writestr("ignored-file.txt", b"This is just some stuff") + f.close() + + response = self.client.post( + url, + { + "file": SimpleUploadedFile( + "symbols.zip", out.getvalue(), content_type="application/zip" + ) + }, + format="multipart", + ) + assert response.status_code == 201, response.content + assert len(response.data) == 1 + + event_data = { + "user": {"ip_address": "31.172.207.97"}, + "extra": {}, + "project": self.project.id, + "platform": "java", + "debug_meta": {"images": [{"type": "proguard", "uuid": PROGUARD_INLINE_UUID}]}, + "exception": { + "values": [ + { + "stacktrace": { + "frames": [ + { + "function": "onClick", + "abs_path": None, + "module": "e.a.c.a", + "filename": None, + "lineno": 2, + }, + { + "function": "t", + "abs_path": None, + "module": "io.sentry.sample.MainActivity", + "filename": "MainActivity.java", + "lineno": 1, + }, + ] + }, + "module": "org.a.b", + "type": "g$a", + "value": "Shit broke yo", + } + ] + }, + "timestamp": iso_format(before_now(seconds=1)), + } + + event = self.post_and_retrieve_event(event_data) + if not self.use_relay(): + # We measure the number of queries after an initial post, + # because there are many queries polluting the array + # before the actual "processing" happens (like, auth_user) + with self.assertWriteQueries( + { + "nodestore_node": 2, + "sentry_eventuser": 1, + "sentry_groupedmessage": 1, + "sentry_userreport": 1, + } + ): + self.post_and_retrieve_event(event_data) + + exc = event.interfaces["exception"].values[0] + bt = exc.stacktrace + frames = bt.frames + + assert len(frames) == 4 + + assert frames[0].function == "onClick" + assert frames[0].module == "io.sentry.sample.-$$Lambda$r3Avcbztes2hicEObh02jjhQqd4" + + assert frames[1].filename == "MainActivity.java" + assert frames[1].module == "io.sentry.sample.MainActivity" + assert frames[1].function == "onClickHandler" + assert frames[1].lineno == 40 + assert frames[2].function == "foo" + assert frames[2].lineno == 44 + assert frames[3].function == "bar" + assert frames[3].lineno == 54 + assert frames[3].filename == "MainActivity.java" + assert frames[3].module == "io.sentry.sample.MainActivity" + + def test_error_on_resolving(self): + url = reverse( + "sentry-api-0-dsym-files", + kwargs={ + "organization_slug": self.project.organization.slug, + "project_slug": self.project.slug, + }, + ) + + self.login_as(user=self.user) + + out = BytesIO() + f = zipfile.ZipFile(out, "w") + f.writestr("proguard/%s.txt" % PROGUARD_BUG_UUID, PROGUARD_BUG_SOURCE) + f.close() + + response = self.client.post( + url, + { + "file": SimpleUploadedFile( + "symbols.zip", out.getvalue(), content_type="application/zip" + ) + }, + format="multipart", + ) + assert response.status_code == 201, response.content + assert len(response.data) == 1 + + event_data = { + "user": {"ip_address": "31.172.207.97"}, + "extra": {}, + "project": self.project.id, + "platform": "java", + "debug_meta": {"images": [{"type": "proguard", "uuid": PROGUARD_BUG_UUID}]}, + "exception": { + "values": [ + { + "stacktrace": { + "frames": [ + { + "function": "a", + "abs_path": None, + "module": "org.a.b.g$a", + "filename": None, + "lineno": 67, + }, + { + "function": "a", + "abs_path": None, + "module": "org.a.b.g$a", + "filename": None, + "lineno": 69, + }, + ] + }, + "type": "RuntimeException", + "value": "Shit broke yo", + } + ] + }, + "timestamp": iso_format(before_now(seconds=1)), + } + event = self.post_and_retrieve_event(event_data) [email protected]_store_integration -class BasicResolvingIntegrationTestRelay( - RelayStoreHelper, TransactionTestCase, BasicResolvingIntegrationTest -): - pass + assert len(event.data["errors"]) == 1 + assert event.data["errors"][0] == { + "mapping_uuid": u"071207ac-b491-4a74-957c-2c94fd9594f2", + "type": "proguard_missing_lineno", + } diff --git a/tests/sentry/lang/javascript/example-project/.gitignore b/tests/relay_integration/lang/javascript/example-project/.gitignore similarity index 100% rename from tests/sentry/lang/javascript/example-project/.gitignore rename to tests/relay_integration/lang/javascript/example-project/.gitignore diff --git a/tests/sentry/lang/javascript/example-project/Makefile b/tests/relay_integration/lang/javascript/example-project/Makefile similarity index 100% rename from tests/sentry/lang/javascript/example-project/Makefile rename to tests/relay_integration/lang/javascript/example-project/Makefile diff --git a/tests/sentry/lang/javascript/example-project/index.html b/tests/relay_integration/lang/javascript/example-project/index.html similarity index 100% rename from tests/sentry/lang/javascript/example-project/index.html rename to tests/relay_integration/lang/javascript/example-project/index.html diff --git a/tests/sentry/lang/javascript/example-project/launch.js b/tests/relay_integration/lang/javascript/example-project/launch.js similarity index 100% rename from tests/sentry/lang/javascript/example-project/launch.js rename to tests/relay_integration/lang/javascript/example-project/launch.js diff --git a/tests/sentry/lang/javascript/example-project/minifiedError.json b/tests/relay_integration/lang/javascript/example-project/minifiedError.json similarity index 100% rename from tests/sentry/lang/javascript/example-project/minifiedError.json rename to tests/relay_integration/lang/javascript/example-project/minifiedError.json diff --git a/tests/sentry/lang/javascript/example-project/package.json b/tests/relay_integration/lang/javascript/example-project/package.json similarity index 100% rename from tests/sentry/lang/javascript/example-project/package.json rename to tests/relay_integration/lang/javascript/example-project/package.json diff --git a/tests/sentry/lang/javascript/example-project/test.js b/tests/relay_integration/lang/javascript/example-project/test.js similarity index 100% rename from tests/sentry/lang/javascript/example-project/test.js rename to tests/relay_integration/lang/javascript/example-project/test.js diff --git a/tests/sentry/lang/javascript/example-project/test.map b/tests/relay_integration/lang/javascript/example-project/test.map similarity index 100% rename from tests/sentry/lang/javascript/example-project/test.map rename to tests/relay_integration/lang/javascript/example-project/test.map diff --git a/tests/sentry/lang/javascript/example-project/test.min.js b/tests/relay_integration/lang/javascript/example-project/test.min.js similarity index 86% rename from tests/sentry/lang/javascript/example-project/test.min.js rename to tests/relay_integration/lang/javascript/example-project/test.min.js index f43cabc6da1af6..965752936089b0 100644 --- a/tests/sentry/lang/javascript/example-project/test.min.js +++ b/tests/relay_integration/lang/javascript/example-project/test.min.js @@ -1,2 +1,2 @@ var makeAFailure=function(){function n(n){}function e(n){throw new Error("failed!")}function r(r){var i=null;if(r.failed){i=e}else{i=n}i(r)}function i(){var n={failed:true,value:42};r(n)}return i}(); -//# sourceMappingURL=test.map \ No newline at end of file +//# sourceMappingURL=test.map diff --git a/tests/sentry/lang/javascript/example-project/yarn.lock b/tests/relay_integration/lang/javascript/example-project/yarn.lock similarity index 100% rename from tests/sentry/lang/javascript/example-project/yarn.lock rename to tests/relay_integration/lang/javascript/example-project/yarn.lock diff --git a/tests/sentry/lang/javascript/fixtures/dist.bundle.js b/tests/relay_integration/lang/javascript/fixtures/dist.bundle.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/dist.bundle.js rename to tests/relay_integration/lang/javascript/fixtures/dist.bundle.js diff --git a/tests/sentry/lang/javascript/fixtures/dist.bundle.js.map b/tests/relay_integration/lang/javascript/fixtures/dist.bundle.js.map similarity index 100% rename from tests/sentry/lang/javascript/fixtures/dist.bundle.js.map rename to tests/relay_integration/lang/javascript/fixtures/dist.bundle.js.map diff --git a/tests/sentry/lang/javascript/fixtures/embedded.js b/tests/relay_integration/lang/javascript/fixtures/embedded.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/embedded.js rename to tests/relay_integration/lang/javascript/fixtures/embedded.js diff --git a/tests/sentry/lang/javascript/fixtures/embedded.js.map b/tests/relay_integration/lang/javascript/fixtures/embedded.js.map similarity index 100% rename from tests/sentry/lang/javascript/fixtures/embedded.js.map rename to tests/relay_integration/lang/javascript/fixtures/embedded.js.map diff --git a/tests/sentry/lang/javascript/fixtures/empty.js b/tests/relay_integration/lang/javascript/fixtures/empty.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/empty.js rename to tests/relay_integration/lang/javascript/fixtures/empty.js diff --git a/tests/sentry/lang/javascript/fixtures/file.min.js b/tests/relay_integration/lang/javascript/fixtures/file.min.js similarity index 83% rename from tests/sentry/lang/javascript/fixtures/file.min.js rename to tests/relay_integration/lang/javascript/fixtures/file.min.js index 12b9f811b28e00..80df2a5737dcaf 100644 --- a/tests/sentry/lang/javascript/fixtures/file.min.js +++ b/tests/relay_integration/lang/javascript/fixtures/file.min.js @@ -1,2 +1,2 @@ function add(a,b){"use strict";return a+b}function multiply(a,b){"use strict";return a*b}function divide(a,b){"use strict";try{return multiply(add(a,b),a,b)/c}catch(e){Raven.captureException(e)}} -//@ sourceMappingURL=file.sourcemap.js \ No newline at end of file +//@ sourceMappingURL=file.sourcemap.js diff --git a/tests/sentry/lang/javascript/fixtures/file.sourcemap.js b/tests/relay_integration/lang/javascript/fixtures/file.sourcemap.js similarity index 87% rename from tests/sentry/lang/javascript/fixtures/file.sourcemap.js rename to tests/relay_integration/lang/javascript/fixtures/file.sourcemap.js index 1bd0f6510cf4a7..d2af021988b081 100644 --- a/tests/sentry/lang/javascript/fixtures/file.sourcemap.js +++ b/tests/relay_integration/lang/javascript/fixtures/file.sourcemap.js @@ -1 +1 @@ -{"version":3,"file":"file.min.js","sources":["file1.js","file2.js"],"names":["add","a","b","multiply","divide","c","e","Raven","captureException"],"mappings":"AAAA,QAASA,KAAIC,EAAGC,GACf,YACA,OAAOD,GAAIC,ECFZ,QAASC,UAASF,EAAGC,GACpB,YACA,OAAOD,GAAIC,EAEZ,QAASE,QAAOH,EAAGC,GAClB,YACA,KACC,MAAOC,UAASH,IAAIC,EAAGC,GAAID,EAAGC,GAAKG,EAClC,MAAOC,GACRC,MAAMC,iBAAiBF"} \ No newline at end of file +{"version":3,"file":"file.min.js","sources":["file1.js","file2.js"],"names":["add","a","b","multiply","divide","c","e","Raven","captureException"],"mappings":"AAAA,QAASA,KAAIC,EAAGC,GACf,YACA,OAAOD,GAAIC,ECFZ,QAASC,UAASF,EAAGC,GACpB,YACA,OAAOD,GAAIC,EAEZ,QAASE,QAAOH,EAAGC,GAClB,YACA,KACC,MAAOC,UAASH,IAAIC,EAAGC,GAAID,EAAGC,GAAKG,EAClC,MAAOC,GACRC,MAAMC,iBAAiBF"} diff --git a/tests/sentry/lang/javascript/fixtures/file1.js b/tests/relay_integration/lang/javascript/fixtures/file1.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/file1.js rename to tests/relay_integration/lang/javascript/fixtures/file1.js diff --git a/tests/sentry/lang/javascript/fixtures/file2.js b/tests/relay_integration/lang/javascript/fixtures/file2.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/file2.js rename to tests/relay_integration/lang/javascript/fixtures/file2.js diff --git a/tests/sentry/lang/javascript/fixtures/indexed.min.js b/tests/relay_integration/lang/javascript/fixtures/indexed.min.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/indexed.min.js rename to tests/relay_integration/lang/javascript/fixtures/indexed.min.js diff --git a/tests/sentry/lang/javascript/fixtures/indexed.sourcemap.js b/tests/relay_integration/lang/javascript/fixtures/indexed.sourcemap.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/indexed.sourcemap.js rename to tests/relay_integration/lang/javascript/fixtures/indexed.sourcemap.js diff --git a/tests/sentry/lang/javascript/fixtures/node_app.min.js b/tests/relay_integration/lang/javascript/fixtures/node_app.min.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/node_app.min.js rename to tests/relay_integration/lang/javascript/fixtures/node_app.min.js diff --git a/tests/sentry/lang/javascript/fixtures/node_app.min.js.map b/tests/relay_integration/lang/javascript/fixtures/node_app.min.js.map similarity index 100% rename from tests/sentry/lang/javascript/fixtures/node_app.min.js.map rename to tests/relay_integration/lang/javascript/fixtures/node_app.min.js.map diff --git a/tests/sentry/lang/javascript/fixtures/nofiles.js b/tests/relay_integration/lang/javascript/fixtures/nofiles.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/nofiles.js rename to tests/relay_integration/lang/javascript/fixtures/nofiles.js diff --git a/tests/sentry/lang/javascript/fixtures/nofiles.js.map b/tests/relay_integration/lang/javascript/fixtures/nofiles.js.map similarity index 100% rename from tests/sentry/lang/javascript/fixtures/nofiles.js.map rename to tests/relay_integration/lang/javascript/fixtures/nofiles.js.map diff --git a/tests/sentry/lang/javascript/fixtures/unsupported.min.js b/tests/relay_integration/lang/javascript/fixtures/unsupported.min.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/unsupported.min.js rename to tests/relay_integration/lang/javascript/fixtures/unsupported.min.js diff --git a/tests/sentry/lang/javascript/fixtures/unsupported.sourcemap.js b/tests/relay_integration/lang/javascript/fixtures/unsupported.sourcemap.js similarity index 100% rename from tests/sentry/lang/javascript/fixtures/unsupported.sourcemap.js rename to tests/relay_integration/lang/javascript/fixtures/unsupported.sourcemap.js diff --git a/tests/relay_integration/lang/javascript/test_example.py b/tests/relay_integration/lang/javascript/test_example.py index d2d4519b58421f..449a6ef2f946d4 100644 --- a/tests/relay_integration/lang/javascript/test_example.py +++ b/tests/relay_integration/lang/javascript/test_example.py @@ -1,11 +1,82 @@ from __future__ import absolute_import -import pytest +import os +import json +import responses -from tests.sentry.lang.javascript.test_example import ExampleTestCase from sentry.testutils import RelayStoreHelper, TransactionTestCase +from sentry.testutils.helpers.datetime import iso_format, before_now [email protected]_store_integration -class ExampleTestCaseRelay(RelayStoreHelper, TransactionTestCase, ExampleTestCase): - pass +def get_fixture_path(name): + return os.path.join(os.path.dirname(__file__), "example-project", name) + + +def load_fixture(name): + with open(get_fixture_path(name)) as f: + return f.read() + + +class ExampleTestCase(RelayStoreHelper, TransactionTestCase): + @responses.activate + def test_sourcemap_expansion(self): + responses.add( + responses.GET, + "http://example.com/test.js", + body=load_fixture("test.js"), + content_type="application/javascript", + ) + responses.add( + responses.GET, + "http://example.com/test.min.js", + body=load_fixture("test.min.js"), + content_type="application/javascript", + ) + responses.add( + responses.GET, + "http://example.com/test.map", + body=load_fixture("test.map"), + content_type="application/json", + ) + responses.add(responses.GET, "http://example.com/index.html", body="Not Found", status=404) + + min_ago = iso_format(before_now(minutes=1)) + + data = { + "timestamp": min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": json.loads(load_fixture("minifiedError.json"))[::-1] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + assert len(frame_list) == 4 + + assert frame_list[0].function == "produceStack" + assert frame_list[0].lineno == 6 + assert frame_list[0].filename == "index.html" + + assert frame_list[1].function == "test" + assert frame_list[1].lineno == 20 + assert frame_list[1].filename == "test.js" + + assert frame_list[2].function == "invoke" + assert frame_list[2].lineno == 15 + assert frame_list[2].filename == "test.js" + + assert frame_list[3].function == "onFailure" + assert frame_list[3].lineno == 5 + assert frame_list[3].filename == "test.js" diff --git a/tests/relay_integration/lang/javascript/test_plugin.py b/tests/relay_integration/lang/javascript/test_plugin.py index aaf4574aab49ce..c64a7ad7bd3275 100644 --- a/tests/relay_integration/lang/javascript/test_plugin.py +++ b/tests/relay_integration/lang/javascript/test_plugin.py @@ -1,15 +1,1360 @@ +# coding: utf-8 + from __future__ import absolute_import -import pytest -from tests.sentry.lang.javascript.test_plugin import JavascriptIntegrationTest -from sentry.testutils import RelayStoreHelper, TransactionTestCase +import os.path +from base64 import b64encode + +import responses + +from sentry.testutils import RelayStoreHelper, TransactionTestCase, SnubaTestCase from sentry.testutils.helpers.datetime import iso_format, before_now +from sentry.utils.compat.mock import patch +from sentry.models import File, Release, ReleaseFile + +# TODO(joshuarli): six 1.12.0 adds ensure_binary +# might also want to put this in utils since we pretty much expect the result to be py3 str and not bytes +BASE64_SOURCEMAP = "data:application/json;base64," + ( + b64encode( + u'{"version":3,"file":"generated.js","sources":["/test.js"],"names":[],"mappings":"AAAA","sourcesContent":[' + '"console.log(\\"hello, World!\\")"]}'.encode("utf-8") + ) + .decode("utf-8") + .replace("\n", "") +) + +def get_fixture_path(name): + return os.path.join(os.path.dirname(__file__), "fixtures", name) [email protected]_store_integration -class JavascriptIntegrationTestRelay( - RelayStoreHelper, TransactionTestCase, JavascriptIntegrationTest -): + +def load_fixture(name): + with open(get_fixture_path(name), "rb") as fp: + return fp.read() + + +class JavascriptIntegrationTest(RelayStoreHelper, SnubaTestCase, TransactionTestCase): def setUp(self): - super(JavascriptIntegrationTestRelay, self).setUp() + super(JavascriptIntegrationTest, self).setUp() self.min_ago = iso_format(before_now(minutes=1)) + + def test_adds_contexts_without_device(self): + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "request": { + "url": "http://example.com", + "headers": [ + [ + "User-Agent", + "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/28.0.1500.72 Safari/537.36", + ] + ], + }, + } + + event = self.post_and_retrieve_event(data) + contexts = event.interfaces["contexts"].to_json() + assert contexts.get("os") == {"name": "Windows", "version": "8", "type": "os"} + assert contexts.get("device") is None + + def test_adds_contexts_with_device(self): + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "request": { + "url": "http://example.com", + "headers": [ + [ + "User-Agent", + "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SCH-R530U Build/JSS15J) AppleWebKit/534.30 (" + "KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 USCC-R530U", + ] + ], + }, + } + + event = self.post_and_retrieve_event(data) + + contexts = event.interfaces["contexts"].to_json() + assert contexts.get("os") == {"name": "Android", "type": "os", "version": "4.3"} + assert contexts.get("browser") == {"name": "Android", "type": "browser", "version": "4.3"} + assert contexts.get("device") == { + "family": "Samsung SCH-R530U", + "type": "device", + "model": "SCH-R530U", + "brand": "Samsung", + } + + def test_adds_contexts_with_ps4_device(self): + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "request": { + "url": "http://example.com", + "headers": [ + [ + "User-Agent", + "Mozilla/5.0 (PlayStation 4 3.55) AppleWebKit/537.78 (KHTML, like Gecko)", + ] + ], + }, + } + + event = self.post_and_retrieve_event(data) + + contexts = event.interfaces["contexts"].to_json() + assert contexts.get("os") is None + assert contexts.get("browser") is None + assert contexts.get("device") == { + "family": "PlayStation 4", + "type": "device", + "model": "PlayStation 4", + "brand": "Sony", + } + + @patch("sentry.lang.javascript.processor.fetch_file") + def test_source_expansion(self, mock_fetch_file): + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/foo.js", + "filename": "foo.js", + "lineno": 4, + "colno": 0, + }, + { + "abs_path": "http://example.com/foo.js", + "filename": "foo.js", + "lineno": 1, + "colno": 0, + }, + ] + }, + } + ] + }, + } + + mock_fetch_file.return_value.body = "\n".join("hello world") + mock_fetch_file.return_value.encoding = None + mock_fetch_file.return_value.headers = {} + + event = self.post_and_retrieve_event(data) + + mock_fetch_file.assert_called_once_with( + "http://example.com/foo.js", + project=self.project, + release=None, + dist=None, + allow_scraping=True, + ) + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + assert frame.pre_context == ["h", "e", "l"] + assert frame.context_line == "l" + assert frame.post_context == ["o", " ", "w", "o", "r"] + + frame = frame_list[1] + assert not frame.pre_context + assert frame.context_line == "h" + assert frame.post_context == ["e", "l", "l", "o", " "] + + # no source map means no raw_stacktrace + assert exception.values[0].raw_stacktrace is None + + @patch("sentry.lang.javascript.processor.fetch_file") + @patch("sentry.lang.javascript.processor.discover_sourcemap") + def test_inlined_sources(self, mock_discover_sourcemap, mock_fetch_file): + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/test.min.js", + "filename": "test.js", + "lineno": 1, + "colno": 1, + } + ] + }, + } + ] + }, + } + + mock_discover_sourcemap.return_value = BASE64_SOURCEMAP + + mock_fetch_file.return_value.url = "http://example.com/test.min.js" + mock_fetch_file.return_value.body = "\n".join("<generated source>") + mock_fetch_file.return_value.encoding = None + + event = self.post_and_retrieve_event(data) + + mock_fetch_file.assert_called_once_with( + "http://example.com/test.min.js", + project=self.project, + release=None, + dist=None, + allow_scraping=True, + ) + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + assert not frame.pre_context + assert frame.context_line == 'console.log("hello, World!")' + assert not frame.post_context + assert frame.data["sourcemap"] == "http://example.com/test.min.js" + + @responses.activate + def test_error_message_translations(self): + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "logentry": { + "formatted": u"ReferenceError: Impossible de d\xe9finir une propri\xe9t\xe9 \xab foo \xbb : objet non " + u"extensible" + }, + "exception": { + "values": [ + {"type": "Error", "value": u"P\u0159\xedli\u0161 mnoho soubor\u016f"}, + { + "type": "Error", + "value": u"foo: wyst\u0105pi\u0142 nieoczekiwany b\u0142\u0105d podczas pr\xf3by uzyskania " + u"informacji o metadanych", + }, + ] + }, + } + + event = self.post_and_retrieve_event(data) + + message = event.interfaces["logentry"] + assert ( + message.formatted + == "ReferenceError: Cannot define property 'foo': object is not extensible" + ) + + exception = event.interfaces["exception"] + assert exception.values[0].value == "Too many files" + assert ( + exception.values[1].value + == "foo: an unexpected failure occurred while trying to obtain metadata information" + ) + + @responses.activate + def test_sourcemap_source_expansion(self): + responses.add( + responses.GET, + "http://example.com/file.min.js", + body=load_fixture("file.min.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/file1.js", + body=load_fixture("file1.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/file2.js", + body=load_fixture("file2.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/file.sourcemap.js", + body=load_fixture("file.sourcemap.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add(responses.GET, "http://example.com/index.html", body="Not Found", status=404) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/file.min.js", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + # NOTE: Intentionally source is not retrieved from this HTML file + { + "function": 'function: "HTMLDocument.<anonymous>"', + "abs_path": "http//example.com/index.html", + "filename": "index.html", + "lineno": 283, + "colno": 17, + "in_app": False, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert event.data["errors"] == [ + {"type": "js_no_source", "url": "http//example.com/index.html"} + ] + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] + expected = u"\treturn a + b; // fôo" + assert frame.context_line == expected + assert frame.post_context == ["}", ""] + + raw_frame_list = exception.values[0].raw_stacktrace.frames + raw_frame = raw_frame_list[0] + assert not raw_frame.pre_context + assert ( + raw_frame.context_line + == 'function add(a,b){"use strict";return a+b}function multiply(a,b){"use strict";return a*b}function ' + 'divide(a,b){"use strict";try{return multip {snip}' + ) + assert raw_frame.post_context == ["//@ sourceMappingURL=file.sourcemap.js", ""] + assert raw_frame.lineno == 1 + + # Since we couldn't expand source for the 2nd frame, both + # its raw and original form should be identical + assert raw_frame_list[1] == frame_list[1] + + @responses.activate + def test_sourcemap_embedded_source_expansion(self): + responses.add( + responses.GET, + "http://example.com/embedded.js", + body=load_fixture("embedded.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/embedded.js.map", + body=load_fixture("embedded.js.map"), + content_type="application/json; charset=utf-8", + ) + responses.add(responses.GET, "http://example.com/index.html", body="Not Found", status=404) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/embedded.js", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + # NOTE: Intentionally source is not retrieved from this HTML file + { + "function": 'function: "HTMLDocument.<anonymous>"', + "abs_path": "http//example.com/index.html", + "filename": "index.html", + "lineno": 283, + "colno": 17, + "in_app": False, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert event.data["errors"] == [ + {"type": "js_no_source", "url": "http//example.com/index.html"} + ] + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] + expected = u"\treturn a + b; // fôo" + assert frame.context_line == expected + assert frame.post_context == ["}", ""] + + @responses.activate + def test_sourcemap_nofiles_source_expansion(self): + project = self.project + release = Release.objects.create(organization_id=project.organization_id, version="abc") + release.add_project(project) + + f_minified = File.objects.create( + name="nofiles.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f_minified.putfile(open(get_fixture_path("nofiles.js"), "rb")) + ReleaseFile.objects.create( + name=u"~/{}".format(f_minified.name), + release=release, + organization_id=project.organization_id, + file=f_minified, + ) + + f_sourcemap = File.objects.create( + name="nofiles.js.map", type="release.file", headers={"Content-Type": "application/json"} + ) + f_sourcemap.putfile(open(get_fixture_path("nofiles.js.map"), "rb")) + ReleaseFile.objects.create( + name=u"app:///{}".format(f_sourcemap.name), + release=release, + organization_id=project.organization_id, + file=f_sourcemap, + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "release": "abc", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [{"abs_path": "app:///nofiles.js", "lineno": 1, "colno": 39}] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert "errors" not in event.data + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + assert len(frame_list) == 1 + frame = frame_list[0] + assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] + assert frame.context_line == u"\treturn a * b;" + assert frame.post_context == [ + "}", + "function divide(a, b) {", + '\t"use strict";', + "\ttry {", + "\t\treturn multiply(add(a, b), a, b) / c;", + ] + + @responses.activate + def test_indexed_sourcemap_source_expansion(self): + responses.add( + responses.GET, + "http://example.com/indexed.min.js", + body=load_fixture("indexed.min.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/file1.js", + body=load_fixture("file1.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/file2.js", + body=load_fixture("file2.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/indexed.sourcemap.js", + body=load_fixture("indexed.sourcemap.js"), + content_type="application/json; charset=utf-8", + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/indexed.min.js", + "filename": "indexed.min.js", + "lineno": 1, + "colno": 39, + }, + { + "abs_path": "http://example.com/indexed.min.js", + "filename": "indexed.min.js", + "lineno": 2, + "colno": 44, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert "errors" not in event.data + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] + + expected = u"\treturn a + b; // fôo" + assert frame.context_line == expected + assert frame.post_context == ["}", ""] + + raw_frame_list = exception.values[0].raw_stacktrace.frames + raw_frame = raw_frame_list[0] + assert not raw_frame.pre_context + assert raw_frame.context_line == 'function add(a,b){"use strict";return a+b}' + assert raw_frame.post_context == [ + 'function multiply(a,b){"use strict";return a*b}function divide(a,b){"use strict";try{return multiply(' + "add(a,b),a,b)/c}catch(e){Raven.captureE {snip}", + "//# sourceMappingURL=indexed.sourcemap.js", + "", + ] + assert raw_frame.lineno == 1 + + frame = frame_list[1] + assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] + assert frame.context_line == "\treturn a * b;" + assert frame.post_context == [ + "}", + "function divide(a, b) {", + '\t"use strict";', + "\ttry {", + "\t\treturn multiply(add(a, b), a, b) / c;", + ] + + raw_frame = raw_frame_list[1] + assert raw_frame.pre_context == ['function add(a,b){"use strict";return a+b}'] + assert ( + raw_frame.context_line + == 'function multiply(a,b){"use strict";return a*b}function divide(a,b){"use strict";try{return multiply(' + "add(a,b),a,b)/c}catch(e){Raven.captureE {snip}" + ) + assert raw_frame.post_context == ["//# sourceMappingURL=indexed.sourcemap.js", ""] + assert raw_frame.lineno == 2 + + @responses.activate + def test_expansion_via_release_artifacts(self): + project = self.project + release = Release.objects.create(organization_id=project.organization_id, version="abc") + release.add_project(project) + + # file.min.js + # ------------ + + f_minified = File.objects.create( + name="file.min.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f_minified.putfile(open(get_fixture_path("file.min.js"), "rb")) + + # Intentionally omit hostname - use alternate artifact path lookup instead + # /file1.js vs http://example.com/file1.js + ReleaseFile.objects.create( + name=u"~/{}?foo=bar".format(f_minified.name), + release=release, + organization_id=project.organization_id, + file=f_minified, + ) + + # file1.js + # --------- + + f1 = File.objects.create( + name="file1.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f1.putfile(open(get_fixture_path("file1.js"), "rb")) + + ReleaseFile.objects.create( + name=u"http://example.com/{}".format(f1.name), + release=release, + organization_id=project.organization_id, + file=f1, + ) + + # file2.js + # ---------- + + f2 = File.objects.create( + name="file2.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f2.putfile(open(get_fixture_path("file2.js"), "rb")) + ReleaseFile.objects.create( + name=u"http://example.com/{}".format(f2.name), + release=release, + organization_id=project.organization_id, + file=f2, + ) + + # To verify that the full url has priority over the relative url, + # we will also add a second ReleaseFile alias for file2.js (f3) w/o + # hostname that points to an empty file. If the processor chooses + # this empty file over the correct file2.js, it will not locate + # context for the 2nd frame. + f2_empty = File.objects.create( + name="empty.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f2_empty.putfile(open(get_fixture_path("empty.js"), "rb")) + ReleaseFile.objects.create( + name=u"~/{}".format(f2.name), # intentionally using f2.name ("file2.js") + release=release, + organization_id=project.organization_id, + file=f2_empty, + ) + + # sourcemap + # ---------- + + f_sourcemap = File.objects.create( + name="file.sourcemap.js", + type="release.file", + headers={"Content-Type": "application/json"}, + ) + f_sourcemap.putfile(open(get_fixture_path("file.sourcemap.js"), "rb")) + ReleaseFile.objects.create( + name=u"http://example.com/{}".format(f_sourcemap.name), + release=release, + organization_id=project.organization_id, + file=f_sourcemap, + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "release": "abc", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/file.min.js?foo=bar", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + { + "abs_path": "http://example.com/file.min.js?foo=bar", + "filename": "file.min.js", + "lineno": 1, + "colno": 79, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert "errors" not in event.data + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] + assert frame.context_line == u"\treturn a + b; // fôo" + assert frame.post_context == ["}", ""] + + frame = frame_list[1] + assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] + assert frame.context_line == "\treturn a * b;" + assert frame.post_context == [ + "}", + "function divide(a, b) {", + '\t"use strict";', + u"\ttry {", + "\t\treturn multiply(add(a, b), a, b) / c;", + ] + + @responses.activate + def test_expansion_via_distribution_release_artifacts(self): + project = self.project + release = Release.objects.create(organization_id=project.organization_id, version="abc") + release.add_project(project) + dist = release.add_dist("foo") + + # file.min.js + # ------------ + + f_minified = File.objects.create( + name="file.min.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f_minified.putfile(open(get_fixture_path("file.min.js"), "rb")) + + # Intentionally omit hostname - use alternate artifact path lookup instead + # /file1.js vs http://example.com/file1.js + ReleaseFile.objects.create( + name=u"~/{}?foo=bar".format(f_minified.name), + release=release, + dist=dist, + organization_id=project.organization_id, + file=f_minified, + ) + + # file1.js + # --------- + + f1 = File.objects.create( + name="file1.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f1.putfile(open(get_fixture_path("file1.js"), "rb")) + + ReleaseFile.objects.create( + name=u"http://example.com/{}".format(f1.name), + release=release, + dist=dist, + organization_id=project.organization_id, + file=f1, + ) + + # file2.js + # ---------- + + f2 = File.objects.create( + name="file2.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f2.putfile(open(get_fixture_path("file2.js"), "rb")) + ReleaseFile.objects.create( + name=u"http://example.com/{}".format(f2.name), + release=release, + dist=dist, + organization_id=project.organization_id, + file=f2, + ) + + # To verify that the full url has priority over the relative url, + # we will also add a second ReleaseFile alias for file2.js (f3) w/o + # hostname that points to an empty file. If the processor chooses + # this empty file over the correct file2.js, it will not locate + # context for the 2nd frame. + f2_empty = File.objects.create( + name="empty.js", type="release.file", headers={"Content-Type": "application/json"} + ) + f2_empty.putfile(open(get_fixture_path("empty.js"), "rb")) + ReleaseFile.objects.create( + name=u"~/{}".format(f2.name), # intentionally using f2.name ("file2.js") + release=release, + dist=dist, + organization_id=project.organization_id, + file=f2_empty, + ) + + # sourcemap + # ---------- + + f_sourcemap = File.objects.create( + name="file.sourcemap.js", + type="release.file", + headers={"Content-Type": "application/json"}, + ) + f_sourcemap.putfile(open(get_fixture_path("file.sourcemap.js"), "rb")) + ReleaseFile.objects.create( + name=u"http://example.com/{}".format(f_sourcemap.name), + release=release, + dist=dist, + organization_id=project.organization_id, + file=f_sourcemap, + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "release": "abc", + "dist": "foo", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/file.min.js?foo=bar", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + { + "abs_path": "http://example.com/file.min.js?foo=bar", + "filename": "file.min.js", + "lineno": 1, + "colno": 79, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert "errors" not in event.data + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] + assert frame.context_line == u"\treturn a + b; // fôo" + assert frame.post_context == ["}", ""] + + frame = frame_list[1] + assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] + assert frame.context_line == "\treturn a * b;" + assert frame.post_context == [ + "}", + "function divide(a, b) {", + '\t"use strict";', + u"\ttry {", + "\t\treturn multiply(add(a, b), a, b) / c;", + ] + + @responses.activate + def test_sourcemap_expansion_with_missing_source(self): + """ + Tests a successful sourcemap expansion that points to source files + that are not found. + """ + responses.add( + responses.GET, + "http://example.com/file.min.js", + body=load_fixture("file.min.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/file.sourcemap.js", + body=load_fixture("file.sourcemap.js"), + content_type="application/json; charset=utf-8", + ) + responses.add(responses.GET, "http://example.com/file1.js", body="Not Found", status=404) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + # Add two frames. We only want to see the + # error once though. + "frames": [ + { + "abs_path": "http://example.com/file.min.js", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + { + "abs_path": "http://example.com/file.min.js", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert event.data["errors"] == [ + {"url": u"http://example.com/file1.js", "type": "fetch_invalid_http_code", "value": 404} + ] + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + frame = frame_list[0] + + # no context information ... + assert not frame.pre_context + assert not frame.context_line + assert not frame.post_context + + # ... but line, column numbers are still correctly mapped + assert frame.lineno == 3 + assert frame.colno == 9 + + @responses.activate + def test_failed_sourcemap_expansion(self): + """ + Tests attempting to parse an indexed source map where each section has a "url" + property - this is unsupported and should fail. + """ + responses.add( + responses.GET, + "http://example.com/unsupported.min.js", + body=load_fixture("unsupported.min.js"), + content_type="application/javascript; charset=utf-8", + ) + + responses.add( + responses.GET, + "http://example.com/unsupported.sourcemap.js", + body=load_fixture("unsupported.sourcemap.js"), + content_type="application/json; charset=utf-8", + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/unsupported.min.js", + "filename": "indexed.min.js", + "lineno": 1, + "colno": 39, + } + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert event.data["errors"] == [ + {"url": u"http://example.com/unsupported.sourcemap.js", "type": "js_invalid_source"} + ] + + def test_failed_sourcemap_expansion_data_url(self): + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "data:application/javascript,base46,asfasf", + "filename": "indexed.min.js", + "lineno": 1, + "colno": 39, + } + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert event.data["errors"] == [{"url": u"<data url>", "type": "js_no_source"}] + + @responses.activate + def test_failed_sourcemap_expansion_missing_location_entirely(self): + responses.add( + responses.GET, + "http://example.com/indexed.min.js", + body="//# sourceMappingURL=indexed.sourcemap.js", + ) + responses.add(responses.GET, "http://example.com/indexed.sourcemap.js", body="{}") + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/indexed.min.js", + "filename": "indexed.min.js", + "lineno": 1, + "colno": 1, + }, + { + "abs_path": "http://example.com/indexed.min.js", + "filename": "indexed.min.js", + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert "errors" not in event.data + + @responses.activate + def test_html_response_for_js(self): + responses.add( + responses.GET, + "http://example.com/file1.js", + body=" <!DOCTYPE html><html><head></head><body></body></html>", + ) + responses.add( + responses.GET, + "http://example.com/file2.js", + body="<!doctype html><html><head></head><body></body></html>", + ) + responses.add( + responses.GET, + "http://example.com/file.html", + body=( + "<!doctype html><html><head></head><body><script>/*legit case*/</script></body></html>" + ), + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/file1.js", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + { + "abs_path": "http://example.com/file2.js", + "filename": "file.min.js", + "lineno": 1, + "colno": 39, + }, + { + "abs_path": "http://example.com/file.html", + "filename": "file.html", + "lineno": 1, + "colno": 1, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert event.data["errors"] == [ + {"url": u"http://example.com/file1.js", "type": "js_invalid_content"}, + {"url": u"http://example.com/file2.js", "type": "js_invalid_content"}, + ] + + def test_node_processing(self): + project = self.project + release = Release.objects.create( + organization_id=project.organization_id, version="nodeabc123" + ) + release.add_project(project) + + f_minified = File.objects.create( + name="dist.bundle.js", + type="release.file", + headers={"Content-Type": "application/javascript"}, + ) + f_minified.putfile(open(get_fixture_path("dist.bundle.js"), "rb")) + ReleaseFile.objects.create( + name=u"~/{}".format(f_minified.name), + release=release, + organization_id=project.organization_id, + file=f_minified, + ) + + f_sourcemap = File.objects.create( + name="dist.bundle.js.map", + type="release.file", + headers={"Content-Type": "application/javascript"}, + ) + f_sourcemap.putfile(open(get_fixture_path("dist.bundle.js.map"), "rb")) + ReleaseFile.objects.create( + name=u"~/{}".format(f_sourcemap.name), + release=release, + organization_id=project.organization_id, + file=f_sourcemap, + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "node", + "release": "nodeabc123", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "filename": "app:///dist.bundle.js", + "function": "bar", + "lineno": 9, + "colno": 2321, + }, + { + "filename": "app:///dist.bundle.js", + "function": "foo", + "lineno": 3, + "colno": 2308, + }, + { + "filename": "app:///dist.bundle.js", + "function": "App", + "lineno": 3, + "colno": 1011, + }, + { + "filename": "app:///dist.bundle.js", + "function": "Object.<anonymous>", + "lineno": 1, + "colno": 1014, + }, + { + "filename": "app:///dist.bundle.js", + "function": "__webpack_require__", + "lineno": 20, + "colno": 30, + }, + { + "filename": "app:///dist.bundle.js", + "function": "<unknown>", + "lineno": 18, + "colno": 63, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + assert len(frame_list) == 6 + + import pprint + + pprint.pprint(frame_list[0].__dict__) + pprint.pprint(frame_list[1].__dict__) + pprint.pprint(frame_list[2].__dict__) + pprint.pprint(frame_list[3].__dict__) + pprint.pprint(frame_list[4].__dict__) + pprint.pprint(frame_list[5].__dict__) + + assert frame_list[0].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" + assert frame_list[0].function == "bar" + assert frame_list[0].lineno == 8 + + assert frame_list[1].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" + assert frame_list[1].function == "foo" + assert frame_list[1].lineno == 2 + + assert frame_list[2].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" + assert frame_list[2].function == "App" + assert frame_list[2].lineno == 2 + + assert frame_list[3].abs_path == "app:///dist.bundle.js" + assert frame_list[3].function == "Object.<anonymous>" + assert frame_list[3].lineno == 1 + + assert frame_list[4].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" + assert frame_list[4].function == "__webpack_require__" + assert frame_list[4].lineno == 19 + + assert frame_list[5].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" + assert frame_list[5].function == "<unknown>" + assert frame_list[5].lineno == 16 + + @responses.activate + def test_no_fetch_from_http(self): + responses.add( + responses.GET, + "http://example.com/node_app.min.js", + body=load_fixture("node_app.min.js"), + content_type="application/javascript; charset=utf-8", + ) + responses.add( + responses.GET, + "http://example.com/node_app.min.js.map", + body=load_fixture("node_app.min.js.map"), + content_type="application/javascript; charset=utf-8", + ) + + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "node", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "node_bootstrap.js", + "filename": "node_bootstrap.js", + "lineno": 1, + "colno": 38, + }, + { + "abs_path": "timers.js", + "filename": "timers.js", + "lineno": 1, + "colno": 39, + }, + { + "abs_path": "webpack:///internal", + "filename": "internal", + "lineno": 1, + "colno": 43, + }, + { + "abs_path": "webpack:///~/some_dep/file.js", + "filename": "file.js", + "lineno": 1, + "colno": 41, + }, + { + "abs_path": "webpack:///./node_modules/file.js", + "filename": "file.js", + "lineno": 1, + "colno": 42, + }, + { + "abs_path": "http://example.com/node_app.min.js", + "filename": "node_app.min.js", + "lineno": 1, + "colno": 40, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + exception = event.interfaces["exception"] + frame_list = exception.values[0].stacktrace.frames + + # This one should not process, so this one should be none. + assert exception.values[0].raw_stacktrace is None + + # None of the in app should update + for x in range(6): + assert not frame_list[x].in_app + + @responses.activate + def test_html_file_with_query_param_ending_with_js_extension(self): + responses.add( + responses.GET, + "http://example.com/file.html", + body=( + "<!doctype html><html><head></head><body><script>/*legit case*/</script></body></html>" + ), + ) + data = { + "timestamp": self.min_ago, + "message": "hello", + "platform": "javascript", + "exception": { + "values": [ + { + "type": "Error", + "stacktrace": { + "frames": [ + { + "abs_path": "http://example.com/file.html?sw=iddqd1337.js", + "filename": "file.html", + "lineno": 1, + "colno": 1, + }, + ] + }, + } + ] + }, + } + + event = self.post_and_retrieve_event(data) + + assert "errors" not in event.data diff --git a/tests/relay_integration/test_message_filters.py b/tests/relay_integration/test_message_filters.py index fce50e4feacf61..2c091f97b2173a 100644 --- a/tests/relay_integration/test_message_filters.py +++ b/tests/relay_integration/test_message_filters.py @@ -1,6 +1,5 @@ from __future__ import absolute_import, print_function -from django.test import override_settings from sentry.testutils import TransactionTestCase, RelayStoreHelper from sentry.models.projectoption import ProjectOption @@ -13,17 +12,13 @@ ) -@override_settings(ALLOWED_HOSTS=["localhost", "testserver", "host.docker.internal"]) class FilterTests(RelayStoreHelper, TransactionTestCase): - def setUp(self): # NOQA - RelayStoreHelper.setUp(self) - def _get_message(self): return {} def _set_filter_state(self, flt, state): ProjectOption.objects.set_value( - project=self.project, key=u"filters:{}".format(flt.spec.id), value=state + project=self.project, key=u"filters:{}".format(flt.id), value=state ) def test_should_not_filter_simple_messages(self): diff --git a/tests/sentry/api/endpoints/snapshots/ProjectFiltersTest/test_get.pysnap b/tests/sentry/api/endpoints/snapshots/ProjectFiltersTest/test_get.pysnap new file mode 100644 index 00000000000000..7d87f6acb16b34 --- /dev/null +++ b/tests/sentry/api/endpoints/snapshots/ProjectFiltersTest/test_get.pysnap @@ -0,0 +1,28 @@ +--- +created: '2020-07-09T11:33:30.140674Z' +creator: sentry +source: tests/sentry/api/endpoints/test_project_filters.py +--- +- active: false + description: Certain browser extensions will inject inline scripts and are known + to cause errors. + hello: browser-extensions - Filter out errors known to be caused by browser extensions + id: browser-extensions + name: Filter out errors known to be caused by browser extensions +- active: false + description: This applies to both IPv4 (``127.0.0.1``) and IPv6 (``::1``) addresses. + hello: localhost - Filter out events coming from localhost + id: localhost + name: Filter out events coming from localhost +- active: false + description: Older browsers often give less accurate information, and while they + may report valid issues, the context to understand them is incorrect or missing. + hello: legacy-browsers - Filter out known errors from legacy browsers + id: legacy-browsers + name: Filter out known errors from legacy browsers +- active: false + description: Some crawlers may execute pages in incompatible ways which then cause + errors that are unlikely to be seen by a normal user. + hello: web-crawlers - Filter out known web crawlers + id: web-crawlers + name: Filter out known web crawlers diff --git a/tests/sentry/api/endpoints/test_project_filter_details.py b/tests/sentry/api/endpoints/test_project_filter_details.py new file mode 100644 index 00000000000000..fb45a9f2d5b281 --- /dev/null +++ b/tests/sentry/api/endpoints/test_project_filter_details.py @@ -0,0 +1,18 @@ +from __future__ import absolute_import + +from sentry.testutils import APITestCase + + +class ProjectFilterDetailsTest(APITestCase): + def test_put(self): + self.login_as(user=self.user) + org = self.create_organization(name="baz", slug="1", owner=self.user) + team = self.create_team(organization=org, name="foo", slug="foo") + project = self.create_project(name="Bar", slug="bar", teams=[team]) + url = "/api/0/projects/%s/%s/filters/browser-extensions/" % (org.slug, project.slug) + + project.update_option("filters:browser-extensions", "0") + response = self.client.put(url, format="json", data={"active": True}) + assert response.status_code == 201 + + assert project.get_option("filters:browser-extensions") == "1" diff --git a/tests/sentry/api/endpoints/test_project_filters.py b/tests/sentry/api/endpoints/test_project_filters.py new file mode 100644 index 00000000000000..91d06c634b407c --- /dev/null +++ b/tests/sentry/api/endpoints/test_project_filters.py @@ -0,0 +1,18 @@ +from __future__ import absolute_import + +from sentry.testutils import APITestCase + + +class ProjectFiltersTest(APITestCase): + def test_get(self): + self.login_as(user=self.user) + org = self.create_organization(name="baz", slug="1", owner=self.user) + team = self.create_team(organization=org, name="foo", slug="foo") + project = self.create_project(name="Bar", slug="bar", teams=[team]) + url = "/api/0/projects/%s/%s/filters/" % (org.slug, project.slug) + + project.update_option("filters:browser-extension", "0") + response = self.client.get(url) + assert response.status_code == 200 + + self.insta_snapshot(response.data) diff --git a/tests/sentry/coreapi/test_auth_from_request.py b/tests/sentry/coreapi/test_auth_from_request.py deleted file mode 100644 index 6eb6a03f8fba03..00000000000000 --- a/tests/sentry/coreapi/test_auth_from_request.py +++ /dev/null @@ -1,89 +0,0 @@ -from __future__ import absolute_import - -from sentry.utils.compat import mock -import pytest - -from django.core.exceptions import SuspiciousOperation - -from sentry.coreapi import ClientAuthHelper, APIUnauthorized - - -def test_valid(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_X_SENTRY_AUTH": "Sentry sentry_key=value, biz=baz"} - request.GET = {} - result = helper.auth_from_request(request) - assert result.public_key == "value" - - -def test_valid_missing_space(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_X_SENTRY_AUTH": "Sentry sentry_key=value,biz=baz"} - request.GET = {} - result = helper.auth_from_request(request) - assert result.public_key == "value" - - -def test_valid_ignore_case(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_X_SENTRY_AUTH": "SeNtRy sentry_key=value, biz=baz"} - request.GET = {} - result = helper.auth_from_request(request) - assert result.public_key == "value" - - -def test_invalid_header_defers_to_GET(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_X_SENTRY_AUTH": "foobar"} - request.GET = {"sentry_version": "1", "foo": "bar"} - result = helper.auth_from_request(request) - assert result.version == "1" - - -def test_invalid_legacy_header_defers_to_GET(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_AUTHORIZATION": "foobar"} - request.GET = {"sentry_version": "1", "foo": "bar"} - result = helper.auth_from_request(request) - assert result.version == "1" - - -def test_invalid_header_bad_token(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_X_SENTRY_AUTH": "Sentryfoo"} - request.GET = {} - with pytest.raises(APIUnauthorized): - helper.auth_from_request(request) - - -def test_invalid_header_missing_pair(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_X_SENTRY_AUTH": "Sentry foo"} - request.GET = {} - with pytest.raises(APIUnauthorized): - helper.auth_from_request(request) - - -def test_invalid_malformed_value(): - helper = ClientAuthHelper() - request = mock.Mock() - request.META = {"HTTP_X_SENTRY_AUTH": "Sentry sentry_key=value,,biz=baz"} - request.GET = {} - with pytest.raises(APIUnauthorized): - helper.auth_from_request(request) - - -def test_multiple_auth_suspicious(): - helper = ClientAuthHelper() - request = mock.Mock() - request.GET = {"sentry_version": "1", "foo": "bar"} - request.META = {"HTTP_X_SENTRY_AUTH": "Sentry sentry_key=value, biz=baz"} - with pytest.raises(SuspiciousOperation): - helper.auth_from_request(request) diff --git a/tests/sentry/coreapi/test_coreapi.py b/tests/sentry/coreapi/test_coreapi.py index 7c70931b87ad87..c5d1e3455ab45e 100644 --- a/tests/sentry/coreapi/test_coreapi.py +++ b/tests/sentry/coreapi/test_coreapi.py @@ -2,83 +2,9 @@ from __future__ import absolute_import -import six import pytest -from sentry.coreapi import ( - APIError, - APIUnauthorized, - Auth, - ClientApiHelper, - ClientAuthHelper, - decode_data, - safely_load_json_string, -) from sentry.interfaces.base import get_interface -from sentry.testutils import TestCase - - -class BaseAPITest(TestCase): - auth_helper_cls = ClientAuthHelper - - def setUp(self): - self.user = self.create_user("[email protected]") - self.team = self.create_team(name="Foo") - self.project = self.create_project(teams=[self.team]) - self.pk = self.project.key_set.get_or_create()[0] - self.helper = ClientApiHelper(agent="Awesome Browser", ip_address="198.51.100.0") - - -class ProjectIdFromAuthTest(BaseAPITest): - def test_invalid_if_missing_key(self): - with pytest.raises(APIUnauthorized): - self.helper.project_id_from_auth(Auth()) - - def test_valid_with_key(self): - auth = Auth(public_key=self.pk.public_key) - result = self.helper.project_id_from_auth(auth) - assert result == self.project.id - - def test_invalid_key(self): - auth = Auth(public_key="z") - with pytest.raises(APIUnauthorized): - self.helper.project_id_from_auth(auth) - - def test_invalid_secret(self): - auth = Auth(public_key=self.pk.public_key, secret_key="z") - with pytest.raises(APIUnauthorized): - self.helper.project_id_from_auth(auth) - - def test_nonascii_key(self): - auth = Auth(public_key="\xc3\xbc") - with pytest.raises(APIUnauthorized): - self.helper.project_id_from_auth(auth) - - -def test_safely_load_json_string_valid_payload(): - data = safely_load_json_string('{"foo": "bar"}') - assert data == {"foo": "bar"} - - -def test_safely_load_json_string_invalid_json(): - with pytest.raises(APIError): - safely_load_json_string("{") - - -def test_safely_load_json_string_unexpected_type(): - with pytest.raises(APIError): - safely_load_json_string("1") - - -def test_valid_data(): - data = decode_data("foo") - assert data == u"foo" - assert isinstance(data, six.text_type) - - -def test_invalid_data(): - with pytest.raises(APIError): - decode_data("\x99") def test_get_interface_does_not_let_through_disallowed_name(): diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_basic.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_basic.pysnap index e3e6ff9926642f..1844e899520e92 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_basic.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_basic.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.009400Z' +created: '2020-07-09T12:04:06.532890Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: style-src cdn.example.com errors: null message: Blocked 'style' from 'example.com' origin: http://example.com -tags: -- - effective-directive - - style-src -- - blocked-uri - - http://example.com/lol.css to_json: blocked_uri: http://example.com/lol.css document_uri: http://example.com diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_coerce_blocked_uri_if_missing.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_coerce_blocked_uri_if_missing.pysnap index b17be20753aca1..7bf034f3368345 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_coerce_blocked_uri_if_missing.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_coerce_blocked_uri_if_missing.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.019309Z' +created: '2020-07-09T12:04:06.579143Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: '' errors: null message: Blocked unsafe (eval() or inline) 'script' origin: http://example.com -tags: -- - effective-directive - - script-src -- - blocked-uri - - self to_json: blocked_uri: self document_uri: http://example.com diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input0.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input0.pysnap index ed0ed4cd4eae48..f0c69c93730a0e 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input0.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input0.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.029494Z' +created: '2020-07-09T12:04:06.589402Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: style-src http://cdn.example.com errors: null message: Blocked inline 'style' origin: http://example.com/foo -tags: -- - effective-directive - - style-src -- - blocked-uri - - self to_json: blocked_uri: self document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input1.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input1.pysnap index 75a3120443f85a..77313776c710ab 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input1.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input1.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.038719Z' +created: '2020-07-09T12:04:06.600198Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: style-src cdn.example.com errors: null message: Blocked inline 'style' origin: http://example.com/foo -tags: -- - effective-directive - - style-src -- - blocked-uri - - self to_json: blocked_uri: self document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input2.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input2.pysnap index 014c9d682430e9..b90f90967eafad 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input2.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input2.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.047322Z' +created: '2020-07-09T12:04:06.611156Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: style-src cdn.example.com errors: null message: Blocked inline 'style' origin: https://example.com/foo -tags: -- - effective-directive - - style-src -- - blocked-uri - - self to_json: blocked_uri: self document_uri: https://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input3.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input3.pysnap index 449f3eaf617afd..2d4e532b76694c 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input3.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input3.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.056386Z' +created: '2020-07-09T12:04:06.622719Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: style-src https://cdn.example.com errors: null message: Blocked inline 'style' origin: http://example.com/foo -tags: -- - effective-directive - - style-src -- - blocked-uri - - self to_json: blocked_uri: self document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input4.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input4.pysnap index 087ea538c4bccb..b4e81e401af474 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input4.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input4.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.065298Z' +created: '2020-07-09T12:04:06.633624Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: style-src 'self' errors: null message: Blocked inline 'style' origin: http://example.com/foo -tags: -- - effective-directive - - style-src -- - blocked-uri - - self to_json: blocked_uri: self document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input5.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input5.pysnap index 5b10eeadb165b6..8c7509fc55cc01 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input5.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_culprit/input5.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.074362Z' +created: '2020-07-09T12:04:06.645283Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: style-src http://example2.com 'self' errors: null message: Blocked inline 'style' origin: http://example.com/foo -tags: -- - effective-directive - - style-src -- - blocked-uri - - self to_json: blocked_uri: self document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input0.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input0.pysnap index effcdcddc31e69..eb43694191b4dc 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input0.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input0.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.093184Z' +created: '2020-07-09T12:04:06.670316Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: '' errors: null message: Blocked 'image' from 'google.com' origin: http://example.com/foo -tags: -- - effective-directive - - img-src -- - blocked-uri - - http://google.com/foo to_json: blocked_uri: http://google.com/foo document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input1.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input1.pysnap index be5c97fa672e03..ca6ee68cb9ba63 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input1.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input1.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.103422Z' +created: '2020-07-09T12:04:06.682795Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: '' errors: null message: Blocked inline 'style' origin: http://example.com/foo -tags: -- - effective-directive - - style-src -- - blocked-uri - - '' to_json: blocked_uri: '' document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input2.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input2.pysnap index 3933d3a357c7b8..df5ad9f7a13206 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input2.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input2.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.114199Z' +created: '2020-07-09T12:04:06.695090Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: script-src 'unsafe-inline' errors: null message: Blocked unsafe inline 'script' origin: http://example.com/foo -tags: -- - effective-directive - - script-src -- - blocked-uri - - '' to_json: blocked_uri: '' document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input3.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input3.pysnap index 7caedf79c34bc7..dd1311ff3deeda 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input3.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input3.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.123989Z' +created: '2020-07-09T12:04:06.707508Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: script-src 'unsafe-eval' errors: null message: Blocked unsafe eval() 'script' origin: http://example.com/foo -tags: -- - effective-directive - - script-src -- - blocked-uri - - '' to_json: blocked_uri: '' document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input4.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input4.pysnap index 8abe81e75fc345..b0b6cde4441722 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input4.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input4.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.134010Z' +created: '2020-07-09T12:04:06.719064Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: script-src 'self' errors: null message: Blocked unsafe (eval() or inline) 'script' origin: http://example.com/foo -tags: -- - effective-directive - - script-src -- - blocked-uri - - '' to_json: blocked_uri: '' document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input5.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input5.pysnap index 39069d9932c8dc..4d88b71d55d5fa 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input5.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input5.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.143868Z' +created: '2020-07-09T12:04:06.730817Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: '' errors: null message: Blocked 'script' from 'data:' origin: http://example.com/foo -tags: -- - effective-directive - - script-src -- - blocked-uri - - data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D to_json: blocked_uri: data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input6.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input6.pysnap index e2e000b18bb65a..aaf22b67fdc040 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input6.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input6.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.153681Z' +created: '2020-07-09T12:04:06.742336Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: '' errors: null message: Blocked 'script' from 'data:' origin: http://example.com/foo -tags: -- - effective-directive - - script-src -- - blocked-uri - - data to_json: blocked_uri: data document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input7.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input7.pysnap index b630f068335f56..59af5909b9b527 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input7.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input7.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.163697Z' +created: '2020-07-09T12:04:06.754430Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: '' errors: null message: Blocked 'style' from 'fonts.google.com' origin: http://example.com/foo -tags: -- - effective-directive - - style-src-elem -- - blocked-uri - - http://fonts.google.com/foo to_json: blocked_uri: http://fonts.google.com/foo document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input8.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input8.pysnap index 775c35ec3f1267..83eafa2262bff2 100644 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input8.pysnap +++ b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_message/input8.pysnap @@ -1,5 +1,5 @@ --- -created: '2019-03-14T17:12:35.174624Z' +created: '2020-07-09T12:04:06.768118Z' creator: sentry source: tests/sentry/event_manager/interfaces/test_csp.py --- @@ -7,11 +7,6 @@ culprit: '' errors: null message: Blocked 'script' from 'cdn.ajaxapis.com' origin: http://example.com/foo -tags: -- - effective-directive - - script-src-elem -- - blocked-uri - - http://cdn.ajaxapis.com/foo to_json: blocked_uri: http://cdn.ajaxapis.com/foo document_uri: http://example.com/foo diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_tags_stripe.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_tags_stripe.pysnap deleted file mode 100644 index 163f6d3a5edd30..00000000000000 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_get_tags_stripe.pysnap +++ /dev/null @@ -1,19 +0,0 @@ ---- -created: '2019-03-14T17:12:35.082701Z' -creator: sentry -source: tests/sentry/event_manager/interfaces/test_csp.py ---- -culprit: '' -errors: null -message: Blocked 'script' from 'api.stripe.com' -origin: https://example.com -tags: -- - effective-directive - - script-src -- - blocked-uri - - https://api.stripe.com/v1/tokens -to_json: - blocked_uri: https://api.stripe.com/v1/tokens?card[number]=xxx - document_uri: https://example.com - effective_directive: script-src - violated_directive: '' diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_real_report.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_real_report.pysnap deleted file mode 100644 index 576bdd437f9f36..00000000000000 --- a/tests/sentry/event_manager/interfaces/snapshots/test_csp/test_real_report.pysnap +++ /dev/null @@ -1,35 +0,0 @@ ---- -created: '2019-04-24T00:06:58.468199Z' -creator: sentry -source: tests/sentry/event_manager/interfaces/test_csp.py ---- -culprit: script-src -errors: null -message: Blocked 'script' from 'baddomain.com' -origin: https://sentry.io/sentry/csp/issues/88513416/ -tags: -- - effective-directive - - script-src -- - blocked-uri - - http://baddomain.com/test.js?_=1515535030116 -to_json: - blocked_uri: http://baddomain.com/test.js?_=1515535030116 - column_number: 66270 - disposition: enforce - document_uri: https://sentry.io/sentry/csp/issues/88513416/ - effective_directive: script-src - line_number: 24 - original_policy: 'default-src *; script-src ''make_csp_snapshot'' ''unsafe-eval'' - ''unsafe-inline'' e90d271df3e973c7.global.ssl.fastly.net cdn.ravenjs.com assets.zendesk.com - ajax.googleapis.com ssl.google-analytics.com www.googleadservices.com analytics.twitter.com - platform.twitter.com *.pingdom.net js.stripe.com api.stripe.com statuspage-production.s3.amazonaws.com - s3.amazonaws.com *.google.com www.gstatic.com aui-cdn.atlassian.com *.atlassian.net - *.jira.com *.zopim.com; font-src * data:; connect-src * wss://*.zopim.com; style-src - ''make_csp_snapshot'' ''unsafe-inline'' e90d271df3e973c7.global.ssl.fastly.net - s3.amazonaws.com aui-cdn.atlassian.com fonts.googleapis.com; img-src * data: blob:; - report-uri https://sentry.io/api/54785/csp-report/?sentry_key=f724a8a027db45f5b21507e7142ff78e&sentry_release=39662eb9734f68e56b7f202260bb706be2f4cee7' - referrer: https://sentry.io/sentry/sentry/releases/7329107476ff14cfa19cf013acd8ce47781bb93a/ - script_sample: '' - source_file: https://e90d271df3e973c7.global.ssl.fastly.net/_static/f0c7c026a4b2a3d2b287ae2d012c9924/sentry/dist/vendor.js - status_code: 0 - violated_directive: script-src diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_expectct/test_from_raw.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_expectct/test_from_raw.pysnap deleted file mode 100644 index dc5aeb27c9d659..00000000000000 --- a/tests/sentry/event_manager/interfaces/snapshots/test_expectct/test_from_raw.pysnap +++ /dev/null @@ -1,24 +0,0 @@ ---- -created: '2019-03-14T17:12:35.467202Z' -creator: sentry -source: tests/sentry/event_manager/interfaces/test_expectct.py ---- -errors: null -to_json: - date_time: '2014-04-06T13:00:50Z' - effective_expiration_date: '2014-05-01T12:40:50Z' - hostname: www.example.com - port: 443 - scts: - - serialized_sct: ABCD== - source: embedded - status: invalid - version: 1 - served_certificate_chain: - - '-----BEGIN CERTIFICATE----- - - -----END CERTIFICATE-----' - validated_certificate_chain: - - '-----BEGIN CERTIFICATE----- - - -----END CERTIFICATE-----' diff --git a/tests/sentry/event_manager/interfaces/snapshots/test_expectstaple/test_from_raw.pysnap b/tests/sentry/event_manager/interfaces/snapshots/test_expectstaple/test_from_raw.pysnap deleted file mode 100644 index ad6bdd6e774fe0..00000000000000 --- a/tests/sentry/event_manager/interfaces/snapshots/test_expectstaple/test_from_raw.pysnap +++ /dev/null @@ -1,21 +0,0 @@ ---- -created: '2019-03-14T17:12:35.509918Z' -creator: sentry -source: tests/sentry/event_manager/interfaces/test_expectstaple.py ---- -errors: null -to_json: - cert_status: REVOKED - date_time: '2014-04-06T13:00:50Z' - effective_expiration_date: '2014-05-01T12:40:50Z' - hostname: www.example.com - port: 443 - response_status: ERROR_RESPONSE - served_certificate_chain: - - '-----BEGIN CERTIFICATE----- - - -----END CERTIFICATE-----' - validated_certificate_chain: - - '-----BEGIN CERTIFICATE----- - - -----END CERTIFICATE-----' diff --git a/tests/sentry/event_manager/interfaces/test_csp.py b/tests/sentry/event_manager/interfaces/test_csp.py index 58bf28ddf18c27..169b61217d0288 100644 --- a/tests/sentry/event_manager/interfaces/test_csp.py +++ b/tests/sentry/event_manager/interfaces/test_csp.py @@ -5,7 +5,6 @@ import pytest from sentry import eventstore -from sentry.interfaces.security import Csp from sentry.event_manager import EventManager @@ -24,7 +23,6 @@ def inner(data): "message": interface and interface.get_message(), "culprit": interface and interface.get_culprit(), "origin": interface and interface.get_origin(), - "tags": interface and interface.get_tags(), } ) @@ -85,16 +83,6 @@ def test_get_culprit(make_csp_snapshot, input): make_csp_snapshot(input) -def test_get_tags_stripe(make_csp_snapshot): - make_csp_snapshot( - dict( - document_uri="https://example.com", - blocked_uri="https://api.stripe.com/v1/tokens?card[number]=xxx", - effective_directive="script-src", - ) - ) - - @pytest.mark.parametrize( "input", [ @@ -148,24 +136,3 @@ def test_get_tags_stripe(make_csp_snapshot): ) def test_get_message(make_csp_snapshot, input): make_csp_snapshot(input) - - -def test_real_report(make_csp_snapshot): - raw_report = { - "csp-report": { - "document-uri": "https://sentry.io/sentry/csp/issues/88513416/", - "referrer": "https://sentry.io/sentry/sentry/releases/7329107476ff14cfa19cf013acd8ce47781bb93a/", - "violated-directive": "script-src", - "effective-directive": "script-src", - "original-policy": "default-src *; script-src 'make_csp_snapshot' 'unsafe-eval' 'unsafe-inline' e90d271df3e973c7.global.ssl.fastly.net cdn.ravenjs.com assets.zendesk.com ajax.googleapis.com ssl.google-analytics.com www.googleadservices.com analytics.twitter.com platform.twitter.com *.pingdom.net js.stripe.com api.stripe.com statuspage-production.s3.amazonaws.com s3.amazonaws.com *.google.com www.gstatic.com aui-cdn.atlassian.com *.atlassian.net *.jira.com *.zopim.com; font-src * data:; connect-src * wss://*.zopim.com; style-src 'make_csp_snapshot' 'unsafe-inline' e90d271df3e973c7.global.ssl.fastly.net s3.amazonaws.com aui-cdn.atlassian.com fonts.googleapis.com; img-src * data: blob:; report-uri https://sentry.io/api/54785/csp-report/?sentry_key=f724a8a027db45f5b21507e7142ff78e&sentry_release=39662eb9734f68e56b7f202260bb706be2f4cee7", - "disposition": "enforce", - "blocked-uri": "http://baddomain.com/test.js?_=1515535030116", - "line-number": 24, - "column-number": 66270, - "source-file": "https://e90d271df3e973c7.global.ssl.fastly.net/_static/f0c7c026a4b2a3d2b287ae2d012c9924/sentry/dist/vendor.js", - "status-code": 0, - "script-sample": "", - } - } - interface = Csp.from_raw(raw_report) - make_csp_snapshot(interface.to_json()) diff --git a/tests/sentry/event_manager/interfaces/test_expectct.py b/tests/sentry/event_manager/interfaces/test_expectct.py index c3b27f5d29442b..54b8b990782c0a 100644 --- a/tests/sentry/event_manager/interfaces/test_expectct.py +++ b/tests/sentry/event_manager/interfaces/test_expectct.py @@ -5,7 +5,6 @@ import pytest from sentry import eventstore -from sentry.interfaces.security import ExpectCT from sentry.event_manager import EventManager @@ -25,19 +24,6 @@ def inner(data): return inner -raw_report = { - "expect-ct-report": { - "date-time": "2014-04-06T13:00:50Z", - "hostname": "www.example.com", - "port": 443, - "effective-expiration-date": "2014-05-01T12:40:50Z", - "served-certificate-chain": ["-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"], - "validated-certificate-chain": ["-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"], - "scts": [ - {"version": 1, "status": "invalid", "source": "embedded", "serialized_sct": "ABCD=="} - ], - } -} interface_json = { "date_time": "2014-04-06T13:00:50Z", "hostname": "www.example.com", @@ -49,10 +35,6 @@ def inner(data): } -def test_from_raw(make_expectct_snapshot): - make_expectct_snapshot(ExpectCT.from_raw(raw_report).to_json()) - - def test_basic(make_expectct_snapshot): make_expectct_snapshot(interface_json) diff --git a/tests/sentry/event_manager/interfaces/test_expectstaple.py b/tests/sentry/event_manager/interfaces/test_expectstaple.py index 54f1fbdd6654e0..ad3b717f4298f1 100644 --- a/tests/sentry/event_manager/interfaces/test_expectstaple.py +++ b/tests/sentry/event_manager/interfaces/test_expectstaple.py @@ -5,7 +5,6 @@ import pytest from sentry import eventstore -from sentry.interfaces.security import ExpectStaple from sentry.event_manager import EventManager @@ -25,18 +24,6 @@ def inner(data): return inner -raw_report = { - "expect-staple-report": { - "date-time": "2014-04-06T13:00:50Z", - "hostname": "www.example.com", - "port": 443, - "response-status": "ERROR_RESPONSE", - "cert-status": "REVOKED", - "effective-expiration-date": "2014-05-01T12:40:50Z", - "served-certificate-chain": ["-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"], - "validated-certificate-chain": ["-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"], - } -} interface_json = { "date_time": "2014-04-06T13:00:50Z", "hostname": "www.example.com", @@ -51,7 +38,3 @@ def inner(data): def test_basic(make_csp_snapshot): make_csp_snapshot(interface_json) - - -def test_from_raw(make_csp_snapshot): - make_csp_snapshot(ExpectStaple.from_raw(raw_report).to_json()) diff --git a/tests/sentry/event_manager/test_event_manager.py b/tests/sentry/event_manager/test_event_manager.py index b9b3256dea17a9..3fe1b5fd9b2bd1 100644 --- a/tests/sentry/event_manager/test_event_manager.py +++ b/tests/sentry/event_manager/test_event_manager.py @@ -7,7 +7,6 @@ import pytest import uuid -from collections import namedtuple from datetime import datetime, timedelta from django.utils import timezone from time import time @@ -41,7 +40,6 @@ from sentry.utils.outcomes import Outcome from sentry.testutils import assert_mock_called_once_with_partial, TestCase from sentry.utils.data_filters import FilterStatKeys -from sentry.relay.config import get_project_config def make_event(**kwargs): @@ -1201,42 +1199,6 @@ def test_checksum_rehashed(self): hashes = [gh.hash for gh in GroupHash.objects.filter(group=event.group)] assert sorted(hashes) == sorted([hash_from_values(checksum), checksum]) - @mock.patch("sentry.event_manager.is_valid_error_message") - def test_should_filter_message(self, mock_is_valid_error_message): - TestItem = namedtuple("TestItem", "value formatted result") - - items = [ - TestItem({"type": "UnfilteredException"}, "UnfilteredException", True), - TestItem( - {"value": "This is an unfiltered exception."}, - "This is an unfiltered exception.", - True, - ), - TestItem( - {"type": "UnfilteredException", "value": "This is an unfiltered exception."}, - "UnfilteredException: This is an unfiltered exception.", - True, - ), - TestItem( - {"type": "FilteredException", "value": "This is a filtered exception."}, - "FilteredException: This is a filtered exception.", - False, - ), - ] - - data = {"exception": {"values": [item.value for item in items]}} - - project_config = get_project_config(self.project) - manager = EventManager(data, project=self.project, project_config=project_config) - - mock_is_valid_error_message.side_effect = [item.result for item in items] - - assert manager.should_filter() == (True, FilterStatKeys.ERROR_MESSAGE) - - assert mock_is_valid_error_message.call_args_list == [ - mock.call(project_config, item.formatted) for item in items - ] - def test_legacy_attributes_moved(self): event = make_event( release="my-release", diff --git a/tests/sentry/event_manager/test_validate_csp.py b/tests/sentry/event_manager/test_validate_csp.py deleted file mode 100644 index d637fe12e68c2b..00000000000000 --- a/tests/sentry/event_manager/test_validate_csp.py +++ /dev/null @@ -1,180 +0,0 @@ -from __future__ import absolute_import - -import pytest - -from sentry.coreapi import APIError -from sentry.event_manager import EventManager -from sentry.utils.compat import map - - -def validate_and_normalize(report, client_ip="198.51.100.0", user_agent="Awesome Browser"): - manager = EventManager(report, client_ip=client_ip, user_agent=user_agent) - manager.process_csp_report() - manager.normalize() - return manager.get_data() - - -def _build_test_report(effective_directive, violated_directive): - report = { - "release": "abc123", - "environment": "production", - "interface": "csp", - "report": { - "csp-report": { - "document-uri": "http://45.55.25.245:8123/csp", - "referrer": "http://example.com", - "violated-directive": violated_directive, - "effective-directive": effective_directive, - "original-policy": "default-src https://45.55.25.245:8123/; child-src https://45.55.25.245:8123/; connect-src https://45.55.25.245:8123/; font-src https://45.55.25.245:8123/; img-src https://45.55.25.245:8123/; media-src https://45.55.25.245:8123/; object-src https://45.55.25.245:8123/; script-src https://45.55.25.245:8123/; style-src https://45.55.25.245:8123/; form-action https://45.55.25.245:8123/; frame-ancestors 'none'; plugin-types 'none'; report-uri http://45.55.25.245:8123/csp-report?os=OS%20X&device=&browser_version=43.0&browser=chrome&os_version=Lion", - "blocked-uri": "http://google.com", - "status-code": 200, - } - }, - } - if violated_directive is None: - del report["report"]["csp-report"]["violated-directive"] - if effective_directive is None: - del report["report"]["csp-report"]["effective-directive"] - - return report - - [email protected]( - "effective_directive,violated_directive,culprit_element", - ( - ("img-src", "img-src https://45.55.25.245:8123/", "img-src"), - ("img-src", "default-src https://45.55.25.245:8123/", "default-src"), - # build a report without the effective-directive key - (None, "img-src https://45.55.25.245:8123/", "img-src"), - ), - ids=( - "directives match", - "prefer effective-directive", - "parse effective-directive from violated-directive", - ), -) -def test_csp_validate(effective_directive, violated_directive, culprit_element): - report = _build_test_report(effective_directive, violated_directive) - result = validate_and_normalize(report) - assert result["logger"] == "csp" - assert result["release"] == "abc123" - assert result["environment"] == "production" - assert "errors" not in result - assert "logentry" in result - assert result["culprit"] == culprit_element + " 'self'" - assert map(tuple, result["tags"]) == [ - ("effective-directive", "img-src"), - ("blocked-uri", "http://google.com"), - ] - assert result["user"] == {"ip_address": "198.51.100.0"} - assert result["request"]["url"] == "http://45.55.25.245:8123/csp" - assert dict(result["request"]["headers"]) == { - "User-Agent": "Awesome Browser", - "Referer": "http://example.com", - } - - [email protected]( - "report", - ( - {}, - {"release": "abc123", "interface": "csp", "report": {}}, - _build_test_report(effective_directive=None, violated_directive=None), - _build_test_report(effective_directive=None, violated_directive=""), - _build_test_report(effective_directive=None, violated_directive="blink-src"), - ), - ids=( - "empty dict", - "no csp-report", - "no violated-directive to parse (expect KeyError)", - "unsplittable violated-directive (expect IndexError)", - "invalid violated-directive (not in schema enum)", - ), -) -def test_csp_validate_failure(report): - with pytest.raises(APIError): - validate_and_normalize(report) - - -def test_csp_tags_out_of_bounds(): - report = { - "release": "abc123", - "interface": "csp", - "report": { - "csp-report": { - "document-uri": "http://45.55.25.245:8123/csp", - "referrer": "http://example.com", - "violated-directive": "img-src https://45.55.25.245:8123/", - "effective-directive": "img-src", - "original-policy": "default-src https://45.55.25.245:8123/; child-src https://45.55.25.245:8123/; connect-src https://45.55.25.245:8123/; font-src https://45.55.25.245:8123/; img-src https://45.55.25.245:8123/; media-src https://45.55.25.245:8123/; object-src https://45.55.25.245:8123/; script-src https://45.55.25.245:8123/; style-src https://45.55.25.245:8123/; form-action https://45.55.25.245:8123/; frame-ancestors 'none'; plugin-types 'none'; report-uri http://45.55.25.245:8123/csp-report?os=OS%20X&device=&browser_version=43.0&browser=chrome&os_version=Lion", - "blocked-uri": "v" * 201, - "status-code": 200, - } - }, - } - result = validate_and_normalize(report) - assert result["tags"] == [["effective-directive", "img-src"], None] - assert len(result["errors"]) == 1 - - -def test_csp_tag_value(): - report = { - "release": "abc123", - "interface": "csp", - "report": { - "csp-report": { - "document-uri": "http://45.55.25.245:8123/csp", - "referrer": "http://example.com", - "violated-directive": "img-src https://45.55.25.245:8123/", - "effective-directive": "img-src", - "original-policy": "default-src https://45.55.25.245:8123/; child-src https://45.55.25.245:8123/; connect-src https://45.55.25.245:8123/; font-src https://45.55.25.245:8123/; img-src https://45.55.25.245:8123/; media-src https://45.55.25.245:8123/; object-src https://45.55.25.245:8123/; script-src https://45.55.25.245:8123/; style-src https://45.55.25.245:8123/; form-action https://45.55.25.245:8123/; frame-ancestors 'none'; plugin-types 'none'; report-uri http://45.55.25.245:8123/csp-report?os=OS%20X&device=&browser_version=43.0&browser=chrome&os_version=Lion", - "blocked-uri": "http://google.com", - "status-code": 200, - } - }, - } - result = validate_and_normalize(report) - assert map(tuple, result["tags"]) == [ - ("effective-directive", "img-src"), - ("blocked-uri", "http://google.com"), - ] - assert "errors" not in result - - -def test_hpkp_validate_basic(): - report = { - "release": "abc123", - "interface": "hpkp", - "report": { - "date-time": "2014-04-06T13:00:50Z", - "hostname": "www.example.com", - "port": 443, - "effective-expiration-date": "2014-05-01T12:40:50Z", - "include-subdomains": False, - "served-certificate-chain": ["-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----"], - "validated-certificate-chain": [ - "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----" - ], - "known-pins": ['pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g="'], - }, - } - result = validate_and_normalize(report) - assert result["release"] == "abc123" - assert "errors" not in result - assert "logentry" in result - assert not result.get("culprit") - assert sorted(map(tuple, result["tags"])) == [ - ("hostname", "www.example.com"), - ("include-subdomains", "false"), - ("port", "443"), - ] - assert result["user"] == {"ip_address": "198.51.100.0"} - expected_headers = [["User-Agent", "Awesome Browser"]] - - assert result["request"] == {"url": "www.example.com", "headers": expected_headers} - - -def test_hpkp_validate_failure(): - report = {"release": "abc123", "interface": "hpkp", "report": {}} - with pytest.raises(APIError): - validate_and_normalize(report) diff --git a/tests/sentry/filters/test_browser_extensions.py b/tests/sentry/filters/test_browser_extensions.py deleted file mode 100644 index 3fa8d77e502b14..00000000000000 --- a/tests/sentry/filters/test_browser_extensions.py +++ /dev/null @@ -1,96 +0,0 @@ -from __future__ import absolute_import - -from sentry.message_filters import _browser_extensions_filter -from sentry.relay.config import ProjectConfig -from sentry.testutils import TestCase - - -class BrowserExtensionsFilterTest(TestCase): - def apply_filter(self, data): - project_config = ProjectConfig(self.project) - return _browser_extensions_filter(project_config, data) - - def get_mock_data(self, exc_value=None, exc_source=None): - return { - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "value": exc_value or "undefined is not defined", - "stacktrace": { - "frames": [ - {"abs_path": "http://example.com/foo.js"}, - {"abs_path": exc_source or "http://example.com/bar.js"}, - ] - }, - } - ] - }, - } - - def test_bails_without_javascript_event(self): - data = {"platform": "python"} - assert not self.apply_filter(data) - - def test_filters_conduit_toolbar(self): - data = self.get_mock_data(exc_value="what does conduitPage even do") - assert self.apply_filter(data) - - def test_filters_google_search_app_ios(self): - data = self.get_mock_data(exc_value="null is not an object (evaluating 'elt.parentNode')") - assert self.apply_filter(data) - - def test_filters_kaspersky_extension(self): - data = self.get_mock_data( - exc_source=( - "https://ff.kis.v2.scr.kaspersky-labs.com/14E4A3DB-9B72-1047-8296-E970532BF7B7/main.js" - ) - ) - assert self.apply_filter(data) - - def test_filters_dragon_web_extension(self): - data = self.get_mock_data(exc_value="plugin.setSuspendState is not a function") - assert self.apply_filter(data) - - def test_filters_chrome_extensions(self): - data = self.get_mock_data(exc_source="chrome://my-extension/or/something") - assert self.apply_filter(data) - - def test_filters_chrome_extensions_second_format(self): - data = self.get_mock_data(exc_source="chrome-extension://my-extension/or/something") - assert self.apply_filter(data) - - def test_filters_firefox_extensions(self): - data = self.get_mock_data(exc_source="moz-extension://my-extension/or/something") - assert self.apply_filter(data) - - def test_filters_safari_extensions(self): - data = self.get_mock_data(exc_source="safari-extension://my-extension/or/something") - assert self.apply_filter(data) - - def test_does_not_filter_generic_data(self): - data = self.get_mock_data() - assert not self.apply_filter(data) - - def test_filters_malformed_data(self): - data = self.get_mock_data() - data["exception"] = None - assert not self.apply_filter(data) - - def test_filters_facebook_source(self): - data = self.get_mock_data(exc_source="https://graph.facebook.com/") - assert self.apply_filter(data) - - data = self.get_mock_data(exc_source="https://connect.facebook.net/en_US/sdk.js") - assert self.apply_filter(data) - - def test_filters_woopra_source(self): - data = self.get_mock_data(exc_source="https://static.woopra.com/js/woopra.js") - assert self.apply_filter(data) - - def test_filters_itunes_source(self): - data = self.get_mock_data( - exc_source="http://metrics.itunes.apple.com.edgesuite.net/itunespreview/itunes/browser:firefo" - ) - assert self.apply_filter(data) diff --git a/tests/sentry/filters/test_legacy_browsers.py b/tests/sentry/filters/test_legacy_browsers.py deleted file mode 100644 index 5d510624a4c6ce..00000000000000 --- a/tests/sentry/filters/test_legacy_browsers.py +++ /dev/null @@ -1,391 +0,0 @@ -from __future__ import absolute_import - -from django.core.urlresolvers import reverse - -from sentry.message_filters import _legacy_browsers_filter, get_filter_key # noqa -from sentry.models.projectoption import ProjectOption -from sentry.models.auditlogentry import AuditLogEntry, AuditLogEntryEvent -from sentry.testutils import APITestCase, TestCase -from sentry.utils.canonical import CanonicalKeyView -from sentry.relay.config import ProjectConfig, _filter_option_to_config_setting # noqa - -USER_AGENTS = { - "android_2": "Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; HTC Vision Build/GRI40) AppleWebKit/533.1 (KHTML, like Gecko) " - "Version/4.0 Mobile Safari/533.1", - "android_4": "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) " - "Chrome/18.0.1025.133 Mobile Safari/535.19", - "ie_5": "Mozilla/4.0 (compatible; MSIE 5.50; Windows NT; SiteKiosk 4.9; SiteCoach 1.0)", - "ie_8": "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET " - "CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MDDC; Tablet PC 2.0)", - "ie_9": "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))", - "iemobile_9": "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; NOKIA; Lumia 710)", - "ie_10": "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 7.0; InfoPath.3; .NET CLR 3.1.40767; Trident/6.0; en-IN)", - "iemobile_10": "Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia " - "520)", - "opera_11": "Opera/9.80 (Windows NT 5.1; U; it) Presto/2.7.62 Version/11.00", - "opera_12": "Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16", - "opera_15": "Mozilla/5.0 (X11; Linux x86_64; Debian) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 " - "Safari/537.36 OPR/15.0.1147.100", - "chrome": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36", - "edge": "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 " - "Edge/12.10136", - "safari_5": "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-HK) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 " - "Safari/533.18.5", - "safari_7": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 " - "Safari/7046A194A", - "opera_mini_8": "Opera/9.80 (J2ME/MIDP; Opera Mini/8.0.35158/36.2534; U; en) Presto/2.12.423 Version/12.16", - "opera_mini_7": "Opera/9.80 (J2ME/MIDP; Opera Mini/7.0.32796/59.323; U; fr) Presto/2.12.423 Version/12.16", -} - - -class SetLegacyBrowserFilterTest(APITestCase): - def test_set_default_all_browsers(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"active": True}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == "1" - - def test_set_default_no_browsers(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"active": False}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == "0" - - def test_set_opera(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"subfilters": ["opera_pre_15"]}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == {"opera_pre_15"} - - assert AuditLogEntry.objects.filter( - organization=project.organization, event=AuditLogEntryEvent.PROJECT_ENABLE - ).exists() - - def test_set_opera_mini(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"subfilters": ["opera_mini_pre_8"]}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == {"opera_mini_pre_8"} - - assert AuditLogEntry.objects.filter( - organization=project.organization, event=AuditLogEntryEvent.PROJECT_ENABLE - ).exists() - - def test_set_ie9(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"subfilters": ["ie9"]}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == {"ie9"} - - assert AuditLogEntry.objects.filter( - organization=project.organization, event=AuditLogEntryEvent.PROJECT_ENABLE - ).exists() - - def test_set_ie8(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"subfilters": ["ie_pre_9"]}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == {"ie_pre_9"} - - assert AuditLogEntry.objects.filter( - organization=project.organization, event=AuditLogEntryEvent.PROJECT_ENABLE - ).exists() - - def test_set_android(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"subfilters": ["android_pre_4"]}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == {"android_pre_4"} - - assert AuditLogEntry.objects.filter( - organization=project.organization, event=AuditLogEntryEvent.PROJECT_ENABLE - ).exists() - - def test_set_safari(self): - self.login_as(user=self.user) - project = self.create_project() - - url = reverse( - "sentry-api-0-project-filters", - kwargs={ - "organization_slug": project.organization.slug, - "project_slug": project.slug, - "filter_id": "legacy-browsers", - }, - ) - response = self.client.put(url, data={"subfilters": ["safari_pre_6"]}) - assert response.status_code == 201, response.content - - options = ProjectOption.objects.get_value(project=project, key="filters:legacy-browsers") - assert options == {"safari_pre_6"} - - assert AuditLogEntry.objects.filter( - organization=project.organization, event=AuditLogEntryEvent.PROJECT_ENABLE - ).exists() - - -class LegacyBrowsersFilterTest(TestCase): - def apply_filter(self, project_config, data): - return _legacy_browsers_filter(project_config, CanonicalKeyView(data)) - - def get_mock_data(self, user_agent): - return { - "platform": "javascript", - "request": { - "url": "http://example.com", - "method": "GET", - "headers": [["User-Agent", user_agent]], - }, - } - - def _get_project_config(self, filter_opt=None): - """ - Constructs a test project_config with the provided legacy_browsers filter setting - :param filter_opt: the value for 'filters:legacy-browsers' project options (may be None) - :return: a ProjectConfig object with the filter option set and the project taken from - the TestCase - """ - ret_val = ProjectConfig(self.project, config={}) - config = ret_val.config - filter_settings = {} - config["filterSettings"] = filter_settings - if filter_opt is not None: - key = get_filter_key(_legacy_browsers_filter) - filter_settings[key] = _filter_option_to_config_setting( - _legacy_browsers_filter, filter_opt - ) - return ret_val - - def test_filters_android_2_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["android_2"]) - assert self.apply_filter(project_config, data) is True - - def test_does_not_filter_android_4_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["android_4"]) - assert self.apply_filter(project_config, data) is False - - def test_filters_ie_9_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["ie_9"]) - assert self.apply_filter(project_config, data) is True - - def test_filters_iemobile_9_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["iemobile_9"]) - assert self.apply_filter(project_config, data) is True - - def test_does_not_filter_ie_10_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["ie_10"]) - assert self.apply_filter(project_config, data) is False - - def test_does_not_filter_iemobile_10_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["iemobile_10"]) - assert self.apply_filter(project_config, data) is False - - def test_filters_opera_12_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["opera_12"]) - assert self.apply_filter(project_config, data) is True - - def test_filters_opera_mini_7_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["opera_mini_7"]) - assert self.apply_filter(project_config, data) is True - - def test_does_not_filter_chrome_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["chrome"]) - assert self.apply_filter(project_config, data) is False - - def test_does_not_filter_edge_by_default(self): - project_config = self._get_project_config("1") - data = self.get_mock_data(USER_AGENTS["edge"]) - assert self.apply_filter(project_config, data) is False - - def test_filter_opera(self): - project_config = self._get_project_config(["opera_pre_15"]) - data = self.get_mock_data(USER_AGENTS["opera_12"]) - assert self.apply_filter(project_config, data) is True - - def test_filter_opera_method(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["opera_12"]) - assert self.apply_filter(project_config, data) is True - - def test_dont_filter_opera_15(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["opera_15"]) - assert self.apply_filter(project_config, data) is False - - def test_filter_opera_mini(self): - project_config = self._get_project_config(["opera_mini_pre_8"]) - data = self.get_mock_data(USER_AGENTS["opera_mini_7"]) - assert self.apply_filter(project_config, data) is True - - def test_filter_opera_mini_method(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["opera_mini_7"]) - assert self.apply_filter(project_config, data) is True - - def test_dont_filter_opera_mini_8(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["opera_mini_8"]) - assert self.apply_filter(project_config, data) is False - - def test_filters_ie8(self): - project_config = self._get_project_config(["ie_pre_9"]) - data = self.get_mock_data(USER_AGENTS["ie_8"]) - assert self.apply_filter(project_config, data) is True - - def test_filters_ie8_method(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["ie_8"]) - assert self.apply_filter(project_config, data) is True - - def test_does_filter_ie9(self): - project_config = self._get_project_config(["ie9"]) - data = self.get_mock_data(USER_AGENTS["ie_9"]) - assert self.apply_filter(project_config, data) is True - - def test_does_filter_iemobile_9(self): - project_config = self._get_project_config(["ie9"]) - data = self.get_mock_data(USER_AGENTS["iemobile_9"]) - assert self.apply_filter(project_config, data) is True - - def test_does_filter_ie10(self): - project_config = self._get_project_config(["ie10"]) - data = self.get_mock_data(USER_AGENTS["ie_10"]) - assert self.apply_filter(project_config, data) is True - - def test_does_not_filter_ie10(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["ie_10"]) - assert self.apply_filter(project_config, data) is False - - def test_does_filter_iemobile_10(self): - project_config = self._get_project_config(["ie10"]) - data = self.get_mock_data(USER_AGENTS["iemobile_10"]) - assert self.apply_filter(project_config, data) is True - - def test_does_not_filter_iemobile_10(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["iemobile_10"]) - assert self.apply_filter(project_config, data) is False - - def test_filters_safari(self): - project_config = self._get_project_config(["safari_pre_6"]) - data = self.get_mock_data(USER_AGENTS["safari_5"]) - assert self.apply_filter(project_config, data) is True - - def test_filters_safari_method(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["safari_5"]) - assert self.apply_filter(project_config, data) is True - - def test_method_does_not_filter_safari_7(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["safari_7"]) - assert self.apply_filter(project_config, data) is False - - def test_filters_android(self): - project_config = self._get_project_config(["android_pre_4"]) - data = self.get_mock_data(USER_AGENTS["android_2"]) - assert self.apply_filter(project_config, data) is True - - def test_filters_android_method(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["android_2"]) - assert self.apply_filter(project_config, data) is True - - def test_method_does_not_filter_android_4(self): - project_config = self._get_project_config() - data = self.get_mock_data(USER_AGENTS["android_4"]) - assert self.apply_filter(project_config, data) is False diff --git a/tests/sentry/filters/test_localhost.py b/tests/sentry/filters/test_localhost.py deleted file mode 100644 index 256cd66312faa5..00000000000000 --- a/tests/sentry/filters/test_localhost.py +++ /dev/null @@ -1,49 +0,0 @@ -from __future__ import absolute_import - -from sentry.message_filters import _localhost_filter -from sentry.relay.config import ProjectConfig -from sentry.testutils import TestCase - - -class LocalhostFilterTest(TestCase): - def apply_filter(self, data): - project_config = ProjectConfig(self.project) - return _localhost_filter(project_config, data) - - def get_mock_data(self, client_ip=None, url=None): - return {"user": {"ip_address": client_ip}, "request": {"url": url}} - - def test_filters_localhost_ipv4(self): - data = self.get_mock_data("127.0.0.1") - assert self.apply_filter(data) - - def test_filters_localhost_ipv6(self): - data = self.get_mock_data("::1") - assert self.apply_filter(data) - - def test_does_not_filter_external_ip(self): - data = self.get_mock_data("74.1.3.56") - assert not self.apply_filter(data) - - def test_fails_gracefully_without_user(self): - assert not self.apply_filter({}) - - def test_filters_localhost_domain(self): - data = self.get_mock_data(url="http://localhost/something.html") - assert self.apply_filter(data) - - data = self.get_mock_data(url="http://localhost:9000/") - assert self.apply_filter(data) - - data = self.get_mock_data(url="https://localhost") - assert self.apply_filter(data) - - data = self.get_mock_data(url="https://127.0.0.1") - assert self.apply_filter(data) - - def test_does_not_filter_non_localhost_domain(self): - data = self.get_mock_data(url="https://getsentry.com/") - assert not self.apply_filter(data) - - data = self.get_mock_data(url="http://example.com/index.html?domain=localhost") - assert not self.apply_filter(data) diff --git a/tests/sentry/filters/test_web_crawlers.py b/tests/sentry/filters/test_web_crawlers.py deleted file mode 100644 index 6e10f1ad5241bf..00000000000000 --- a/tests/sentry/filters/test_web_crawlers.py +++ /dev/null @@ -1,88 +0,0 @@ -from __future__ import absolute_import - -from sentry.models.project import Project -from unittest import TestCase - -from sentry.message_filters import _web_crawlers_filter -from sentry.relay.config import ProjectConfig - - -class WebCrawlersFilterTest(TestCase): - def apply_filter(self, data): - project = Project() - project_config = ProjectConfig(project) - return _web_crawlers_filter(project_config, data) - - def get_mock_data(self, user_agent): - return { - "request": { - "url": "http://example.com", - "method": "GET", - "headers": [["User-Agent", user_agent]], - } - } - - def test_filters_google_adsense(self): - data = self.get_mock_data("Mediapartners-Google") - assert self.apply_filter(data) - - def test_filters_google_adsbot(self): - data = self.get_mock_data("AdsBot-Google (+http://www.google.com/adsbot.html)") - assert self.apply_filter(data) - - def test_filters_google_bot(self): - data = self.get_mock_data( - "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" - ) - assert self.apply_filter(data) - - def test_filters_google_feedfetcher(self): - data = self.get_mock_data("FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)") - assert self.apply_filter(data) - - def test_does_not_filter_google_pubsub(self): - data = self.get_mock_data( - "APIs-Google (+https://developers.google.com/webmasters/APIs-Google.html)" - ) - assert not self.apply_filter(data) - - def test_does_not_filter_chrome(self): - data = self.get_mock_data( - "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36" - ) - assert not self.apply_filter(data) - - def test_filters_twitterbot(self): - data = self.get_mock_data("Twitterbot/1.0") - assert self.apply_filter(data) - - def test_filters_slack(self): - data = self.get_mock_data("Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)") - assert self.apply_filter(data) - - data = self.get_mock_data("Slack-ImgProxy 0.19 (+https://api.slack.com/robots)") - assert self.apply_filter(data) - - data = self.get_mock_data("Slackbot 1.0(+https://api.slack.com/robots)") - assert self.apply_filter(data) - - def test_filters_calypso_appcrawler(self): - data = self.get_mock_data( - "Mozilla/5.0 (Linux; Android 6.0.1; Calypso AppCrawler Build/MMB30Y; wv) AppleWebKit/537.36 (KHTML, " - "like Gecko) Version/4.0 Chrome/53.0.2785.124 Mobile Safari/537.36" - ) - assert self.apply_filter(data) - - def test_filters_pingdom_bot(self): - data = self.get_mock_data( - "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PingdomTMS/0.8.5 Safari/534.34" - ) - assert self.apply_filter(data) - - def test_filters_lytics_bot(self): - data = self.get_mock_data("lyticsbot-external") - assert self.apply_filter(data) - - def test_filters_google_apis(self): - data = self.get_mock_data("APIs-Google") - assert not self.apply_filter(data) diff --git a/tests/sentry/lang/java/test_plugin.py b/tests/sentry/lang/java/test_plugin.py deleted file mode 100644 index 6b8b8569f95df7..00000000000000 --- a/tests/sentry/lang/java/test_plugin.py +++ /dev/null @@ -1,326 +0,0 @@ -from __future__ import absolute_import - -import zipfile -import pytest -from six import BytesIO - -from django.core.urlresolvers import reverse -from django.core.files.uploadedfile import SimpleUploadedFile - -from sentry.testutils import SentryStoreHelper, TestCase -from sentry.testutils.helpers.datetime import before_now, iso_format - -PROGUARD_UUID = "6dc7fdb0-d2fb-4c8e-9d6b-bb1aa98929b1" -PROGUARD_SOURCE = b"""\ -org.slf4j.helpers.Util$ClassContextSecurityManager -> org.a.b.g$a: - 65:65:void <init>() -> <init> - 67:67:java.lang.Class[] getClassContext() -> a - 69:69:java.lang.Class[] getExtraClassContext() -> a - 65:65:void <init>(org.slf4j.helpers.Util$1) -> <init> -""" -PROGUARD_INLINE_UUID = "d748e578-b3d1-5be5-b0e5-a42e8c9bf8e0" -PROGUARD_INLINE_SOURCE = b"""\ -# compiler: R8 -# compiler_version: 2.0.74 -# min_api: 16 -# pg_map_id: 5b46fdc -# common_typos_disable -$r8$backportedMethods$utility$Objects$2$equals -> a: - boolean equals(java.lang.Object,java.lang.Object) -> a -$r8$twr$utility -> b: - void $closeResource(java.lang.Throwable,java.lang.Object) -> a -android.support.v4.app.RemoteActionCompatParcelizer -> android.support.v4.app.RemoteActionCompatParcelizer: - 1:1:void <init>():11:11 -> <init> -io.sentry.sample.-$$Lambda$r3Avcbztes2hicEObh02jjhQqd4 -> e.a.c.a: - io.sentry.sample.MainActivity f$0 -> b -io.sentry.sample.MainActivity -> io.sentry.sample.MainActivity: - 1:1:void <init>():15:15 -> <init> - 1:1:boolean onCreateOptionsMenu(android.view.Menu):60:60 -> onCreateOptionsMenu - 1:1:boolean onOptionsItemSelected(android.view.MenuItem):69:69 -> onOptionsItemSelected - 2:2:boolean onOptionsItemSelected(android.view.MenuItem):76:76 -> onOptionsItemSelected - 1:1:void bar():54:54 -> t - 1:1:void foo():44 -> t - 1:1:void onClickHandler(android.view.View):40 -> t -""" -PROGUARD_BUG_UUID = "071207ac-b491-4a74-957c-2c94fd9594f2" -PROGUARD_BUG_SOURCE = b"x" - - -class BasicResolvingIntegrationTest(object): - def post_and_retrieve_event(self, data): - raise NotImplementedError( - "post_and_retrieve_event should be implemented in a dervied test class" - ) - - def test_basic_resolving(self): - url = reverse( - "sentry-api-0-dsym-files", - kwargs={ - "organization_slug": self.project.organization.slug, - "project_slug": self.project.slug, - }, - ) - - self.login_as(user=self.user) - - out = BytesIO() - f = zipfile.ZipFile(out, "w") - f.writestr("proguard/%s.txt" % PROGUARD_UUID, PROGUARD_SOURCE) - f.writestr("ignored-file.txt", b"This is just some stuff") - f.close() - - response = self.client.post( - url, - { - "file": SimpleUploadedFile( - "symbols.zip", out.getvalue(), content_type="application/zip" - ) - }, - format="multipart", - ) - assert response.status_code == 201, response.content - assert len(response.data) == 1 - - event_data = { - "user": {"ip_address": "31.172.207.97"}, - "extra": {}, - "project": self.project.id, - "platform": "java", - "debug_meta": {"images": [{"type": "proguard", "uuid": PROGUARD_UUID}]}, - "exception": { - "values": [ - { - "stacktrace": { - "frames": [ - { - "function": "a", - "abs_path": None, - "module": "org.a.b.g$a", - "filename": None, - "lineno": 67, - }, - { - "function": "a", - "abs_path": None, - "module": "org.a.b.g$a", - "filename": None, - "lineno": 69, - }, - ] - }, - "module": "org.a.b", - "type": "g$a", - "value": "Shit broke yo", - } - ] - }, - "timestamp": iso_format(before_now(seconds=1)), - } - - event = self.post_and_retrieve_event(event_data) - if not self.use_relay(): - # We measure the number of queries after an initial post, - # because there are many queries polluting the array - # before the actual "processing" happens (like, auth_user) - with self.assertWriteQueries( - { - "nodestore_node": 2, - "sentry_eventuser": 1, - "sentry_groupedmessage": 1, - "sentry_userreport": 1, - } - ): - self.post_and_retrieve_event(event_data) - - exc = event.interfaces["exception"].values[0] - bt = exc.stacktrace - frames = bt.frames - - assert exc.type == "Util$ClassContextSecurityManager" - assert exc.module == "org.slf4j.helpers" - assert frames[0].function == "getClassContext" - assert frames[0].module == "org.slf4j.helpers.Util$ClassContextSecurityManager" - assert frames[1].function == "getExtraClassContext" - assert frames[1].module == "org.slf4j.helpers.Util$ClassContextSecurityManager" - - assert event.culprit == ( - "org.slf4j.helpers.Util$ClassContextSecurityManager " "in getExtraClassContext" - ) - - def test_resolving_inline(self): - url = reverse( - "sentry-api-0-dsym-files", - kwargs={ - "organization_slug": self.project.organization.slug, - "project_slug": self.project.slug, - }, - ) - - self.login_as(user=self.user) - - out = BytesIO() - f = zipfile.ZipFile(out, "w") - f.writestr("proguard/%s.txt" % PROGUARD_INLINE_UUID, PROGUARD_INLINE_SOURCE) - f.writestr("ignored-file.txt", b"This is just some stuff") - f.close() - - response = self.client.post( - url, - { - "file": SimpleUploadedFile( - "symbols.zip", out.getvalue(), content_type="application/zip" - ) - }, - format="multipart", - ) - assert response.status_code == 201, response.content - assert len(response.data) == 1 - - event_data = { - "user": {"ip_address": "31.172.207.97"}, - "extra": {}, - "project": self.project.id, - "platform": "java", - "debug_meta": {"images": [{"type": "proguard", "uuid": PROGUARD_INLINE_UUID}]}, - "exception": { - "values": [ - { - "stacktrace": { - "frames": [ - { - "function": "onClick", - "abs_path": None, - "module": "e.a.c.a", - "filename": None, - "lineno": 2, - }, - { - "function": "t", - "abs_path": None, - "module": "io.sentry.sample.MainActivity", - "filename": "MainActivity.java", - "lineno": 1, - }, - ] - }, - "module": "org.a.b", - "type": "g$a", - "value": "Shit broke yo", - } - ] - }, - "timestamp": iso_format(before_now(seconds=1)), - } - - event = self.post_and_retrieve_event(event_data) - if not self.use_relay(): - # We measure the number of queries after an initial post, - # because there are many queries polluting the array - # before the actual "processing" happens (like, auth_user) - with self.assertWriteQueries( - { - "nodestore_node": 2, - "sentry_eventuser": 1, - "sentry_groupedmessage": 1, - "sentry_userreport": 1, - } - ): - self.post_and_retrieve_event(event_data) - - exc = event.interfaces["exception"].values[0] - bt = exc.stacktrace - frames = bt.frames - - assert len(frames) == 4 - - assert frames[0].function == "onClick" - assert frames[0].module == "io.sentry.sample.-$$Lambda$r3Avcbztes2hicEObh02jjhQqd4" - - assert frames[1].filename == "MainActivity.java" - assert frames[1].module == "io.sentry.sample.MainActivity" - assert frames[1].function == "onClickHandler" - assert frames[1].lineno == 40 - assert frames[2].function == "foo" - assert frames[2].lineno == 44 - assert frames[3].function == "bar" - assert frames[3].lineno == 54 - assert frames[3].filename == "MainActivity.java" - assert frames[3].module == "io.sentry.sample.MainActivity" - - def test_error_on_resolving(self): - url = reverse( - "sentry-api-0-dsym-files", - kwargs={ - "organization_slug": self.project.organization.slug, - "project_slug": self.project.slug, - }, - ) - - self.login_as(user=self.user) - - out = BytesIO() - f = zipfile.ZipFile(out, "w") - f.writestr("proguard/%s.txt" % PROGUARD_BUG_UUID, PROGUARD_BUG_SOURCE) - f.close() - - response = self.client.post( - url, - { - "file": SimpleUploadedFile( - "symbols.zip", out.getvalue(), content_type="application/zip" - ) - }, - format="multipart", - ) - assert response.status_code == 201, response.content - assert len(response.data) == 1 - - event_data = { - "user": {"ip_address": "31.172.207.97"}, - "extra": {}, - "project": self.project.id, - "platform": "java", - "debug_meta": {"images": [{"type": "proguard", "uuid": PROGUARD_BUG_UUID}]}, - "exception": { - "values": [ - { - "stacktrace": { - "frames": [ - { - "function": "a", - "abs_path": None, - "module": "org.a.b.g$a", - "filename": None, - "lineno": 67, - }, - { - "function": "a", - "abs_path": None, - "module": "org.a.b.g$a", - "filename": None, - "lineno": 69, - }, - ] - }, - "type": "RuntimeException", - "value": "Shit broke yo", - } - ] - }, - "timestamp": iso_format(before_now(seconds=1)), - } - - event = self.post_and_retrieve_event(event_data) - - assert len(event.data["errors"]) == 1 - assert event.data["errors"][0] == { - "mapping_uuid": u"071207ac-b491-4a74-957c-2c94fd9594f2", - "type": "proguard_missing_lineno", - } - - [email protected]_store_integration -class BasicResolvingIntegrationTestLegacy( - SentryStoreHelper, TestCase, BasicResolvingIntegrationTest -): - pass diff --git a/tests/sentry/lang/javascript/test_example.py b/tests/sentry/lang/javascript/test_example.py deleted file mode 100644 index 2f7c0c44bd2fdc..00000000000000 --- a/tests/sentry/lang/javascript/test_example.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import - -import os -import json -import pytest -import responses - -from sentry.testutils import TransactionTestCase, SentryStoreHelper -from sentry.testutils.helpers.datetime import iso_format, before_now - - -def get_fixture_path(name): - return os.path.join(os.path.dirname(__file__), "example-project", name) - - -def load_fixture(name): - with open(get_fixture_path(name)) as f: - return f.read() - - -class ExampleTestCase(object): - def post_and_retrieve_event(self, data): - raise NotImplementedError( - "post_and_retrieve_event should be implemented in dervied test class" - ) - - @responses.activate - def test_sourcemap_expansion(self): - responses.add( - responses.GET, - "http://example.com/test.js", - body=load_fixture("test.js"), - content_type="application/javascript", - ) - responses.add( - responses.GET, - "http://example.com/test.min.js", - body=load_fixture("test.min.js"), - content_type="application/javascript", - ) - responses.add( - responses.GET, - "http://example.com/test.map", - body=load_fixture("test.map"), - content_type="application/json", - ) - responses.add(responses.GET, "http://example.com/index.html", body="Not Found", status=404) - - min_ago = iso_format(before_now(minutes=1)) - - data = { - "timestamp": min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": json.loads(load_fixture("minifiedError.json"))[::-1] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - assert len(frame_list) == 4 - - import pprint - - pprint.pprint(frame_list) - - assert frame_list[0].function == "produceStack" - assert frame_list[0].lineno == 6 - assert frame_list[0].filename == "index.html" - - assert frame_list[1].function == "test" - assert frame_list[1].lineno == 20 - assert frame_list[1].filename == "test.js" - - assert frame_list[2].function == "invoke" - assert frame_list[2].lineno == 15 - assert frame_list[2].filename == "test.js" - - assert frame_list[3].function == "onFailure" - assert frame_list[3].lineno == 5 - assert frame_list[3].filename == "test.js" - - [email protected]_store_integration -class ExampleTestCaseLegacy(SentryStoreHelper, TransactionTestCase, ExampleTestCase): - pass diff --git a/tests/sentry/lang/javascript/test_plugin.py b/tests/sentry/lang/javascript/test_plugin.py deleted file mode 100644 index cb160600f23836..00000000000000 --- a/tests/sentry/lang/javascript/test_plugin.py +++ /dev/null @@ -1,1384 +0,0 @@ -# coding: utf-8 - -from __future__ import absolute_import - -import os.path -import pytest -import responses - -from base64 import b64encode - -from sentry.utils.compat.mock import patch -from sentry.models import File, Release, ReleaseFile -from sentry.testutils import TestCase, SnubaTestCase, SentryStoreHelper - -from sentry.testutils.helpers.datetime import iso_format, before_now - -# TODO(joshuarli): six 1.12.0 adds ensure_binary -# might also want to put this in utils since we pretty much expect the result to be py3 str and not bytes -BASE64_SOURCEMAP = "data:application/json;base64," + ( - b64encode( - u'{"version":3,"file":"generated.js","sources":["/test.js"],"names":[],"mappings":"AAAA","sourcesContent":[' - '"console.log(\\"hello, World!\\")"]}'.encode("utf-8") - ) - .decode("utf-8") - .replace("\n", "") -) - - -def get_fixture_path(name): - return os.path.join(os.path.dirname(__file__), "fixtures", name) - - -def load_fixture(name): - with open(get_fixture_path(name), "rb") as fp: - return fp.read() - - -class JavascriptIntegrationTest(SnubaTestCase): - def setUp(self): - super(JavascriptIntegrationTest, self).setUp() - self.min_ago = iso_format(before_now(minutes=1)) - - def test_adds_contexts_without_device(self): - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "request": { - "url": "http://example.com", - "headers": [ - [ - "User-Agent", - "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/28.0.1500.72 Safari/537.36", - ] - ], - }, - } - - event = self.post_and_retrieve_event(data) - if not self.use_relay(): - # We measure the number of queries after an initial post, - # because there are many queries polluting the array - # before the actual "processing" happens (like, auth_user) - with self.assertWriteQueries( - { - "nodestore_node": 2, - "sentry_eventuser": 1, - "sentry_groupedmessage": 1, - "sentry_userreport": 1, - }, - debug=True, - ): # debug=True is for coverage - self._postWithHeader(data) - - contexts = event.interfaces["contexts"].to_json() - assert contexts.get("os") == {"name": "Windows", "version": "8", "type": "os"} - assert contexts.get("device") is None - - def test_adds_contexts_with_device(self): - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "request": { - "url": "http://example.com", - "headers": [ - [ - "User-Agent", - "Mozilla/5.0 (Linux; U; Android 4.3; en-us; SCH-R530U Build/JSS15J) AppleWebKit/534.30 (" - "KHTML, like Gecko) Version/4.0 Mobile Safari/534.30 USCC-R530U", - ] - ], - }, - } - - event = self.post_and_retrieve_event(data) - - contexts = event.interfaces["contexts"].to_json() - assert contexts.get("os") == {"name": "Android", "type": "os", "version": "4.3"} - assert contexts.get("browser") == {"name": "Android", "type": "browser", "version": "4.3"} - assert contexts.get("device") == { - "family": "Samsung SCH-R530U", - "type": "device", - "model": "SCH-R530U", - "brand": "Samsung", - } - - def test_adds_contexts_with_ps4_device(self): - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "request": { - "url": "http://example.com", - "headers": [ - [ - "User-Agent", - "Mozilla/5.0 (PlayStation 4 3.55) AppleWebKit/537.78 (KHTML, like Gecko)", - ] - ], - }, - } - - event = self.post_and_retrieve_event(data) - - contexts = event.interfaces["contexts"].to_json() - assert contexts.get("os") is None - assert contexts.get("browser") is None - assert contexts.get("device") == { - "family": "PlayStation 4", - "type": "device", - "model": "PlayStation 4", - "brand": "Sony", - } - - @patch("sentry.lang.javascript.processor.fetch_file") - def test_source_expansion(self, mock_fetch_file): - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/foo.js", - "filename": "foo.js", - "lineno": 4, - "colno": 0, - }, - { - "abs_path": "http://example.com/foo.js", - "filename": "foo.js", - "lineno": 1, - "colno": 0, - }, - ] - }, - } - ] - }, - } - - mock_fetch_file.return_value.body = "\n".join("hello world") - mock_fetch_file.return_value.encoding = None - mock_fetch_file.return_value.headers = {} - - event = self.post_and_retrieve_event(data) - - mock_fetch_file.assert_called_once_with( - "http://example.com/foo.js", - project=self.project, - release=None, - dist=None, - allow_scraping=True, - ) - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - assert frame.pre_context == ["h", "e", "l"] - assert frame.context_line == "l" - assert frame.post_context == ["o", " ", "w", "o", "r"] - - frame = frame_list[1] - assert not frame.pre_context - assert frame.context_line == "h" - assert frame.post_context == ["e", "l", "l", "o", " "] - - # no source map means no raw_stacktrace - assert exception.values[0].raw_stacktrace is None - - @patch("sentry.lang.javascript.processor.fetch_file") - @patch("sentry.lang.javascript.processor.discover_sourcemap") - def test_inlined_sources(self, mock_discover_sourcemap, mock_fetch_file): - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/test.min.js", - "filename": "test.js", - "lineno": 1, - "colno": 1, - } - ] - }, - } - ] - }, - } - - mock_discover_sourcemap.return_value = BASE64_SOURCEMAP - - mock_fetch_file.return_value.url = "http://example.com/test.min.js" - mock_fetch_file.return_value.body = "\n".join("<generated source>") - mock_fetch_file.return_value.encoding = None - - event = self.post_and_retrieve_event(data) - - mock_fetch_file.assert_called_once_with( - "http://example.com/test.min.js", - project=self.project, - release=None, - dist=None, - allow_scraping=True, - ) - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - assert not frame.pre_context - assert frame.context_line == 'console.log("hello, World!")' - assert not frame.post_context - assert frame.data["sourcemap"] == "http://example.com/test.min.js" - - @responses.activate - def test_error_message_translations(self): - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "logentry": { - "formatted": u"ReferenceError: Impossible de d\xe9finir une propri\xe9t\xe9 \xab foo \xbb : objet non " - u"extensible" - }, - "exception": { - "values": [ - {"type": "Error", "value": u"P\u0159\xedli\u0161 mnoho soubor\u016f"}, - { - "type": "Error", - "value": u"foo: wyst\u0105pi\u0142 nieoczekiwany b\u0142\u0105d podczas pr\xf3by uzyskania " - u"informacji o metadanych", - }, - ] - }, - } - - event = self.post_and_retrieve_event(data) - - message = event.interfaces["logentry"] - assert ( - message.formatted - == "ReferenceError: Cannot define property 'foo': object is not extensible" - ) - - exception = event.interfaces["exception"] - assert exception.values[0].value == "Too many files" - assert ( - exception.values[1].value - == "foo: an unexpected failure occurred while trying to obtain metadata information" - ) - - @responses.activate - def test_sourcemap_source_expansion(self): - responses.add( - responses.GET, - "http://example.com/file.min.js", - body=load_fixture("file.min.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/file1.js", - body=load_fixture("file1.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/file2.js", - body=load_fixture("file2.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/file.sourcemap.js", - body=load_fixture("file.sourcemap.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add(responses.GET, "http://example.com/index.html", body="Not Found", status=404) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/file.min.js", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - # NOTE: Intentionally source is not retrieved from this HTML file - { - "function": 'function: "HTMLDocument.<anonymous>"', - "abs_path": "http//example.com/index.html", - "filename": "index.html", - "lineno": 283, - "colno": 17, - "in_app": False, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert event.data["errors"] == [ - {"type": "js_no_source", "url": "http//example.com/index.html"} - ] - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] - expected = u"\treturn a + b; // fôo" - assert frame.context_line == expected - assert frame.post_context == ["}", ""] - - raw_frame_list = exception.values[0].raw_stacktrace.frames - raw_frame = raw_frame_list[0] - assert not raw_frame.pre_context - assert ( - raw_frame.context_line - == 'function add(a,b){"use strict";return a+b}function multiply(a,b){"use strict";return a*b}function ' - 'divide(a,b){"use strict";try{return multip {snip}' - ) - assert raw_frame.post_context == ["//@ sourceMappingURL=file.sourcemap.js"] - assert raw_frame.lineno == 1 - - # Since we couldn't expand source for the 2nd frame, both - # its raw and original form should be identical - assert raw_frame_list[1] == frame_list[1] - - @responses.activate - def test_sourcemap_embedded_source_expansion(self): - responses.add( - responses.GET, - "http://example.com/embedded.js", - body=load_fixture("embedded.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/embedded.js.map", - body=load_fixture("embedded.js.map"), - content_type="application/json; charset=utf-8", - ) - responses.add(responses.GET, "http://example.com/index.html", body="Not Found", status=404) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/embedded.js", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - # NOTE: Intentionally source is not retrieved from this HTML file - { - "function": 'function: "HTMLDocument.<anonymous>"', - "abs_path": "http//example.com/index.html", - "filename": "index.html", - "lineno": 283, - "colno": 17, - "in_app": False, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert event.data["errors"] == [ - {"type": "js_no_source", "url": "http//example.com/index.html"} - ] - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] - expected = u"\treturn a + b; // fôo" - assert frame.context_line == expected - assert frame.post_context == ["}", ""] - - @responses.activate - def test_sourcemap_nofiles_source_expansion(self): - project = self.project - release = Release.objects.create(organization_id=project.organization_id, version="abc") - release.add_project(project) - - f_minified = File.objects.create( - name="nofiles.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f_minified.putfile(open(get_fixture_path("nofiles.js"), "rb")) - ReleaseFile.objects.create( - name=u"~/{}".format(f_minified.name), - release=release, - organization_id=project.organization_id, - file=f_minified, - ) - - f_sourcemap = File.objects.create( - name="nofiles.js.map", type="release.file", headers={"Content-Type": "application/json"} - ) - f_sourcemap.putfile(open(get_fixture_path("nofiles.js.map"), "rb")) - ReleaseFile.objects.create( - name=u"app:///{}".format(f_sourcemap.name), - release=release, - organization_id=project.organization_id, - file=f_sourcemap, - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "release": "abc", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [{"abs_path": "app:///nofiles.js", "lineno": 1, "colno": 39}] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert "errors" not in event.data - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - assert len(frame_list) == 1 - frame = frame_list[0] - assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] - assert frame.context_line == u"\treturn a * b;" - assert frame.post_context == [ - "}", - "function divide(a, b) {", - '\t"use strict";', - "\ttry {", - "\t\treturn multiply(add(a, b), a, b) / c;", - ] - - @responses.activate - def test_indexed_sourcemap_source_expansion(self): - responses.add( - responses.GET, - "http://example.com/indexed.min.js", - body=load_fixture("indexed.min.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/file1.js", - body=load_fixture("file1.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/file2.js", - body=load_fixture("file2.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/indexed.sourcemap.js", - body=load_fixture("indexed.sourcemap.js"), - content_type="application/json; charset=utf-8", - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/indexed.min.js", - "filename": "indexed.min.js", - "lineno": 1, - "colno": 39, - }, - { - "abs_path": "http://example.com/indexed.min.js", - "filename": "indexed.min.js", - "lineno": 2, - "colno": 44, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert "errors" not in event.data - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] - - expected = u"\treturn a + b; // fôo" - assert frame.context_line == expected - assert frame.post_context == ["}", ""] - - raw_frame_list = exception.values[0].raw_stacktrace.frames - raw_frame = raw_frame_list[0] - assert not raw_frame.pre_context - assert raw_frame.context_line == 'function add(a,b){"use strict";return a+b}' - assert raw_frame.post_context == [ - 'function multiply(a,b){"use strict";return a*b}function divide(a,b){"use strict";try{return multiply(' - "add(a,b),a,b)/c}catch(e){Raven.captureE {snip}", - "//# sourceMappingURL=indexed.sourcemap.js", - "", - ] - assert raw_frame.lineno == 1 - - frame = frame_list[1] - assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] - assert frame.context_line == "\treturn a * b;" - assert frame.post_context == [ - "}", - "function divide(a, b) {", - '\t"use strict";', - "\ttry {", - "\t\treturn multiply(add(a, b), a, b) / c;", - ] - - raw_frame = raw_frame_list[1] - assert raw_frame.pre_context == ['function add(a,b){"use strict";return a+b}'] - assert ( - raw_frame.context_line - == 'function multiply(a,b){"use strict";return a*b}function divide(a,b){"use strict";try{return multiply(' - "add(a,b),a,b)/c}catch(e){Raven.captureE {snip}" - ) - assert raw_frame.post_context == ["//# sourceMappingURL=indexed.sourcemap.js", ""] - assert raw_frame.lineno == 2 - - @responses.activate - def test_expansion_via_release_artifacts(self): - project = self.project - release = Release.objects.create(organization_id=project.organization_id, version="abc") - release.add_project(project) - - # file.min.js - # ------------ - - f_minified = File.objects.create( - name="file.min.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f_minified.putfile(open(get_fixture_path("file.min.js"), "rb")) - - # Intentionally omit hostname - use alternate artifact path lookup instead - # /file1.js vs http://example.com/file1.js - ReleaseFile.objects.create( - name=u"~/{}?foo=bar".format(f_minified.name), - release=release, - organization_id=project.organization_id, - file=f_minified, - ) - - # file1.js - # --------- - - f1 = File.objects.create( - name="file1.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f1.putfile(open(get_fixture_path("file1.js"), "rb")) - - ReleaseFile.objects.create( - name=u"http://example.com/{}".format(f1.name), - release=release, - organization_id=project.organization_id, - file=f1, - ) - - # file2.js - # ---------- - - f2 = File.objects.create( - name="file2.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f2.putfile(open(get_fixture_path("file2.js"), "rb")) - ReleaseFile.objects.create( - name=u"http://example.com/{}".format(f2.name), - release=release, - organization_id=project.organization_id, - file=f2, - ) - - # To verify that the full url has priority over the relative url, - # we will also add a second ReleaseFile alias for file2.js (f3) w/o - # hostname that points to an empty file. If the processor chooses - # this empty file over the correct file2.js, it will not locate - # context for the 2nd frame. - f2_empty = File.objects.create( - name="empty.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f2_empty.putfile(open(get_fixture_path("empty.js"), "rb")) - ReleaseFile.objects.create( - name=u"~/{}".format(f2.name), # intentionally using f2.name ("file2.js") - release=release, - organization_id=project.organization_id, - file=f2_empty, - ) - - # sourcemap - # ---------- - - f_sourcemap = File.objects.create( - name="file.sourcemap.js", - type="release.file", - headers={"Content-Type": "application/json"}, - ) - f_sourcemap.putfile(open(get_fixture_path("file.sourcemap.js"), "rb")) - ReleaseFile.objects.create( - name=u"http://example.com/{}".format(f_sourcemap.name), - release=release, - organization_id=project.organization_id, - file=f_sourcemap, - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "release": "abc", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/file.min.js?foo=bar", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - { - "abs_path": "http://example.com/file.min.js?foo=bar", - "filename": "file.min.js", - "lineno": 1, - "colno": 79, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert "errors" not in event.data - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] - assert frame.context_line == u"\treturn a + b; // fôo" - assert frame.post_context == ["}", ""] - - frame = frame_list[1] - assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] - assert frame.context_line == "\treturn a * b;" - assert frame.post_context == [ - "}", - "function divide(a, b) {", - '\t"use strict";', - u"\ttry {", - "\t\treturn multiply(add(a, b), a, b) / c;", - ] - - @responses.activate - def test_expansion_via_distribution_release_artifacts(self): - project = self.project - release = Release.objects.create(organization_id=project.organization_id, version="abc") - release.add_project(project) - dist = release.add_dist("foo") - - # file.min.js - # ------------ - - f_minified = File.objects.create( - name="file.min.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f_minified.putfile(open(get_fixture_path("file.min.js"), "rb")) - - # Intentionally omit hostname - use alternate artifact path lookup instead - # /file1.js vs http://example.com/file1.js - ReleaseFile.objects.create( - name=u"~/{}?foo=bar".format(f_minified.name), - release=release, - dist=dist, - organization_id=project.organization_id, - file=f_minified, - ) - - # file1.js - # --------- - - f1 = File.objects.create( - name="file1.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f1.putfile(open(get_fixture_path("file1.js"), "rb")) - - ReleaseFile.objects.create( - name=u"http://example.com/{}".format(f1.name), - release=release, - dist=dist, - organization_id=project.organization_id, - file=f1, - ) - - # file2.js - # ---------- - - f2 = File.objects.create( - name="file2.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f2.putfile(open(get_fixture_path("file2.js"), "rb")) - ReleaseFile.objects.create( - name=u"http://example.com/{}".format(f2.name), - release=release, - dist=dist, - organization_id=project.organization_id, - file=f2, - ) - - # To verify that the full url has priority over the relative url, - # we will also add a second ReleaseFile alias for file2.js (f3) w/o - # hostname that points to an empty file. If the processor chooses - # this empty file over the correct file2.js, it will not locate - # context for the 2nd frame. - f2_empty = File.objects.create( - name="empty.js", type="release.file", headers={"Content-Type": "application/json"} - ) - f2_empty.putfile(open(get_fixture_path("empty.js"), "rb")) - ReleaseFile.objects.create( - name=u"~/{}".format(f2.name), # intentionally using f2.name ("file2.js") - release=release, - dist=dist, - organization_id=project.organization_id, - file=f2_empty, - ) - - # sourcemap - # ---------- - - f_sourcemap = File.objects.create( - name="file.sourcemap.js", - type="release.file", - headers={"Content-Type": "application/json"}, - ) - f_sourcemap.putfile(open(get_fixture_path("file.sourcemap.js"), "rb")) - ReleaseFile.objects.create( - name=u"http://example.com/{}".format(f_sourcemap.name), - release=release, - dist=dist, - organization_id=project.organization_id, - file=f_sourcemap, - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "release": "abc", - "dist": "foo", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/file.min.js?foo=bar", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - { - "abs_path": "http://example.com/file.min.js?foo=bar", - "filename": "file.min.js", - "lineno": 1, - "colno": 79, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert "errors" not in event.data - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - assert frame.pre_context == ["function add(a, b) {", '\t"use strict";'] - assert frame.context_line == u"\treturn a + b; // fôo" - assert frame.post_context == ["}", ""] - - frame = frame_list[1] - assert frame.pre_context == ["function multiply(a, b) {", '\t"use strict";'] - assert frame.context_line == "\treturn a * b;" - assert frame.post_context == [ - "}", - "function divide(a, b) {", - '\t"use strict";', - u"\ttry {", - "\t\treturn multiply(add(a, b), a, b) / c;", - ] - - @responses.activate - def test_sourcemap_expansion_with_missing_source(self): - """ - Tests a successful sourcemap expansion that points to source files - that are not found. - """ - responses.add( - responses.GET, - "http://example.com/file.min.js", - body=load_fixture("file.min.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/file.sourcemap.js", - body=load_fixture("file.sourcemap.js"), - content_type="application/json; charset=utf-8", - ) - responses.add(responses.GET, "http://example.com/file1.js", body="Not Found", status=404) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - # Add two frames. We only want to see the - # error once though. - "frames": [ - { - "abs_path": "http://example.com/file.min.js", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - { - "abs_path": "http://example.com/file.min.js", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert event.data["errors"] == [ - {"url": u"http://example.com/file1.js", "type": "fetch_invalid_http_code", "value": 404} - ] - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - frame = frame_list[0] - - # no context information ... - assert not frame.pre_context - assert not frame.context_line - assert not frame.post_context - - # ... but line, column numbers are still correctly mapped - assert frame.lineno == 3 - assert frame.colno == 9 - - @responses.activate - def test_failed_sourcemap_expansion(self): - """ - Tests attempting to parse an indexed source map where each section has a "url" - property - this is unsupported and should fail. - """ - responses.add( - responses.GET, - "http://example.com/unsupported.min.js", - body=load_fixture("unsupported.min.js"), - content_type="application/javascript; charset=utf-8", - ) - - responses.add( - responses.GET, - "http://example.com/unsupported.sourcemap.js", - body=load_fixture("unsupported.sourcemap.js"), - content_type="application/json; charset=utf-8", - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/unsupported.min.js", - "filename": "indexed.min.js", - "lineno": 1, - "colno": 39, - } - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert event.data["errors"] == [ - {"url": u"http://example.com/unsupported.sourcemap.js", "type": "js_invalid_source"} - ] - - def test_failed_sourcemap_expansion_data_url(self): - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "data:application/javascript,base46,asfasf", - "filename": "indexed.min.js", - "lineno": 1, - "colno": 39, - } - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert event.data["errors"] == [{"url": u"<data url>", "type": "js_no_source"}] - - @responses.activate - def test_failed_sourcemap_expansion_missing_location_entirely(self): - responses.add( - responses.GET, - "http://example.com/indexed.min.js", - body="//# sourceMappingURL=indexed.sourcemap.js", - ) - responses.add(responses.GET, "http://example.com/indexed.sourcemap.js", body="{}") - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/indexed.min.js", - "filename": "indexed.min.js", - "lineno": 1, - "colno": 1, - }, - { - "abs_path": "http://example.com/indexed.min.js", - "filename": "indexed.min.js", - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert "errors" not in event.data - - @responses.activate - def test_html_response_for_js(self): - responses.add( - responses.GET, - "http://example.com/file1.js", - body=" <!DOCTYPE html><html><head></head><body></body></html>", - ) - responses.add( - responses.GET, - "http://example.com/file2.js", - body="<!doctype html><html><head></head><body></body></html>", - ) - responses.add( - responses.GET, - "http://example.com/file.html", - body=( - "<!doctype html><html><head></head><body><script>/*legit case*/</script></body></html>" - ), - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/file1.js", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - { - "abs_path": "http://example.com/file2.js", - "filename": "file.min.js", - "lineno": 1, - "colno": 39, - }, - { - "abs_path": "http://example.com/file.html", - "filename": "file.html", - "lineno": 1, - "colno": 1, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert event.data["errors"] == [ - {"url": u"http://example.com/file1.js", "type": "js_invalid_content"}, - {"url": u"http://example.com/file2.js", "type": "js_invalid_content"}, - ] - - @responses.activate - def test_html_file_with_query_param_ending_with_js_extension(self): - responses.add( - responses.GET, - "http://example.com/file.html", - body=( - "<!doctype html><html><head></head><body><script>/*legit case*/</script></body></html>" - ), - ) - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "javascript", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "http://example.com/file.html?sw=iddqd1337.js", - "filename": "file.html", - "lineno": 1, - "colno": 1, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - assert "errors" not in event.data - - def test_node_processing(self): - project = self.project - release = Release.objects.create( - organization_id=project.organization_id, version="nodeabc123" - ) - release.add_project(project) - - f_minified = File.objects.create( - name="dist.bundle.js", - type="release.file", - headers={"Content-Type": "application/javascript"}, - ) - f_minified.putfile(open(get_fixture_path("dist.bundle.js"), "rb")) - ReleaseFile.objects.create( - name=u"~/{}".format(f_minified.name), - release=release, - organization_id=project.organization_id, - file=f_minified, - ) - - f_sourcemap = File.objects.create( - name="dist.bundle.js.map", - type="release.file", - headers={"Content-Type": "application/javascript"}, - ) - f_sourcemap.putfile(open(get_fixture_path("dist.bundle.js.map"), "rb")) - ReleaseFile.objects.create( - name=u"~/{}".format(f_sourcemap.name), - release=release, - organization_id=project.organization_id, - file=f_sourcemap, - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "node", - "release": "nodeabc123", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "filename": "app:///dist.bundle.js", - "function": "bar", - "lineno": 9, - "colno": 2321, - }, - { - "filename": "app:///dist.bundle.js", - "function": "foo", - "lineno": 3, - "colno": 2308, - }, - { - "filename": "app:///dist.bundle.js", - "function": "App", - "lineno": 3, - "colno": 1011, - }, - { - "filename": "app:///dist.bundle.js", - "function": "Object.<anonymous>", - "lineno": 1, - "colno": 1014, - }, - { - "filename": "app:///dist.bundle.js", - "function": "__webpack_require__", - "lineno": 20, - "colno": 30, - }, - { - "filename": "app:///dist.bundle.js", - "function": "<unknown>", - "lineno": 18, - "colno": 63, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - assert len(frame_list) == 6 - - import pprint - - pprint.pprint(frame_list[0].__dict__) - pprint.pprint(frame_list[1].__dict__) - pprint.pprint(frame_list[2].__dict__) - pprint.pprint(frame_list[3].__dict__) - pprint.pprint(frame_list[4].__dict__) - pprint.pprint(frame_list[5].__dict__) - - assert frame_list[0].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" - assert frame_list[0].function == "bar" - assert frame_list[0].lineno == 8 - - assert frame_list[1].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" - assert frame_list[1].function == "foo" - assert frame_list[1].lineno == 2 - - assert frame_list[2].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" - assert frame_list[2].function == "App" - assert frame_list[2].lineno == 2 - - assert frame_list[3].abs_path == "app:///dist.bundle.js" - assert frame_list[3].function == "Object.<anonymous>" - assert frame_list[3].lineno == 1 - - assert frame_list[4].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" - assert frame_list[4].function == "__webpack_require__" - assert frame_list[4].lineno == 19 - - assert frame_list[5].abs_path == "webpack:///webpack/bootstrap d9a5a31d9276b73873d3" - assert frame_list[5].function == "<unknown>" - assert frame_list[5].lineno == 16 - - @responses.activate - def test_no_fetch_from_http(self): - responses.add( - responses.GET, - "http://example.com/node_app.min.js", - body=load_fixture("node_app.min.js"), - content_type="application/javascript; charset=utf-8", - ) - responses.add( - responses.GET, - "http://example.com/node_app.min.js.map", - body=load_fixture("node_app.min.js.map"), - content_type="application/javascript; charset=utf-8", - ) - - data = { - "timestamp": self.min_ago, - "message": "hello", - "platform": "node", - "exception": { - "values": [ - { - "type": "Error", - "stacktrace": { - "frames": [ - { - "abs_path": "node_bootstrap.js", - "filename": "node_bootstrap.js", - "lineno": 1, - "colno": 38, - }, - { - "abs_path": "timers.js", - "filename": "timers.js", - "lineno": 1, - "colno": 39, - }, - { - "abs_path": "webpack:///internal", - "filename": "internal", - "lineno": 1, - "colno": 43, - }, - { - "abs_path": "webpack:///~/some_dep/file.js", - "filename": "file.js", - "lineno": 1, - "colno": 41, - }, - { - "abs_path": "webpack:///./node_modules/file.js", - "filename": "file.js", - "lineno": 1, - "colno": 42, - }, - { - "abs_path": "http://example.com/node_app.min.js", - "filename": "node_app.min.js", - "lineno": 1, - "colno": 40, - }, - ] - }, - } - ] - }, - } - - event = self.post_and_retrieve_event(data) - - exception = event.interfaces["exception"] - frame_list = exception.values[0].stacktrace.frames - - # This one should not process, so this one should be none. - assert exception.values[0].raw_stacktrace is None - - # None of the in app should update - for x in range(6): - assert not frame_list[x].in_app - - [email protected]_store_integration -class JavascriptIntegrationTestLegacy(SentryStoreHelper, TestCase, JavascriptIntegrationTest): - def setUp(self): - super(JavascriptIntegrationTestLegacy, self).setUp() - self.min_ago = iso_format(before_now(minutes=1)) diff --git a/tests/sentry/lang/native/test_minidump.py b/tests/sentry/lang/native/test_minidump.py deleted file mode 100644 index e4e0446c887f2e..00000000000000 --- a/tests/sentry/lang/native/test_minidump.py +++ /dev/null @@ -1,171 +0,0 @@ -from __future__ import absolute_import -import io -import msgpack -from sentry.lang.native.minidump import ( - is_minidump_event, - merge_attached_breadcrumbs, - merge_attached_event, -) - - -class MockFile(object): - def __init__(self, bytes): - self._io = io.BytesIO(bytes) - self.size = len(bytes) - - def __getattr__(self, name): - return getattr(self._io, name) - - -def test_merge_attached_event_empty(): - mpack_event = msgpack.packb({}) - event = {} - merge_attached_event(MockFile(mpack_event), event) - assert not event - - -def test_merge_attached_event_too_large_empty(): - mpack_event = msgpack.packb({"a": "a" * 100000}) - event = {} - merge_attached_event(MockFile(mpack_event), event) - assert not event - - -def test_merge_attached_event_arbitrary_key(): - mpack_event = msgpack.packb({"key": "value"}) - event = {} - merge_attached_event(MockFile(mpack_event), event) - assert event["key"] == "value" - - -def test_merge_attached_event_empty_file(): - event = {} - merge_attached_event(MockFile(b""), event) - assert not event - - -def test_merge_attached_event_invalid_file(): - event = {} - merge_attached_event(MockFile(b"\xde"), event) - assert not event - - -def test_merge_attached_breadcrumbs_empty_creates_crumb(): - mpack_crumb = msgpack.packb({}) - event = {} - merge_attached_breadcrumbs(MockFile(mpack_crumb), event) - assert event - - -def test_merge_attached_breadcrumb_too_large_empty(): - mpack_crumb = msgpack.packb({"message": "a" * 50000}) - event = {} - merge_attached_breadcrumbs(MockFile(mpack_crumb), event) - assert not event.get("breadcrumbs") - - -def test_merge_attached_breadcrumbs_empty_file(): - event = {} - merge_attached_breadcrumbs(MockFile(b""), event) - assert not event.get("breadcrumbs") - - -def test_merge_attached_breadcrumbs_invalid_file(): - event = {} - merge_attached_breadcrumbs(MockFile(b"\xde"), event) - assert not event.get("breadcrumbs") - - -# See: -# https://github.com/getsentry/sentrypad/blob/e1d4feb65c3e9db829cc4ca9d4003ff3c818d95a/src/sentry.cpp#L337-L366 -def test_merge_attached_breadcrumbs_single_crumb(): - mpack_crumb = msgpack.packb( - { - "timestamp": "0000-00-00T00:00:00Z", - "category": "c", - "type": "t", - "level": "debug", - "message": "m", - } - ) - event = {} - merge_attached_breadcrumbs(MockFile(mpack_crumb), event) - assert event["breadcrumbs"][0]["timestamp"] == "0000-00-00T00:00:00Z" - assert event["breadcrumbs"][0]["category"] == "c" - assert event["breadcrumbs"][0]["type"] == "t" - assert event["breadcrumbs"][0]["level"] == "debug" - assert event["breadcrumbs"][0]["message"] == "m" - - -def test_merge_attached_breadcrumbs_timestamp_ordered(): - event = {} - mpack_crumb1 = msgpack.packb({"timestamp": "0001-01-01T01:00:02Z"}) - merge_attached_breadcrumbs(MockFile(mpack_crumb1), event) - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:02Z" - - crumbs_file2 = bytearray() - crumbs_file2.extend(msgpack.packb({"timestamp": "0001-01-01T01:00:01Z"})) - # File with 2 items to extend cap - crumbs_file2.extend(msgpack.packb({"timestamp": "0001-01-01T01:00:01Z"})) - merge_attached_breadcrumbs(MockFile(crumbs_file2), event) - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:01Z" - assert event["breadcrumbs"][1]["timestamp"] == "0001-01-01T01:00:02Z" - - mpack_crumb3 = msgpack.packb({"timestamp": "0001-01-01T01:00:03Z"}) - merge_attached_breadcrumbs(MockFile(mpack_crumb3), event) - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:02Z" - assert event["breadcrumbs"][1]["timestamp"] == "0001-01-01T01:00:03Z" - - mpack_crumb4 = msgpack.packb({"timestamp": "0001-01-01T01:00:00Z"}) - merge_attached_breadcrumbs(MockFile(mpack_crumb4), event) - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:02Z" - assert event["breadcrumbs"][1]["timestamp"] == "0001-01-01T01:00:03Z" - - -def test_merge_attached_breadcrumbs_capped(): - # Crumbs are capped by the largest file - event = {} - - crumbs_file1 = bytearray() - for i in range(0, 2): - crumbs_file1.extend(msgpack.packb({"timestamp": "0001-01-01T01:00:01Z"})) - - merge_attached_breadcrumbs(MockFile(crumbs_file1), event) - assert len(event["breadcrumbs"]) == 2 - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:01Z" - assert event["breadcrumbs"][1]["timestamp"] == "0001-01-01T01:00:01Z" - - crumbs_file2 = bytearray() - for i in range(0, 3): - crumbs_file2.extend(msgpack.packb({"timestamp": "0001-01-01T01:00:02Z"})) - - merge_attached_breadcrumbs(MockFile(crumbs_file2), event) - assert len(event["breadcrumbs"]) == 3 - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:02Z" - assert event["breadcrumbs"][1]["timestamp"] == "0001-01-01T01:00:02Z" - assert event["breadcrumbs"][2]["timestamp"] == "0001-01-01T01:00:02Z" - - crumbs_file3 = msgpack.packb({"timestamp": "0001-01-01T01:00:03Z"}) - merge_attached_breadcrumbs(MockFile(crumbs_file3), event) - assert len(event["breadcrumbs"]) == 3 - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:02Z" - assert event["breadcrumbs"][1]["timestamp"] == "0001-01-01T01:00:02Z" - assert event["breadcrumbs"][2]["timestamp"] == "0001-01-01T01:00:03Z" - - crumbs_file4 = msgpack.packb({"timestamp": "0001-01-01T01:00:04Z"}) - merge_attached_breadcrumbs(MockFile(crumbs_file4), event) - assert len(event["breadcrumbs"]) == 3 - assert event["breadcrumbs"][0]["timestamp"] == "0001-01-01T01:00:02Z" - assert event["breadcrumbs"][1]["timestamp"] == "0001-01-01T01:00:03Z" - assert event["breadcrumbs"][2]["timestamp"] == "0001-01-01T01:00:04Z" - - -def test_is_minidump(): - assert is_minidump_event({"exception": {"values": [{"mechanism": {"type": "minidump"}}]}}) - assert not is_minidump_event({"exception": {"values": [{"mechanism": {"type": "other"}}]}}) - assert not is_minidump_event({"exception": {"values": [{"mechanism": {"type": None}}]}}) - assert not is_minidump_event({"exception": {"values": [{"mechanism": None}]}}) - assert not is_minidump_event({"exception": {"values": [None]}}) - assert not is_minidump_event({"exception": {"values": []}}) - assert not is_minidump_event({"exception": {"values": None}}) - assert not is_minidump_event({"exception": None}) diff --git a/tests/sentry/lang/native/test_unreal.py b/tests/sentry/lang/native/test_unreal.py deleted file mode 100644 index 6a0d9cc284d987..00000000000000 --- a/tests/sentry/lang/native/test_unreal.py +++ /dev/null @@ -1,108 +0,0 @@ -from __future__ import absolute_import -import os - -from symbolic import Unreal4Crash - -from sentry.testutils import TestCase -from sentry.lang.native.minidump import MINIDUMP_ATTACHMENT_TYPE -from sentry.lang.native.unreal import ( - merge_unreal_user, - unreal_attachment_type, - merge_unreal_context_event, - merge_unreal_logs_event, -) -from sentry.models import UserReport - - -MOCK_EVENT_ID = "12852a74acc943a790c8f1cd23907caa" - - -def get_fixture_path(name): - return os.path.join( - os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, "fixtures", "native", name - ) - - -def get_unreal_crash_file(): - return get_fixture_path("unreal_crash") - - -def test_unreal_attachment_type_minidump(): - file = MockFile("minidump") - assert unreal_attachment_type(file) == MINIDUMP_ATTACHMENT_TYPE - - -def test_unreal_attachment_type_unknown(): - file = MockFile("something unknown") - assert unreal_attachment_type(file) is None - - -class MockFile(TestCase): - def __init__(self, type): - self.type = type - - -class UnrealIntegrationTest(TestCase): - def test_merge_unreal_context_event(self): - with open(get_unreal_crash_file(), "rb") as f: - event = {"event_id": MOCK_EVENT_ID, "environment": "Production"} - user_id = "ebff51ef3c4878627823eebd9ff40eb4|2e7d369327054a448be6c8d3601213cb|C52DC39D-DAF3-5E36-A8D3-BF5F53A5D38F" - merge_unreal_user(event, user_id) - unreal_crash = Unreal4Crash.from_bytes(f.read()) - merge_unreal_context_event(unreal_crash.get_context(), event, self.project) - self.insta_snapshot(event) - - def test_merge_unreal_context_event_without_user(self): - expected_message = "user comments" - context = {"runtime_properties": {"user_description": expected_message}} - event = {"event_id": MOCK_EVENT_ID} - merge_unreal_context_event(context, event, self.project) - - user_report = UserReport.objects.get(event_id=MOCK_EVENT_ID, project=self.project) - assert user_report.comments == expected_message - assert user_report.name == "unknown" - assert event.get("user") is None - - def test_merge_unreal_context_event_with_user(self): - expected_message = "user comments" - expected_username = "John Doe" - context = { - "runtime_properties": { - "username": expected_username, - "user_description": expected_message, - } - } - event = {"event_id": MOCK_EVENT_ID} - merge_unreal_context_event(context, event, self.project) - - user_report = UserReport.objects.get(event_id=event["event_id"], project=self.project) - assert user_report.comments == expected_message - assert user_report.name == expected_username - assert event["user"]["username"] == expected_username - - def test_merge_unreal_context_event_without_user_description(self): - expected_username = "Jane Bloggs" - context = {"runtime_properties": {"username": expected_username}} - event = {"event_id": MOCK_EVENT_ID} - merge_unreal_context_event(context, event, self.project) - try: - user_report = UserReport.objects.get(event_id=MOCK_EVENT_ID, project=self.project) - except UserReport.DoesNotExist: - user_report = None - - assert user_report is None - assert event["user"]["username"] == expected_username - - def test_merge_unreal_logs_event(self): - with open(get_unreal_crash_file(), "rb") as f: - event = {"event_id": MOCK_EVENT_ID, "environment": None} - unreal_crash = Unreal4Crash.from_bytes(f.read()) - merge_unreal_logs_event(unreal_crash.get_logs(), event) - breadcrumbs = event["breadcrumbs"]["values"] - assert len(breadcrumbs) == 100 - assert breadcrumbs[0]["timestamp"] == "2018-11-20T11:47:14Z" - assert breadcrumbs[0]["message"] == " 4. 'Parallels Display Adapter (WDDM)' (P:0 D:0)" - assert breadcrumbs[0]["category"] == "LogWindows" - assert breadcrumbs[99]["timestamp"] == "2018-11-20T11:47:15Z" - assert breadcrumbs[99]["message"] == "Texture pool size now 1000 MB" - assert breadcrumbs[99]["category"] == "LogContentStreaming" diff --git a/tests/sentry/lang/native/test_utils.py b/tests/sentry/lang/native/test_utils.py index 5c1e935221c636..1ed6706ece2a72 100644 --- a/tests/sentry/lang/native/test_utils.py +++ b/tests/sentry/lang/native/test_utils.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -from sentry.lang.native.utils import get_sdk_from_event +from sentry.lang.native.utils import get_sdk_from_event, is_minidump_event def test_get_sdk_from_event(): @@ -29,3 +29,14 @@ def test_get_sdk_from_event(): assert sdk_info["version_major"] == 9 assert sdk_info["version_minor"] == 3 assert sdk_info["version_patchlevel"] == 1 + + +def test_is_minidump(): + assert is_minidump_event({"exception": {"values": [{"mechanism": {"type": "minidump"}}]}}) + assert not is_minidump_event({"exception": {"values": [{"mechanism": {"type": "other"}}]}}) + assert not is_minidump_event({"exception": {"values": [{"mechanism": {"type": None}}]}}) + assert not is_minidump_event({"exception": {"values": [{"mechanism": None}]}}) + assert not is_minidump_event({"exception": {"values": [None]}}) + assert not is_minidump_event({"exception": {"values": []}}) + assert not is_minidump_event({"exception": {"values": None}}) + assert not is_minidump_event({"exception": None}) diff --git a/tests/sentry/models/test_monitor.py b/tests/sentry/models/test_monitor.py index 077d6f7a2e0235..21bbf40c33134e 100644 --- a/tests/sentry/models/test_monitor.py +++ b/tests/sentry/models/test_monitor.py @@ -47,8 +47,8 @@ def test_next_run_interval(self): 2019, 2, 1, 1, 10, 20, tzinfo=timezone.utc ) - @patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_mark_failed_default_params(self, mock_insert_data_to_database): + @patch("sentry.coreapi.insert_data_to_database_legacy") + def test_mark_failed_default_params(self, mock_insert_data_to_database_legacy): monitor = Monitor.objects.create( name="test monitor", organization_id=self.organization.id, @@ -58,9 +58,9 @@ def test_mark_failed_default_params(self, mock_insert_data_to_database): ) assert monitor.mark_failed() - assert len(mock_insert_data_to_database.mock_calls) == 1 + assert len(mock_insert_data_to_database_legacy.mock_calls) == 1 - event = mock_insert_data_to_database.mock_calls[0].args[0] + event = mock_insert_data_to_database_legacy.mock_calls[0].args[0] assert dict( event, @@ -84,8 +84,8 @@ def test_mark_failed_default_params(self, mock_insert_data_to_database): } ) == dict(event) - @patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_mark_failed_with_reason(self, mock_insert_data_to_database): + @patch("sentry.coreapi.insert_data_to_database_legacy") + def test_mark_failed_with_reason(self, mock_insert_data_to_database_legacy): monitor = Monitor.objects.create( name="test monitor", organization_id=self.organization.id, @@ -95,9 +95,9 @@ def test_mark_failed_with_reason(self, mock_insert_data_to_database): ) assert monitor.mark_failed(reason=MonitorFailure.DURATION) - assert len(mock_insert_data_to_database.mock_calls) == 1 + assert len(mock_insert_data_to_database_legacy.mock_calls) == 1 - event = mock_insert_data_to_database.mock_calls[0].args[0] + event = mock_insert_data_to_database_legacy.mock_calls[0].args[0] assert dict( event, diff --git a/tests/sentry/utils/http/tests.py b/tests/sentry/utils/http/tests.py index 8fcd5ca9d5f5c7..08745bc93b2c16 100644 --- a/tests/sentry/utils/http/tests.py +++ b/tests/sentry/utils/http/tests.py @@ -19,13 +19,6 @@ origin_from_request, heuristic_decode, ) -from sentry.utils.data_filters import ( - is_valid_ip, - is_valid_release, - is_valid_error_message, - FilterTypes, -) -from sentry.relay.config import get_project_config class AbsoluteUriTest(unittest.TestCase): @@ -252,84 +245,6 @@ def test_without_hostname(self): assert result is True -class IsValidIPTestCase(TestCase): - def is_valid_ip(self, ip, inputs): - self.project.update_option("sentry:blacklisted_ips", inputs) - project_config = get_project_config(self.project) - return is_valid_ip(project_config, ip) - - def test_not_in_blacklist(self): - assert self.is_valid_ip("127.0.0.1", []) - assert self.is_valid_ip("127.0.0.1", ["0.0.0.0", "192.168.1.1", "10.0.0.0/8"]) - - def test_match_blacklist(self): - assert not self.is_valid_ip("127.0.0.1", ["127.0.0.1"]) - assert not self.is_valid_ip("127.0.0.1", ["0.0.0.0", "127.0.0.1", "192.168.1.1"]) - - def test_match_blacklist_range(self): - assert not self.is_valid_ip("127.0.0.1", ["127.0.0.0/8"]) - assert not self.is_valid_ip("127.0.0.1", ["0.0.0.0", "127.0.0.0/8", "192.168.1.0/8"]) - - def test_garbage_input(self): - assert self.is_valid_ip("127.0.0.1", ["lol/bar"]) - - -class IsValidReleaseTestCase(TestCase): - def is_valid_release(self, value, inputs): - self.project.update_option(u"sentry:{}".format(FilterTypes.RELEASES), inputs) - project_config = get_project_config(self.project) - return is_valid_release(project_config, value) - - def test_release_not_in_list(self): - assert self.is_valid_release("1.2.3", None) - assert self.is_valid_release("1.2.3", []) - assert self.is_valid_release("1.2.3", ["1.1.1", "1.1.2", "1.2.1"]) - - def test_release_match_list(self): - assert not self.is_valid_release("1.2.3", ["1.2.3"]) - assert not self.is_valid_release("1.2.3", ["1.2.*", "1.3.0", "1.3.1"]) - assert not self.is_valid_release("1.2.3", ["1.3.0", "1.*", "1.3.1"]) - - def test_garbage_data(self): - assert self.is_valid_release(1, ["1.2.3"]) - - -class IsValidErrorMessageTestCase(TestCase): - def is_valid_error_message(self, value, inputs): - self.project.update_option(u"sentry:{}".format(FilterTypes.ERROR_MESSAGES), inputs) - project_config = get_project_config(self.project) - return is_valid_error_message(project_config, value) - - def test_error_class_not_in_list(self): - assert self.is_valid_error_message( - "ZeroDivisionError: integer division or modulo by zero", None - ) - assert self.is_valid_error_message( - "ZeroDivisionError: integer division or modulo by zero", [] - ) - assert self.is_valid_error_message( - "ZeroDivisionError: integer division or modulo by zero", - ["TypeError*", "*: cannot import name*"], - ) - - def test_error_class_match_list(self): - assert not self.is_valid_error_message( - "ImportError: cannot import name is_valid", ["*: cannot import name*"] - ) - assert not self.is_valid_error_message( - "ZeroDivisionError: divided by 0", ["ImportError*", "TypeError*", "*: divided by 0"] - ) - - def test_garbage_data(self): - assert self.is_valid_error_message(1, ["ImportError*"]) - assert self.is_valid_error_message(None, ["ImportError*"]) - assert self.is_valid_error_message({}, ["ImportError*"]) - - def test_bad_characters_in_pattern(self): - patterns = [u"*google_tag_manager['GTM-3TL3'].macro(...)*"] - assert self.is_valid_error_message("it bad", patterns) - - class OriginFromRequestTestCase(TestCase): def test_nothing(self): request = HttpRequest() diff --git a/tests/sentry/utils/test_csp.py b/tests/sentry/utils/test_csp.py index 8c2995601c6fdb..70a8c71b4a5ce5 100644 --- a/tests/sentry/utils/test_csp.py +++ b/tests/sentry/utils/test_csp.py @@ -18,32 +18,3 @@ def test_invalid_csp_report(report): with pytest.raises(InterfaceValidationError): Csp.to_python(report) - - [email protected]( - "report", - ( - {"effective_directive": "style-src", "blocked_uri": "about"}, - {"effective_directive": "style-src", "blocked_uri": "ms-browser-extension"}, - {"effective_directive": "style-src", "source_file": "chrome-extension://fdsa"}, - {"effective_directive": "style-src", "source_file": "http://localhost:8000"}, - {"effective_directive": "style-src", "source_file": "http://localhost"}, - {"effective_directive": "style-src", "source_file": "http://foo.superfish.com"}, - {"effective_directive": "style-src", "blocked_uri": "http://foo.superfish.com"}, - ), -) -def test_blocked_csp_report(report): - assert Csp.to_python(report).should_filter() is True - - [email protected]( - "report", - ( - {"effective_directive": "style-src", "blocked_uri": "http://example.com"}, - {"effective_directive": "script-src", "blocked_uri": "http://example.com"}, - {"effective_directive": "style-src", "source_file": "http://example.com"}, - {"effective_directive": "style-src"}, - ), -) -def test_valid_csp_report(report): - assert Csp.to_python(report).should_filter() is False diff --git a/tests/sentry/web/api/tests.py b/tests/sentry/web/api/tests.py index ed961f10689001..e62a7120542516 100644 --- a/tests/sentry/web/api/tests.py +++ b/tests/sentry/web/api/tests.py @@ -2,653 +2,13 @@ from __future__ import absolute_import -import pytest from sentry.utils.compat import mock from django.core.urlresolvers import reverse -from django.core.files.uploadedfile import SimpleUploadedFile from exam import fixture -from sentry.utils.compat.mock import Mock -from six import BytesIO -from sentry.coreapi import APIRateLimited -from sentry.models import ProjectKey, EventAttachment -from sentry.signals import event_accepted -from sentry.testutils import assert_mock_called_once_with_partial, TestCase +from sentry.testutils import TestCase from sentry.utils import json -from sentry.utils.data_filters import FilterTypes - - [email protected]("functionality moved and tested in Relay") -class SecurityReportCspTest(TestCase): - @fixture - def path(self): - path = reverse("sentry-api-security-report", kwargs={"project_id": self.project.id}) - return path + "?sentry_key=%s" % self.projectkey.public_key - - @pytest.mark.obsolete("can be removed, covered in Relay") - def test_get_response(self): - resp = self.client.get(self.path) - assert resp.status_code == 405, resp.content - - @pytest.mark.obsolete("can be removed, NOT worth porting to Relay") - def test_invalid_content_type(self): - resp = self.client.post(self.path, content_type="text/plain") - assert resp.status_code == 400, resp.content - - @pytest.mark.obsolete("can be removed, NOT worth porting to Relay") - def test_missing_csp_report(self): - resp = self.client.post( - self.path, - content_type="application/csp-report", - data='{"lol":1}', - HTTP_USER_AGENT="awesome", - ) - assert resp.status_code == 400, resp.content - - @pytest.mark.obsolete( - "ported to Relay", "tests/integration/test_security_report.py::test_uses_origins" - ) - @mock.patch("sentry.utils.http.get_origins") - def test_bad_origin(self, get_origins): - get_origins.return_value = ["example.com"] - resp = self.client.post( - self.path, - content_type="application/csp-report", - data='{"csp-report":{"document-uri":"http://lolnope.com","effective-directive":"img-src",' - '"violated-directive":"img-src","source-file":"test.html"}}', - HTTP_USER_AGENT="awesome", - ) - assert resp.status_code == 403, resp.content - - get_origins.return_value = ["*"] - resp = self.client.post( - self.path, - content_type="application/csp-report", - data='{"csp-report":{"document-uri":"about:blank"}}', - HTTP_USER_AGENT="awesome", - ) - assert resp.status_code == 400, resp.content - - @pytest.mark.obsolete( - "already covered in Relay by multiple integration tests", - "tests/integration/test_security_report.py", - ) - @mock.patch("sentry.web.api.is_valid_origin", mock.Mock(return_value=True)) - @mock.patch("sentry.web.api.SecurityReportView.process") - def test_post_success(self, process): - process.return_value = "ok" - resp = self._postCspWithHeader( - { - "document-uri": "http://example.com", - "source-file": "http://example.com", - "effective-directive": "style-src", - "violated-directive": "style-src", - "disposition": "enforce", - } - ) - assert resp.status_code == 201, resp.content - - [email protected]("functionality moved and tested in Relay") -class SecurityReportHpkpTest(TestCase): - @fixture - def path(self): - path = reverse("sentry-api-security-report", kwargs={"project_id": self.project.id}) - return path + "?sentry_key=%s" % self.projectkey.public_key - - @mock.patch("sentry.web.api.is_valid_origin", mock.Mock(return_value=True)) - @mock.patch("sentry.web.api.SecurityReportView.process") - def test_post_success(self, process): - process.return_value = "ok" - resp = self.client.post( - self.path, - content_type="application/json", - data=json.dumps( - { - "date-time": "2014-04-06T13:00:50Z", - "hostname": "www.example.com", - "port": 443, - "effective-expiration-date": "2014-05-01T12:40:50Z", - "include-subdomains": False, - "served-certificate-chain": [ - "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----" - ], - "validated-certificate-chain": [ - "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----" - ], - "known-pins": ['pin-sha256="E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g="'], - } - ), - HTTP_USER_AGENT="awesome", - ) - assert resp.status_code == 201, resp.content - - [email protected]( - "functionality moved and tested in Relay", - "tests/integration/test_security_report.py::test_security_reports_no_processing", -) -class SecurityReportExpectCTTest(TestCase): - @fixture - def path(self): - path = reverse("sentry-api-security-report", kwargs={"project_id": self.project.id}) - return path + "?sentry_key=%s" % self.projectkey.public_key - - @mock.patch("sentry.web.api.is_valid_origin", mock.Mock(return_value=True)) - @mock.patch("sentry.web.api.SecurityReportView.process") - def test_post_success(self, process): - process.return_value = "ok" - resp = self.client.post( - self.path, - content_type="application/expect-ct-report+json", - data=json.dumps( - { - "expect-ct-report": { - "date-time": "2014-04-06T13:00:50Z", - "hostname": "www.example.com", - "port": 443, - "effective-expiration-date": "2014-05-01T12:40:50Z", - "served-certificate-chain": [ - "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----" - ], - "validated-certificate-chain": [ - "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----" - ], - "scts": [ - { - "version": 1, - "status": "invalid", - "source": "embedded", - "serialized_sct": "ABCD==", - } - ], - } - } - ), - HTTP_USER_AGENT="awesome", - ) - assert resp.status_code == 201, resp.content - - [email protected]( - "functionality moved and tested in Relay", - "tests/integration/test_security_report.py::test_security_reports_no_processing", -) -class SecurityReportExpectStapleTest(TestCase): - @fixture - def path(self): - path = reverse("sentry-api-security-report", kwargs={"project_id": self.project.id}) - return path + "?sentry_key=%s" % self.projectkey.public_key - - @mock.patch("sentry.web.api.is_valid_origin", mock.Mock(return_value=True)) - @mock.patch("sentry.web.api.SecurityReportView.process") - def test_post_success(self, process): - process.return_value = "ok" - resp = self.client.post( - self.path, - content_type="application/expect-staple-report", - data=json.dumps( - { - "expect-staple-report": { - "date-time": "2014-04-06T13:00:50Z", - "hostname": "www.example.com", - "port": 443, - "response-status": "ERROR_RESPONSE", - "cert-status": "REVOKED", - "effective-expiration-date": "2014-05-01T12:40:50Z", - "served-certificate-chain": [ - "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----" - ], - "validated-certificate-chain": [ - "-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----" - ], - } - } - ), - HTTP_USER_AGENT="awesome", - ) - assert resp.status_code == 201, resp.content - - [email protected]("functionality moved in Relay") -class StoreViewTest(TestCase): - @fixture - def path(self): - return reverse("sentry-api-store", kwargs={"project_id": self.project.id}) - - @pytest.mark.obsolete("covered in Relay", "tests/integration/test_store.py") - @mock.patch("sentry.web.api.StoreView._parse_header") - def test_options_response(self, parse_header): - project = self.create_project() - pk = ProjectKey.objects.get_or_create(project=project)[0] - parse_header.return_value = { - "sentry_project": project.id, - "sentry_key": pk.public_key, - "sentry_version": "2.0", - } - resp = self.client.options(self.path) - assert resp.status_code == 200, (resp.status_code, resp.content) - assert resp.has_header("Allow") - self.assertEquals(resp["Allow"], "GET, POST, HEAD, OPTIONS") - assert resp.has_header("Content-Length") - self.assertEquals(resp["Content-Length"], "0") - - @pytest.mark.obsolete( - "Will not be directly tested since implementation is part of axis-web CORS" - ) - def test_options_with_no_origin_or_referrer(self): - resp = self.client.options(self.path) - assert resp.status_code == 200, (resp.status_code, resp.content) - assert resp.has_header("Access-Control-Allow-Origin") - self.assertEquals(resp["Access-Control-Allow-Origin"], "*") - - @pytest.mark.obsolete( - "Will not be directly tested since implementation is part of axis-web CORS" - ) - def test_options_response_with_valid_origin(self): - resp = self.client.options(self.path, HTTP_ORIGIN="http://foo.com") - assert resp.status_code == 200, (resp.status_code, resp.content) - assert resp.has_header("Access-Control-Allow-Origin") - self.assertEquals(resp["Access-Control-Allow-Origin"], "http://foo.com") - - @pytest.mark.obsolete( - "Will not be directly tested since implementation is part of axis-web CORS" - ) - def test_options_response_with_valid_referrer(self): - resp = self.client.options(self.path, HTTP_REFERER="http://foo.com") - assert resp.status_code == 200, (resp.status_code, resp.content) - assert resp.has_header("Access-Control-Allow-Origin") - self.assertEquals(resp["Access-Control-Allow-Origin"], "http://foo.com") - - @pytest.mark.obsolete( - "Will not be directly tested since implementation is part of axis-web CORS" - ) - def test_options_response_origin_preferred_over_referrer(self): - resp = self.client.options( - self.path, HTTP_REFERER="http://foo.com", HTTP_ORIGIN="http://bar.com" - ) - assert resp.status_code == 200, (resp.status_code, resp.content) - assert resp.has_header("Access-Control-Allow-Origin") - self.assertEquals(resp["Access-Control-Allow-Origin"], "http://bar.com") - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/client_ips.rs") - @mock.patch("sentry.event_manager.is_valid_ip", mock.Mock(return_value=False)) - def test_request_with_blacklisted_ip(self): - resp = self._postWithHeader({}) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/releases.rs") - @mock.patch("sentry.event_manager.is_valid_release", mock.Mock(return_value=False)) - def test_request_with_filtered_release(self): - body = { - "release": "abcdefg", - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/error_messages.rs") - @mock.patch("sentry.event_manager.is_valid_error_message", mock.Mock(return_value=False)) - def test_request_with_filtered_error(self): - body = { - "release": "abcdefg", - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/client_ips.rs") - def test_request_with_invalid_ip(self): - self.project.update_option("sentry:blacklisted_ips", ["127.0.0.1"]) - body = { - "release": "abcdefg", - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/releases.rs") - def test_request_with_invalid_release(self): - self.project.update_option(u"sentry:{}".format(FilterTypes.RELEASES), ["1.3.2"]) - body = { - "release": "1.3.2", - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/releases.rs") - def test_request_with_short_release_globbing(self): - self.project.update_option(u"sentry:{}".format(FilterTypes.RELEASES), ["1.*"]) - body = { - "release": "1.3.2", - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/releases.rs") - def test_request_with_longer_release_globbing(self): - self.project.update_option(u"sentry:{}".format(FilterTypes.RELEASES), ["2.1.*"]) - body = { - "release": "2.1.3", - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - def test_request_with_invalid_error_messages(self): - self.project.update_option( - u"sentry:{}".format(FilterTypes.ERROR_MESSAGES), ["ZeroDivisionError*"] - ) - body = { - "release": "abcdefg", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - "logentry": { - "formatted": "ZeroDivisionError: integer division or modulo by zero", - "message": "%s: integer division or modulo by zero", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete( - "Moved to Relay", "tests/integration/test_basic.py::test_store_allowed_origins_passes" - ) - @mock.patch("sentry.relay.config.get_origins") - def test_request_with_bad_origin(self, get_origins): - get_origins.return_value = ["foo.com"] - - body = {"logentry": {"formatted": "hello world"}} - - resp = self._postWithHeader(body, HTTP_ORIGIN="lolnope.com") - assert resp.status_code == 403, (resp.status_code, resp.content) - assert b"Invalid origin" in resp.content - - @pytest.mark.obsolete("Unit test in Relay", "relay-filter/error_messages.rs") - def test_request_with_beginning_glob(self): - self.project.update_option( - u"sentry:{}".format(FilterTypes.ERROR_MESSAGES), - ["*: integer division or modulo by zero"], - ) - body = { - "release": "abcdefg", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - "logentry": { - "message": "ZeroDivisionError: integer division or modulo by zero", - "formatted": "", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 403, (resp.status_code, resp.content) - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrubs_ip_address(self, mock_insert_data_to_database): - self.project.update_option("sentry:scrub_ip_address", True) - body = { - "message": "foo bar", - "sdk": {"name": "sentry-browser", "version": "3.23.3", "client_ip": "127.0.0.1"}, - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert not call_data["user"].get("ip_address") - assert not call_data["request"]["env"].get("REMOTE_ADDR") - assert not call_data["sdk"].get("client_ip") - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrubs_org_ip_address_override(self, mock_insert_data_to_database): - self.organization.update_option("sentry:require_scrub_ip_address", True) - self.project.update_option("sentry:scrub_ip_address", False) - body = { - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "env": {"REMOTE_ADDR": "127.0.0.1"}, - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert not call_data["user"].get("ip_address") - assert not call_data["request"]["env"].get("REMOTE_ADDR") - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrub_data_off(self, mock_insert_data_to_database): - self.project.update_option("sentry:scrub_data", False) - self.project.update_option("sentry:scrub_defaults", False) - body = { - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "data": "password=lol&foo=1&bar=2&baz=3", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert call_data["request"]["data"] == { - "password": "lol", - "foo": "1", - "bar": "2", - "baz": "3", - } - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrub_data_on(self, mock_insert_data_to_database): - self.project.update_option("sentry:scrub_data", True) - self.project.update_option("sentry:scrub_defaults", False) - body = { - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "data": "password=lol&foo=1&bar=2&baz=3", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert call_data["request"]["data"] == { - "password": "lol", - "foo": "1", - "bar": "2", - "baz": "3", - } - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrub_data_defaults(self, mock_insert_data_to_database): - self.project.update_option("sentry:scrub_data", True) - self.project.update_option("sentry:scrub_defaults", True) - body = { - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "data": "password=lol&foo=1&bar=2&baz=3", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert call_data["request"]["data"] == { - "password": "[Filtered]", - "foo": "1", - "bar": "2", - "baz": "3", - } - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrub_data_sensitive_fields(self, mock_insert_data_to_database): - self.project.update_option("sentry:scrub_data", True) - self.project.update_option("sentry:scrub_defaults", True) - self.project.update_option("sentry:sensitive_fields", ["foo", "bar"]) - body = { - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "data": "password=lol&foo=1&bar=2&baz=3", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert call_data["request"]["data"] == { - "password": "[Filtered]", - "foo": "[Filtered]", - "bar": "[Filtered]", - "baz": "3", - } - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrub_data_org_override(self, mock_insert_data_to_database): - self.organization.update_option("sentry:require_scrub_data", True) - self.project.update_option("sentry:scrub_data", False) - self.organization.update_option("sentry:require_scrub_defaults", True) - self.project.update_option("sentry:scrub_defaults", False) - body = { - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "data": "password=lol&foo=1&bar=2&baz=3", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert call_data["request"]["data"] == { - "password": "[Filtered]", - "foo": "1", - "bar": "2", - "baz": "3", - } - - @pytest.mark.obsolete("Unit test in Relay, PII/data scrubbing") - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_scrub_data_org_override_sensitive_fields(self, mock_insert_data_to_database): - self.organization.update_option("sentry:require_scrub_data", True) - self.organization.update_option("sentry:require_scrub_defaults", True) - self.organization.update_option("sentry:sensitive_fields", ["baz"]) - self.project.update_option("sentry:sensitive_fields", ["foo", "bar"]) - body = { - "message": "foo bar", - "user": {"ip_address": "127.0.0.1"}, - "request": { - "method": "GET", - "url": "http://example.com/", - "data": "password=lol&foo=1&bar=2&baz=3", - }, - } - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert call_data["request"]["data"] == { - "password": "[Filtered]", - "foo": "[Filtered]", - "bar": "[Filtered]", - "baz": "[Filtered]", - } - - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database") - def test_uses_client_as_sdk(self, mock_insert_data_to_database): - body = {"message": "foo bar"} - resp = self._postWithHeader(body) - assert resp.status_code == 200, (resp.status_code, resp.content) - - call_data = mock_insert_data_to_database.call_args[0][0] - assert call_data["sdk"] == {"name": "_postWithHeader", "version": "0.0.0"} - - @mock.patch("sentry.coreapi.ClientApiHelper.insert_data_to_database", Mock()) - def test_accepted_signal(self): - mock_event_accepted = Mock() - - event_accepted.connect(mock_event_accepted) - - resp = self._postWithHeader({"logentry": {"message": u"hello"}}) - - assert resp.status_code == 200, resp.content - - assert_mock_called_once_with_partial( - mock_event_accepted, ip="127.0.0.1", project=self.project, signal=event_accepted - ) class CrossDomainXmlTest(TestCase): @@ -698,94 +58,6 @@ def test_output_allows_x_sentry_auth(self): ) -class EventAttachmentStoreViewTest(TestCase): - @fixture - def path(self): - # TODO: Having the event set here means the case where event isnt' created - # yet isn't covered by this test class - return reverse( - "sentry-api-event-attachment", - kwargs={"project_id": self.project.id, "event_id": self.event.event_id}, - ) - - def has_attachment(self): - return EventAttachment.objects.filter( - project_id=self.project.id, event_id=self.event.event_id - ).exists() - - def test_event_attachments_feature_creates_attachment(self): - out = BytesIO() - out.write(b"hi") - with self.feature("organizations:event-attachments"): - response = self._postEventAttachmentWithHeader( - { - "attachment1": SimpleUploadedFile( - "mapping.txt", out.getvalue(), content_type="text/plain" - ) - }, - format="multipart", - ) - - assert response.status_code == 201 - assert self.has_attachment() - - def test_event_attachments_without_feature_returns_forbidden(self): - out = BytesIO() - out.write(b"hi") - with self.feature({"organizations:event-attachments": False}): - response = self._postEventAttachmentWithHeader( - { - "attachment1": SimpleUploadedFile( - "mapping.txt", out.getvalue(), content_type="text/plain" - ) - }, - format="multipart", - ) - - assert response.status_code == 403 - assert not self.has_attachment() - - def test_event_attachments_without_files_returns_400(self): - out = BytesIO() - out.write(b"hi") - with self.feature("organizations:event-attachments"): - response = self._postEventAttachmentWithHeader({}, format="multipart") - - assert response.status_code == 400 - assert not self.has_attachment() - - def test_event_attachments_event_doesnt_exist_creates_attachment(self): - with self.feature("organizations:event-attachments"): - self.path = self.path.replace(self.event.event_id, "z" * 32) - out = BytesIO() - out.write(b"hi") - response = self._postEventAttachmentWithHeader( - { - "attachment1": SimpleUploadedFile( - "mapping.txt", out.getvalue(), content_type="text/plain" - ) - }, - format="multipart", - ) - - assert response.status_code == 201 - assert self.has_attachment() - - def test_event_attachments_event_empty_file_creates_attachment(self): - with self.feature("organizations:event-attachments"): - response = self._postEventAttachmentWithHeader( - { - "attachment1": SimpleUploadedFile( - "mapping.txt", BytesIO().getvalue(), content_type="text/plain" - ) - }, - format="multipart", - ) - - assert response.status_code == 201 - assert self.has_attachment() - - class RobotsTxtTest(TestCase): @fixture def path(self): @@ -797,17 +69,6 @@ def test_robots(self): assert resp["Content-Type"] == "text/plain" -def rate_limited_dispatch(*args, **kwargs): - raise APIRateLimited(retry_after=42.42) - - -class APIViewTest(TestCase): - @mock.patch("sentry.web.api.APIView._dispatch", new=rate_limited_dispatch) - def test_retry_after_int(self): - resp = self._postWithHeader({}) - assert resp["Retry-After"] == "43" - - class ClientConfigViewTest(TestCase): @fixture def path(self): diff --git a/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_apple_crash_with_attachments.pysnap b/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_apple_crash_with_attachments.pysnap index 3283da793be565..bf49095a878ff7 100644 --- a/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_apple_crash_with_attachments.pysnap +++ b/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_apple_crash_with_attachments.pysnap @@ -1,5 +1,5 @@ --- -created: '2020-02-07T14:42:34.863069Z' +created: '2020-07-06T21:32:23.619726Z' creator: sentry source: tests/symbolicator/test_unreal_full.py --- @@ -89,7 +89,6 @@ contexts: misc_cpu_vendor: GenuineIntel misc_number_of_cores: 4 misc_number_of_cores_inc_hyperthread: 8 - misc_primary_gpu_brand: Radeon Pro 560 platform_name: MacNoEditor portable_call_stack: YetAnotherMac 0x000000000864e000 + a52132 YetAnotherMac 0x000000000864e000 + 35ed85b YetAnotherMac 0x000000000864e000 + 3611c29 YetAnotherMac 0x000000000864e000 diff --git a/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_crash_with_attachments.pysnap b/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_crash_with_attachments.pysnap index c7e8c9d0fdc5bd..9c15dcbee1eda9 100644 --- a/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_crash_with_attachments.pysnap +++ b/tests/symbolicator/snapshots/SymbolicatorUnrealIntegrationTest/test_unreal_crash_with_attachments.pysnap @@ -1,5 +1,5 @@ --- -created: '2020-02-07T14:42:38.524701Z' +created: '2020-07-06T21:32:31.094138Z' creator: sentry source: tests/symbolicator/test_unreal_full.py --- @@ -82,7 +82,6 @@ contexts: misc_cpu_vendor: GenuineIntel misc_number_of_cores: 6 misc_number_of_cores_inc_hyperthread: 6 - misc_primary_gpu_brand: Parallels Display Adapter (WDDM) platform_name: WindowsNoEditor portable_call_stack: YetAnother 0x00000000544e0000 + 703394 YetAnother 0x00000000544e0000 + 281f2ee YetAnother 0x00000000544e0000 + 2a26dd3 YetAnother 0x00000000544e0000 diff --git a/tests/symbolicator/test_minidump_full.py b/tests/symbolicator/test_minidump_full.py index 32db87e2178beb..f62dce1587b6df 100644 --- a/tests/symbolicator/test_minidump_full.py +++ b/tests/symbolicator/test_minidump_full.py @@ -8,10 +8,8 @@ from django.core.urlresolvers import reverse from django.core.files.uploadedfile import SimpleUploadedFile -from django.test import override_settings -from sentry import eventstore -from sentry.testutils import TransactionTestCase +from sentry.testutils import TransactionTestCase, RelayStoreHelper from sentry.models import EventAttachment from sentry.lang.native.utils import STORE_CRASH_REPORTS_ALL @@ -23,8 +21,7 @@ # `~/.sentry/config.yml` and run `sentry devservices up` -@override_settings(ALLOWED_HOSTS=["localhost", "testserver", "host.docker.internal"]) -class SymbolicatorMinidumpIntegrationTest(TransactionTestCase): +class SymbolicatorMinidumpIntegrationTest(RelayStoreHelper, TransactionTestCase): @pytest.fixture(autouse=True) def initialize(self, live_server): self.project.update_option("sentry:builtin_symbol_sources", []) @@ -70,16 +67,15 @@ def test_full_minidump(self): self.upload_symbols() with self.feature("organizations:event-attachments"): - attachment = BytesIO(b"Hello World!") - attachment.name = "hello.txt" with open(get_fixture_path("windows.dmp"), "rb") as f: - resp = self._postMinidumpWithHeader( - f, {"sentry[logger]": "test-logger", "some_file": attachment} + event = self.post_and_retrieve_minidump( + { + "upload_file_minidump": f, + "some_file": ("hello.txt", BytesIO(b"Hello World!")), + }, + {"sentry[logger]": "test-logger"}, ) - assert resp.status_code == 200 - event_id = resp.content - event = eventstore.get_event_by_id(self.project.id, event_id) insta_snapshot_stacktrace_data(self, event.data) assert event.data.get("logger") == "test-logger" # assert event.data.get("extra") == {"foo": "bar"} @@ -103,13 +99,11 @@ def test_full_minidump_json_extra(self): with self.feature("organizations:event-attachments"): with open(get_fixture_path("windows.dmp"), "rb") as f: - resp = self._postMinidumpWithHeader( - f, {"sentry": '{"logger":"test-logger"}', "foo": "bar"} + event = self.post_and_retrieve_minidump( + {"upload_file_minidump": f}, + {"sentry": '{"logger":"test-logger"}', "foo": "bar"}, ) - assert resp.status_code == 200 - event_id = resp.content - event = eventstore.get_event_by_id(self.project.id, event_id) assert event.data.get("logger") == "test-logger" assert event.data.get("extra") == {"foo": "bar"} # Other assertions are performed by `test_full_minidump` @@ -120,38 +114,21 @@ def test_full_minidump_invalid_extra(self): with self.feature("organizations:event-attachments"): with open(get_fixture_path("windows.dmp"), "rb") as f: - resp = self._postMinidumpWithHeader( - f, {"sentry": "{{{{", "foo": "bar"} # invalid sentry JSON + event = self.post_and_retrieve_minidump( + {"upload_file_minidump": f}, + {"sentry": "{{{{", "foo": "bar"}, # invalid sentry JSON ) - assert resp.status_code == 200 - event_id = resp.content - event = eventstore.get_event_by_id(self.project.id, event_id) assert not event.data.get("logger") assert event.data.get("extra") == {"foo": "bar"} # Other assertions are performed by `test_full_minidump` - def test_raw_minidump(self): - self.project.update_option("sentry:store_crash_reports", STORE_CRASH_REPORTS_ALL) - self.upload_symbols() - - with self.feature("organizations:event-attachments"): - with open(get_fixture_path("windows.dmp"), "rb") as f: - # Send as raw request body instead of multipart/form-data - resp = self._postMinidumpWithHeader(f, raw=True) - assert resp.status_code == 200 - event_id = resp.content - - event = eventstore.get_event_by_id(self.project.id, event_id) - insta_snapshot_stacktrace_data(self, event.data) - def test_missing_dsym(self): with self.feature("organizations:event-attachments"): with open(get_fixture_path("windows.dmp"), "rb") as f: - resp = self._postMinidumpWithHeader(f, {"sentry[logger]": "test-logger"}) - assert resp.status_code == 200 - event_id = resp.content + event = self.post_and_retrieve_minidump( + {"upload_file_minidump": f}, {"sentry[logger]": "test-logger"} + ) - event = eventstore.get_event_by_id(self.project.id, event_id) insta_snapshot_stacktrace_data(self, event.data) assert not EventAttachment.objects.filter(event_id=event.event_id) diff --git a/tests/symbolicator/test_payload_full.py b/tests/symbolicator/test_payload_full.py index 132a7f9eb037f5..dbff38a45aeb44 100644 --- a/tests/symbolicator/test_payload_full.py +++ b/tests/symbolicator/test_payload_full.py @@ -8,13 +8,11 @@ from django.core.urlresolvers import reverse from django.core.files.uploadedfile import SimpleUploadedFile -from django.test import override_settings from sentry import eventstore -from sentry.testutils import TransactionTestCase +from sentry.testutils import TransactionTestCase, RelayStoreHelper from sentry.models import File, ProjectDebugFile from sentry.testutils.helpers.datetime import iso_format, before_now -from sentry.utils import json from tests.symbolicator import get_fixture_path, insta_snapshot_stacktrace_data @@ -64,7 +62,21 @@ } -class ResolvingIntegrationTestBase(object): +class SymbolicatorResolvingIntegrationTest(RelayStoreHelper, TransactionTestCase): + # For these tests to run, write `symbolicator.enabled: true` into your + # `~/.sentry/config.yml` and run `sentry devservices up` + + @pytest.fixture(autouse=True) + def initialize(self, live_server): + self.project.update_option("sentry:builtin_symbol_sources", []) + new_prefix = live_server.url + + with patch("sentry.auth.system.is_internal_ip", return_value=True), self.options( + {"system.url-prefix": new_prefix} + ): + # Run test case: + yield + def get_event(self, event_id): return eventstore.get_event_by_id(self.project.id, event_id) @@ -96,10 +108,7 @@ def test_real_resolving(self): assert response.status_code == 201, response.content assert len(response.data) == 1 - resp = self._postWithHeader(dict(project=self.project.id, **REAL_RESOLVING_EVENT_DATA)) - assert resp.status_code == 200 - - event = self.get_event(json.loads(resp.content)["id"]) + event = self.post_and_retrieve_event(REAL_RESOLVING_EVENT_DATA) assert event.data["culprit"] == "main" insta_snapshot_stacktrace_data(self, event.data) @@ -158,20 +167,14 @@ def test_debug_id_resolving(self): "timestamp": iso_format(before_now(seconds=1)), } - resp = self._postWithHeader(event_data) - assert resp.status_code == 200 - - event = self.get_event(json.loads(resp.content)["id"]) + event = self.post_and_retrieve_event(event_data) assert event.data["culprit"] == "main" insta_snapshot_stacktrace_data(self, event.data) def test_missing_dsym(self): self.login_as(user=self.user) - resp = self._postWithHeader(dict(project=self.project.id, **REAL_RESOLVING_EVENT_DATA)) - assert resp.status_code == 200 - - event = self.get_event(json.loads(resp.content)["id"]) + event = self.post_and_retrieve_event(REAL_RESOLVING_EVENT_DATA) assert event.data["culprit"] == "unknown" insta_snapshot_stacktrace_data(self, event.data) @@ -181,26 +184,6 @@ def test_missing_debug_images(self): payload = dict(project=self.project.id, **REAL_RESOLVING_EVENT_DATA) del payload["debug_meta"] - resp = self._postWithHeader(payload) - assert resp.status_code == 200 - - event = self.get_event(json.loads(resp.content)["id"]) + event = self.post_and_retrieve_event(payload) assert event.data["culprit"] == "unknown" insta_snapshot_stacktrace_data(self, event.data) - - -@override_settings(ALLOWED_HOSTS=["localhost", "testserver", "host.docker.internal"]) -class SymbolicatorResolvingIntegrationTest(ResolvingIntegrationTestBase, TransactionTestCase): - # For these tests to run, write `symbolicator.enabled: true` into your - # `~/.sentry/config.yml` and run `sentry devservices up` - - @pytest.fixture(autouse=True) - def initialize(self, live_server): - self.project.update_option("sentry:builtin_symbol_sources", []) - new_prefix = live_server.url - - with patch("sentry.auth.system.is_internal_ip", return_value=True), self.options( - {"system.url-prefix": new_prefix} - ): - # Run test case: - yield diff --git a/tests/symbolicator/test_unreal_full.py b/tests/symbolicator/test_unreal_full.py index be0cf5ac683903..5a6cf0ba9e28de 100644 --- a/tests/symbolicator/test_unreal_full.py +++ b/tests/symbolicator/test_unreal_full.py @@ -8,11 +8,9 @@ from django.core.urlresolvers import reverse from django.core.files.uploadedfile import SimpleUploadedFile -from django.test import override_settings -from sentry.testutils import TransactionTestCase +from sentry.testutils import TransactionTestCase, RelayStoreHelper from sentry.models import EventAttachment -from sentry import eventstore from sentry.lang.native.utils import STORE_CRASH_REPORTS_ALL from tests.symbolicator import get_fixture_path @@ -31,8 +29,7 @@ def get_unreal_crash_apple_file(): return get_fixture_path("unreal_crash_apple") -@override_settings(ALLOWED_HOSTS=["localhost", "testserver", "host.docker.internal"]) -class SymbolicatorUnrealIntegrationTest(TransactionTestCase): +class SymbolicatorUnrealIntegrationTest(RelayStoreHelper, TransactionTestCase): # For these tests to run, write `symbolicator.enabled: true` into your # `~/.sentry/config.yml` and run `sentry devservices up` @@ -83,11 +80,7 @@ def unreal_crash_test_impl(self, filename): # attachments feature has to be on for the files extract stick around with self.feature("organizations:event-attachments"): with open(filename, "rb") as f: - resp = self._postUnrealWithHeader(f.read()) - assert resp.status_code == 200 - event_id = resp.content - - event = eventstore.get_event_by_id(self.project.id, event_id) + event = self.post_and_retrieve_unreal(f.read()) self.insta_snapshot( { @@ -107,7 +100,7 @@ def test_unreal_crash_with_attachments(self): context, config, minidump, log = attachments assert context.name == "CrashContext.runtime-xml" - assert context.file.type == "event.attachment" + assert context.file.type == "unreal.context" assert context.file.checksum == "835d3e10db5d1799dc625132c819c047261ddcfb" assert config.name == "CrashReportClient.ini" @@ -119,7 +112,7 @@ def test_unreal_crash_with_attachments(self): assert minidump.file.checksum == "089d9fd3b5c0cc4426339ab46ec3835e4be83c0f" assert log.name == "YetAnother.log" # Log file is named after the project - assert log.file.type == "event.attachment" + assert log.file.type == "unreal.logs" assert log.file.checksum == "24d1c5f75334cd0912cc2670168d593d5fe6c081" def test_unreal_apple_crash_with_attachments(self): @@ -129,7 +122,7 @@ def test_unreal_apple_crash_with_attachments(self): context, config, diagnostics, log, info, minidump = attachments assert context.name == "CrashContext.runtime-xml" - assert context.file.type == "event.attachment" + assert context.file.type == "unreal.context" assert context.file.checksum == "5d2723a7d25111645702fcbbcb8e1d038db56c6e" assert config.name == "CrashReportClient.ini" @@ -141,7 +134,7 @@ def test_unreal_apple_crash_with_attachments(self): assert diagnostics.file.checksum == "aa271bf4e307a78005410234081945352e8fb236" assert log.name == "YetAnotherMac.log" # Log file is named after the project - assert log.file.type == "event.attachment" + assert log.file.type == "unreal.logs" assert log.file.checksum == "735e751a8b6b943dbc0abce0e6d096f4d48a0c1e" assert info.name == "info.txt"
be0f10bfb9160244f987c8e2d535cac0469cfcf0
2022-09-13 00:09:22
anthony sottile
ref: unskip sentry_sdk mypy exclude and fix errors (#38678)
false
unskip sentry_sdk mypy exclude and fix errors (#38678)
ref
diff --git a/mypy.ini b/mypy.ini index 51f063ef764161..6040d5a24adc6d 100644 --- a/mypy.ini +++ b/mypy.ini @@ -189,9 +189,5 @@ ignore_missing_imports = True ignore_missing_imports = True # TODO: these cause type errors when followed -[mypy-sentry_sdk] -follow_imports = skip -[mypy-sentry_sdk.tracing] -follow_imports = skip [mypy-snuba_sdk.*] follow_imports = skip diff --git a/src/sentry/integrations/github/client.py b/src/sentry/integrations/github/client.py index 65edb84e12a8e4..6ebda72a3887f2 100644 --- a/src/sentry/integrations/github/client.py +++ b/src/sentry/integrations/github/client.py @@ -87,13 +87,13 @@ def get_with_pagination(self, path: str, *args: Any, **kwargs: Any) -> Sequence[ own URL. https://docs.github.com/en/rest/guides/traversing-with-pagination """ - try: - with sentry_sdk.configure_scope() as scope: + with sentry_sdk.configure_scope() as scope: + if scope.span is not None: parent_span_id = scope.span.span_id trace_id = scope.span.trace_id - except AttributeError: - parent_span_id = None - trace_id = None + else: + parent_span_id = None + trace_id = None with sentry_sdk.start_transaction( op=f"{self.integration_type}.http.pagination", diff --git a/src/sentry/integrations/slack/client.py b/src/sentry/integrations/slack/client.py index a247435b79910b..53f5ababfa3af6 100644 --- a/src/sentry/integrations/slack/client.py +++ b/src/sentry/integrations/slack/client.py @@ -27,7 +27,7 @@ def track_response_data( try: span.set_http_status(int(code)) except ValueError: - span.set_status(code) + span.set_status(str(code)) span.set_tag("integration", "slack") diff --git a/src/sentry/shared_integrations/client/base.py b/src/sentry/shared_integrations/client/base.py index d05842b1dd8eca..813aeccee24ccb 100644 --- a/src/sentry/shared_integrations/client/base.py +++ b/src/sentry/shared_integrations/client/base.py @@ -101,13 +101,13 @@ def _request( tags={str(self.integration_type): self.name}, ) - try: - with sentry_sdk.configure_scope() as scope: - parent_span_id = scope.span.span_id - trace_id = scope.span.trace_id - except AttributeError: - parent_span_id = None - trace_id = None + with sentry_sdk.configure_scope() as scope: + if scope.span is not None: + parent_span_id: str | None = scope.span.span_id + trace_id: str | None = scope.span.trace_id + else: + parent_span_id = None + trace_id = None with sentry_sdk.start_transaction( op=f"{self.integration_type}.http", diff --git a/src/sentry/shared_integrations/client/internal.py b/src/sentry/shared_integrations/client/internal.py index 7b88a7debb236a..2b60c22465161f 100644 --- a/src/sentry/shared_integrations/client/internal.py +++ b/src/sentry/shared_integrations/client/internal.py @@ -25,13 +25,13 @@ def request(self, *args: Any, **kwargs: Any) -> Response: tags={str(self.integration_type): self.name}, ) - try: - with sentry_sdk.configure_scope() as scope: - parent_span_id = scope.span.span_id - trace_id = scope.span.trace_id - except AttributeError: - parent_span_id = None - trace_id = None + with sentry_sdk.configure_scope() as scope: + if scope.span is not None: + parent_span_id: str | None = scope.span.span_id + trace_id: str | None = scope.span.trace_id + else: + parent_span_id = None + trace_id = None with sentry_sdk.start_transaction( op=f"{self.integration_type}.http",
5f9cc9db9fdf57b0d1157bda774f6f98eb919c69
2023-06-22 01:21:17
Cathy Teng
feat(github-comments): hit github API to get PR from branch commit (#51300)
false
hit github API to get PR from branch commit (#51300)
feat
diff --git a/src/sentry/integrations/github/client.py b/src/sentry/integrations/github/client.py index f46926d29e5892..ea2d65e6ea407a 100644 --- a/src/sentry/integrations/github/client.py +++ b/src/sentry/integrations/github/client.py @@ -217,6 +217,13 @@ def get_commit(self, repo: str, sha: str) -> JSONData: commit: JSONData = self.get_cached(f"/repos/{repo}/commits/{sha}") return commit + def get_pullrequest_from_commit(self, repo: str, sha: str) -> JSONData: + """ + https://docs.github.com/en/rest/commits/commits#list-pull-requests-associated-with-a-commit + """ + pullrequest: JSONData = self.get(f"/repos/{repo}/commits/{sha}/pulls") + return pullrequest + def get_repo(self, repo: str) -> JSONData: """ https://docs.github.com/en/rest/repos/repos#get-a-repository diff --git a/src/sentry/integrations/utils/commit_context.py b/src/sentry/integrations/utils/commit_context.py index 7af4a03181cd9c..8ecdaf95fe93b2 100644 --- a/src/sentry/integrations/utils/commit_context.py +++ b/src/sentry/integrations/utils/commit_context.py @@ -25,6 +25,7 @@ def find_commit_context_for_event( frame: Event frame """ result = [] + installation = None for code_mapping in code_mappings: if not code_mapping.organization_integration_id: logger.info( @@ -77,6 +78,8 @@ def find_commit_context_for_event( install = integration_service.get_installation( integration=integration, organization_id=code_mapping.organization_id ) + if installation is None and install is not None: + installation = install try: commit_context = install.get_commit_context( code_mapping.repository, src_path, code_mapping.default_branch, frame @@ -107,4 +110,4 @@ def find_commit_context_for_event( if commit_context: result.append((commit_context, code_mapping)) - return result + return result, installation diff --git a/src/sentry/tasks/commit_context.py b/src/sentry/tasks/commit_context.py index 043f9cf90041d9..8d7aecac37e0e2 100644 --- a/src/sentry/tasks/commit_context.py +++ b/src/sentry/tasks/commit_context.py @@ -7,6 +7,7 @@ from sentry import analytics, features from sentry.api.serializers.models.release import get_users_for_authors +from sentry.integrations.base import IntegrationInstallation from sentry.integrations.utils.commit_context import find_commit_context_for_event from sentry.locks import locks from sentry.models import ( @@ -33,7 +34,9 @@ logger = logging.getLogger(__name__) -def queue_comment_task_if_needed(commit: Commit, group_owner: GroupOwner): +def queue_comment_task_if_needed( + commit: Commit, group_owner: GroupOwner, repo: Repository, installation: IntegrationInstallation +): from sentry.tasks.integrations.github.pr_comment import comment_workflow logger.info( @@ -41,15 +44,22 @@ def queue_comment_task_if_needed(commit: Commit, group_owner: GroupOwner): extra={"organization_id": commit.organization_id, "merge_commit_sha": commit.key}, ) + response = installation.get_client().get_pullrequest_from_commit(repo=repo.name, sha=commit.key) + + if not (response.status_code == 200 and isinstance(response, list) and len(response) == 1): + # the response should return a single PR, return if multiple + return + pr_query = PullRequest.objects.filter( - organization_id=commit.organization_id, merge_commit_sha=commit.key + organization_id=commit.organization_id, merge_commit_sha=response[0]["merge_commit_sha"] ) if not pr_query.exists(): logger.info( "github.pr_comment.queue_comment_task_missing_pr", - extra={"organization_id": commit.organization_id, "merge_commit_sha": commit.key}, + extra={"organization_id": commit.organization_id, "suspect_commit_sha": commit.key}, ) return + pr = pr_query.get() if pr.date_added >= datetime.now(tz=timezone.utc) - timedelta(days=30) and ( not pr.pullrequestcomment_set.exists() @@ -184,7 +194,7 @@ def process_commit_context( ) return - found_contexts = find_commit_context_for_event( + found_contexts, installation = find_commit_context_for_event( code_mappings=code_mappings, frame=frame, extra={ @@ -314,8 +324,12 @@ def process_commit_context( extra={"organization_id": project.organization_id}, ) repo = Repository.objects.filter(id=commit.repository_id) - if repo.exists() and repo.get().provider == "integrations:github": - queue_comment_task_if_needed(commit, group_owner) + if ( + installation is not None + and repo.exists() + and repo.get().provider == "integrations:github" + ): + queue_comment_task_if_needed(commit, group_owner, repo.get(), installation) else: logger.info( "github.pr_comment.incorrect_repo_config", diff --git a/tests/sentry/tasks/test_commit_context.py b/tests/sentry/tasks/test_commit_context.py index 91e4c4f9ba960e..3e1130852f195f 100644 --- a/tests/sentry/tasks/test_commit_context.py +++ b/tests/sentry/tasks/test_commit_context.py @@ -2,15 +2,19 @@ from unittest.mock import Mock, patch import pytest +import responses from celery.exceptions import MaxRetriesExceededError from django.utils import timezone +from sentry.integrations.github.integration import GitHubIntegrationProvider from sentry.models import PullRequest, PullRequestComment, Repository from sentry.models.commit import Commit from sentry.models.groupowner import GroupOwner, GroupOwnerType from sentry.shared_integrations.exceptions.base import ApiError +from sentry.snuba.sessions_v2 import isoformat_z from sentry.tasks.commit_context import process_commit_context from sentry.testutils import TestCase +from sentry.testutils.cases import IntegrationTestCase from sentry.testutils.helpers import with_feature from sentry.testutils.helpers.datetime import before_now, iso_format from sentry.testutils.silo import region_silo_test @@ -427,11 +431,14 @@ def after_return(self, status, retval, task_id, args, kwargs, einfo): ), ) @patch("sentry.tasks.integrations.github.pr_comment.comment_workflow.delay") -class TestGHCommentQueuing(TestCommitContextMixin): +class TestGHCommentQueuing(IntegrationTestCase, TestCommitContextMixin): + provider = GitHubIntegrationProvider + base_url = "https://api.github.com" + def setUp(self): super().setUp() self.pull_request = PullRequest.objects.create( - organization_id=self.organization.id, + organization_id=self.commit.organization_id, repository_id=self.repo.id, key="99", author=self.commit.author, @@ -449,6 +456,24 @@ def setUp(self): updated_at=iso_format(before_now(days=1)), group_ids=[], ) + self.installation_id = "github:1" + self.user_id = "user_1" + self.app_id = "app_1" + self.access_token = "xxxxx-xxxxxxxxx-xxxxxxxxxx-xxxxxxxxxxxx" + self.expires_at = isoformat_z(timezone.now() + timedelta(days=365)) + + def add_responses(self): + responses.add( + responses.POST, + self.base_url + f"/app/installations/{self.installation_id}/access_tokens", + json={"token": self.access_token, "expires_at": self.expires_at}, + ) + responses.add( + responses.GET, + self.base_url + f"/repos/example/commits/{self.commit.key}/pulls", + status=200, + json=[{"merge_commit_sha": self.pull_request.merge_commit_sha}], + ) @with_feature("organizations:pr-comment-bot") def test_gh_comment_not_github(self, mock_comment_workflow): @@ -480,9 +505,24 @@ def test_gh_comment_feature_flag(self, mock_comment_workflow): assert not mock_comment_workflow.called @with_feature("organizations:pr-comment-bot") - def test_gh_comment_no_pr(self, mock_comment_workflow): + @patch("sentry.integrations.github.client.get_jwt", return_value=b"jwt_token_1") + @responses.activate + def test_gh_comment_no_pr(self, get_jwt, mock_comment_workflow): """No comments on suspect commit with no pr""" self.pull_request.delete() + + responses.add( + responses.POST, + self.base_url + f"/app/installations/{self.installation_id}/access_tokens", + json={"token": self.access_token, "expires_at": self.expires_at}, + ) + responses.add( + responses.GET, + self.base_url + f"/repos/example/commits/{self.commit.key}/pulls", + status=200, + json={"message": "No commit found for SHA"}, + ) + with self.tasks(): event_frames = get_frame_paths(self.event) process_commit_context( @@ -501,11 +541,15 @@ def test_gh_comment_org_settings(self, mock_comment_workflow): pass @with_feature("organizations:pr-comment-bot") - def test_gh_comment_pr_too_old(self, mock_comment_workflow): + @patch("sentry.integrations.github.client.get_jwt", return_value=b"jwt_token_1") + @responses.activate + def test_gh_comment_pr_too_old(self, get_jwt, mock_comment_workflow): """No comment on pr that's older than 30 days""" self.pull_request.date_added = iso_format(before_now(days=31)) self.pull_request.save() + self.add_responses() + with self.tasks(): event_frames = get_frame_paths(self.event) process_commit_context( @@ -518,11 +562,15 @@ def test_gh_comment_pr_too_old(self, mock_comment_workflow): assert not mock_comment_workflow.called @with_feature("organizations:pr-comment-bot") - def test_gh_comment_repeat_issue(self, mock_comment_workflow): + @patch("sentry.integrations.github.client.get_jwt", return_value=b"jwt_token_1") + @responses.activate + def test_gh_comment_repeat_issue(self, get_jwt, mock_comment_workflow): """No comment on a pr that has a comment with the issue in the same pr list""" self.pull_request_comment.group_ids.append(self.event.group_id) self.pull_request_comment.save() + self.add_responses() + with self.tasks(): event_frames = get_frame_paths(self.event) process_commit_context( @@ -535,10 +583,14 @@ def test_gh_comment_repeat_issue(self, mock_comment_workflow): assert not mock_comment_workflow.called @with_feature("organizations:pr-comment-bot") - def test_gh_comment_create_queued(self, mock_comment_workflow): + @patch("sentry.integrations.github.client.get_jwt", return_value=b"jwt_token_1") + @responses.activate + def test_gh_comment_create_queued(self, get_jwt, mock_comment_workflow): """Task queued if no prior comment exists""" self.pull_request_comment.delete() + self.add_responses() + with self.tasks(): event_frames = get_frame_paths(self.event) process_commit_context( @@ -551,9 +603,13 @@ def test_gh_comment_create_queued(self, mock_comment_workflow): assert mock_comment_workflow.called @with_feature("organizations:pr-comment-bot") - def test_gh_comment_update_queue(self, mock_comment_workflow): + @patch("sentry.integrations.github.client.get_jwt", return_value=b"jwt_token_1") + @responses.activate + def test_gh_comment_update_queue(self, get_jwt, mock_comment_workflow): """Task queued if new issue for prior comment""" + self.add_responses() + with self.tasks(): assert not GroupOwner.objects.filter(group=self.event.group).exists() event_frames = get_frame_paths(self.event)
107dc593253e9599a569b4dcc3afb737088ed344
2024-02-29 22:46:47
Cathy Teng
chore(ui): remove UI for org roles from team (#66061)
false
remove UI for org roles from team (#66061)
chore
diff --git a/static/app/views/settings/components/teamSelect/teamSelectForMember.tsx b/static/app/views/settings/components/teamSelect/teamSelectForMember.tsx index 176167e7fd1b53..af1d5e9002e670 100644 --- a/static/app/views/settings/components/teamSelect/teamSelectForMember.tsx +++ b/static/app/views/settings/components/teamSelect/teamSelectForMember.tsx @@ -138,11 +138,10 @@ function TeamRow({ organization: Organization; team: Team; }) { - const hasOrgAdmin = organization.access.includes('org:admin'); const isIdpProvisioned = team.flags['idp:provisioned']; - const isRemoveDisabled = disabled || isIdpProvisioned || !hasOrgAdmin; + const isRemoveDisabled = disabled || isIdpProvisioned; - const buttonHelpText = getButtonHelpText(isIdpProvisioned, !hasOrgAdmin); + const buttonHelpText = getButtonHelpText(isIdpProvisioned); return ( <TeamPanelItem data-test-id="team-row-for-member"> diff --git a/static/app/views/settings/components/teamSelect/utils.tsx b/static/app/views/settings/components/teamSelect/utils.tsx index f4fd48b20abd21..9d236d2fe55ad8 100644 --- a/static/app/views/settings/components/teamSelect/utils.tsx +++ b/static/app/views/settings/components/teamSelect/utils.tsx @@ -72,7 +72,6 @@ export function DropdownAddTeam({ renderDropdownOption({ isAddingTeamToMember, isAddingTeamToProject, - organization, team, index, disabled, @@ -112,27 +111,23 @@ function renderDropdownOption({ disabled, index, isAddingTeamToMember, - organization, team, }: { disabled: boolean; index: number; isAddingTeamToMember: boolean; isAddingTeamToProject: boolean; - organization: Organization; team: Team; }) { - const hasOrgAdmin = organization.access.includes('org:admin'); const isIdpProvisioned = isAddingTeamToMember && team.flags['idp:provisioned']; - const isPermissionGroup = isAddingTeamToMember && !hasOrgAdmin; - const buttonHelpText = getButtonHelpText(isIdpProvisioned, isPermissionGroup); + const buttonHelpText = getButtonHelpText(isIdpProvisioned); return { index, value: team.slug, searchKey: team.slug, label: () => { - if (isIdpProvisioned || isPermissionGroup) { + if (isIdpProvisioned) { return ( <Tooltip title={buttonHelpText}> <DropdownTeamBadgeDisabled avatarSize={18} team={team} /> @@ -142,7 +137,7 @@ function renderDropdownOption({ return <DropdownTeamBadge avatarSize={18} team={team} />; }, - disabled: disabled || isIdpProvisioned || isPermissionGroup, + disabled: disabled || isIdpProvisioned, }; } diff --git a/static/app/views/settings/organizationTeams/allTeamsRow.tsx b/static/app/views/settings/organizationTeams/allTeamsRow.tsx index 111190e6eda36a..5761076f2983b0 100644 --- a/static/app/views/settings/organizationTeams/allTeamsRow.tsx +++ b/static/app/views/settings/organizationTeams/allTeamsRow.tsx @@ -176,17 +176,13 @@ class AllTeamsRow extends Component<Props, State> { render() { const {team, openMembership, organization} = this.props; - const {access} = organization; const urlPrefix = `/settings/${organization.slug}/teams/`; - const canEditTeam = access.includes('org:write') || access.includes('team:admin'); // TODO(team-roles): team admins can also manage membership // org:admin is a unique scope that only org owners have - const isOrgOwner = access.includes('org:admin'); - const isPermissionGroup = !canEditTeam || !isOrgOwner; const isIdpProvisioned = team.flags['idp:provisioned']; - const buttonHelpText = getButtonHelpText(isIdpProvisioned, isPermissionGroup); + const buttonHelpText = getButtonHelpText(isIdpProvisioned); const display = ( <IdBadge @@ -201,7 +197,7 @@ class AllTeamsRow extends Component<Props, State> { const canViewTeam = team.hasAccess; const teamRoleName = this.getTeamRoleName(); - const isDisabled = isIdpProvisioned || isPermissionGroup; + const isDisabled = isIdpProvisioned; return ( <TeamPanelItem> diff --git a/static/app/views/settings/organizationTeams/teamMembers.tsx b/static/app/views/settings/organizationTeams/teamMembers.tsx index fc922b1b7550a7..da0d15c27d2bd9 100644 --- a/static/app/views/settings/organizationTeams/teamMembers.tsx +++ b/static/app/views/settings/organizationTeams/teamMembers.tsx @@ -310,10 +310,7 @@ class TeamMembers extends DeprecatedAsyncView<Props, State> { renderMembers(isTeamAdmin: boolean) { const {config, organization, team} = this.props; - const {access} = organization; - // org:admin is a unique scope that only org owners have - const isOrgOwner = access.includes('org:admin'); const {teamMembers, loading} = this.state; if (loading) { @@ -325,7 +322,6 @@ class TeamMembers extends DeprecatedAsyncView<Props, State> { <TeamMembersRow key={member.id} hasWriteAccess={isTeamAdmin} - isOrgOwner={isOrgOwner} organization={organization} team={team} member={member} diff --git a/static/app/views/settings/organizationTeams/teamMembersRow.tsx b/static/app/views/settings/organizationTeams/teamMembersRow.tsx index d683ffb5a287d9..e947b82344ba74 100644 --- a/static/app/views/settings/organizationTeams/teamMembersRow.tsx +++ b/static/app/views/settings/organizationTeams/teamMembersRow.tsx @@ -12,7 +12,6 @@ import {getButtonHelpText} from 'sentry/views/settings/organizationTeams/utils'; interface Props { hasWriteAccess: boolean; - isOrgOwner: boolean; member: TeamMember; organization: Organization; removeMember: (member: Member) => void; @@ -27,7 +26,6 @@ function TeamMembersRow({ member, user, hasWriteAccess, - isOrgOwner, removeMember, updateMemberRole, }: Props) { @@ -50,7 +48,6 @@ function TeamMembersRow({ <div> <RemoveButton hasWriteAccess={hasWriteAccess} - isOrgOwner={isOrgOwner} isSelf={isSelf} onClick={() => removeMember(member)} member={member} @@ -62,12 +59,11 @@ function TeamMembersRow({ function RemoveButton(props: { hasWriteAccess: boolean; - isOrgOwner: boolean; isSelf: boolean; member: TeamMember; onClick: () => void; }) { - const {member, hasWriteAccess, isOrgOwner, isSelf, onClick} = props; + const {member, hasWriteAccess, isSelf, onClick} = props; const canRemoveMember = hasWriteAccess || isSelf; if (!canRemoveMember) { @@ -85,7 +81,7 @@ function RemoveButton(props: { } const isIdpProvisioned = member.flags['idp:provisioned']; - const buttonHelpText = getButtonHelpText(isIdpProvisioned, !isOrgOwner); + const buttonHelpText = getButtonHelpText(isIdpProvisioned); const buttonRemoveText = isSelf ? t('Leave') : t('Remove'); return ( diff --git a/static/app/views/settings/organizationTeams/utils.tsx b/static/app/views/settings/organizationTeams/utils.tsx index 689c21f83ae5e8..e6cd6bc7f474b5 100644 --- a/static/app/views/settings/organizationTeams/utils.tsx +++ b/static/app/views/settings/organizationTeams/utils.tsx @@ -1,18 +1,11 @@ import {t} from 'sentry/locale'; -export function getButtonHelpText( - isIdpProvisioned: boolean = false, - isPermissionGroup: boolean = false -) { +export function getButtonHelpText(isIdpProvisioned: boolean = false) { if (isIdpProvisioned) { return t( "Membership to this team is managed through your organization's identity provider." ); } - if (isPermissionGroup) { - return t('Membership to a team with an organization role is managed by org owners.'); - } - return undefined; }
8d6e0ecb3dc65d5cc9f9f684a108a1b2145a64a1
2025-03-13 00:05:57
Alexander Tarasov
fix(integrations): validate new project on code mappings update (#86775)
false
validate new project on code mappings update (#86775)
fix
diff --git a/src/sentry/integrations/api/endpoints/organization_code_mapping_details.py b/src/sentry/integrations/api/endpoints/organization_code_mapping_details.py index 573ac320ff69a5..c3743693367ed6 100644 --- a/src/sentry/integrations/api/endpoints/organization_code_mapping_details.py +++ b/src/sentry/integrations/api/endpoints/organization_code_mapping_details.py @@ -45,9 +45,14 @@ def convert_args(self, request: Request, organization_id_or_slug, config_id, *ar except RepositoryProjectPathConfig.DoesNotExist: raise Http404 + if request.data.get("projectId"): + kwargs["new_project"] = super().get_project( + kwargs["organization"], request.data.get("projectId") + ) + return (args, kwargs) - def put(self, request: Request, config_id, organization, config) -> Response: + def put(self, request: Request, config_id, organization, config, new_project) -> Response: """ Update a repository project path config `````````````````` @@ -61,7 +66,7 @@ def put(self, request: Request, config_id, organization, config) -> Response: :param string default_branch: :auth: required """ - if not request.access.has_project_access(config.project): + if not request.access.has_projects_access([config.project, new_project]): return self.respond(status=status.HTTP_403_FORBIDDEN) try: diff --git a/tests/sentry/integrations/api/endpoints/test_organization_code_mapping_details.py b/tests/sentry/integrations/api/endpoints/test_organization_code_mapping_details.py index f767a8b9949f08..67b30ecc77cb8a 100644 --- a/tests/sentry/integrations/api/endpoints/test_organization_code_mapping_details.py +++ b/tests/sentry/integrations/api/endpoints/test_organization_code_mapping_details.py @@ -30,6 +30,7 @@ def setUp(self): teams=[self.team, self.team2], ) self.project = self.create_project(organization=self.org, teams=[self.team], name="Bengal") + self.project2 = self.create_project(organization=self.org, teams=[self.team2], name="Tiger") self.integration, self.org_integration = self.create_provider_integration_for( self.org, self.user, provider="github", name="Example", external_id="abcd" ) @@ -73,6 +74,9 @@ def test_non_project_member_permissions(self): self.create_team_membership(team=self.team, member=non_member_om) + response = self.make_put({"projectId": self.project2.id, "sourceRoot": "newRoot"}) + assert response.status_code == status.HTTP_403_FORBIDDEN + response = self.make_put({"sourceRoot": "newRoot"}) assert response.status_code == status.HTTP_200_OK
7c5630292eaea8250584c2c6fa4325806cc8988c
2022-09-30 00:40:44
Elias Hussary
feat(profiling): add discord link to feedback modal (#39461)
false
add discord link to feedback modal (#39461)
feat
diff --git a/static/app/components/featureFeedback/feedbackModal.spec.tsx b/static/app/components/featureFeedback/feedbackModal.spec.tsx index 954a0e3749c40b..733fe90592077b 100644 --- a/static/app/components/featureFeedback/feedbackModal.spec.tsx +++ b/static/app/components/featureFeedback/feedbackModal.spec.tsx @@ -102,6 +102,28 @@ describe('FeatureFeedback', function () { // Close modal userEvent.click(screen.getByRole('button', {name: 'Cancel'})); }); + + it('renders an arbitrary secondary action', function () { + render(<GlobalModal />); + + openModal(modalProps => ( + <ComponentProviders> + <FeedbackModal + {...modalProps} + featureName="test" + secondaryAction={<a href="#">Test Secondary Action Link</a>} + /> + </ComponentProviders> + )); + + userEvent.click(screen.getByText('Select type of feedback')); + + // Available feedback types + expect(screen.getByText('Test Secondary Action Link')).toBeInTheDocument(); + + // Close modal + userEvent.click(screen.getByRole('button', {name: 'Cancel'})); + }); }); describe('custom', function () { diff --git a/static/app/components/featureFeedback/feedbackModal.tsx b/static/app/components/featureFeedback/feedbackModal.tsx index d79a7717bf5259..24eb14e1e3e0c6 100644 --- a/static/app/components/featureFeedback/feedbackModal.tsx +++ b/static/app/components/featureFeedback/feedbackModal.tsx @@ -1,4 +1,4 @@ -import {Fragment, useCallback, useMemo, useState} from 'react'; +import React, {Fragment, useCallback, useMemo, useState} from 'react'; import {css, useTheme} from '@emotion/react'; import styled from '@emotion/styled'; import { @@ -53,6 +53,7 @@ export type ChildrenProps<T> = { onBack?: () => void; onNext?: () => void; primaryDisabledReason?: string; + secondaryAction?: React.ReactNode; submitEventData?: Event; }) => ReturnType<ModalRenderProps['Footer']>; Header: (props: {children: React.ReactNode}) => ReturnType<ModalRenderProps['Header']>; @@ -70,6 +71,7 @@ type DefaultFeedbackModal = { featureName: string; children?: undefined; feedbackTypes?: string[]; + secondaryAction?: React.ReactNode; }; export type FeedbackModalProps<T extends Data> = @@ -169,9 +171,13 @@ export function FeedbackModal<T extends Data>({ onNext, submitEventData, primaryDisabledReason, + secondaryAction, }: Parameters<ChildrenProps<T>['Footer']>[0]) => { return ( <Footer> + {secondaryAction && ( + <SecondaryActionWrapper>{secondaryAction}</SecondaryActionWrapper> + )} {onBack && ( <BackButtonWrapper> <Button onClick={onBack}>{t('Back')}</Button> @@ -278,7 +284,7 @@ export function FeedbackModal<T extends Data>({ /> </Field> </ModalBody> - <ModalFooter /> + <ModalFooter secondaryAction={props?.secondaryAction} /> </Fragment> ); } @@ -305,3 +311,8 @@ const BackButtonWrapper = styled('div')` margin-right: ${space(1)}; width: 100%; `; + +const SecondaryActionWrapper = styled('div')` + flex: 1; + align-self: center; +`; diff --git a/static/app/components/featureFeedback/index.spec.tsx b/static/app/components/featureFeedback/index.spec.tsx index 3922ee4a9efc3f..4feb19f70a4375 100644 --- a/static/app/components/featureFeedback/index.spec.tsx +++ b/static/app/components/featureFeedback/index.spec.tsx @@ -44,6 +44,26 @@ describe('FeatureFeedback', function () { expect(screen.getByRole('button', {name: 'Submit Feedback'})).toBeInTheDocument(); }); + it('shows the modal on click with custom "onClick" handler', async function () { + const mockOnClick = jest.fn(); + render( + <ComponentProviders> + <FeatureFeedback + featureName="test" + buttonProps={{ + onClick: mockOnClick, + }} + /> + </ComponentProviders> + ); + + userEvent.click(screen.getByText('Give Feedback')); + + expect(await screen.findByText('Select type of feedback')).toBeInTheDocument(); + + expect(mockOnClick).toHaveBeenCalled(); + }); + it('Close modal on click', async function () { render( <ComponentProviders> diff --git a/static/app/components/featureFeedback/index.tsx b/static/app/components/featureFeedback/index.tsx index e1b781727f84c8..d03e98bd48170b 100644 --- a/static/app/components/featureFeedback/index.tsx +++ b/static/app/components/featureFeedback/index.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import {openModal} from 'sentry/actionCreators/modal'; import Button, {ButtonProps} from 'sentry/components/button'; import { @@ -11,6 +13,7 @@ import {t} from 'sentry/locale'; export type FeatureFeedbackProps<T extends Data> = FeedbackModalProps<T> & { buttonProps?: Partial<ButtonProps>; + secondaryAction?: React.ReactNode; }; // Provides a button that, when clicked, opens a modal with a form that, @@ -19,14 +22,18 @@ export function FeatureFeedback<T extends Data>({ buttonProps = {}, ...props }: FeatureFeedbackProps<T>) { - function handleClick() { + const {onClick, ..._buttonProps} = buttonProps; + function handleClick(e: React.MouseEvent) { openModal(modalProps => <FeedbackModal {...modalProps} {...props} />, { modalCss, }); + if (onClick) { + onClick(e); + } } return ( - <Button icon={<IconMegaphone />} onClick={handleClick} {...buttonProps}> + <Button icon={<IconMegaphone />} onClick={handleClick} {..._buttonProps}> {t('Give Feedback')} </Button> ); diff --git a/static/app/utils/analytics/profilingAnalyticsEvents.tsx b/static/app/utils/analytics/profilingAnalyticsEvents.tsx index 22d7e9b687476f..1a25d3c49c1e18 100644 --- a/static/app/utils/analytics/profilingAnalyticsEvents.tsx +++ b/static/app/utils/analytics/profilingAnalyticsEvents.tsx @@ -1,4 +1,5 @@ export type ProfilingEventParameters = { + 'profiling_views.give_feedback_action': {}; 'profiling_views.go_to_flamegraph': {source: string}; 'profiling_views.go_to_transaction': {source: string}; 'profiling_views.landing': {}; @@ -9,6 +10,7 @@ export type ProfilingEventParameters = { 'profiling_views.profile_details': {}; 'profiling_views.profile_flamegraph': {}; 'profiling_views.profile_summary': {}; + 'profiling_views.visit_discord_channel': {}; }; type EventKey = keyof ProfilingEventParameters; @@ -22,4 +24,6 @@ export const profilingEventMap: Record<EventKey, string> = { 'profiling_views.go_to_flamegraph': 'Profiling Views: Go to Flamegraph', 'profiling_views.go_to_transaction': 'Profiling Views: Go to Transaction', 'profiling_views.onboarding_action': 'Profiling Actions: Onboarding Action', + 'profiling_views.give_feedback_action': 'Profiling Actions: Feedback Action', + 'profiling_views.visit_discord_channel': 'Profiling Actions: Visit Discord Channel', }; diff --git a/static/app/views/profiling/content.tsx b/static/app/views/profiling/content.tsx index 41d8f6240d2838..dc07e5bd98a463 100644 --- a/static/app/views/profiling/content.tsx +++ b/static/app/views/profiling/content.tsx @@ -144,7 +144,37 @@ function ProfilingContent({location, router}: ProfilingContentProps) { <StyledHeading>{t('Profiling')}</StyledHeading> <HeadingActions> <Button onClick={onSetupProfilingClick}>{t('Set Up Profiling')}</Button> - <FeatureFeedback featureName="profiling" /> + <FeatureFeedback + buttonProps={{ + priority: 'primary', + onClick: () => { + trackAdvancedAnalyticsEvent( + 'profiling_views.give_feedback_action', + { + organization, + } + ); + }, + }} + featureName="profiling" + secondaryAction={ + <Button + priority="link" + href="https://discord.gg/zrMjKA4Vnz" + external + onClick={() => { + trackAdvancedAnalyticsEvent( + 'profiling_views.visit_discord_channel', + { + organization, + } + ); + }} + > + {t('Visit Discord Channel')} + </Button> + } + /> </HeadingActions> </StyledLayoutHeaderContent> </Layout.Header>
d456c946af86713faa16f575c7c1deb381a0e22b
2024-03-18 23:43:00
George Gritsouk
ref(perf): Accept `MutableQuery` in data loading hooks (#67080)
false
Accept `MutableQuery` in data loading hooks (#67080)
ref
diff --git a/static/app/views/performance/browser/resources/resourceSummaryPage/index.tsx b/static/app/views/performance/browser/resources/resourceSummaryPage/index.tsx index b7a5addcb0890c..4726b69374e8a5 100644 --- a/static/app/views/performance/browser/resources/resourceSummaryPage/index.tsx +++ b/static/app/views/performance/browser/resources/resourceSummaryPage/index.tsx @@ -8,6 +8,7 @@ import {EnvironmentPageFilter} from 'sentry/components/organizations/environment import PageFilterBar from 'sentry/components/organizations/pageFilterBar'; import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter'; import {t} from 'sentry/locale'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import {useParams} from 'sentry/utils/useParams'; @@ -45,9 +46,9 @@ function ResourceSummary() { query: {transaction}, } = useLocation(); const {data} = useSpanMetrics({ - filters: { + search: MutableSearch.fromQueryObject({ 'span.group': groupId, - }, + }), fields: [ `avg(${SPAN_SELF_TIME})`, `avg(${HTTP_RESPONSE_CONTENT_LENGTH})`, diff --git a/static/app/views/performance/browser/resources/resourceSummaryPage/resourceSummaryCharts.tsx b/static/app/views/performance/browser/resources/resourceSummaryPage/resourceSummaryCharts.tsx index 25ae1d76b4df94..7fbabd966543fb 100644 --- a/static/app/views/performance/browser/resources/resourceSummaryPage/resourceSummaryCharts.tsx +++ b/static/app/views/performance/browser/resources/resourceSummaryPage/resourceSummaryCharts.tsx @@ -3,6 +3,7 @@ import type {Series} from 'sentry/types/echarts'; import {formatBytesBase2} from 'sentry/utils'; import {formatRate} from 'sentry/utils/formatters'; import getDynamicText from 'sentry/utils/getDynamicText'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {RESOURCE_THROUGHPUT_UNIT} from 'sentry/views/performance/browser/resources'; import {useResourceModuleFilters} from 'sentry/views/performance/browser/resources/utils/useResourceFilters'; import {AVG_COLOR, THROUGHPUT_COLOR} from 'sentry/views/starfish/colours'; @@ -35,12 +36,12 @@ function ResourceSummaryCharts(props: {groupId: string}) { const {data: spanMetricsSeriesData, isLoading: areSpanMetricsSeriesLoading} = useSpanMetricsSeries({ - filters: { + search: MutableSearch.fromQueryObject({ 'span.group': props.groupId, ...(filters[RESOURCE_RENDER_BLOCKING_STATUS] ? {[RESOURCE_RENDER_BLOCKING_STATUS]: filters[RESOURCE_RENDER_BLOCKING_STATUS]} : {}), - }, + }), yAxis: [ `spm()`, `avg(${SPAN_SELF_TIME})`, diff --git a/static/app/views/performance/database/databaseLandingPage.tsx b/static/app/views/performance/database/databaseLandingPage.tsx index fce703aab64425..cab7bc8c09faff 100644 --- a/static/app/views/performance/database/databaseLandingPage.tsx +++ b/static/app/views/performance/database/databaseLandingPage.tsx @@ -15,6 +15,7 @@ import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {fromSorts} from 'sentry/utils/discover/eventView'; import {decodeScalar} from 'sentry/utils/queryString'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; @@ -80,7 +81,7 @@ export function DatabaseLandingPage() { const cursor = decodeScalar(location.query?.[QueryParameterNames.SPANS_CURSOR]); const queryListResponse = useSpanMetrics({ - filters: tableFilters, + search: MutableSearch.fromQueryObject(tableFilters), fields: [ 'project.id', 'span.group', @@ -101,7 +102,7 @@ export function DatabaseLandingPage() { data: throughputData, error: throughputError, } = useSpanMetricsSeries({ - filters: chartFilters, + search: MutableSearch.fromQueryObject(chartFilters), yAxis: ['spm()'], referrer: 'api.starfish.span-landing-page-metrics-chart', }); @@ -111,7 +112,7 @@ export function DatabaseLandingPage() { data: durationData, error: durationError, } = useSpanMetricsSeries({ - filters: chartFilters, + search: MutableSearch.fromQueryObject(chartFilters), yAxis: [`${selectedAggregate}(${SpanMetricsField.SPAN_SELF_TIME})`], referrer: 'api.starfish.span-landing-page-metrics-chart', }); diff --git a/static/app/views/performance/database/databaseSpanSummaryPage.tsx b/static/app/views/performance/database/databaseSpanSummaryPage.tsx index 9b8f80a6e061eb..639a4e231f05ae 100644 --- a/static/app/views/performance/database/databaseSpanSummaryPage.tsx +++ b/static/app/views/performance/database/databaseSpanSummaryPage.tsx @@ -11,6 +11,7 @@ import PageFilterBar from 'sentry/components/organizations/pageFilterBar'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {DurationUnit, RateUnit, type Sort} from 'sentry/utils/discover/fields'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; @@ -70,7 +71,7 @@ function SpanSummaryPage({params}: Props) { const sort = useModuleSort(QueryParameterNames.ENDPOINTS_SORT, DEFAULT_SORT); const {data, isLoading: areSpanMetricsLoading} = useSpanMetrics({ - filters, + search: MutableSearch.fromQueryObject(filters), fields: [ SpanMetricsField.SPAN_OP, SpanMetricsField.SPAN_DESCRIPTION, @@ -105,7 +106,7 @@ function SpanSummaryPage({params}: Props) { data: throughputData, error: throughputError, } = useSpanMetricsSeries({ - filters, + search: MutableSearch.fromQueryObject(filters), yAxis: ['spm()'], enabled: Boolean(groupId), referrer: 'api.starfish.span-summary-page-metrics-chart', @@ -116,7 +117,7 @@ function SpanSummaryPage({params}: Props) { data: durationData, error: durationError, } = useSpanMetricsSeries({ - filters, + search: MutableSearch.fromQueryObject(filters), yAxis: [`${selectedAggregate}(${SpanMetricsField.SPAN_SELF_TIME})`], enabled: Boolean(groupId), referrer: 'api.starfish.span-summary-page-metrics-chart', diff --git a/static/app/views/performance/http/httpDomainSummaryPage.tsx b/static/app/views/performance/http/httpDomainSummaryPage.tsx index 5d0bf34d36f59f..80c5fe711741d1 100644 --- a/static/app/views/performance/http/httpDomainSummaryPage.tsx +++ b/static/app/views/performance/http/httpDomainSummaryPage.tsx @@ -12,6 +12,7 @@ import {space} from 'sentry/styles/space'; import {fromSorts} from 'sentry/utils/discover/eventView'; import {DurationUnit, RateUnit} from 'sentry/utils/discover/fields'; import {decodeScalar} from 'sentry/utils/queryString'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; @@ -57,7 +58,7 @@ export function HTTPDomainSummaryPage() { const cursor = decodeScalar(location.query?.[QueryParameterNames.TRANSACTIONS_CURSOR]); const {data: domainMetrics, isLoading: areDomainMetricsLoading} = useSpanMetrics({ - filters, + search: MutableSearch.fromQueryObject(filters), fields: [ SpanMetricsField.SPAN_DOMAIN, `${SpanFunction.SPM}()`, @@ -77,7 +78,7 @@ export function HTTPDomainSummaryPage() { data: throughputData, error: throughputError, } = useSpanMetricsSeries({ - filters, + search: MutableSearch.fromQueryObject(filters), yAxis: ['spm()'], enabled: Boolean(domain), referrer: 'api.starfish.http-module-domain-summary-throughput-chart', @@ -88,7 +89,7 @@ export function HTTPDomainSummaryPage() { data: durationData, error: durationError, } = useSpanMetricsSeries({ - filters, + search: MutableSearch.fromQueryObject(filters), yAxis: [`avg(${SpanMetricsField.SPAN_SELF_TIME})`], enabled: Boolean(domain), referrer: 'api.starfish.http-module-domain-summary-duration-chart', @@ -99,7 +100,7 @@ export function HTTPDomainSummaryPage() { data: responseCodeData, error: responseCodeError, } = useSpanMetricsSeries({ - filters: filters, + search: MutableSearch.fromQueryObject(filters), yAxis: ['http_response_rate(3)', 'http_response_rate(4)', 'http_response_rate(5)'], referrer: 'api.starfish.http-module-domain-summary-response-code-chart', }); @@ -111,7 +112,7 @@ export function HTTPDomainSummaryPage() { error: transactionsListError, pageLinks: transactionsListPageLinks, } = useSpanMetrics({ - filters, + search: MutableSearch.fromQueryObject(filters), fields: [ 'transaction', 'spm()', diff --git a/static/app/views/performance/http/httpLandingPage.tsx b/static/app/views/performance/http/httpLandingPage.tsx index 5c734ba4a501a6..f6b0216ad5888a 100644 --- a/static/app/views/performance/http/httpLandingPage.tsx +++ b/static/app/views/performance/http/httpLandingPage.tsx @@ -10,6 +10,7 @@ import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilt import {t} from 'sentry/locale'; import {fromSorts} from 'sentry/utils/discover/eventView'; import {decodeScalar} from 'sentry/utils/queryString'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; @@ -53,7 +54,7 @@ export function HTTPLandingPage() { data: throughputData, error: throughputError, } = useSpanMetricsSeries({ - filters: chartFilters, + search: MutableSearch.fromQueryObject(chartFilters), yAxis: ['spm()'], referrer: 'api.starfish.http-module-landing-throughput-chart', }); @@ -63,7 +64,7 @@ export function HTTPLandingPage() { data: durationData, error: durationError, } = useSpanMetricsSeries({ - filters: chartFilters, + search: MutableSearch.fromQueryObject(chartFilters), yAxis: [`avg(span.self_time)`], referrer: 'api.starfish.http-module-landing-duration-chart', }); @@ -73,13 +74,13 @@ export function HTTPLandingPage() { data: responseCodeData, error: responseCodeError, } = useSpanMetricsSeries({ - filters: chartFilters, + search: MutableSearch.fromQueryObject(chartFilters), yAxis: ['http_response_rate(3)', 'http_response_rate(4)', 'http_response_rate(5)'], referrer: 'api.starfish.http-module-landing-response-code-chart', }); const domainsListResponse = useSpanMetrics({ - filters: tableFilters, + search: MutableSearch.fromQueryObject(tableFilters), fields: [ 'project.id', 'span.domain', diff --git a/static/app/views/starfish/queries/useSpanMetrics.spec.tsx b/static/app/views/starfish/queries/useSpanMetrics.spec.tsx index e829275d90396f..9eb29244c4f55e 100644 --- a/static/app/views/starfish/queries/useSpanMetrics.spec.tsx +++ b/static/app/views/starfish/queries/useSpanMetrics.spec.tsx @@ -6,6 +6,7 @@ import {makeTestQueryClient} from 'sentry-test/queryClient'; import {reactHooks} from 'sentry-test/reactTestingLibrary'; import {QueryClientProvider} from 'sentry/utils/queryClient'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import usePageFilters from 'sentry/utils/usePageFilters'; @@ -89,7 +90,14 @@ describe('useSpanMetrics', () => { const {result, waitFor} = reactHooks.renderHook( ({filters, fields, sorts, limit, cursor, referrer}) => - useSpanMetrics({filters, fields, sorts, limit, cursor, referrer}), + useSpanMetrics({ + search: MutableSearch.fromQueryObject(filters), + fields, + sorts, + limit, + cursor, + referrer, + }), { wrapper: Wrapper, initialProps: { diff --git a/static/app/views/starfish/queries/useSpanMetrics.tsx b/static/app/views/starfish/queries/useSpanMetrics.tsx index 810c4d6e7896ad..0784d3e6bfcc4c 100644 --- a/static/app/views/starfish/queries/useSpanMetrics.tsx +++ b/static/app/views/starfish/queries/useSpanMetrics.tsx @@ -2,33 +2,29 @@ import type {PageFilters} from 'sentry/types'; import EventView from 'sentry/utils/discover/eventView'; import type {Sort} from 'sentry/utils/discover/fields'; import {DiscoverDatasets} from 'sentry/utils/discover/types'; -import {MutableSearch} from 'sentry/utils/tokenizeSearch'; +import type {MutableSearch} from 'sentry/utils/tokenizeSearch'; import usePageFilters from 'sentry/utils/usePageFilters'; -import type { - MetricsProperty, - MetricsResponse, - SpanMetricsQueryFilters, -} from 'sentry/views/starfish/types'; +import type {MetricsProperty, MetricsResponse} from 'sentry/views/starfish/types'; import {useWrappedDiscoverQuery} from 'sentry/views/starfish/utils/useSpansQuery'; interface UseSpanMetricsOptions<Fields> { cursor?: string; enabled?: boolean; fields?: Fields; - filters?: SpanMetricsQueryFilters; limit?: number; referrer?: string; + search?: MutableSearch; sorts?: Sort[]; } export const useSpanMetrics = <Fields extends MetricsProperty[]>( options: UseSpanMetricsOptions<Fields> = {} ) => { - const {fields = [], filters = {}, sorts = [], limit, cursor, referrer} = options; + const {fields = [], search = undefined, sorts = [], limit, cursor, referrer} = options; const pageFilters = usePageFilters(); - const eventView = getEventView(filters, fields, sorts, pageFilters.selection); + const eventView = getEventView(search, fields, sorts, pageFilters.selection); const result = useWrappedDiscoverQuery({ eventView, @@ -51,17 +47,15 @@ export const useSpanMetrics = <Fields extends MetricsProperty[]>( }; function getEventView( - filters: SpanMetricsQueryFilters = {}, + search: MutableSearch | undefined, fields: string[] = [], sorts: Sort[] = [], pageFilters: PageFilters ) { - const query = MutableSearch.fromQueryObject(filters); - const eventView = EventView.fromNewQueryWithPageFilters( { name: '', - query: query.formatString(), + query: search?.formatString() ?? '', fields, dataset: DiscoverDatasets.SPANS_METRICS, version: 2, diff --git a/static/app/views/starfish/queries/useSpanMetricsSeries.spec.tsx b/static/app/views/starfish/queries/useSpanMetricsSeries.spec.tsx index 0da3ca5559026c..c98a42e4aaa33f 100644 --- a/static/app/views/starfish/queries/useSpanMetricsSeries.spec.tsx +++ b/static/app/views/starfish/queries/useSpanMetricsSeries.spec.tsx @@ -5,6 +5,7 @@ import {makeTestQueryClient} from 'sentry-test/queryClient'; import {reactHooks} from 'sentry-test/reactTestingLibrary'; import {QueryClientProvider} from 'sentry/utils/queryClient'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import usePageFilters from 'sentry/utils/usePageFilters'; @@ -63,7 +64,7 @@ describe('useSpanMetricsSeries', () => { const {result} = reactHooks.renderHook( ({filters, enabled}) => useSpanMetricsSeries({ - filters, + search: MutableSearch.fromQueryObject(filters), enabled, }), { @@ -96,7 +97,8 @@ describe('useSpanMetricsSeries', () => { }); const {result, waitFor} = reactHooks.renderHook( - ({filters, yAxis}) => useSpanMetricsSeries({filters, yAxis}), + ({filters, yAxis}) => + useSpanMetricsSeries({search: MutableSearch.fromQueryObject(filters), yAxis}), { wrapper: Wrapper, initialProps: { diff --git a/static/app/views/starfish/queries/useSpanMetricsSeries.tsx b/static/app/views/starfish/queries/useSpanMetricsSeries.tsx index ce00de57930fc4..0aa05c423a2656 100644 --- a/static/app/views/starfish/queries/useSpanMetricsSeries.tsx +++ b/static/app/views/starfish/queries/useSpanMetricsSeries.tsx @@ -7,11 +7,11 @@ import {intervalToMilliseconds} from 'sentry/utils/dates'; import EventView from 'sentry/utils/discover/eventView'; import {parseFunction} from 'sentry/utils/discover/fields'; import {DiscoverDatasets} from 'sentry/utils/discover/types'; -import {MutableSearch} from 'sentry/utils/tokenizeSearch'; +import type {MutableSearch} from 'sentry/utils/tokenizeSearch'; import usePageFilters from 'sentry/utils/usePageFilters'; import {getIntervalForMetricFunction} from 'sentry/views/performance/database/getIntervalForMetricFunction'; import {DEFAULT_INTERVAL} from 'sentry/views/performance/database/settings'; -import type {MetricsProperty, SpanMetricsQueryFilters} from 'sentry/views/starfish/types'; +import type {MetricsProperty} from 'sentry/views/starfish/types'; import {useWrappedDiscoverTimeseriesQuery} from 'sentry/views/starfish/utils/useSpansQuery'; interface SpanMetricTimeseriesRow { @@ -21,19 +21,19 @@ interface SpanMetricTimeseriesRow { interface UseSpanMetricsSeriesOptions<Fields> { enabled?: boolean; - filters?: SpanMetricsQueryFilters; referrer?: string; + search?: MutableSearch; yAxis?: Fields; } export const useSpanMetricsSeries = <Fields extends MetricsProperty[]>( options: UseSpanMetricsSeriesOptions<Fields> = {} ) => { - const {filters = {}, yAxis = [], referrer = 'span-metrics-series'} = options; + const {search = undefined, yAxis = [], referrer = 'span-metrics-series'} = options; const pageFilters = usePageFilters(); - const eventView = getEventView(filters, pageFilters.selection, yAxis); + const eventView = getEventView(search, pageFilters.selection, yAxis); const result = useWrappedDiscoverTimeseriesQuery<SpanMetricTimeseriesRow[]>({ eventView, @@ -61,12 +61,10 @@ export const useSpanMetricsSeries = <Fields extends MetricsProperty[]>( }; function getEventView( - filters: SpanMetricsQueryFilters, + search: MutableSearch | undefined, pageFilters: PageFilters, yAxis: string[] ) { - const query = MutableSearch.fromQueryObject(filters); - // Pick the highest possible interval for the given yAxis selection. Find the ideal interval for each function, then choose the largest one. This results in the lowest granularity, but best performance. const interval = sortBy( yAxis.map(yAxisFunctionName => { @@ -86,7 +84,7 @@ function getEventView( return EventView.fromNewQueryWithPageFilters( { name: '', - query: query.formatString(), + query: search?.formatString() ?? undefined, fields: [], yAxis, dataset: DiscoverDatasets.SPANS_METRICS, diff --git a/static/app/views/starfish/queries/useSpanSamples.tsx b/static/app/views/starfish/queries/useSpanSamples.tsx index 305dcb41b9f36d..e17b780ae6f1a0 100644 --- a/static/app/views/starfish/queries/useSpanSamples.tsx +++ b/static/app/views/starfish/queries/useSpanSamples.tsx @@ -77,7 +77,7 @@ export const useSpanSamples = (options: Options) => { const dateCondtions = getDateConditions(pageFilter.selection); const {isLoading: isLoadingSeries, data: spanMetricsSeriesData} = useSpanMetricsSeries({ - filters: {'span.group': groupId, ...filters}, + search: MutableSearch.fromQueryObject({'span.group': groupId, ...filters}), yAxis: [`avg(${SPAN_SELF_TIME})`], enabled: Object.values({'span.group': groupId, ...filters}).every(value => Boolean(value) diff --git a/static/app/views/starfish/views/screens/screenLoadSpans/samples/samplesContainer.tsx b/static/app/views/starfish/views/screens/screenLoadSpans/samples/samplesContainer.tsx index e81ad157f0836a..26040a5b3320ed 100644 --- a/static/app/views/starfish/views/screens/screenLoadSpans/samples/samplesContainer.tsx +++ b/static/app/views/starfish/views/screens/screenLoadSpans/samples/samplesContainer.tsx @@ -9,6 +9,7 @@ import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Project} from 'sentry/types/project'; import {decodeScalar} from 'sentry/utils/queryString'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import useRouter from 'sentry/utils/useRouter'; @@ -99,7 +100,7 @@ export function ScreenLoadSampleContainer({ } const {data} = useSpanMetrics({ - filters: {...filters, ...additionalFilters}, + search: MutableSearch.fromQueryObject({...filters, ...additionalFilters}), fields: [`avg(${SPAN_SELF_TIME})`, 'count()', SPAN_OP], enabled: Boolean(groupId) && Boolean(transactionName), referrer: 'api.starfish.span-summary-panel-samples-table-avg', diff --git a/static/app/views/starfish/views/spanSummaryPage/index.tsx b/static/app/views/starfish/views/spanSummaryPage/index.tsx index 31a1eae2e93683..0ceddf561b3a3e 100644 --- a/static/app/views/starfish/views/spanSummaryPage/index.tsx +++ b/static/app/views/starfish/views/spanSummaryPage/index.tsx @@ -12,6 +12,7 @@ import {fromSorts} from 'sentry/utils/discover/eventView'; import type {Sort} from 'sentry/utils/discover/fields'; import {formatSpanOperation} from 'sentry/utils/formatters'; import {PageAlert, PageAlertProvider} from 'sentry/utils/performance/contexts/pageAlert'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import useOrganization from 'sentry/utils/useOrganization'; import {normalizeUrl} from 'sentry/utils/withDomainRequired'; import {StarfishPageFiltersContainer} from 'sentry/views/starfish/components/starfishPageFiltersContainer'; @@ -63,7 +64,7 @@ function SpanSummaryPage({params, location}: Props) { )[0] ?? DEFAULT_SORT; // We only allow one sort on this table in this view const {data, isLoading: isSpanMetricsLoading} = useSpanMetrics({ - filters, + search: MutableSearch.fromQueryObject(filters), fields: ['span.op', 'span.group', 'project.id', 'sps()'], enabled: Boolean(groupId), referrer: 'api.starfish.span-summary-page-metrics', diff --git a/static/app/views/starfish/views/spanSummaryPage/sampleList/durationChart/index.tsx b/static/app/views/starfish/views/spanSummaryPage/sampleList/durationChart/index.tsx index 5aae02e93766a4..a3a5276ce5488e 100644 --- a/static/app/views/starfish/views/spanSummaryPage/sampleList/durationChart/index.tsx +++ b/static/app/views/starfish/views/spanSummaryPage/sampleList/durationChart/index.tsx @@ -8,6 +8,7 @@ import type { Series, } from 'sentry/types/echarts'; import {usePageAlert} from 'sentry/utils/performance/contexts/pageAlert'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import usePageFilters from 'sentry/utils/usePageFilters'; import {AVG_COLOR} from 'sentry/views/starfish/colours'; import Chart from 'sentry/views/starfish/components/chart'; @@ -106,7 +107,7 @@ function DurationChart({ data: spanMetricsSeriesData, error: spanMetricsSeriesError, } = useSpanMetricsSeries({ - filters: {...filters, ...additionalFilters}, + search: MutableSearch.fromQueryObject({...filters, ...additionalFilters}), yAxis: [`avg(${SPAN_SELF_TIME})`], enabled: Object.values({...filters, ...additionalFilters}).every(value => Boolean(value) @@ -115,7 +116,7 @@ function DurationChart({ }); const {data, error: spanMetricsError} = useSpanMetrics({ - filters, + search: MutableSearch.fromQueryObject(filters), fields: [`avg(${SPAN_SELF_TIME})`, SPAN_OP], enabled: Object.values(filters).every(value => Boolean(value)), referrer: 'api.starfish.span-summary-panel-samples-table-avg', diff --git a/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleInfo/index.tsx b/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleInfo/index.tsx index dfa305f7ccb173..2d0c26f1300fa2 100644 --- a/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleInfo/index.tsx +++ b/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleInfo/index.tsx @@ -3,6 +3,7 @@ import styled from '@emotion/styled'; import {RateUnit} from 'sentry/utils/discover/fields'; import {usePageAlert} from 'sentry/utils/performance/contexts/pageAlert'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {CountCell} from 'sentry/views/starfish/components/tableCells/countCell'; import {DurationCell} from 'sentry/views/starfish/components/tableCells/durationCell'; import {ThroughputCell} from 'sentry/views/starfish/components/tableCells/throughputCell'; @@ -43,7 +44,7 @@ function SampleInfo(props: Props) { } const {data, error} = useSpanMetrics({ - filters, + search: MutableSearch.fromQueryObject(filters), fields: [ SPAN_OP, 'spm()', diff --git a/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleTable/sampleTable.tsx b/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleTable/sampleTable.tsx index 21cf70c9bbd60a..e31f08a4859cb1 100644 --- a/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleTable/sampleTable.tsx +++ b/static/app/views/starfish/views/spanSummaryPage/sampleList/sampleTable/sampleTable.tsx @@ -8,6 +8,7 @@ import {space} from 'sentry/styles/space'; import {trackAnalytics} from 'sentry/utils/analytics'; import {usePageAlert} from 'sentry/utils/performance/contexts/pageAlert'; import {VisuallyCompleteWithData} from 'sentry/utils/performanceForSentry'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import useOrganization from 'sentry/utils/useOrganization'; import type {SamplesTableColumnHeader} from 'sentry/views/starfish/components/samplesTable/spanSamplesTable'; import {SpanSamplesTable} from 'sentry/views/starfish/components/samplesTable/spanSamplesTable'; @@ -65,7 +66,7 @@ function SampleTable({ } const {data, isFetching: isFetchingSpanMetrics} = useSpanMetrics({ - filters: {...filters, ...additionalFilters}, + search: MutableSearch.fromQueryObject({...filters, ...additionalFilters}), fields: [`avg(${SPAN_SELF_TIME})`, SPAN_OP], enabled: Object.values({...filters, ...additionalFilters}).every(value => Boolean(value) diff --git a/static/app/views/starfish/views/spanSummaryPage/spanSummaryView.tsx b/static/app/views/starfish/views/spanSummaryPage/spanSummaryView.tsx index 189fc46d61fd9e..5737988554a876 100644 --- a/static/app/views/starfish/views/spanSummaryPage/spanSummaryView.tsx +++ b/static/app/views/starfish/views/spanSummaryPage/spanSummaryView.tsx @@ -5,6 +5,7 @@ import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {DurationUnit, RateUnit} from 'sentry/utils/discover/fields'; import {formatRate} from 'sentry/utils/formatters'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import {MetricReadout} from 'sentry/views/performance/metricReadout'; import {AVG_COLOR, ERRORS_COLOR, THROUGHPUT_COLOR} from 'sentry/views/starfish/colours'; @@ -51,7 +52,7 @@ export function SpanSummaryView({groupId}: Props) { } const {data} = useSpanMetrics({ - filters, + search: MutableSearch.fromQueryObject(filters), fields: [ SpanMetricsField.SPAN_OP, SpanMetricsField.SPAN_DESCRIPTION, @@ -92,7 +93,10 @@ export function SpanSummaryView({groupId}: Props) { const {isLoading: areSpanMetricsSeriesLoading, data: spanMetricsSeriesData} = useSpanMetricsSeries({ - filters: {'span.group': groupId, ...seriesQueryFilter}, + search: MutableSearch.fromQueryObject({ + 'span.group': groupId, + ...seriesQueryFilter, + }), yAxis: [`avg(${SpanMetricsField.SPAN_SELF_TIME})`, 'spm()', 'http_error_count()'], enabled: Boolean(groupId), referrer: 'api.starfish.span-summary-page-metrics-chart', diff --git a/static/app/views/starfish/views/spans/spansTable.tsx b/static/app/views/starfish/views/spans/spansTable.tsx index 0cd30da35aff9a..9040a8d272fb1a 100644 --- a/static/app/views/starfish/views/spans/spansTable.tsx +++ b/static/app/views/starfish/views/spans/spansTable.tsx @@ -12,6 +12,7 @@ import type {EventsMetaType} from 'sentry/utils/discover/eventView'; import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers'; import {VisuallyCompleteWithData} from 'sentry/utils/performanceForSentry'; import {decodeScalar} from 'sentry/utils/queryString'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; import {useLocation} from 'sentry/utils/useLocation'; import useOrganization from 'sentry/utils/useOrganization'; import {renderHeadCell} from 'sentry/views/starfish/components/tableCells/renderHeadCell'; @@ -76,7 +77,7 @@ export default function SpansTable({ }; const {isLoading, data, meta, pageLinks} = useSpanMetrics({ - filters: pickBy(filters, value => value !== undefined), + search: MutableSearch.fromQueryObject(pickBy(filters, value => value !== undefined)), fields: [ PROJECT_ID, SPAN_OP,
e78ebab13c0023a7f8ec02ea42400c15a1639d70
2024-03-29 01:56:28
Ash
ref(performance): Remove unsupported transaction summary features (#67731)
false
Remove unsupported transaction summary features (#67731)
ref
diff --git a/static/app/components/discover/transactionsList.tsx b/static/app/components/discover/transactionsList.tsx index f87da946468fa2..c8a1f1ac8517e1 100644 --- a/static/app/components/discover/transactionsList.tsx +++ b/static/app/components/discover/transactionsList.tsx @@ -287,6 +287,11 @@ class _TransactionsList extends Component<Props> { const cursorOffset = parseCursor(cursor)?.offset ?? 0; numSamples = numSamples ?? null; const totalNumSamples = numSamples === null ? null : numSamples + cursorOffset; + + const hasTransactionSummaryCleanupFlag = organization.features.includes( + 'performance-transaction-summary-cleanup' + ); + return ( <Fragment> <div> @@ -297,7 +302,7 @@ class _TransactionsList extends Component<Props> { onChange={opt => handleDropdownChange(opt.value)} /> </div> - {supportsInvestigationRule && ( + {supportsInvestigationRule && !hasTransactionSummaryCleanupFlag && ( <InvestigationRuleWrapper> <InvestigationRuleCreation buttonProps={{size: 'xs'}} diff --git a/static/app/views/performance/transactionSummary/header.tsx b/static/app/views/performance/transactionSummary/header.tsx index 8407c4b32847cc..f82d94e7d6821f 100644 --- a/static/app/views/performance/transactionSummary/header.tsx +++ b/static/app/views/performance/transactionSummary/header.tsx @@ -113,6 +113,10 @@ function TransactionHeader({ const {getReplayCountForTransaction} = useReplayCountForTransactions(); const replaysCount = getReplayCountForTransaction(transactionName); + const hasTransactionSummaryCleanupFlag = organization.features.includes( + 'performance-transaction-summary-cleanup' + ); + return ( <Layout.Header> <Layout.HeaderContent> @@ -195,7 +199,10 @@ function TransactionHeader({ <TabList.Item key={Tab.TRANSACTION_SUMMARY}>{t('Overview')}</TabList.Item> <TabList.Item key={Tab.EVENTS}>{t('Sampled Events')}</TabList.Item> <TabList.Item key={Tab.TAGS}>{t('Tags')}</TabList.Item> - <TabList.Item key={Tab.SPANS}>{t('Spans')}</TabList.Item> + <TabList.Item key={Tab.SPANS} hidden={hasTransactionSummaryCleanupFlag}> + {t('Spans')} + </TabList.Item> + <TabList.Item key={Tab.ANOMALIES} textValue={t('Anomalies')} diff --git a/static/app/views/performance/transactionSummary/transactionOverview/content.tsx b/static/app/views/performance/transactionSummary/transactionOverview/content.tsx index 65844f6e3f157f..c010801bd11139 100644 --- a/static/app/views/performance/transactionSummary/transactionOverview/content.tsx +++ b/static/app/views/performance/transactionSummary/transactionOverview/content.tsx @@ -332,15 +332,24 @@ function SummaryContent({ handleOpenAllEventsClick: handleAllEventsViewClick, }; + const hasTransactionSummaryCleanupFlag = organization.features.includes( + 'performance-transaction-summary-cleanup' + ); + return ( <Fragment> <Layout.Main> - <FilterActions> - <Filter - organization={organization} - currentFilter={spanOperationBreakdownFilter} - onChangeFilter={onChangeFilter} - /> + <FilterActions + hasTransactionSummaryCleanupFlag={hasTransactionSummaryCleanupFlag} + > + {!hasTransactionSummaryCleanupFlag && ( + <Filter + organization={organization} + currentFilter={spanOperationBreakdownFilter} + onChangeFilter={onChangeFilter} + /> + )} + <PageFilterBar condensed> <EnvironmentPageFilter /> <DatePageFilter /> @@ -401,18 +410,21 @@ function SummaryContent({ /> </PerformanceAtScaleContextProvider> - <SuspectSpans - location={location} - organization={organization} - eventView={eventView} - totals={ - defined(totalValues?.['count()']) - ? {'count()': totalValues!['count()']} - : null - } - projectId={projectId} - transactionName={transactionName} - /> + {!hasTransactionSummaryCleanupFlag && ( + <SuspectSpans + location={location} + organization={organization} + eventView={eventView} + totals={ + defined(totalValues?.['count()']) + ? {'count()': totalValues!['count()']} + : null + } + projectId={projectId} + transactionName={transactionName} + /> + )} + <TagExplorer eventView={eventView} organization={organization} @@ -556,7 +568,7 @@ function getTransactionsListSort( return {selected: selectedSort, options: sortOptions}; } -const FilterActions = styled('div')` +const FilterActions = styled('div')<{hasTransactionSummaryCleanupFlag: boolean}>` display: grid; gap: ${space(2)}; margin-bottom: ${space(2)}; @@ -566,7 +578,10 @@ const FilterActions = styled('div')` } @media (min-width: ${p => p.theme.breakpoints.xlarge}) { - grid-template-columns: auto auto 1fr; + ${p => + p.hasTransactionSummaryCleanupFlag + ? `grid-template-columns: auto 1fr;` + : `grid-template-columns: auto auto 1fr;`} } `;
6830f872100be6c60d8472856f5b32306644c91e
2025-01-08 23:06:26
Richard Roggenkemper
fix(issue-details): Fix tags preview if no tags (#83069)
false
Fix tags preview if no tags (#83069)
fix
diff --git a/static/app/views/issueDetails/streamline/issueTagsPreview.tsx b/static/app/views/issueDetails/streamline/issueTagsPreview.tsx index fdce563c47c628..d5f493e8ddcfc9 100644 --- a/static/app/views/issueDetails/streamline/issueTagsPreview.tsx +++ b/static/app/views/issueDetails/streamline/issueTagsPreview.tsx @@ -43,7 +43,7 @@ export default function IssueTagsPreview({ ); } - if (isError || !tagsToPreview || searchQuery) { + if (isError || !tagsToPreview || searchQuery || tagsToPreview.length === 0) { return null; }
c2e55304e8a2aad1eb0f517c5482a77e6e7a05f6
2023-10-30 23:38:00
Michelle Zhang
ref(replays): add info about turning off scrubbed PII in details URL (#58946)
false
add info about turning off scrubbed PII in details URL (#58946)
ref
diff --git a/static/app/components/replays/replayCurrentUrl.tsx b/static/app/components/replays/replayCurrentUrl.tsx index 67a7dbefc9b53c..7606ec7173b616 100644 --- a/static/app/components/replays/replayCurrentUrl.tsx +++ b/static/app/components/replays/replayCurrentUrl.tsx @@ -1,16 +1,22 @@ import {useMemo} from 'react'; import * as Sentry from '@sentry/react'; +import ExternalLink from 'sentry/components/links/externalLink'; +import Link from 'sentry/components/links/link'; import {useReplayContext} from 'sentry/components/replays/replayContext'; import TextCopyInput from 'sentry/components/textCopyInput'; import {Tooltip} from 'sentry/components/tooltip'; -import {t} from 'sentry/locale'; +import {tct} from 'sentry/locale'; import getCurrentUrl from 'sentry/utils/replays/getCurrentUrl'; +import useProjects from 'sentry/utils/useProjects'; function ReplayCurrentUrl() { const {currentTime, replay} = useReplayContext(); const replayRecord = replay?.getReplay(); const frames = replay?.getNavigationFrames(); + const projId = replayRecord?.project_id; + const {projects} = useProjects(); + const projSlug = projects.find(p => p.id === projId)?.slug ?? undefined; const url = useMemo(() => { try { @@ -32,9 +38,24 @@ function ReplayCurrentUrl() { if (url.includes('[Filtered]')) { return ( <Tooltip - title={t( - 'Warning! This URL contains content scrubbed by our PII filters and may no longer be valid.' + title={tct( + "Funny looking URL? It contains content scrubbed by our [filters] and may no longer be valid. This is to protect your users' privacy. If necessary, you can turn this off in your [settings].", + { + filters: ( + <ExternalLink href="https://docs.sentry.io/product/data-management-settings/scrubbing/server-side-scrubbing/"> + {'Data Scrubber'} + </ExternalLink> + ), + settings: projSlug ? ( + <Link to={`/settings/projects/${projSlug}/security-and-privacy/`}> + {'Settings, under Security & Privacy'} + </Link> + ) : ( + 'Settings, under Security & Privacy' + ), + } )} + isHoverable > <TextCopyInput size="sm">{url}</TextCopyInput> </Tooltip>
5b8f6d2ca1f6295c87b82bd3902e3e338f6275cd
2023-09-19 02:28:13
Colleen O'Rourke
ref(alerts): Add neglected rule data (#56308)
false
Add neglected rule data (#56308)
ref
diff --git a/src/sentry/api/serializers/models/rule.py b/src/sentry/api/serializers/models/rule.py index 0228b52e29d015..f8feca3a0888f3 100644 --- a/src/sentry/api/serializers/models/rule.py +++ b/src/sentry/api/serializers/models/rule.py @@ -15,6 +15,7 @@ actor_type_to_string, ) from sentry.models.actor import Actor +from sentry.models.rule import NeglectedRule from sentry.models.rulefirehistory import RuleFireHistory from sentry.models.rulesnooze import RuleSnooze from sentry.services.hybrid_cloud.user.service import user_service @@ -195,4 +196,13 @@ def serialize(self, obj, attrs, user, **kwargs): else: d["snooze"] = False + try: + neglected_rule = NeglectedRule.objects.get( + rule=obj, organization=obj.project.organization_id, opted_out=False + ) + d["disableReason"] = "noisy" + d["disableDate"] = neglected_rule.disable_date + except (NeglectedRule.DoesNotExist, NeglectedRule.MultipleObjectsReturned): + pass + return d diff --git a/tests/sentry/api/endpoints/test_project_rule_details.py b/tests/sentry/api/endpoints/test_project_rule_details.py index a91968f4521915..7b28099298f353 100644 --- a/tests/sentry/api/endpoints/test_project_rule_details.py +++ b/tests/sentry/api/endpoints/test_project_rule_details.py @@ -1,6 +1,6 @@ from __future__ import annotations -from datetime import datetime, timezone +from datetime import datetime, timedelta, timezone from typing import Any, Mapping from unittest.mock import patch @@ -10,7 +10,14 @@ from sentry.constants import ObjectStatus from sentry.integrations.slack.utils.channel import strip_channel_name -from sentry.models import Environment, Integration, Rule, RuleActivity, RuleActivityType +from sentry.models import ( + Environment, + Integration, + NeglectedRule, + Rule, + RuleActivity, + RuleActivityType, +) from sentry.models.actor import Actor, get_actor_for_user from sentry.models.rulefirehistory import RuleFireHistory from sentry.silo import SiloMode @@ -160,6 +167,28 @@ def test_with_filters(self): assert len(response.data["filters"]) == 1 assert response.data["filters"][0]["id"] == conditions[1]["id"] + @responses.activate + def test_neglected_rule(self): + now = datetime.now().replace(tzinfo=timezone.utc) + NeglectedRule.objects.create( + rule=self.rule, + organization=self.organization, + opted_out=False, + disable_date=now + timedelta(days=14), + ) + response = self.get_success_response( + self.organization.slug, self.project.slug, self.rule.id, status_code=200 + ) + assert response.data["disableReason"] == "noisy" + assert response.data["disableDate"] == now + timedelta(days=14) + + another_rule = self.create_project_rule(project=self.project) + response = self.get_success_response( + self.organization.slug, self.project.slug, another_rule.id, status_code=200 + ) + assert not response.data.get("disableReason") + assert not response.data.get("disableDate") + @responses.activate def test_with_snooze_rule(self): self.snooze_rule(user_id=self.user.id, owner_id=self.user.id, rule=self.rule)
123c60f99304ed107cddf2dee7f873439a001f33
2023-04-26 20:01:09
William Mak
feat(starfish): add datefilter and tpm charts (#47935)
false
add datefilter and tpm charts (#47935)
feat
diff --git a/static/app/views/starfish/modules/databaseModule/databaseChartView.tsx b/static/app/views/starfish/modules/databaseModule/databaseChartView.tsx index 4eec37ca2301ab..a38d270949cbb4 100644 --- a/static/app/views/starfish/modules/databaseModule/databaseChartView.tsx +++ b/static/app/views/starfish/modules/databaseModule/databaseChartView.tsx @@ -2,13 +2,19 @@ import {Fragment} from 'react'; import styled from '@emotion/styled'; import {useQuery} from '@tanstack/react-query'; import {Location} from 'history'; +import moment from 'moment'; import {CompactSelect} from 'sentry/components/compactSelect'; import {t} from 'sentry/locale'; +import space from 'sentry/styles/space'; import {Series} from 'sentry/types/echarts'; +import usePageFilters from 'sentry/utils/usePageFilters'; import Chart from 'sentry/views/starfish/components/chart'; import ChartPanel from 'sentry/views/starfish/components/chartPanel'; +import {zeroFillSeries} from 'sentry/views/starfish/utils/zeroFillSeries'; +const PERIOD_REGEX = /^(\d+)([h,d])$/; +const INTERVAL = 12; const HOST = 'http://localhost:8080'; type Props = { @@ -38,6 +44,18 @@ function parseOptions(options, label) { } export default function APIModuleView({action, table, onChange}: Props) { + const pageFilter = usePageFilters(); + const [_, num, unit] = pageFilter.selection.datetime.period?.match(PERIOD_REGEX) ?? []; + const startTime = + num && unit + ? moment().subtract(num, unit as 'h' | 'd') + : moment(pageFilter.selection.datetime.start); + const endTime = moment(pageFilter.selection.datetime.end ?? undefined); + const DATE_FILTERS = ` + start_timestamp > fromUnixTimestamp(${startTime.unix()}) and + start_timestamp < fromUnixTimestamp(${endTime.unix()}) + `; + const OPERATION_QUERY = ` select action as key, @@ -46,6 +64,7 @@ export default function APIModuleView({action, table, onChange}: Props) { where startsWith(span_operation, 'db') and span_operation != 'db.redis' and + ${DATE_FILTERS} and action != '' group by action order by -power(10, floor(log10(uniq(description)))), -quantile(0.75)(exclusive_time) @@ -59,45 +78,61 @@ export default function APIModuleView({action, table, onChange}: Props) { where startsWith(span_operation, 'db') and span_operation != 'db.redis' and + ${DATE_FILTERS} and action != '' ${actionQuery} group by domain - order by -power(10, floor(log10(uniq(description)))), -quantile(0.75)(exclusive_time) + order by -power(10, floor(log10(count()))), -quantile(0.75)(exclusive_time) `; - const TOP_QUERY = ` - select floor(quantile(0.75)(exclusive_time), 5) as p75, action, - toStartOfInterval(start_timestamp, INTERVAL 1 DAY) as interval - from default.spans_experimental_starfish - where action in ( + const ACTION_SUBQUERY = ` select action from default.spans_experimental_starfish where startsWith(span_operation, 'db') and span_operation != 'db.redis' and + ${DATE_FILTERS} and action != '' group by action - order by -power(10, floor(log10(uniq(description)))), -quantile(0.75)(exclusive_time) + order by -power(10, floor(log10(count()))), -quantile(0.75)(exclusive_time) limit 5 - ) - group by interval, - action - order by interval, - action + `; + const TOP_QUERY = ` + select floor(quantile(0.75)(exclusive_time), 5) as p75, action, count() as count, + toStartOfInterval(start_timestamp, INTERVAL ${INTERVAL} hour) as interval + from default.spans_experimental_starfish + where + startsWith(span_operation, 'db') and + span_operation != 'db.redis' and + ${DATE_FILTERS} and + action in (${ACTION_SUBQUERY}) + group by action, + interval + order by action, + interval + `; + + const DOMAIN_SUBQUERY = ` + select domain + from default.spans_experimental_starfish + where + startsWith(span_operation, 'db') and + span_operation != 'db.redis' and + ${DATE_FILTERS} and + domain != '' + ${actionQuery} + group by domain + order by -power(10, floor(log10(count()))), -quantile(0.75)(exclusive_time) + limit 5 `; const TOP_TABLE_QUERY = ` - select floor(quantile(0.75)(exclusive_time), 5) as p75, domain, - toStartOfInterval(start_timestamp, INTERVAL 1 DAY) as interval + select floor(quantile(0.75)(exclusive_time), 5) as p75, domain, count() as count, + toStartOfInterval(start_timestamp, INTERVAL ${INTERVAL} hour) as interval from default.spans_experimental_starfish - where domain in ( - select domain - from default.spans_experimental_starfish - where startsWith(span_operation, 'db') and - span_operation != 'db.redis' and - domain != '' - ${actionQuery} - group by domain - order by -power(10, floor(log10(uniq(description)))), -quantile(0.75)(exclusive_time) - limit 5 - ) + where + startsWith(span_operation, 'db') and + span_operation != 'db.redis' and + ${DATE_FILTERS} and + domain in (${DOMAIN_SUBQUERY}) + ${actionQuery} group by interval, domain order by interval, @@ -105,37 +140,42 @@ export default function APIModuleView({action, table, onChange}: Props) { `; const {data: operationData} = useQuery({ - queryKey: ['operation'], + queryKey: ['operation', pageFilter.selection.datetime], queryFn: () => fetch(`${HOST}/?query=${OPERATION_QUERY}`).then(res => res.json()), retry: false, initialData: [], }); const {data: tableData} = useQuery({ - queryKey: ['table', action], + queryKey: ['table', action, pageFilter.selection.datetime], queryFn: () => fetch(`${HOST}/?query=${TABLE_QUERY}`).then(res => res.json()), retry: false, initialData: [], }); const {isLoading: isTopGraphLoading, data: topGraphData} = useQuery({ - queryKey: ['topGraph'], + queryKey: ['topGraph', pageFilter.selection.datetime], queryFn: () => fetch(`${HOST}/?query=${TOP_QUERY}`).then(res => res.json()), retry: false, initialData: [], }); const {isLoading: tableGraphLoading, data: tableGraphData} = useQuery({ - queryKey: ['topTable', action], + queryKey: ['topTable', action, pageFilter.selection.datetime], queryFn: () => fetch(`${HOST}/?query=${TOP_TABLE_QUERY}`).then(res => res.json()), retry: false, initialData: [], }); const seriesByDomain: {[action: string]: Series} = {}; + const tpmByDomain: {[action: string]: Series} = {}; if (!tableGraphLoading) { tableGraphData.forEach(datum => { seriesByDomain[datum.domain] = { seriesName: datum.domain, data: [], }; + tpmByDomain[datum.domain] = { + seriesName: datum.domain, + data: [], + }; }); tableGraphData.forEach(datum => { @@ -143,10 +183,21 @@ export default function APIModuleView({action, table, onChange}: Props) { value: datum.p75, name: datum.interval, }); + tpmByDomain[datum.domain].data.push({ + value: datum.count, + name: datum.interval, + }); }); } - const topDomains = Object.values(seriesByDomain); + const topDomains = Object.values(seriesByDomain).map(series => + zeroFillSeries(series, moment.duration(INTERVAL, 'hours'), startTime, endTime) + ); + const tpmDomains = Object.values(tpmByDomain).map(series => + zeroFillSeries(series, moment.duration(INTERVAL, 'hours'), startTime, endTime) + ); + + const tpmByQuery: {[query: string]: Series} = {}; const seriesByQuery: {[action: string]: Series} = {}; if (!isTopGraphLoading) { @@ -155,6 +206,10 @@ export default function APIModuleView({action, table, onChange}: Props) { seriesName: datum.action, data: [], }; + tpmByQuery[datum.action] = { + seriesName: datum.action, + data: [], + }; }); topGraphData.forEach(datum => { @@ -162,55 +217,32 @@ export default function APIModuleView({action, table, onChange}: Props) { value: datum.p75, name: datum.interval, }); + tpmByQuery[datum.action].data.push({ + value: datum.count, + name: datum.interval, + }); }); } - const topData = Object.values(seriesByQuery); + const tpmData = Object.values(tpmByQuery).map(series => + zeroFillSeries(series, moment.duration(INTERVAL, 'hours'), startTime, endTime) + ); + const topData = Object.values(seriesByQuery).map(series => + zeroFillSeries(series, moment.duration(INTERVAL, 'hours'), startTime, endTime) + ); return ( <Fragment> - <ChartPanel title={t('Slowest Operations')}> - <Chart - statsPeriod="24h" - height={180} - data={topData} - start="" - end="" - loading={isTopGraphLoading} - utc={false} - grid={{ - left: '0', - right: '0', - top: '16px', - bottom: '8px', - }} - disableMultiAxis - definedAxisTicks={4} - isLineChart - showLegend - /> - </ChartPanel> - <Selectors> - Operation: - <CompactSelect - value={action} - options={parseOptions(operationData, 'query')} - menuTitle="Operation" - onChange={opt => onChange('action', opt.value)} - /> - </Selectors> - {tableData.length === 1 && tableData[0].key === '' ? ( - <Fragment /> - ) : ( - <Fragment> - <ChartPanel title={t('Slowest Tables')}> + <ChartsContainer> + <ChartsContainerItem> + <ChartPanel title={t('Slowest Operations P75')}> <Chart statsPeriod="24h" height={180} - data={topDomains} + data={topData} start="" end="" - loading={tableGraphLoading} + loading={isTopGraphLoading} utc={false} grid={{ left: '0', @@ -224,6 +256,92 @@ export default function APIModuleView({action, table, onChange}: Props) { showLegend /> </ChartPanel> + </ChartsContainerItem> + <ChartsContainerItem> + <ChartPanel title={t('Operation Throughput')}> + <Chart + statsPeriod="24h" + height={180} + data={tpmData} + start="" + end="" + loading={isTopGraphLoading} + utc={false} + grid={{ + left: '0', + right: '0', + top: '16px', + bottom: '8px', + }} + disableMultiAxis + definedAxisTicks={4} + showLegend + isLineChart + /> + </ChartPanel> + </ChartsContainerItem> + </ChartsContainer> + <Selectors> + Operation: + <CompactSelect + value={action} + options={parseOptions(operationData, 'query')} + menuTitle="Operation" + onChange={opt => onChange('action', opt.value)} + /> + </Selectors> + {tableData.length === 1 && tableData[0].key === '' ? ( + <Fragment /> + ) : ( + <Fragment> + <ChartsContainer> + <ChartsContainerItem> + <ChartPanel title={t('Slowest Tables P75')}> + <Chart + statsPeriod="24h" + height={180} + data={topDomains} + start="" + end="" + loading={tableGraphLoading} + utc={false} + grid={{ + left: '0', + right: '0', + top: '16px', + bottom: '8px', + }} + disableMultiAxis + definedAxisTicks={4} + isLineChart + showLegend + /> + </ChartPanel> + </ChartsContainerItem> + <ChartsContainerItem> + <ChartPanel title={t('Table Throughput')}> + <Chart + statsPeriod="24h" + height={180} + data={tpmDomains} + start="" + end="" + loading={isTopGraphLoading} + utc={false} + grid={{ + left: '0', + right: '0', + top: '16px', + bottom: '8px', + }} + disableMultiAxis + definedAxisTicks={4} + showLegend + isLineChart + /> + </ChartPanel> + </ChartsContainerItem> + </ChartsContainer> <Selectors> Table: <CompactSelect @@ -241,5 +359,16 @@ export default function APIModuleView({action, table, onChange}: Props) { const Selectors = styled(`div`)` display: flex; - margin-bottom: 16px; + margin-bottom: ${space(2)}; +`; + +const ChartsContainer = styled('div')` + display: flex; + flex-direction: row; + flex-wrap: wrap; + gap: ${space(2)}; +`; + +const ChartsContainerItem = styled('div')` + flex: 1; `; diff --git a/static/app/views/starfish/modules/databaseModule/databaseTableView.tsx b/static/app/views/starfish/modules/databaseModule/databaseTableView.tsx index 25c79c057b714d..e4d5e9fca3db02 100644 --- a/static/app/views/starfish/modules/databaseModule/databaseTableView.tsx +++ b/static/app/views/starfish/modules/databaseModule/databaseTableView.tsx @@ -1,11 +1,14 @@ import {useQuery} from '@tanstack/react-query'; import {Location} from 'history'; +import moment from 'moment'; import GridEditable, {GridColumnHeader} from 'sentry/components/gridEditable'; import {Hovercard} from 'sentry/components/hovercard'; import Link from 'sentry/components/links/link'; import ArrayValue from 'sentry/utils/discover/arrayValue'; +import usePageFilters from 'sentry/utils/usePageFilters'; +const PERIOD_REGEX = /^(\d+)([h,d])$/; const HOST = 'http://localhost:8080'; type Props = { @@ -41,7 +44,7 @@ const COLUMN_ORDER = [ }, { key: 'epm', - name: 'tpm', + name: 'Tpm', }, { key: 'p75', @@ -69,14 +72,29 @@ export default function APIModuleView({ const tableFilter = table ? `domain = '${table}'` : null; const actionFilter = action ? `action = '${action}'` : null; + const pageFilter = usePageFilters(); + const [_, num, unit] = pageFilter.selection.datetime.period?.match(PERIOD_REGEX) ?? []; + const startTime = + num && unit + ? moment().subtract(num, unit as 'h' | 'd') + : moment(pageFilter.selection.datetime.start); + const endTime = moment(pageFilter.selection.datetime.end ?? undefined); + const DATE_FILTERS = ` + start_timestamp > fromUnixTimestamp(${startTime.unix()}) and + start_timestamp < fromUnixTimestamp(${endTime.unix()}) + `; + const filters = [ `startsWith(span_operation, 'db')`, `span_operation != 'db.redis'`, transactionFilter, tableFilter, actionFilter, + DATE_FILTERS, ].filter(fil => !!fil); - const TABLE_LIST_QUERY = `select description, group_id, (divide(count(), divide(1209600.0, 60)) AS epm), quantile(0.75)(exclusive_time) as p75, + const TABLE_LIST_QUERY = `select description, group_id, count() as count, (divide(count, ${ + (endTime.unix() - startTime.unix()) / 60 + }) AS epm), quantile(0.75)(exclusive_time) as p75, uniq(transaction) as transactions, sum(exclusive_time) as total_time, domain, diff --git a/static/app/views/starfish/modules/databaseModule/index.tsx b/static/app/views/starfish/modules/databaseModule/index.tsx index 6690c5e58f2c41..7210f085146a7f 100644 --- a/static/app/views/starfish/modules/databaseModule/index.tsx +++ b/static/app/views/starfish/modules/databaseModule/index.tsx @@ -1,8 +1,11 @@ import {Component} from 'react'; +import styled from '@emotion/styled'; import {Location} from 'history'; +import DatePageFilter from 'sentry/components/datePageFilter'; import * as Layout from 'sentry/components/layouts/thirds'; import {t} from 'sentry/locale'; +import space from 'sentry/styles/space'; import { PageErrorAlert, PageErrorProvider, @@ -62,6 +65,9 @@ class DatabaseModule extends Component<Props, State> { <Layout.Body> <Layout.Main fullWidth> <PageErrorAlert /> + <FilterOptionsContainer> + <DatePageFilter alignDropdown="left" /> + </FilterOptionsContainer> <DatabaseChartView location={location} action={action} @@ -95,3 +101,10 @@ class DatabaseModule extends Component<Props, State> { } export default DatabaseModule; + +const FilterOptionsContainer = styled('div')` + display: flex; + flex-direction: row; + gap: ${space(1)}; + margin-bottom: ${space(2)}; +`;
b099c801c179309cd105c61b23149912be5cffc5
2024-09-20 03:40:16
Katie Byers
ref(buffer): Update `Buffer.incr`-related docstrings (#77767)
false
Update `Buffer.incr`-related docstrings (#77767)
ref
diff --git a/src/sentry/buffer/base.py b/src/sentry/buffer/base.py index 7e9bf9503745d4..5cdb624d011e97 100644 --- a/src/sentry/buffer/base.py +++ b/src/sentry/buffer/base.py @@ -104,10 +104,24 @@ def incr( ) -> None: """ >>> incr(Group, columns={'times_seen': 1}, filters={'pk': group.pk}) - signal_only - added to indicate that `process` should only call the complete - signal handler with the updated model and skip creates/updates in the database. this - is useful in cases where we need to do additional processing before writing to the - database and opt to do it in a `buffer_incr_complete` receiver. + + model - The model whose records will be updated + + columns - Columns whose values should be incremented, in the form + { column_name: increment_amount } + + filters - kwargs to pass to `<model_class>.objects.get` to select the records which will be + updated + + extra - Other columns whose values should be changed, in the form + { column_name: new_value }. This is separate from `columns` because existing values in those + columns are incremented, whereas existing values in these columns are fully overwritten with + the new values. + + signal_only - Added to indicate that `process` should only call the `buffer_incr_complete` + signal handler with the updated model and skip creates/updates in the database. This is useful + in cases where we need to do additional processing before writing to the database and opt to do + it in a `buffer_incr_complete` receiver. """ process_incr.apply_async( kwargs={ diff --git a/src/sentry/event_manager.py b/src/sentry/event_manager.py index a3074b33fedbf5..8158b9c23dc253 100644 --- a/src/sentry/event_manager.py +++ b/src/sentry/event_manager.py @@ -2209,9 +2209,9 @@ def _process_existing_aggregate( "title": _get_updated_group_title(existing_metadata, incoming_metadata), } - update_kwargs = {"times_seen": 1} - - buffer_incr(Group, update_kwargs, {"id": group.id}, updated_group_values) + # We pass `times_seen` separately from all of the other columns so that `buffer_inr` knows to + # increment rather than overwrite the existing value + buffer_incr(Group, {"times_seen": 1}, {"id": group.id}, updated_group_values) return bool(is_regression) diff --git a/src/sentry/tasks/process_buffer.py b/src/sentry/tasks/process_buffer.py index e4deedee5b5947..73d69a23a07325 100644 --- a/src/sentry/tasks/process_buffer.py +++ b/src/sentry/tasks/process_buffer.py @@ -67,9 +67,10 @@ def process_incr(**kwargs): def buffer_incr(model, *args, **kwargs): """ - Call `buffer.incr` task, resolving the model name first. + Call `buffer.incr` as a task on the given model, either directly or via celery depending on + `settings.SENTRY_BUFFER_INCR_AS_CELERY_TASK`. - `model_name` must be in form `app_label.model_name` e.g. `sentry.group`. + See `Buffer.incr` for an explanation of the args and kwargs to pass here. """ (buffer_incr_task.delay if settings.SENTRY_BUFFER_INCR_AS_CELERY_TASK else buffer_incr_task)( app_label=model._meta.app_label, model_name=model._meta.model_name, args=args, kwargs=kwargs @@ -83,6 +84,8 @@ def buffer_incr(model, *args, **kwargs): def buffer_incr_task(app_label, model_name, args, kwargs): """ Call `buffer.incr`, resolving the model first. + + `model_name` must be in form `app_label.model_name` e.g. `sentry.group`. """ from sentry import buffer
571a45d85093d4f9d87d2c047a751dda6cdda42d
2024-02-06 04:27:56
Kev
fix(metrics-extraction): Only send exception for old widget (#64602)
false
Only send exception for old widget (#64602)
fix
diff --git a/src/sentry/relay/config/metric_extraction.py b/src/sentry/relay/config/metric_extraction.py index 9cd595b3a699ae..d6aa52f9a04d9f 100644 --- a/src/sentry/relay/config/metric_extraction.py +++ b/src/sentry/relay/config/metric_extraction.py @@ -488,6 +488,14 @@ def _can_widget_query_use_stateful_extraction( on_demand_entry = on_demand_entries[0] on_demand_hashes = on_demand_entry.spec_hashes + if on_demand_entry.date_modified < widget_query.date_modified: + # On demand entry was updated before the widget_query got updated, meaning it's potentially out of date + metrics.incr( + "on_demand_metrics.on_demand_spec.out_of_date_on_demand", + sample_rate=1.0, + ) + return False + if set(spec_hashes) != set(on_demand_hashes): # Spec hashes should match. with sentry_sdk.push_scope() as scope: @@ -501,6 +509,7 @@ def _can_widget_query_use_stateful_extraction( amount=len(metrics_specs), sample_rate=1.0, ) + return False return True diff --git a/tests/sentry/relay/config/test_metric_extraction.py b/tests/sentry/relay/config/test_metric_extraction.py index 63aec2e4b35504..9234c496b8ddd8 100644 --- a/tests/sentry/relay/config/test_metric_extraction.py +++ b/tests/sentry/relay/config/test_metric_extraction.py @@ -1970,3 +1970,29 @@ def test_level_field(default_project: Project) -> None: create_widget([aggr], query, default_project) config = get_metric_extraction_config(default_project) assert config is None + + +@django_db_all +def test_widget_modifed_after_on_demand(default_project: Project) -> None: + duration = 1000 + with Feature( + { + ON_DEMAND_METRICS_WIDGETS: True, + "organizations:on-demand-metrics-query-spec-version-two": True, + } + ): + widget_query = create_widget( + ["epm()"], + f"transaction.duration:>={duration}", + default_project, + columns=["user.id", "release", "count()"], + ) + + with mock.patch("sentry_sdk.capture_exception") as capture_exception: + + process_widget_specs([widget_query.id]) + config = get_metric_extraction_config(default_project) + + assert config and config["metrics"] + + assert capture_exception.call_count == 0
8024974b5b8ec0d7d392431ae4921ecbc710c8c6
2025-02-13 22:40:19
anthony sottile
ref: remote MetricUnit literal (#85150)
false
remote MetricUnit literal (#85150)
ref
diff --git a/src/sentry/sentry_metrics/querying/metadata/metrics.py b/src/sentry/sentry_metrics/querying/metadata/metrics.py index d15da8f26440fc..7f01ec7b2e0fb6 100644 --- a/src/sentry/sentry_metrics/querying/metadata/metrics.py +++ b/src/sentry/sentry_metrics/querying/metadata/metrics.py @@ -7,7 +7,7 @@ from sentry.sentry_metrics.use_case_id_registry import UseCaseID from sentry.snuba.metrics import parse_mri from sentry.snuba.metrics.naming_layer.mri import ParsedMRI, get_available_operations -from sentry.snuba.metrics.utils import MetricMeta, MetricType, MetricUnit +from sentry.snuba.metrics.utils import MetricMeta, MetricType from sentry.snuba.metrics_layer.query import fetch_metric_mris @@ -75,7 +75,7 @@ def _build_metric_meta( return MetricMeta( type=cast(MetricType, parsed_mri.entity), name=parsed_mri.name, - unit=cast(MetricUnit, parsed_mri.unit), + unit=parsed_mri.unit, mri=parsed_mri.mri_string, operations=available_operations, projectIds=project_ids, diff --git a/src/sentry/snuba/metrics/naming_layer/mri.py b/src/sentry/snuba/metrics/naming_layer/mri.py index 716e29d84be58e..5fe3d215810dba 100644 --- a/src/sentry/snuba/metrics/naming_layer/mri.py +++ b/src/sentry/snuba/metrics/naming_layer/mri.py @@ -48,7 +48,6 @@ OP_REGEX, MetricEntity, MetricOperationType, - MetricUnit, ) MRI_SCHEMA_REGEX_STRING = r"(?P<entity>[^:]+):(?P<namespace>[^/]+)/(?P<name>[^@]+)@(?P<unit>.+)" @@ -274,8 +273,9 @@ def format_mri_field_value(field: str, value: str) -> str: if parsed_mri_field is None: return value - unit = cast(MetricUnit, parsed_mri_field.mri.unit) - return format_value_using_unit_and_op(float(value), unit, parsed_mri_field.op) + return format_value_using_unit_and_op( + float(value), parsed_mri_field.mri.unit, parsed_mri_field.op + ) except InvalidParams: return value diff --git a/src/sentry/snuba/metrics/units.py b/src/sentry/snuba/metrics/units.py index 78880fef339a8f..f7e9b7550bd795 100644 --- a/src/sentry/snuba/metrics/units.py +++ b/src/sentry/snuba/metrics/units.py @@ -1,4 +1,4 @@ -from sentry.snuba.metrics.utils import MetricOperationType, MetricUnit +from sentry.snuba.metrics.utils import MetricOperationType from sentry.utils.numbers import format_bytes __all__ = ( @@ -8,7 +8,7 @@ def format_value_using_unit_and_op( - value: int | float, unit: MetricUnit, op: MetricOperationType | None + value: int | float, unit: str, op: MetricOperationType | None ) -> str: if op == "count" or op == "count_unique": return round_with_fixed(value, 2) @@ -16,7 +16,7 @@ def format_value_using_unit_and_op( return format_value_using_unit(value, unit) -def format_value_using_unit(value: int | float, unit: MetricUnit) -> str: +def format_value_using_unit(value: int | float, unit: str) -> str: if unit == "nanosecond": return get_duration(value / 1000000000) elif unit == "microsecond": diff --git a/src/sentry/snuba/metrics/utils.py b/src/sentry/snuba/metrics/utils.py index 3eff50bfe702d8..f81cb43643a23f 100644 --- a/src/sentry/snuba/metrics/utils.py +++ b/src/sentry/snuba/metrics/utils.py @@ -15,7 +15,6 @@ "TS_COL_GROUP", "TAG_REGEX", "MetricOperationType", - "MetricUnit", "MetricType", "OP_TO_SNUBA_FUNCTION", "AVAILABLE_OPERATIONS", @@ -93,31 +92,6 @@ "on_demand_count_web_vitals", "on_demand_user_misery", ] -MetricUnit = Literal[ - "nanosecond", - "microsecond", - "millisecond", - "second", - "minute", - "hour", - "day", - "week", - "bit", - "byte", - "kibibyte", - "mebibyte", - "gibibyte", - "tebibyte", - "pebibyte", - "exbibyte", - "kilobyte", - "megabyte", - "gigabyte", - "terabyte", - "petabyte", - "exabyte", - "none", -] #: The type of metric, which determines the snuba entity to query MetricType = Literal[ "counter", @@ -338,7 +312,7 @@ class MetricMeta(TypedDict): name: str type: MetricType operations: Collection[MetricOperationType] - unit: MetricUnit | None + unit: str | None metric_id: NotRequired[int] mri: str projectIds: Sequence[int]
b959993401b99d14e72994411e42017a4b4127c3
2025-01-03 03:18:40
Evan Purkhiser
ref(browserHistory): Remove from transactionsTable (#82706)
false
Remove from transactionsTable (#82706)
ref
diff --git a/static/app/views/insights/queues/components/tables/transactionsTable.tsx b/static/app/views/insights/queues/components/tables/transactionsTable.tsx index df3bb8fd600ee8..e741c309e46dae 100644 --- a/static/app/views/insights/queues/components/tables/transactionsTable.tsx +++ b/static/app/views/insights/queues/components/tables/transactionsTable.tsx @@ -12,13 +12,13 @@ import type {CursorHandler} from 'sentry/components/pagination'; import Pagination from 'sentry/components/pagination'; import {t} from 'sentry/locale'; import type {Organization} from 'sentry/types/organization'; -import {browserHistory} from 'sentry/utils/browserHistory'; import type {EventsMetaType} from 'sentry/utils/discover/eventView'; import {FIELD_FORMATTERS, getFieldRenderer} from 'sentry/utils/discover/fieldRenderers'; import type {Sort} from 'sentry/utils/discover/fields'; import {decodeScalar, decodeSorts} from 'sentry/utils/queryString'; import useLocationQuery from 'sentry/utils/url/useLocationQuery'; import {useLocation} from 'sentry/utils/useLocation'; +import {useNavigate} from 'sentry/utils/useNavigate'; import useOrganization from 'sentry/utils/useOrganization'; import {renderHeadCell} from 'sentry/views/insights/common/components/tableCells/renderHeadCell'; import {useModuleURL} from 'sentry/views/insights/common/utils/useModuleURL'; @@ -103,8 +103,9 @@ const DEFAULT_SORT = { }; export function TransactionsTable() { - const organization = useOrganization(); + const navigate = useNavigate(); const location = useLocation(); + const organization = useOrganization(); const locationQuery = useLocationQuery({ fields: { @@ -124,7 +125,7 @@ export function TransactionsTable() { }); const handleCursor: CursorHandler = (newCursor, pathname, query) => { - browserHistory.push({ + navigate({ pathname, query: {...query, [QueryParameterNames.TRANSACTIONS_CURSOR]: newCursor}, });
e1111d98e133b6863551ad02dc463d9dc15673a9
2019-11-13 06:52:23
Dan Fuller
fix(api): Fix failing snuba test in Django 1.9
false
Fix failing snuba test in Django 1.9
fix
diff --git a/tests/snuba/api/endpoints/test_organization_group_index.py b/tests/snuba/api/endpoints/test_organization_group_index.py index 263abbb6151009..20bf012de6c3a5 100644 --- a/tests/snuba/api/endpoints/test_organization_group_index.py +++ b/tests/snuba/api/endpoints/test_organization_group_index.py @@ -5,6 +5,7 @@ from datetime import timedelta from uuid import uuid4 +import django from django.core.urlresolvers import reverse from django.utils import timezone from mock import patch, Mock @@ -1180,7 +1181,15 @@ def test_set_private(self): response = self.get_valid_response( qs_params={"id": [group1.id, group2.id]}, isPublic="false" ) - assert response.data == {"isPublic": False} + if django.VERSION < (1, 9): + assert response.data == {"isPublic": False} + else: + # In Django < 1.9 `.delete()` returns nothing, even if it manages to delete + # rows. In 1.9+ it returns information about how many rows were deleted. + # We use `.delete()` in an if statement when setting `isPublic`, and it was + # always returning False due to this. Since this is fixed we now have this + # extra attribute. + assert response.data == {"isPublic": False, "shareId": None} new_group1 = Group.objects.get(id=group1.id) assert not bool(new_group1.get_share_id())
293aff8811a1b0941587955b8d155b0f1981e339
2021-09-29 01:09:19
William Mak
ref(discover): Update timeout message to include transaction (#28883)
false
Update timeout message to include transaction (#28883)
ref
diff --git a/src/sentry/api/bases/organization_events.py b/src/sentry/api/bases/organization_events.py index c10dff0adc4dbd..8cfe878de02929 100644 --- a/src/sentry/api/bases/organization_events.py +++ b/src/sentry/api/bases/organization_events.py @@ -16,6 +16,7 @@ from sentry.exceptions import InvalidSearchQuery from sentry.models import Organization, Team from sentry.models.group import Group +from sentry.search.events.constants import TIMEOUT_ERROR_MESSAGE from sentry.search.events.fields import get_function_alias from sentry.search.events.filter import get_filter from sentry.snuba import discover @@ -162,9 +163,7 @@ def handle_query_errors(self): ), ): sentry_sdk.set_tag("query.error_reason", "Timeout") - raise ParseError( - detail="Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects." - ) + raise ParseError(detail=TIMEOUT_ERROR_MESSAGE) elif isinstance(error, (snuba.UnqualifiedQueryError)): sentry_sdk.set_tag("query.error_reason", str(error)) raise ParseError(detail=str(error)) diff --git a/src/sentry/data_export/utils.py b/src/sentry/data_export/utils.py index 98ae801bdb9ceb..0653675019b6fc 100644 --- a/src/sentry/data_export/utils.py +++ b/src/sentry/data_export/utils.py @@ -1,5 +1,6 @@ from functools import wraps +from sentry.search.events.constants import TIMEOUT_ERROR_MESSAGE from sentry.snuba import discover from sentry.utils import metrics, snuba from sentry.utils.sdk import capture_exception @@ -44,7 +45,7 @@ def wrapped(*args, **kwargs): snuba.QueryTooManySimultaneous, ), ): - message = "Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects." + message = TIMEOUT_ERROR_MESSAGE recoverable = True elif isinstance( error, diff --git a/src/sentry/search/events/constants.py b/src/sentry/search/events/constants.py index 1f37ef8e426f84..690f407a63efc9 100644 --- a/src/sentry/search/events/constants.py +++ b/src/sentry/search/events/constants.py @@ -3,6 +3,10 @@ from sentry.snuba.dataset import Dataset from sentry.utils.snuba import DATASETS +TIMEOUT_ERROR_MESSAGE = """ +Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects. Also consider a +filter on the transaction field if you're filtering performance data. +""" KEY_TRANSACTION_ALIAS = "key_transaction" PROJECT_THRESHOLD_CONFIG_INDEX_ALIAS = "project_threshold_config_index" PROJECT_THRESHOLD_OVERRIDE_CONFIG_INDEX_ALIAS = "project_threshold_override_config_index" diff --git a/tests/sentry/data_export/test_tasks.py b/tests/sentry/data_export/test_tasks.py index cd860cecc7aebb..d901adca00b537 100644 --- a/tests/sentry/data_export/test_tasks.py +++ b/tests/sentry/data_export/test_tasks.py @@ -5,6 +5,7 @@ from sentry.data_export.tasks import assemble_download, merge_export_blobs from sentry.exceptions import InvalidSearchQuery from sentry.models import File +from sentry.search.events.constants import TIMEOUT_ERROR_MESSAGE from sentry.testutils import SnubaTestCase, TestCase from sentry.testutils.helpers.datetime import before_now, iso_format from sentry.utils.compat.mock import patch @@ -499,37 +500,25 @@ def test_discover_snuba_error(self, emailer, mock_query): with self.tasks(): assemble_download(de.id, count_down=0) error = emailer.call_args[1]["message"] - assert ( - error - == "Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects." - ) + assert error == TIMEOUT_ERROR_MESSAGE mock_query.side_effect = QueryMemoryLimitExceeded("test") with self.tasks(): assemble_download(de.id, count_down=0) error = emailer.call_args[1]["message"] - assert ( - error - == "Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects." - ) + assert error == TIMEOUT_ERROR_MESSAGE mock_query.side_effect = QueryExecutionTimeMaximum("test") with self.tasks(): assemble_download(de.id, count_down=0) error = emailer.call_args[1]["message"] - assert ( - error - == "Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects." - ) + assert error == TIMEOUT_ERROR_MESSAGE mock_query.side_effect = QueryTooManySimultaneous("test") with self.tasks(): assemble_download(de.id, count_down=0) error = emailer.call_args[1]["message"] - assert ( - error - == "Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects." - ) + assert error == TIMEOUT_ERROR_MESSAGE mock_query.side_effect = DatasetSelectionError("test") with self.tasks(): diff --git a/tests/snuba/api/endpoints/test_organization_events_v2.py b/tests/snuba/api/endpoints/test_organization_events_v2.py index b33149da69142b..cd74b27372fb14 100644 --- a/tests/snuba/api/endpoints/test_organization_events_v2.py +++ b/tests/snuba/api/endpoints/test_organization_events_v2.py @@ -22,6 +22,7 @@ SEMVER_ALIAS, SEMVER_BUILD_ALIAS, SEMVER_PACKAGE_ALIAS, + TIMEOUT_ERROR_MESSAGE, ) from sentry.testutils import APITestCase, SnubaTestCase from sentry.testutils.helpers import parse_link_header @@ -144,10 +145,7 @@ def test_handling_snuba_errors(self, mock_query): query = {"field": ["id", "timestamp"], "orderby": ["-timestamp", "-id"]} response = self.do_request(query) assert response.status_code == 400, response.content - assert ( - response.data["detail"] - == "Query timeout. Please try again. If the problem persists try a smaller date range or fewer projects." - ) + assert response.data["detail"] == TIMEOUT_ERROR_MESSAGE mock_query.side_effect = QueryExecutionError("test")
a0652d9d7c5ff91c933ff6f5f505b74b60c69da6
2023-08-26 00:56:05
Michelle Zhang
ref: convert sentryAppToken.js to typescript (#55076)
false
convert sentryAppToken.js to typescript (#55076)
ref
diff --git a/fixtures/js-stubs/sentryAppToken.js b/fixtures/js-stubs/sentryAppToken.tsx similarity index 51% rename from fixtures/js-stubs/sentryAppToken.js rename to fixtures/js-stubs/sentryAppToken.tsx index 6b3f3d21d2390e..85c49d1e2d85c8 100644 --- a/fixtures/js-stubs/sentryAppToken.js +++ b/fixtures/js-stubs/sentryAppToken.tsx @@ -1,11 +1,17 @@ -export function SentryAppToken(params = {}) { +import {InternalAppApiToken} from 'sentry/types'; + +export function SentryAppToken( + params: Partial<InternalAppApiToken> = {} +): InternalAppApiToken { return { token: '123456123456123456123456-token', dateCreated: '2019-03-02T18:30:26Z', scopes: [], refreshToken: '123456123456123456123456-refreshtoken', - expiresAt: null, + expiresAt: '', application: null, + id: '1', + state: 'active', ...params, }; }
2ec7aba2853221487ef287e3c20efd5b74e8e7da
2023-10-20 14:14:12
Ogi
fix(on-demand): p100 support (#58500)
false
p100 support (#58500)
fix
diff --git a/src/sentry/snuba/metrics/utils.py b/src/sentry/snuba/metrics/utils.py index b84adcd8ecb24a..cfdf90c6746eed 100644 --- a/src/sentry/snuba/metrics/utils.py +++ b/src/sentry/snuba/metrics/utils.py @@ -278,6 +278,7 @@ class MetricMetaWithTagKeys(MetricMeta): "p90", "p95", "p99", + "p100", ) DERIVED_OPERATIONS = ( "histogram",
e1f3b4eb97d805f8632b2dc92796a5e97297d00b
2024-02-21 22:40:45
Matt Duncan
ref(issues): Mark OrganizationProjectsSentFirstEventEndpoint private (#65509)
false
Mark OrganizationProjectsSentFirstEventEndpoint private (#65509)
ref
diff --git a/src/sentry/api/endpoints/organization_projects_sent_first_event.py b/src/sentry/api/endpoints/organization_projects_sent_first_event.py index a350a479cca779..20c94045d0cfff 100644 --- a/src/sentry/api/endpoints/organization_projects_sent_first_event.py +++ b/src/sentry/api/endpoints/organization_projects_sent_first_event.py @@ -12,7 +12,7 @@ class OrganizationProjectsSentFirstEventEndpoint(OrganizationEndpoint): owner = ApiOwner.ISSUES publish_status = { - "GET": ApiPublishStatus.UNKNOWN, + "GET": ApiPublishStatus.PRIVATE, } def get(self, request: Request, organization) -> Response:
9e1f16e1445b81827867feac20feaf3f2703823c
2022-06-07 19:27:54
edwardgou-sentry
feat(alerts): Update relatedTransactions table to use events (#35393)
false
Update relatedTransactions table to use events (#35393)
feat
diff --git a/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx b/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx index 0a1d8c28336ff0..6179c5786d8f65 100644 --- a/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx +++ b/static/app/views/alerts/rules/metric/details/relatedTransactions.tsx @@ -68,7 +68,7 @@ class Table extends Component<TableProps, TableState> { const tableMeta = tableData.meta; const field = String(column.key); - const fieldRenderer = getFieldRenderer(field, tableMeta); + const fieldRenderer = getFieldRenderer(field, tableMeta, false); const rendered = fieldRenderer(dataRow, {organization, location}); if (field === 'transaction') { @@ -149,6 +149,7 @@ class Table extends Component<TableProps, TableState> { eventView={sortedEventView} orgSlug={organization.slug} location={location} + useEvents > {({isLoading, tableData}) => ( <GridEditable
cdbc6c38a6b8244c01accd87e1e314fac4139438
2024-10-11 22:55:29
Josh Ferge
ref(ownership): refactor post_process telemetry (#78979)
false
refactor post_process telemetry (#78979)
ref
diff --git a/src/sentry/models/projectownership.py b/src/sentry/models/projectownership.py index 1f8031b9ba8980..ba1a81de5d764a 100644 --- a/src/sentry/models/projectownership.py +++ b/src/sentry/models/projectownership.py @@ -5,6 +5,7 @@ from collections.abc import Mapping, Sequence from typing import TYPE_CHECKING, Any +import sentry_sdk from django.db import models from django.db.models.signals import post_delete, post_save from django.utils import timezone @@ -168,6 +169,7 @@ def _hydrate_rules(cls, project_id, rules, type: str = OwnerRuleType.OWNERSHIP_R @classmethod @metrics.wraps("projectownership.get_issue_owners") + @sentry_sdk.trace def get_issue_owners( cls, project_id, data, limit=2 ) -> Sequence[tuple[Rule, Sequence[Team | RpcUser], str]]: diff --git a/src/sentry/tasks/post_process.py b/src/sentry/tasks/post_process.py index f3aa26f85933fc..3b6d171c9f13f8 100644 --- a/src/sentry/tasks/post_process.py +++ b/src/sentry/tasks/post_process.py @@ -176,6 +176,7 @@ def _capture_group_stats(job: PostProcessJob) -> None: metrics.incr("events.unique", tags={"platform": platform}, skip_internal=False) +@sentry_sdk.trace def should_issue_owners_ratelimit(project_id: int, group_id: int, organization_id: int | None): """ Make sure that we do not accept more groups than the enforced_limit at the project level. @@ -204,109 +205,87 @@ def should_issue_owners_ratelimit(project_id: int, group_id: int, organization_i return len(groups) > enforced_limit [email protected]("post_process.handle_owner_assignment") +@sentry_sdk.trace def handle_owner_assignment(job): if job["is_reprocessed"]: return - with sentry_sdk.start_span(op="tasks.post_process_group.handle_owner_assignment"): - try: - from sentry.models.groupowner import ( - ASSIGNEE_DOES_NOT_EXIST_DURATION, - ASSIGNEE_EXISTS_DURATION, - ASSIGNEE_EXISTS_KEY, - ISSUE_OWNERS_DEBOUNCE_DURATION, - ISSUE_OWNERS_DEBOUNCE_KEY, - ) - from sentry.models.projectownership import ProjectOwnership - - event = job["event"] - project, group = event.project, event.group - # We want to debounce owner assignment when: - # - GroupOwner of type Ownership Rule || CodeOwner exist with TTL 1 day - # - we tried to calculate and could not find issue owners with TTL 1 day - # - an Assignee has been set with TTL of infinite - with metrics.timer("post_process.handle_owner_assignment"): - with sentry_sdk.start_span(op="post_process.handle_owner_assignment.ratelimited"): - if should_issue_owners_ratelimit( - project_id=project.id, - group_id=group.id, - organization_id=event.project.organization_id, - ): - metrics.incr("sentry.task.post_process.handle_owner_assignment.ratelimited") - return + from sentry.models.groupowner import ( + ASSIGNEE_DOES_NOT_EXIST_DURATION, + ASSIGNEE_EXISTS_DURATION, + ASSIGNEE_EXISTS_KEY, + ISSUE_OWNERS_DEBOUNCE_DURATION, + ISSUE_OWNERS_DEBOUNCE_KEY, + ) + from sentry.models.projectownership import ProjectOwnership - with sentry_sdk.start_span( - op="post_process.handle_owner_assignment.cache_set_assignee" - ): - # Is the issue already assigned to a team or user? - assignee_key = ASSIGNEE_EXISTS_KEY(group.id) - assignees_exists = cache.get(assignee_key) - if assignees_exists is None: - assignees_exists = group.assignee_set.exists() - # Cache for 1 day if it's assigned. We don't need to move that fast. - cache.set( - assignee_key, - assignees_exists, - ( - ASSIGNEE_EXISTS_DURATION - if assignees_exists - else ASSIGNEE_DOES_NOT_EXIST_DURATION - ), - ) + event = job["event"] + project, group = event.project, event.group + # We want to debounce owner assignment when: + # - GroupOwner of type Ownership Rule || CodeOwner exist with TTL 1 day + # - we tried to calculate and could not find issue owners with TTL 1 day + # - an Assignee has been set with TTL of infinite + + if should_issue_owners_ratelimit( + project_id=project.id, + group_id=group.id, + organization_id=event.project.organization_id, + ): + metrics.incr("sentry.task.post_process.handle_owner_assignment.ratelimited") + return - if assignees_exists: - metrics.incr( - "sentry.task.post_process.handle_owner_assignment.assignee_exists" - ) - return + # Is the issue already assigned to a team or user? + assignee_key = ASSIGNEE_EXISTS_KEY(group.id) + assignees_exists = cache.get(assignee_key) + if assignees_exists is None: + assignees_exists = group.assignee_set.exists() + # Cache for 1 day if it's assigned. We don't need to move that fast. + cache.set( + assignee_key, + assignees_exists, + (ASSIGNEE_EXISTS_DURATION if assignees_exists else ASSIGNEE_DOES_NOT_EXIST_DURATION), + ) - with sentry_sdk.start_span( - op="post_process.handle_owner_assignment.debounce_issue_owners" - ): - issue_owners_key = ISSUE_OWNERS_DEBOUNCE_KEY(group.id) - debounce_issue_owners = cache.get(issue_owners_key) + if assignees_exists: + metrics.incr("sentry.task.post_process.handle_owner_assignment.assignee_exists") + return - if debounce_issue_owners: - metrics.incr("sentry.tasks.post_process.handle_owner_assignment.debounce") - return + issue_owners_key = ISSUE_OWNERS_DEBOUNCE_KEY(group.id) + debounce_issue_owners = cache.get(issue_owners_key) - with metrics.timer("post_process.process_owner_assignments.duration"): - with sentry_sdk.start_span( - op="post_process.handle_owner_assignment.get_issue_owners" - ): - if killswitch_matches_context( - "post_process.get-autoassign-owners", - { - "project_id": project.id, - }, - ): - # see ProjectOwnership.get_issue_owners - issue_owners: Sequence[tuple[Rule, Sequence[Team | RpcUser], str]] = [] - else: - issue_owners = ProjectOwnership.get_issue_owners(project.id, event.data) - - # Cache for 1 day after we calculated. We don't need to move that fast. - cache.set( - issue_owners_key, - True, - ISSUE_OWNERS_DEBOUNCE_DURATION, - ) + if debounce_issue_owners: + metrics.incr("sentry.tasks.post_process.handle_owner_assignment.debounce") + return - with sentry_sdk.start_span( - op="post_process.handle_owner_assignment.handle_group_owners" - ): - if issue_owners: - try: - handle_group_owners(project, group, issue_owners) - except Exception: - logger.exception("Failed to store group owners") - else: - handle_invalid_group_owners(group) + if killswitch_matches_context( + "post_process.get-autoassign-owners", + { + "project_id": project.id, + }, + ): + # see ProjectOwnership.get_issue_owners + issue_owners: Sequence[tuple[Rule, Sequence[Team | RpcUser], str]] = [] + handle_invalid_group_owners(group) + else: + issue_owners = ProjectOwnership.get_issue_owners(project.id, event.data) + # Cache for 1 day after we calculated. We don't need to move that fast. + cache.set( + issue_owners_key, + True, + ISSUE_OWNERS_DEBOUNCE_DURATION, + ) + if issue_owners: + try: + handle_group_owners(project, group, issue_owners) except Exception: - logger.exception("Failed to handle owner assignments") + logger.exception("Failed to store group owners") + else: + handle_invalid_group_owners(group) +@sentry_sdk.trace def handle_invalid_group_owners(group): from sentry.models.groupowner import GroupOwner, GroupOwnerType @@ -322,6 +301,7 @@ def handle_invalid_group_owners(group): ) +@sentry_sdk.trace def handle_group_owners( project: Project, group: Group,
a6abdc2ad2b6c5d742a45f2fff030f7c4504a6b6
2022-05-11 18:53:47
Ryan Albrecht
fix(replay): Use `AbortController` to prevent extra state updates after the mouse has left the tracking component (#34419)
false
Use `AbortController` to prevent extra state updates after the mouse has left the tracking component (#34419)
fix
diff --git a/static/app/components/replays/player/horizontalMouseTracking.tsx b/static/app/components/replays/player/horizontalMouseTracking.tsx index 4457e24a04ea57..d1bd40bd29ad47 100644 --- a/static/app/components/replays/player/horizontalMouseTracking.tsx +++ b/static/app/components/replays/player/horizontalMouseTracking.tsx @@ -1,4 +1,5 @@ import React, {useCallback, useRef} from 'react'; +import * as Sentry from '@sentry/react'; import {useReplayContext} from 'sentry/components/replays/replayContext'; @@ -6,18 +7,33 @@ type Props = { children: React.ReactNode; }; +class AbortError extends Error {} + /** * Replace `elem.getBoundingClientRect()` which is too laggy for onMouseMove */ -function getBoundingRect(elem: Element): Promise<DOMRectReadOnly> { - return new Promise((resolve, _reject) => { +function getBoundingRect( + elem: Element, + {signal}: {signal: AbortSignal} +): Promise<DOMRectReadOnly> { + return new Promise((resolve, reject) => { + if (signal.aborted) { + reject(new AbortError()); + } + + const abortHandler = () => { + reject(new AbortError()); + }; + const observer = new IntersectionObserver(entries => { for (const entry of entries) { const bounds = entry.boundingClientRect; resolve(bounds); + signal.removeEventListener('abort', abortHandler); } observer.disconnect(); }); + signal.addEventListener('abort', abortHandler); observer.observe(elem); }); } @@ -25,6 +41,7 @@ function getBoundingRect(elem: Element): Promise<DOMRectReadOnly> { // TODO(replay): should this be an HoC? function HorizontalMouseTracking({children}: Props) { const elem = useRef<HTMLDivElement>(null); + const controller = useRef<AbortController>(new AbortController()); const {duration, setCurrentHoverTime} = useReplayContext(); const onMouseMove = useCallback( @@ -34,22 +51,38 @@ function HorizontalMouseTracking({children}: Props) { return; } - const rect = await getBoundingRect(elem.current); - const left = e.clientX - rect.left; - if (left >= 0) { - const percent = left / rect.width; - const time = percent * duration; - setCurrentHoverTime(time); - } else { - setCurrentHoverTime(undefined); + try { + const rect = await getBoundingRect(elem.current, { + signal: controller.current.signal, + }); + const left = e.clientX - rect.left; + if (left >= 0) { + const percent = left / rect.width; + const time = percent * duration; + setCurrentHoverTime(time); + } else { + setCurrentHoverTime(undefined); + } + } catch (err) { + if (err instanceof AbortError) { + // Ignore abortions + return; + } + + Sentry.captureException(err); } }, - [duration, setCurrentHoverTime] + [controller, duration, setCurrentHoverTime] ); const onMouseLeave = useCallback(() => { + if (controller.current) { + controller.current.abort(); + controller.current = new AbortController(); + } + setCurrentHoverTime(undefined); - }, [setCurrentHoverTime]); + }, [controller, setCurrentHoverTime]); return ( <div
ea4b299abf3d40aa5e660924dec4f530c68ccf43
2020-02-19 23:02:25
Markus Unterwaditzer
fix: Remove broken attribute access (#17131)
false
Remove broken attribute access (#17131)
fix
diff --git a/src/sentry/ingest/ingest_consumer.py b/src/sentry/ingest/ingest_consumer.py index 99d6ba340ac868..36dd9b5d277699 100644 --- a/src/sentry/ingest/ingest_consumer.py +++ b/src/sentry/ingest/ingest_consumer.py @@ -65,7 +65,7 @@ def flush_batch(self, batch): projects_to_fetch = set() - with metrics.timer("ingest_consumer.prepare_messages", tags=self.__metrics_default_tags): + with metrics.timer("ingest_consumer.prepare_messages"): for message in batch: message_type = message["type"] projects_to_fetch.add(message["project_id"]) @@ -81,13 +81,11 @@ def flush_batch(self, batch): else: raise ValueError("Unknown message type: {}".format(message_type)) - with metrics.timer("ingest_consumer.fetch_projects", tags=self.__metrics_default_tags): + with metrics.timer("ingest_consumer.fetch_projects"): projects = {p.id: p for p in Project.objects.get_many_from_cache(projects_to_fetch)} # attachment_chunk messages need to be processed before attachment/event messages. - with metrics.timer( - "ingest_consumer.process_attachment_chunk_batch", tags=self.__metrics_default_tags - ): + with metrics.timer("ingest_consumer.process_attachment_chunk_batch"): for _ in self.pool.imap_unordered( lambda msg: process_attachment_chunk(msg, projects=projects), attachment_chunks, diff --git a/tests/sentry/ingest/ingest_consumer/test_ingest_kafka.py b/tests/sentry/ingest/ingest_consumer/test_ingest_kafka.py index 4de4cd94e16fca..297c22fe9d3804 100644 --- a/tests/sentry/ingest/ingest_consumer/test_ingest_kafka.py +++ b/tests/sentry/ingest/ingest_consumer/test_ingest_kafka.py @@ -8,6 +8,7 @@ from django.conf import settings +from sentry import eventstore from sentry.event_manager import EventManager from sentry.ingest.ingest_consumer import ConsumerType, get_ingest_consumer from sentry.utils import json @@ -50,37 +51,10 @@ def _get_test_message(project): return val, event_id -def _shutdown_requested(max_secs, num_events): - """ - Requests a shutdown after the specified interval has passed or the specified number - of events are detected - :param max_secs: number of seconds after which to request a shutdown - :param num_events: number of events after which to request a shutdown - :return: True if a shutdown is requested False otherwise - """ - from sentry.models import Event - - def inner(): - end_time = time.time() - if end_time - start_time > max_secs: - logger.debug("Shutdown requested because max secs exceeded") - return True - elif Event.objects.count() >= num_events: - logger.debug("Shutdown requested because num events reached") - return True - else: - return False - - start_time = time.time() - return inner - - @pytest.mark.django_db def test_ingest_consumer_reads_from_topic_and_calls_celery_task( task_runner, kafka_producer, kafka_admin, requires_kafka ): - from sentry.models import Event - group_id = "test-consumer" topic_event_name = ConsumerType.get_topic_name(ConsumerType.Events) @@ -107,14 +81,16 @@ def test_ingest_consumer_reads_from_topic_and_calls_celery_task( with task_runner(): i = 0 - while Event.objects.count() < 3 and i < MAX_POLL_ITERATIONS: + while i < MAX_POLL_ITERATIONS: + if eventstore.get_event_by_id(project.id, event_id): + break + consumer._run_once() i += 1 # check that we got the messages - assert Event.objects.count() == 3 for event_id in event_ids: - message = Event.objects.get(event_id=event_id) + message = eventstore.get_event_by_id(project.id, event_id) assert message is not None # check that the data has not been scrambled assert message.data["extra"]["the_id"] == event_id
81d34d0487970da634cef65e0e5e2de5dcbbe9ef
2023-11-08 00:06:45
NisanthanNanthakumar
feat(eventuser): Migrate save_userreport away from EventUser (#59179)
false
Migrate save_userreport away from EventUser (#59179)
feat
diff --git a/src/sentry/api/serializers/models/userreport.py b/src/sentry/api/serializers/models/userreport.py index 71281c49e3e1cf..19b061411fd5b8 100644 --- a/src/sentry/api/serializers/models/userreport.py +++ b/src/sentry/api/serializers/models/userreport.py @@ -1,38 +1,55 @@ +from typing import Dict + +from sentry import eventstore from sentry.api.serializers import Serializer, register, serialize -from sentry.models.eventuser import EventUser +from sentry.eventstore.models import Event from sentry.models.group import Group +from sentry.models.project import Project from sentry.models.userreport import UserReport +from sentry.snuba.dataset import Dataset +from sentry.utils.eventuser import EventUser @register(UserReport) class UserReportSerializer(Serializer): def get_attrs(self, item_list, user, **kwargs): - event_user_ids = {i.event_user_id for i in item_list if i.event_user_id} + attrs = {} - # Avoid querying if there aren't any to actually query, it's possible - # for event_user_id to be None. - if event_user_ids: - queryset = list(EventUser.objects.filter(id__in=event_user_ids)) - event_users = {e.id: d for e, d in zip(queryset, serialize(queryset, user))} - else: - event_users = {} + project = Project.objects.get(id=item_list[0].project_id) - attrs = {} + events = eventstore.backend.get_events( + filter=eventstore.Filter( + event_ids=[item.event_id for item in item_list], + project_ids=[project.id], + ), + referrer="UserReportSerializer.get_attrs", + dataset=Dataset.Events, + tenant_ids={"organization_id": project.organization_id}, + ) + + events_dict: Dict[str, Event] = {event.event_id: event for event in events} for item in item_list: - attrs[item] = {"event_user": event_users.get(item.event_user_id)} + attrs[item] = { + "event_user": EventUser.from_event(events_dict[item.event_id]) + if events_dict.get(item.event_id) + else {} + } return attrs def serialize(self, obj, attrs, user, **kwargs): # TODO(dcramer): add in various context from the event # context == user / http / extra interfaces + name = obj.name or obj.email email = obj.email + user = None if attrs["event_user"]: event_user = attrs["event_user"] - if isinstance(event_user, dict): - name = name or event_user.get("name") - email = email or event_user.get("email") + if isinstance(event_user, EventUser): + name = name or event_user.name + email = email or event_user.email + user = event_user.serialize() return { "id": str(obj.id), "eventID": obj.event_id, @@ -40,7 +57,7 @@ def serialize(self, obj, attrs, user, **kwargs): "email": email, "comments": obj.comments, "dateCreated": obj.date_added, - "user": attrs["event_user"], + "user": user, "event": {"id": obj.event_id, "eventID": obj.event_id}, } diff --git a/src/sentry/ingest/userreport.py b/src/sentry/ingest/userreport.py index fb5813239c2863..acdbc5ad026531 100644 --- a/src/sentry/ingest/userreport.py +++ b/src/sentry/ingest/userreport.py @@ -1,29 +1,23 @@ from __future__ import annotations import logging -from datetime import datetime, timedelta -from typing import Any, Mapping, Optional, Tuple +from datetime import timedelta from django.db import IntegrityError, router from django.utils import timezone -from snuba_sdk import Column, Condition, Entity, Op, Query, Request from sentry import analytics, eventstore, features -from sentry.api.serializers import serialize from sentry.eventstore.models import Event from sentry.feedback.usecases.create_feedback import shim_to_feedback -from sentry.models.eventuser import EventUser +from sentry.models.eventuser import EventUser as EventUser_model from sentry.models.userreport import UserReport from sentry.signals import user_feedback_received -from sentry.snuba.dataset import Dataset, EntityKey from sentry.utils import metrics from sentry.utils.db import atomic_transaction -from sentry.utils.snuba import raw_snql_query +from sentry.utils.eventuser import EventUser logger = logging.getLogger(__name__) -REFERRER = "sentry.ingest.userreport" - class Conflict(Exception): pass @@ -40,21 +34,23 @@ def save_userreport(project, report, start_time=None): event = eventstore.backend.get_event_by_id(project.id, report["event_id"]) - # TODO(dcramer): we should probably create the user if they dont - # exist, and ideally we'd also associate that with the event - euser = find_event_user(report, event) - - if features.has("organizations:eventuser-from-snuba", project.organization) and event: - try: - find_and_compare_eventuser_data(event, euser) - except Exception: - logger.exception( - "Error when attempting to compare EventUser with Snuba results & Event data" - ) + euser, eventuser_record = find_event_user(event, report) if euser and not euser.name and report.get("name"): - euser.update(name=report["name"]) + euser.name = report["name"] + + # TODO(nisanthan): Continue updating the EventUser record's name + # And record metrics to see how often this logic hits. + if eventuser_record and not eventuser_record.name and report.get("name"): + eventuser_record.update(name=report["name"]) + analytics.record( + "eventuser_endpoint.request", + project_id=project.id, + endpoint="sentry.ingest.userreport.eventuser_record_name.update", + ) + if euser: + # TODO(nisanthan): Remove this eventually once UserReport model drops the event_user_id column report["event_user_id"] = euser.id if event: @@ -108,12 +104,12 @@ def save_userreport(project, report, start_time=None): return report_instance -def find_event_user(report_data, event): +def find_eventuser_record(report_data, event): if not event: if not report_data.get("email"): return None try: - return EventUser.objects.filter( + return EventUser_model.objects.filter( project_id=report_data["project_id"], email=report_data["email"] )[0] except IndexError: @@ -125,181 +121,17 @@ def find_event_user(report_data, event): return None try: - return EventUser.for_tags(project_id=report_data["project_id"], values=[tag])[tag] + return EventUser_model.for_tags(project_id=report_data["project_id"], values=[tag])[tag] except KeyError: pass -def find_and_compare_eventuser_data(event: Event, eventuser: EventUser): - """ - Compare the EventUser record, the query results from Snuba and - the Event data property with each other. - Log the results of the comparisons. - """ - try: - snuba_eventuser = find_eventuser_with_snuba(event) - except Exception: - return logger.exception("Error when attempting to fetch EventUser data from Snuba") - - # Compare Snuba result with EventUser record - snuba_eventuser_equality = _is_snuba_result_equal_to_eventuser(snuba_eventuser, eventuser) - # Compare Event data result with EventUser record - event_eventuser_equality = _is_event_data_equal_to_eventuser(event, eventuser) - # Compare Snuba result with Event data - snuba_event_equality = _is_event_data_equal_to_snuba_result(event, snuba_eventuser) - - logger.info( - "EventUser equality checks with Snuba and Event.", - extra={ - "eventuser": serialize(eventuser), - "dataset_results": snuba_eventuser, - "event_id": event.event_id, - "project_id": event.project_id, - "group_id": event.group_id, - "event.data.user": event.data.get("user", {}), - "snuba_eventuser_equality": snuba_eventuser_equality, - "event_eventuser_equality": event_eventuser_equality, - "snuba_event_equality": snuba_event_equality, - }, - ) - - analytics.record( - "eventuser_equality.check", - event_id=event.event_id, - project_id=event.project_id, - group_id=event.group_id, - snuba_eventuser_equality=snuba_eventuser_equality, - event_eventuser_equality=event_eventuser_equality, - snuba_event_equality=snuba_event_equality, - ) - - -def find_eventuser_with_snuba(event: Event): - """ - Query Snuba to get the EventUser information for an Event. - """ - start_date, end_date = _start_and_end_dates(event.datetime) - - query = _generate_entity_dataset_query( - event.project_id, event.group_id, event.event_id, start_date, end_date - ) - request = Request( - dataset=Dataset.Events.value, - app_id=REFERRER, - query=query, - tenant_ids={"referrer": REFERRER, "organization_id": event.project.organization.id}, - ) - data_results = raw_snql_query(request, referrer=REFERRER)["data"] - - if len(data_results) == 0: - logger.info( - "Errors dataset query to find EventUser did not return any results.", - extra={ - "event_id": event.event_id, - "project_id": event.project_id, - "group_id": event.group_id, - }, - ) - return {} - - return data_results[0] - - -def _is_snuba_result_equal_to_eventuser(snuba_result: Mapping[str, Any], eventuser: EventUser): - EVENTUSER_TO_SNUBA_KEY_MAP = { - "project_id": ["project_id"], - "ident": ["user_id"], - "email": ["user_email"], - "username": ["user_name"], - "ip_address": ["ip_address_v6", "ip_address_v4"], - } - - for eventuser_key, snuba_result_keys in EVENTUSER_TO_SNUBA_KEY_MAP.items(): - value = getattr(eventuser, eventuser_key) if eventuser is not None else None - if value not in [snuba_result[key] for key in snuba_result_keys]: - return False - - return True - - -def get_nested_value(d, value): - """ - Return the value from a nested object of a path in dot notation. - """ - for key in value.split("."): - d = d.get(key, None) - - return d - - -def _is_event_data_equal_to_eventuser(event: Event, eventuser: EventUser): - EVENTUSER_TO_EVENT_DATA_KEY_MAP = { - "ident": ["user.id"], - "email": ["user.email"], - "username": ["user.username"], - "ip_address": ["user.ip_address"], - } - for eventuser_key, event_data_keys in EVENTUSER_TO_EVENT_DATA_KEY_MAP.items(): - value = getattr(eventuser, eventuser_key) if eventuser is not None else None - if value not in [get_nested_value(event.data, key) for key in event_data_keys]: - return False - - return True - - -def _is_event_data_equal_to_snuba_result(event: Event, snuba_result: Mapping[str, Any]): - EVENT_DATA_TO_SNUBA_KEY_MAP = { - "user.id": ["user_id"], - "user.email": ["user_email"], - "user.username": ["user_name"], - "user.ip_address": ["ip_address_v6", "ip_address_v4"], - } - - for event_data_key, snuba_result_keys in EVENT_DATA_TO_SNUBA_KEY_MAP.items(): - if get_nested_value(event.data, event_data_key) not in [ - snuba_result[key] for key in snuba_result_keys - ]: - return False - - return True - - -def _generate_entity_dataset_query( - project_id: Optional[int], - group_id: Optional[int], - event_id: str, - start_date: datetime, - end_date: datetime, -) -> Query: - """This simply generates a query based on the passed parameters""" - where_conditions = [ - Condition(Column("event_id"), Op.EQ, event_id), - Condition(Column("timestamp"), Op.GTE, start_date), - Condition(Column("timestamp"), Op.LT, end_date), - ] - if project_id: - where_conditions.append(Condition(Column("project_id"), Op.EQ, project_id)) - - if group_id: - where_conditions.append(Condition(Column("group_id"), Op.EQ, group_id)) - - return Query( - match=Entity(EntityKey.Events.value), - select=[ - Column("project_id"), - Column("group_id"), - Column("ip_address_v6"), - Column("ip_address_v4"), - Column("event_id"), - Column("user_id"), - Column("user"), - Column("user_name"), - Column("user_email"), - ], - where=where_conditions, - ) - - -def _start_and_end_dates(time: datetime) -> Tuple[datetime, datetime]: - """Return the 10 min range start and end time range .""" - return time - timedelta(minutes=5), time + timedelta(minutes=5) +def find_event_user(event: Event, report_data): + if not event: + return None, None + eventuser_record = find_eventuser_record(report_data, event) + eventuser = EventUser.from_event(event) + if eventuser_record: + eventuser.id = eventuser_record.id + + return eventuser, eventuser_record diff --git a/src/sentry/testutils/factories.py b/src/sentry/testutils/factories.py index 2153be5f512669..4a65c540d3dd53 100644 --- a/src/sentry/testutils/factories.py +++ b/src/sentry/testutils/factories.py @@ -114,6 +114,7 @@ from sentry.signals import project_created from sentry.silo import SiloMode from sentry.snuba.dataset import Dataset +from sentry.testutils.helpers.datetime import iso_format from sentry.testutils.outbox import outbox_runner from sentry.testutils.silo import assume_test_silo_mode from sentry.types.activity import ActivityType @@ -1057,7 +1058,6 @@ def create_sentry_app_installation( if not prevent_token_exchange and ( install.sentry_app.status != SentryAppStatus.INTERNAL ): - GrantExchanger.run( install=rpc_install, code=install.api_grant.code, @@ -1250,11 +1250,20 @@ def create_doc_integration_avatar(doc_integration=None, **kwargs) -> DocIntegrat @staticmethod @assume_test_silo_mode(SiloMode.CONTROL) - def create_userreport(group, project=None, event_id=None, **kwargs): + def create_userreport(project, event_id=None, **kwargs): + event = Factories.store_event( + data={ + "timestamp": iso_format(datetime.utcnow()), + "event_id": event_id or "a" * 32, + "message": "testing", + }, + project_id=project.id, + ) + return UserReport.objects.create( - group_id=group.id, - event_id=event_id or "a" * 32, - project_id=project.id if project is not None else group.project.id, + group_id=event.group.id, + event_id=event.event_id, + project_id=project.id, name="Jane Bloggs", email="[email protected]", comments="the application crashed", diff --git a/src/sentry/utils/eventuser.py b/src/sentry/utils/eventuser.py new file mode 100644 index 00000000000000..5f7d487819b4ca --- /dev/null +++ b/src/sentry/utils/eventuser.py @@ -0,0 +1,123 @@ +from __future__ import annotations + +import logging +from dataclasses import dataclass +from datetime import datetime, timedelta +from typing import Optional, Tuple + +from snuba_sdk import Column, Condition, Entity, Op, Query, Request + +from sentry.eventstore.models import Event +from sentry.snuba.dataset import Dataset, EntityKey +from sentry.utils.avatar import get_gravatar_url +from sentry.utils.snuba import raw_snql_query + +logger = logging.getLogger(__name__) + +REFERRER = "sentry.utils.eventuser" + + +@dataclass +class EventUser: + project_id: Optional[int] + email: str + username: str + name: str + ip_address: str + id: Optional[int] = None + + @staticmethod + def from_event(event: Event): + return EventUser( + id=None, + project_id=event.project_id if event else None, + email=event.data.get("user", {}).get("email") if event else None, + username=event.data.get("user", {}).get("username") if event else None, + name=event.data.get("user", {}).get("name") if event else None, + ip_address=event.data.get("user", {}).get("ip_address") if event else None, + ) + + def get_display_name(self): + return self.name or self.email or self.username + + def serialize(self): + return { + "id": str(self.id), + "username": self.username, + "email": self.email, + "name": self.get_display_name(), + "ipAddress": self.ip_address, + "avatarUrl": get_gravatar_url(self.email, size=32), + } + + +def find_eventuser_with_snuba(event: Event): + """ + Query Snuba to get the EventUser information for an Event. + """ + start_date, end_date = _start_and_end_dates(event.datetime) + + query = _generate_entity_dataset_query( + event.project_id, event.group_id, event.event_id, start_date, end_date + ) + request = Request( + dataset=Dataset.Events.value, + app_id=REFERRER, + query=query, + tenant_ids={"referrer": REFERRER, "organization_id": event.project.organization.id}, + ) + data_results = raw_snql_query(request, referrer=REFERRER)["data"] + + if len(data_results) == 0: + logger.info( + "Errors dataset query to find EventUser did not return any results.", + extra={ + "event_id": event.event_id, + "project_id": event.project_id, + "group_id": event.group_id, + }, + ) + return {} + + return data_results[0] + + +def _generate_entity_dataset_query( + project_id: Optional[int], + group_id: Optional[int], + event_id: str, + start_date: datetime, + end_date: datetime, +) -> Query: + """This simply generates a query based on the passed parameters""" + where_conditions = [ + Condition(Column("event_id"), Op.EQ, event_id), + Condition(Column("timestamp"), Op.GTE, start_date), + Condition(Column("timestamp"), Op.LT, end_date), + ] + if project_id: + where_conditions.append(Condition(Column("project_id"), Op.EQ, project_id)) + + if group_id: + where_conditions.append(Condition(Column("group_id"), Op.EQ, group_id)) + + return Query( + match=Entity(EntityKey.Events.value), + select=[ + Column("project_id"), + Column("group_id"), + Column("ip_address_v6"), + Column("ip_address_v4"), + Column("event_id"), + Column("user_id"), + Column("user"), + Column("user_name"), + Column("user_email"), + ], + where=where_conditions, + ) + + +def _start_and_end_dates(time: datetime) -> Tuple[datetime, datetime]: + """Return the 10 min range start and end time range .""" + return time - timedelta(minutes=5), time + timedelta(minutes=5) diff --git a/tests/acceptance/test_organization_user_feedback.py b/tests/acceptance/test_organization_user_feedback.py index 2bf894e70e8a86..7bd69ee7109aed 100644 --- a/tests/acceptance/test_organization_user_feedback.py +++ b/tests/acceptance/test_organization_user_feedback.py @@ -19,7 +19,7 @@ def setUp(self): self.project.update(first_event=timezone.now()) def test(self): - self.create_userreport(date_added=timezone.now(), group=self.group, project=self.project) + self.create_userreport(date_added=timezone.now(), project=self.project) self.browser.get(self.path) self.browser.wait_until_not('[data-test-id="loading-indicator"]') self.browser.wait_until('[data-test-id="user-feedback-list"]') diff --git a/tests/acceptance/test_project_user_feedback.py b/tests/acceptance/test_project_user_feedback.py index 07778243dbae78..b768d1bef2f119 100644 --- a/tests/acceptance/test_project_user_feedback.py +++ b/tests/acceptance/test_project_user_feedback.py @@ -19,10 +19,8 @@ def setUp(self): self.project.update(first_event=timezone.now()) def test(self): - group = self.create_group(project=self.project, message="Foo bar") self.create_userreport( date_added=timezone.now(), - group=group, project=self.project, event_id=self.event.event_id, ) diff --git a/tests/apidocs/endpoints/projects/test_user_feedback.py b/tests/apidocs/endpoints/projects/test_user_feedback.py index 8a47dc3cd413a1..b67fb5f653870c 100644 --- a/tests/apidocs/endpoints/projects/test_user_feedback.py +++ b/tests/apidocs/endpoints/projects/test_user_feedback.py @@ -9,11 +9,9 @@ class ProjectUserFeedbackDocs(APIDocsTestCase): def setUp(self): event = self.create_event("a", message="oh no") - group = self.create_group(project=self.project, message="Foo bar") self.event_id = event.event_id self.create_userreport( date_added=timezone.now(), - group=group, project=self.project, event_id=self.event_id, ) diff --git a/tests/sentry/api/endpoints/test_organization_user_reports.py b/tests/sentry/api/endpoints/test_organization_user_reports.py index 3b2354569a3f78..8271afde81565c 100644 --- a/tests/sentry/api/endpoints/test_organization_user_reports.py +++ b/tests/sentry/api/endpoints/test_organization_user_reports.py @@ -1,12 +1,9 @@ from datetime import datetime, timedelta -from unittest import mock -from sentry.api.serializers import serialize -from sentry.ingest.userreport import find_event_user, save_userreport +from sentry.ingest.userreport import save_userreport from sentry.models.group import GroupStatus from sentry.models.userreport import UserReport from sentry.testutils.cases import APITestCase, SnubaTestCase -from sentry.testutils.helpers.features import with_feature from sentry.testutils.silo import region_silo_test @@ -117,10 +114,7 @@ def test_invalid_date_params(self): ) assert response.status_code == 400 - @with_feature("organizations:eventuser-from-snuba") - @mock.patch("sentry.analytics.record") - @mock.patch("sentry.ingest.userreport.logger") - def test_with_event_user(self, mock_logger, mock_record): + def test_with_event_user(self): event = self.store_event( data={ "event_id": "d" * 32, @@ -145,44 +139,8 @@ def test_with_event_user(self, mock_logger, mock_record): "comments": "It broke", } save_userreport(self.project_1, report_data) - eventuser = find_event_user(report_data, event) response = self.get_response(self.project_1.organization.slug, project=[self.project_1.id]) assert response.status_code == 200 assert response.data[0]["comments"] == "It broke" assert response.data[0]["user"]["name"] == "Alice" assert response.data[0]["user"]["email"] == "[email protected]" - assert mock_logger.info.call_count == 1 - mock_logger.info.assert_called_once_with( - "EventUser equality checks with Snuba and Event.", - extra={ - "event_id": event.event_id, - "project_id": event.project_id, - "group_id": event.group_id, - "eventuser": serialize(eventuser), - "dataset_results": { - "project_id": event.project_id, - "group_id": event.group_id, - "ip_address_v6": None, - "ip_address_v4": "8.8.8.8", - "event_id": event.event_id, - "user_id": "123", - "user": "id:123", - "user_name": "haveibeenpwned", - "user_email": "[email protected]", - }, - "event.data.user": event.data.get("user", {}), - "snuba_eventuser_equality": True, - "event_eventuser_equality": True, - "snuba_event_equality": True, - }, - ) - - mock_record.assert_called_with( - "eventuser_equality.check", - event_id=event.event_id, - project_id=event.project_id, - group_id=event.group_id, - snuba_eventuser_equality=True, - event_eventuser_equality=True, - snuba_event_equality=True, - ) diff --git a/tests/sentry/api/endpoints/test_project_user_reports.py b/tests/sentry/api/endpoints/test_project_user_reports.py index dfb4ed66cbe31d..b934f7cd81cefe 100644 --- a/tests/sentry/api/endpoints/test_project_user_reports.py +++ b/tests/sentry/api/endpoints/test_project_user_reports.py @@ -1,10 +1,9 @@ -from datetime import timedelta +from datetime import datetime, timedelta from unittest.mock import patch from uuid import uuid4 from django.utils import timezone -from sentry.models.eventuser import EventUser from sentry.models.group import GroupStatus from sentry.models.userreport import UserReport from sentry.testutils.cases import APITestCase, SnubaTestCase @@ -57,11 +56,31 @@ def test_simple(self): self.login_as(user=self.user) project = self.create_project() - group = self.create_group(project=project) - group2 = self.create_group(project=project, status=GroupStatus.RESOLVED) + event1 = self.store_event( + data={ + "timestamp": iso_format(datetime.utcnow()), + "event_id": "a" * 32, + "message": "something went wrong", + }, + project_id=project.id, + ) + group = event1.group + event2 = self.store_event( + data={ + "timestamp": iso_format(datetime.utcnow()), + "event_id": "c" * 32, + "message": "testing", + }, + project_id=project.id, + ) + group2 = event2.group + group2.status = GroupStatus.RESOLVED + group2.substatus = None + group2.save() + report_1 = UserReport.objects.create( project_id=project.id, - event_id="a" * 32, + event_id=event1.event_id, name="Foo", email="[email protected]", comments="Hello world", @@ -80,7 +99,7 @@ def test_simple(self): # should not be included due to resolution UserReport.objects.create( project_id=project.id, - event_id="c" * 32, + event_id=event2.event_id, name="Baz", email="[email protected]", comments="Hello world", @@ -109,7 +128,15 @@ def test_all_reports(self): self.login_as(user=self.user) project = self.create_project() - group = self.create_group(project=project, status=GroupStatus.RESOLVED) + event = self.store_event( + data={ + "timestamp": iso_format(datetime.utcnow()), + "event_id": "a" * 32, + "message": "testing", + }, + project_id=project.id, + ) + group = event.group report_1 = UserReport.objects.create( project_id=project.id, event_id="a" * 32, @@ -119,6 +146,10 @@ def test_all_reports(self): group_id=group.id, ) + group.status = GroupStatus.RESOLVED + group.substatus = None + group.save() + url = f"/api/0/projects/{project.organization.slug}/{project.slug}/user-feedback/" response = self.client.get(f"{url}?status=", format="json") @@ -276,45 +307,6 @@ def test_already_present(self): assert report.name == "Foo Bar" assert report.comments == "It broke!" - def test_already_present_with_matching_user(self): - self.login_as(user=self.user) - - euser = EventUser.objects.get(project_id=self.project.id, email="[email protected]") - - UserReport.objects.create( - group_id=self.event.group.id, - project_id=self.project.id, - event_id=self.event.event_id, - name="foo", - email="[email protected]", - comments="", - ) - - url = f"/api/0/projects/{self.project.organization.slug}/{self.project.slug}/user-feedback/" - - response = self.client.post( - url, - data={ - "event_id": self.event.event_id, - "email": "[email protected]", - "name": "Foo Bar", - "comments": "It broke!", - }, - ) - - assert response.status_code == 200, response.content - - report = UserReport.objects.get(id=response.data["id"]) - assert report.project_id == self.project.id - assert report.group_id == self.event.group.id - assert report.email == "[email protected]" - assert report.name == "Foo Bar" - assert report.comments == "It broke!" - assert report.event_user_id == euser.id - - euser = EventUser.objects.get(id=euser.id) - assert euser.name == "Foo Bar" - def test_already_present_after_deadline(self): self.login_as(user=self.user) diff --git a/tests/sentry/ingest/ingest_consumer/test_ingest_consumer_processing.py b/tests/sentry/ingest/ingest_consumer/test_ingest_consumer_processing.py index c84017cd87e5bb..322afd62e21f3e 100644 --- a/tests/sentry/ingest/ingest_consumer/test_ingest_consumer_processing.py +++ b/tests/sentry/ingest/ingest_consumer/test_ingest_consumer_processing.py @@ -436,9 +436,6 @@ def test_userreport(django_cache, default_project, monkeypatch): mgr.normalize() mgr.save(default_project.id) - (evtuser,) = EventUser.objects.all() - assert not evtuser.name - assert not UserReport.objects.all() assert process_userreport( @@ -461,9 +458,6 @@ def test_userreport(django_cache, default_project, monkeypatch): (report,) = UserReport.objects.all() assert report.comments == "hello world" - (evtuser,) = EventUser.objects.all() - assert evtuser.name == "Hans Gans" - @django_db_all def test_userreport_reverse_order(django_cache, default_project, monkeypatch): diff --git a/tests/sentry/utils/test_query.py b/tests/sentry/utils/test_query.py index 5317c90fbb1289..c4354d689701e9 100644 --- a/tests/sentry/utils/test_query.py +++ b/tests/sentry/utils/test_query.py @@ -67,14 +67,13 @@ class RangeQuerySetWrapperWithProgressBarApproxTest(RangeQuerySetWrapperTest): class BulkDeleteObjectsTest(TestCase): def setUp(self): super().setUp() - self.group = self.create_group(project=self.project, message="Foo bar") UserReport.objects.all().delete() def test_basic(self): total = 10 records = [] for i in range(total): - records.append(self.create_userreport(group=self.group, event_id=i)) + records.append(self.create_userreport(project=self.project, event_id=str(i) * 32)) result = bulk_delete_objects(UserReport, id__in=[r.id for r in records]) assert result, "Could be more work to do" @@ -84,7 +83,7 @@ def test_limiting(self): total = 10 records = [] for i in range(total): - records.append(self.create_userreport(group=self.group, event_id=i)) + records.append(self.create_userreport(project=self.project, event_id=str(i) * 32)) result = bulk_delete_objects(UserReport, id__in=[r.id for r in records], limit=5) assert result, "Still more work to do"
12cdf8b7290edc1b8ce2071075dbf3ea0080e839
2020-12-04 23:33:33
Burak Yigit Kaya
ci(py3): Make py2 builds available under `-py2` suffix (#22460)
false
Make py2 builds available under `-py2` suffix (#22460)
ci
diff --git a/docker/builder.dockerfile b/docker/builder.dockerfile index 19dc001baf71bb..89218b766bc740 100644 --- a/docker/builder.dockerfile +++ b/docker/builder.dockerfile @@ -44,9 +44,6 @@ VOLUME ["/workspace/node_modules", "/workspace/build"] COPY docker/builder.sh /builder.sh ENTRYPOINT [ "/builder.sh" ] -# TODO: Remove this once PY3 becomes stable -ENV SENTRY_PYTHON3=1 - ARG SOURCE_COMMIT ENV SENTRY_BUILD=${SOURCE_COMMIT:-unknown} LABEL org.opencontainers.image.revision=$SOURCE_COMMIT diff --git a/docker/cloudbuild.yaml b/docker/cloudbuild.yaml index 1d41f060879d15..ff0840714aef19 100644 --- a/docker/cloudbuild.yaml +++ b/docker/cloudbuild.yaml @@ -64,6 +64,8 @@ steps: - get-onpremise-repo entrypoint: 'bash' dir: onpremise + env: + - 'SENTRY_PYTHON2=1' args: - '-e' - '-c' @@ -127,6 +129,12 @@ steps: docker push $$DOCKER_REPO:$COMMIT_SHA docker tag $$SENTRY_IMAGE $$DOCKER_REPO:nightly docker push $$DOCKER_REPO:nightly + docker tag $$SENTRY_IMAGE $$DOCKER_REPO:$SHORT_SHA-py2 + docker push $$DOCKER_REPO:$SHORT_SHA-py2 + docker tag $$SENTRY_IMAGE $$DOCKER_REPO:$COMMIT_SHA-py2 + docker push $$DOCKER_REPO:$COMMIT_SHA-py2 + docker tag $$SENTRY_IMAGE $$DOCKER_REPO:nightly-py2 + docker push $$DOCKER_REPO:nightly-py2 - name: 'gcr.io/cloud-builders/docker' id: docker-push-py3 waitFor:
9f67a02488d435567766d4d3d406c8045bf0894e
2021-01-27 20:57:11
Matej Minar
fix(ui): Fix endless spinner on deleted event (#23364)
false
Fix endless spinner on deleted event (#23364)
fix
diff --git a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx index faf93b3d11160d..acdf106e6da88b 100644 --- a/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx +++ b/src/sentry/static/sentry/app/views/organizationGroupDetails/groupDetails.tsx @@ -139,7 +139,7 @@ class GroupDetails extends React.Component<Props, State> { } catch (err) { // This is an expected error, capture to Sentry so that it is not considered as an unhandled error Sentry.captureException(err); - this.setState({eventError: true, loading: false}); + this.setState({eventError: true, loading: false, loadingEvent: false}); } }
d6fe4d454805e5d8ace07dfd053364d43ea80d0f
2022-02-15 17:03:24
Matej Minar
feat(metrics): Add metrics to series transformer (#31783)
false
Add metrics to series transformer (#31783)
feat
diff --git a/static/app/utils/metrics/metricsRequest.tsx b/static/app/utils/metrics/metricsRequest.tsx index 9545ec73dc12c3..46cc96ce9e70f4 100644 --- a/static/app/utils/metrics/metricsRequest.tsx +++ b/static/app/utils/metrics/metricsRequest.tsx @@ -9,10 +9,12 @@ import {shouldFetchPreviousPeriod} from 'sentry/components/charts/utils'; import {DEFAULT_STATS_PERIOD} from 'sentry/constants'; import {t} from 'sentry/locale'; import {MetricsApiResponse} from 'sentry/types'; +import {Series} from 'sentry/types/echarts'; import {getPeriod} from 'sentry/utils/getPeriod'; import {TableData} from '../discover/discoverQuery'; +import {transformMetricsResponseToSeries} from './transformMetricsResponseToSeries'; import {transformMetricsResponseToTable} from './transformMetricsResponseToTable'; const propNamesToIgnore = ['api', 'children']; @@ -28,6 +30,8 @@ export type MetricsRequestRenderProps = { reloading: boolean; response: MetricsApiResponse | null; responsePrevious: MetricsApiResponse | null; + seriesData?: Series[]; + seriesDataPrevious?: Series[]; tableData?: TableData; }; @@ -36,10 +40,14 @@ type DefaultProps = { * Include data for previous period */ includePrevious: boolean; + /** + * Transform the response data to be something ingestible by charts + */ + includeSeriesData: boolean; /** * Transform the response data to be something ingestible by GridEditable tables */ - includeTabularData?: boolean; + includeTabularData: boolean; /** * If true, no request will be made */ @@ -67,6 +75,7 @@ type State = { class MetricsRequest extends React.Component<Props, State> { static defaultProps: DefaultProps = { includePrevious: false, + includeSeriesData: false, includeTabularData: false, isDisabled: false, }; @@ -203,7 +212,8 @@ class MetricsRequest extends React.Component<Props, State> { render() { const {reloading, errored, error, response, responsePrevious, pageLinks} = this.state; - const {children, isDisabled, includeTabularData} = this.props; + const {children, isDisabled, includeTabularData, includeSeriesData, includePrevious} = + this.props; const loading = response === null && !isDisabled && !error; @@ -219,6 +229,13 @@ class MetricsRequest extends React.Component<Props, State> { tableData: includeTabularData ? transformMetricsResponseToTable({response}) : undefined, + seriesData: includeSeriesData + ? transformMetricsResponseToSeries(response) + : undefined, + seriesDataPrevious: + includeSeriesData && includePrevious + ? transformMetricsResponseToSeries(responsePrevious) + : undefined, }); } } diff --git a/static/app/utils/metrics/transformMetricsResponseToSeries.tsx b/static/app/utils/metrics/transformMetricsResponseToSeries.tsx new file mode 100644 index 00000000000000..999015badb1171 --- /dev/null +++ b/static/app/utils/metrics/transformMetricsResponseToSeries.tsx @@ -0,0 +1,20 @@ +import {MetricsApiResponse} from 'sentry/types'; +import {Series} from 'sentry/types/echarts'; + +export function transformMetricsResponseToSeries( + response: MetricsApiResponse | null +): Series[] { + return ( + response?.groups.flatMap(group => + Object.keys(group.series).map(field => ({ + seriesName: `${field}${Object.entries(group.by) + .map(([key, value]) => `|${key}:${value}`) + .join('')}`, + data: response.intervals.map((interval, index) => ({ + name: interval, + value: group.series[field][index] ?? 0, + })), + })) + ) ?? [] + ); +} diff --git a/tests/fixtures/js-stubs/sessions.js b/tests/fixtures/js-stubs/sessions.js index 609c5d1329959d..9440359e74b4ae 100644 --- a/tests/fixtures/js-stubs/sessions.js +++ b/tests/fixtures/js-stubs/sessions.js @@ -707,3 +707,93 @@ export function UserTotalCountByProjectIn24h() { ], }; } + +export function SessionUserCountByStatusByRelease() { + return { + start: '2022-01-15T00:00:00Z', + end: '2022-01-29T00:00:00Z', + query: '', + intervals: [ + '2022-01-15T00:00:00Z', + '2022-01-16T00:00:00Z', + '2022-01-17T00:00:00Z', + '2022-01-18T00:00:00Z', + '2022-01-19T00:00:00Z', + '2022-01-20T00:00:00Z', + '2022-01-21T00:00:00Z', + '2022-01-22T00:00:00Z', + '2022-01-23T00:00:00Z', + '2022-01-24T00:00:00Z', + '2022-01-25T00:00:00Z', + '2022-01-26T00:00:00Z', + '2022-01-27T00:00:00Z', + '2022-01-28T00:00:00Z', + ], + groups: [ + { + by: {'session.status': 'crashed', release: '1'}, + totals: {'sum(session)': 34, 'count_unique(user)': 1}, + series: { + 'sum(session)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 11, 0, 0, 0], + 'count_unique(user)': [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0], + }, + }, + { + by: {'session.status': 'abnormal', release: '1'}, + totals: {'sum(session)': 1, 'count_unique(user)': 1}, + series: { + 'sum(session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + 'count_unique(user)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + }, + }, + { + by: {'session.status': 'errored', release: '1'}, + totals: {'sum(session)': 451, 'count_unique(user)': 2}, + series: { + 'sum(session)': [0, 0, 0, 0, 0, 37, 0, 0, 0, 335, 79, 0, 0, 0], + 'count_unique(user)': [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 2, 0, 0, 0], + }, + }, + { + by: {'session.status': 'healthy', release: '1'}, + totals: {'sum(session)': 5058, 'count_unique(user)': 3}, + series: { + 'sum(session)': [0, 0, 0, 0, 0, 2503, 661, 0, 0, 1464, 430, 0, 0, 0], + 'count_unique(user)': [0, 0, 0, 0, 0, 3, 3, 0, 0, 1, 1, 0, 0, 0], + }, + }, + { + by: {'session.status': 'crashed', release: '2'}, + totals: {'sum(session)': 35, 'count_unique(user)': 2}, + series: { + 'sum(session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 23, 11, 0, 0, 0], + 'count_unique(user)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0], + }, + }, + { + by: {'session.status': 'abnormal', release: '2'}, + totals: {'sum(session)': 1, 'count_unique(user)': 1}, + series: { + 'sum(session)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + 'count_unique(user)': [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + }, + }, + { + by: {'session.status': 'errored', release: '2'}, + totals: {'sum(session)': 452, 'count_unique(user)': 1}, + series: { + 'sum(session)': [1, 0, 0, 0, 0, 37, 0, 0, 0, 335, 79, 0, 0, 0], + 'count_unique(user)': [1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0], + }, + }, + { + by: {'session.status': 'healthy', release: '2'}, + totals: {'sum(session)': 5059, 'count_unique(user)': 10}, + series: { + 'sum(session)': [1, 0, 0, 0, 0, 2503, 661, 0, 0, 1464, 430, 0, 0, 0], + 'count_unique(user)': [1, 0, 0, 0, 0, 10, 3, 0, 0, 4, 3, 0, 0, 0], + }, + }, + ], + }; +} diff --git a/tests/fixtures/js-stubs/types.tsx b/tests/fixtures/js-stubs/types.tsx index ae210f0a209a34..7d0904a98c828f 100644 --- a/tests/fixtures/js-stubs/types.tsx +++ b/tests/fixtures/js-stubs/types.tsx @@ -104,6 +104,7 @@ type TestStubFixtures = { SessionTotalCountByProjectIn24h: SimpleStub; SessionUserCountByStatus: SimpleStub; SessionUserCountByStatus2: SimpleStub; + SessionUserCountByStatusByRelease: SimpleStub; SessionUserStatusCountByProjectInPeriod: SimpleStub; SessionUserStatusCountByReleaseInPeriod: SimpleStub; SesssionTotalCountByReleaseIn24h: SimpleStub; diff --git a/tests/js/spec/utils/metrics/metricsRequest.spec.tsx b/tests/js/spec/utils/metrics/metricsRequest.spec.tsx index 762074c46edcdc..3ef08229f0b136 100644 --- a/tests/js/spec/utils/metrics/metricsRequest.spec.tsx +++ b/tests/js/spec/utils/metrics/metricsRequest.spec.tsx @@ -1,6 +1,11 @@ import {mountWithTheme, waitFor} from 'sentry-test/reactTestingLibrary'; import MetricsRequest from 'sentry/utils/metrics/metricsRequest'; +import {transformMetricsResponseToSeries} from 'sentry/utils/metrics/transformMetricsResponseToSeries'; + +jest.mock('sentry/utils/metrics/transformMetricsResponseToSeries', () => ({ + transformMetricsResponseToSeries: jest.fn().mockReturnValue([]), +})); describe('MetricsRequest', () => { const project = TestStubs.Project(); @@ -251,4 +256,30 @@ describe('MetricsRequest', () => { }) ); }); + + it('includes series data', () => { + mountWithTheme( + <MetricsRequest {...props} includeSeriesData includePrevious> + {childrenMock} + </MetricsRequest> + ); + + expect(metricsMock).toHaveBeenCalledTimes(2); + + expect(childrenMock).toHaveBeenLastCalledWith({ + error: null, + errored: false, + isLoading: true, + loading: true, + pageLinks: null, + reloading: false, + response: null, + responsePrevious: null, + seriesData: [], + seriesDataPrevious: [], + tableData: undefined, + }); + + expect(transformMetricsResponseToSeries).toHaveBeenCalledWith(null); + }); }); diff --git a/tests/js/spec/utils/metrics/transformMetricsResponseToSeries.spec.tsx b/tests/js/spec/utils/metrics/transformMetricsResponseToSeries.spec.tsx new file mode 100644 index 00000000000000..1f7de05fecc5c9 --- /dev/null +++ b/tests/js/spec/utils/metrics/transformMetricsResponseToSeries.spec.tsx @@ -0,0 +1,314 @@ +import {transformMetricsResponseToSeries} from 'sentry/utils/metrics/transformMetricsResponseToSeries'; + +describe('transformMetricsResponseToSeries', function () { + it('transforms metrics into series', () => { + expect( + transformMetricsResponseToSeries(TestStubs.SessionUserCountByStatusByRelease()) + ).toEqual([ + { + seriesName: 'sum(session)|session.status:crashed|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 0}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 23}, + {name: '2022-01-25T00:00:00Z', value: 11}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:crashed|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 0}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 1}, + {name: '2022-01-25T00:00:00Z', value: 1}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'sum(session)|session.status:abnormal|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 0}, + {name: '2022-01-25T00:00:00Z', value: 0}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:abnormal|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 0}, + {name: '2022-01-25T00:00:00Z', value: 0}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'sum(session)|session.status:errored|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 0}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 37}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 335}, + {name: '2022-01-25T00:00:00Z', value: 79}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:errored|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 0}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 1}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 2}, + {name: '2022-01-25T00:00:00Z', value: 2}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'sum(session)|session.status:healthy|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 0}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 2503}, + {name: '2022-01-21T00:00:00Z', value: 661}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 1464}, + {name: '2022-01-25T00:00:00Z', value: 430}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:healthy|release:1', + data: [ + {name: '2022-01-15T00:00:00Z', value: 0}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 3}, + {name: '2022-01-21T00:00:00Z', value: 3}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 1}, + {name: '2022-01-25T00:00:00Z', value: 1}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'sum(session)|session.status:crashed|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 23}, + {name: '2022-01-25T00:00:00Z', value: 11}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:crashed|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 2}, + {name: '2022-01-25T00:00:00Z', value: 2}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'sum(session)|session.status:abnormal|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 0}, + {name: '2022-01-25T00:00:00Z', value: 0}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:abnormal|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 0}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 0}, + {name: '2022-01-25T00:00:00Z', value: 0}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'sum(session)|session.status:errored|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 37}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 335}, + {name: '2022-01-25T00:00:00Z', value: 79}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:errored|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 1}, + {name: '2022-01-21T00:00:00Z', value: 0}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 1}, + {name: '2022-01-25T00:00:00Z', value: 1}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'sum(session)|session.status:healthy|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 2503}, + {name: '2022-01-21T00:00:00Z', value: 661}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 1464}, + {name: '2022-01-25T00:00:00Z', value: 430}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + { + seriesName: 'count_unique(user)|session.status:healthy|release:2', + data: [ + {name: '2022-01-15T00:00:00Z', value: 1}, + {name: '2022-01-16T00:00:00Z', value: 0}, + {name: '2022-01-17T00:00:00Z', value: 0}, + {name: '2022-01-18T00:00:00Z', value: 0}, + {name: '2022-01-19T00:00:00Z', value: 0}, + {name: '2022-01-20T00:00:00Z', value: 10}, + {name: '2022-01-21T00:00:00Z', value: 3}, + {name: '2022-01-22T00:00:00Z', value: 0}, + {name: '2022-01-23T00:00:00Z', value: 0}, + {name: '2022-01-24T00:00:00Z', value: 4}, + {name: '2022-01-25T00:00:00Z', value: 3}, + {name: '2022-01-26T00:00:00Z', value: 0}, + {name: '2022-01-27T00:00:00Z', value: 0}, + {name: '2022-01-28T00:00:00Z', value: 0}, + ], + }, + ]); + }); +});
de8ddef2ada837b2c9fc0163e2c1495079773dcb
2024-10-24 22:16:28
Richard Roggenkemper
chore(issue-views): Remove exclamation (#79680)
false
Remove exclamation (#79680)
chore
diff --git a/static/app/views/issueList/addViewPage.tsx b/static/app/views/issueList/addViewPage.tsx index 93cd0feca01320..b6f42a9c3502df 100644 --- a/static/app/views/issueList/addViewPage.tsx +++ b/static/app/views/issueList/addViewPage.tsx @@ -121,7 +121,7 @@ function AddViewBanner({hasSavedSearches}: {hasSavedSearches: boolean}) { <SubTitle> <div> {t( - 'Issues just got a lot more personalized! Save your frequent issue searches for quick access.' + 'Issues just got a lot more personalized. Save your frequent issue searches for quick access.' )} </div> <div>{t('A few notes before you get started:')}</div>
f2ffb21fd07244ef5721d0f59788feadf2b945b5
2018-01-03 03:10:48
Jess MacQueen
fix(db): Add empty migration to freeze app state to fix conflict
false
Add empty migration to freeze app state to fix conflict
fix
diff --git a/src/sentry/south_migrations/0372_resolve_migration_conflict.py b/src/sentry/south_migrations/0372_resolve_migration_conflict.py new file mode 100644 index 00000000000000..ebcd86c8aee743 --- /dev/null +++ b/src/sentry/south_migrations/0372_resolve_migration_conflict.py @@ -0,0 +1,1035 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + # Flag to indicate if this migration is too risky + # to run online and needs to be coordinated for offline + is_dangerous = False + + def forwards(self, orm): + pass + + def backwards(self, orm): + pass + + models = { + 'sentry.activity': { + 'Meta': {'object_name': 'Activity'}, + 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True'}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ident': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}) + }, + 'sentry.apiapplication': { + 'Meta': {'object_name': 'ApiApplication'}, + 'allowed_origins': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'client_id': ('django.db.models.fields.CharField', [], {'default': "'2d9d98af24954282816dde477011b1885ac21cf667064653b6605f4ed4436ece'", 'unique': 'True', 'max_length': '64'}), + 'client_secret': ('sentry.db.models.fields.encrypted.EncryptedTextField', [], {'default': "'817ef300849348cf8aedc7badfaa96c58fbf56bc6c6d40c8bfdc5ccd87acaccf'"}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'homepage_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "'Trusty Kangaroo'", 'max_length': '64', 'blank': 'True'}), + 'owner': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}), + 'privacy_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}), + 'redirect_uris': ('django.db.models.fields.TextField', [], {}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'terms_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}) + }, + 'sentry.apiauthorization': { + 'Meta': {'unique_together': "(('user', 'application'),)", 'object_name': 'ApiAuthorization'}, + 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']", 'null': 'True'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), + 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.apigrant': { + 'Meta': {'object_name': 'ApiGrant'}, + 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']"}), + 'code': ('django.db.models.fields.CharField', [], {'default': "'bb377c65c90e4ee2b9b79e4f9b4d37b9'", 'max_length': '64', 'db_index': 'True'}), + 'expires_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 1, 2, 0, 0)', 'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'redirect_uri': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), + 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.apikey': { + 'Meta': {'object_name': 'ApiKey'}, + 'allowed_origins': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}), + 'label': ('django.db.models.fields.CharField', [], {'default': "'Default'", 'max_length': '64', 'blank': 'True'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'key_set'", 'to': "orm['sentry.Organization']"}), + 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), + 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'sentry.apitoken': { + 'Meta': {'object_name': 'ApiToken'}, + 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']", 'null': 'True'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'expires_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 2, 1, 0, 0)', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'refresh_token': ('django.db.models.fields.CharField', [], {'default': "'bd8dbf66981947a2b12f838c88775d3d7d22d4c976db402094dc0dd4be42484b'", 'max_length': '64', 'unique': 'True', 'null': 'True'}), + 'scope_list': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), + 'scopes': ('django.db.models.fields.BigIntegerField', [], {'default': 'None'}), + 'token': ('django.db.models.fields.CharField', [], {'default': "'1f41ffcca11d4769a87c1ccc35379250b9c72cf83dee4114afe8870c867c46d2'", 'unique': 'True', 'max_length': '64'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.auditlogentry': { + 'Meta': {'object_name': 'AuditLogEntry'}, + 'actor': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'blank': 'True', 'related_name': "'audit_actors'", 'null': 'True', 'to': "orm['sentry.User']"}), + 'actor_key': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiKey']", 'null': 'True', 'blank': 'True'}), + 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), + 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'event': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), + 'target_object': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'target_user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'blank': 'True', 'related_name': "'audit_targets'", 'null': 'True', 'to': "orm['sentry.User']"}) + }, + 'sentry.authenticator': { + 'Meta': {'unique_together': "(('user', 'type'),)", 'object_name': 'Authenticator', 'db_table': "'auth_authenticator'"}, + 'config': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedAutoField', [], {'primary_key': 'True'}), + 'last_used_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.authidentity': { + 'Meta': {'unique_together': "(('auth_provider', 'ident'), ('auth_provider', 'user'))", 'object_name': 'AuthIdentity'}, + 'auth_provider': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.AuthProvider']"}), + 'data': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ident': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'last_synced': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_verified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.authprovider': { + 'Meta': {'object_name': 'AuthProvider'}, + 'config': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'default_global_access': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'default_role': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '50'}), + 'default_teams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.Team']", 'symmetrical': 'False', 'blank': 'True'}), + 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_sync': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']", 'unique': 'True'}), + 'provider': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'sync_time': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) + }, + 'sentry.broadcast': { + 'Meta': {'object_name': 'Broadcast'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_expires': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 1, 9, 0, 0)', 'null': 'True', 'blank': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}), + 'link': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'message': ('django.db.models.fields.CharField', [], {'max_length': '256'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'upstream_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}) + }, + 'sentry.broadcastseen': { + 'Meta': {'unique_together': "(('broadcast', 'user'),)", 'object_name': 'BroadcastSeen'}, + 'broadcast': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Broadcast']"}), + 'date_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.commit': { + 'Meta': {'unique_together': "(('repository_id', 'key'),)", 'object_name': 'Commit', 'index_together': "(('repository_id', 'date_added'),)"}, + 'author': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.CommitAuthor']", 'null': 'True'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'message': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'repository_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) + }, + 'sentry.commitauthor': { + 'Meta': {'unique_together': "(('organization_id', 'email'), ('organization_id', 'external_id'))", 'object_name': 'CommitAuthor'}, + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '164', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}) + }, + 'sentry.commitfilechange': { + 'Meta': {'unique_together': "(('commit', 'filename'),)", 'object_name': 'CommitFileChange'}, + 'commit': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Commit']"}), + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '1'}) + }, + 'sentry.counter': { + 'Meta': {'object_name': 'Counter', 'db_table': "'sentry_projectcounter'"}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'unique': 'True'}), + 'value': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) + }, + 'sentry.deletedorganization': { + 'Meta': {'object_name': 'DeletedOrganization'}, + 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'actor_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'date_deleted': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}) + }, + 'sentry.deletedproject': { + 'Meta': {'object_name': 'DeletedProject'}, + 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'actor_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'date_deleted': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'organization_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'organization_slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}), + 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}), + 'team_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'team_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'team_slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}) + }, + 'sentry.deletedteam': { + 'Meta': {'object_name': 'DeletedTeam'}, + 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'actor_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'actor_label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'date_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'date_deleted': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'organization_name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'organization_slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}), + 'reason': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}) + }, + 'sentry.deploy': { + 'Meta': {'object_name': 'Deploy'}, + 'date_finished': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'environment_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), + 'notified': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'db_index': 'True', 'blank': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}) + }, + 'sentry.distribution': { + 'Meta': {'unique_together': "(('release', 'name'),)", 'object_name': 'Distribution'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) + }, + 'sentry.dsymapp': { + 'Meta': {'unique_together': "(('project', 'platform', 'app_id'),)", 'object_name': 'DSymApp'}, + 'app_id': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_synced': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'platform': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'sync_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}) + }, + 'sentry.email': { + 'Meta': {'object_name': 'Email'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('sentry.db.models.fields.citext.CIEmailField', [], {'unique': 'True', 'max_length': '75'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}) + }, + 'sentry.environment': { + 'Meta': {'unique_together': "(('project_id', 'name'), ('organization_id', 'name'))", 'object_name': 'Environment'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'projects': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.Project']", 'through': "orm['sentry.EnvironmentProject']", 'symmetrical': 'False'}) + }, + 'sentry.environmentproject': { + 'Meta': {'unique_together': "(('project', 'environment'),)", 'object_name': 'EnvironmentProject'}, + 'environment': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Environment']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) + }, + 'sentry.event': { + 'Meta': {'unique_together': "(('project_id', 'event_id'),)", 'object_name': 'Event', 'db_table': "'sentry_message'", 'index_together': "(('group_id', 'datetime'),)"}, + 'data': ('sentry.db.models.fields.node.NodeField', [], {'null': 'True', 'blank': 'True'}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'db_column': "'message_id'"}), + 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'message': ('django.db.models.fields.TextField', [], {}), + 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'time_spent': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'null': 'True'}) + }, + 'sentry.eventmapping': { + 'Meta': {'unique_together': "(('project_id', 'event_id'),)", 'object_name': 'EventMapping'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) + }, + 'sentry.eventprocessingissue': { + 'Meta': {'unique_together': "(('raw_event', 'processing_issue'),)", 'object_name': 'EventProcessingIssue'}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'processing_issue': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ProcessingIssue']"}), + 'raw_event': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.RawEvent']"}) + }, + 'sentry.eventtag': { + 'Meta': {'unique_together': "(('event_id', 'key_id', 'value_id'),)", 'object_name': 'EventTag', 'index_together': "(('group_id', 'key_id', 'value_id'),)"}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'event_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), + 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), + 'value_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) + }, + 'sentry.eventuser': { + 'Meta': {'unique_together': "(('project_id', 'ident'), ('project_id', 'hash'))", 'object_name': 'EventUser', 'index_together': "(('project_id', 'email'), ('project_id', 'username'), ('project_id', 'ip_address'))"}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True'}), + 'hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ident': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), + 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39', 'null': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}) + }, + 'sentry.featureadoption': { + 'Meta': {'unique_together': "(('organization', 'feature_id'),)", 'object_name': 'FeatureAdoption'}, + 'applicable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'complete': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'date_completed': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'feature_id': ('django.db.models.fields.PositiveIntegerField', [], {}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}) + }, + 'sentry.file': { + 'Meta': {'object_name': 'File'}, + 'blob': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'legacy_blob'", 'null': 'True', 'to': "orm['sentry.FileBlob']"}), + 'blobs': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.FileBlob']", 'through': "orm['sentry.FileBlobIndex']", 'symmetrical': 'False'}), + 'checksum': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True'}), + 'headers': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'path': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'size': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '64'}) + }, + 'sentry.fileblob': { + 'Meta': {'object_name': 'FileBlob'}, + 'checksum': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'path': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'size': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}) + }, + 'sentry.fileblobindex': { + 'Meta': {'unique_together': "(('file', 'blob', 'offset'),)", 'object_name': 'FileBlobIndex'}, + 'blob': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.FileBlob']"}), + 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'offset': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) + }, + 'sentry.group': { + 'Meta': {'unique_together': "(('project', 'short_id'),)", 'object_name': 'Group', 'db_table': "'sentry_groupedmessage'", 'index_together': "(('project', 'first_release'),)"}, + 'active_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), + 'culprit': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'db_column': "'view'", 'blank': 'True'}), + 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True', 'blank': 'True'}), + 'first_release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']", 'null': 'True', 'on_delete': 'models.PROTECT'}), + 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'is_public': ('django.db.models.fields.NullBooleanField', [], {'default': 'False', 'null': 'True', 'blank': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'level': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '40', 'db_index': 'True', 'blank': 'True'}), + 'logger': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64', 'db_index': 'True', 'blank': 'True'}), + 'message': ('django.db.models.fields.TextField', [], {}), + 'num_comments': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'null': 'True'}), + 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), + 'resolved_at': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'db_index': 'True'}), + 'score': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'default': '0'}), + 'short_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'time_spent_count': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'default': '0'}), + 'time_spent_total': ('sentry.db.models.fields.bounded.BoundedIntegerField', [], {'default': '0'}), + 'times_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '1', 'db_index': 'True'}) + }, + 'sentry.groupassignee': { + 'Meta': {'object_name': 'GroupAssignee', 'db_table': "'sentry_groupasignee'"}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'assignee_set'", 'unique': 'True', 'to': "orm['sentry.Group']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'assignee_set'", 'to': "orm['sentry.Project']"}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'sentry_assignee_set'", 'to': "orm['sentry.User']"}) + }, + 'sentry.groupbookmark': { + 'Meta': {'unique_together': "(('project', 'user', 'group'),)", 'object_name': 'GroupBookmark'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'bookmark_set'", 'to': "orm['sentry.Group']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'bookmark_set'", 'to': "orm['sentry.Project']"}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'sentry_bookmark_set'", 'to': "orm['sentry.User']"}) + }, + 'sentry.groupcommitresolution': { + 'Meta': {'unique_together': "(('group_id', 'commit_id'),)", 'object_name': 'GroupCommitResolution'}, + 'commit_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}) + }, + 'sentry.groupemailthread': { + 'Meta': {'unique_together': "(('email', 'group'), ('email', 'msgid'))", 'object_name': 'GroupEmailThread'}, + 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'groupemail_set'", 'to': "orm['sentry.Group']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'msgid': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'groupemail_set'", 'to': "orm['sentry.Project']"}) + }, + 'sentry.grouphash': { + 'Meta': {'unique_together': "(('project', 'hash'),)", 'object_name': 'GroupHash'}, + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'null': 'True'}), + 'group_tombstone_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), + 'hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), + 'state': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) + }, + 'sentry.grouplink': { + 'Meta': {'unique_together': "(('group_id', 'linked_type', 'linked_id'),)", 'object_name': 'GroupLink'}, + 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'linked_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}), + 'linked_type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '1'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'db_index': 'True'}), + 'relationship': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '2'}) + }, + 'sentry.groupmeta': { + 'Meta': {'unique_together': "(('group', 'key'),)", 'object_name': 'GroupMeta'}, + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'value': ('django.db.models.fields.TextField', [], {}) + }, + 'sentry.groupredirect': { + 'Meta': {'object_name': 'GroupRedirect'}, + 'group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'previous_group_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'unique': 'True'}) + }, + 'sentry.grouprelease': { + 'Meta': {'unique_together': "(('group_id', 'release_id', 'environment'),)", 'object_name': 'GroupRelease'}, + 'environment': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '64'}), + 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'release_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}) + }, + 'sentry.groupresolution': { + 'Meta': {'object_name': 'GroupResolution'}, + 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'unique': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), + 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) + }, + 'sentry.grouprulestatus': { + 'Meta': {'unique_together': "(('rule', 'group'),)", 'object_name': 'GroupRuleStatus'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_active': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'rule': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Rule']"}), + 'status': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}) + }, + 'sentry.groupseen': { + 'Meta': {'unique_together': "(('user', 'group'),)", 'object_name': 'GroupSeen'}, + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'db_index': 'False'}) + }, + 'sentry.groupshare': { + 'Meta': {'object_name': 'GroupShare'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'unique': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}), + 'uuid': ('django.db.models.fields.CharField', [], {'default': "'ac0cd039ff0044e9a09df6826e9a827d'", 'unique': 'True', 'max_length': '32'}) + }, + 'sentry.groupsnooze': { + 'Meta': {'object_name': 'GroupSnooze'}, + 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'unique': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'state': ('jsonfield.fields.JSONField', [], {'null': 'True'}), + 'until': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'user_count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'user_window': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'window': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}) + }, + 'sentry.groupsubscription': { + 'Meta': {'unique_together': "(('group', 'user'),)", 'object_name': 'GroupSubscription'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'subscription_set'", 'to': "orm['sentry.Group']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'subscription_set'", 'to': "orm['sentry.Project']"}), + 'reason': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.grouptagkey': { + 'Meta': {'unique_together': "(('project_id', 'group_id', 'key'),)", 'object_name': 'GroupTagKey'}, + 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), + 'values_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) + }, + 'sentry.grouptagvalue': { + 'Meta': {'unique_together': "(('group_id', 'key', 'value'),)", 'object_name': 'GroupTagValue', 'db_table': "'sentry_messagefiltervalue'", 'index_together': "(('project_id', 'key', 'value', 'last_seen'),)"}, + 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), + 'group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), + 'times_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'sentry.grouptombstone': { + 'Meta': {'object_name': 'GroupTombstone'}, + 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'culprit': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'level': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '40', 'blank': 'True'}), + 'message': ('django.db.models.fields.TextField', [], {}), + 'previous_group_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'unique': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) + }, + 'sentry.identity': { + 'Meta': {'unique_together': "(('idp', 'external_id'),)", 'object_name': 'Identity'}, + 'data': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_verified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'idp': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.IdentityProvider']"}), + 'scopes': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) + }, + 'sentry.identityprovider': { + 'Meta': {'unique_together': "(('type', 'instance'),)", 'object_name': 'IdentityProvider'}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'instance': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '64'}) + }, + 'sentry.integration': { + 'Meta': {'unique_together': "(('provider', 'external_id'),)", 'object_name': 'Integration'}, + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'metadata': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'organizations': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'integrations'", 'symmetrical': 'False', 'through': "orm['sentry.OrganizationIntegration']", 'to': "orm['sentry.Organization']"}), + 'projects': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'integrations'", 'symmetrical': 'False', 'through': "orm['sentry.ProjectIntegration']", 'to': "orm['sentry.Project']"}), + 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64'}) + }, + 'sentry.lostpasswordhash': { + 'Meta': {'object_name': 'LostPasswordHash'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'hash': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'unique': 'True'}) + }, + 'sentry.option': { + 'Meta': {'object_name': 'Option'}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'}), + 'last_updated': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) + }, + 'sentry.organization': { + 'Meta': {'object_name': 'Organization'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'default_role': ('django.db.models.fields.CharField', [], {'default': "'member'", 'max_length': '32'}), + 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '1'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'members': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'org_memberships'", 'symmetrical': 'False', 'through': "orm['sentry.OrganizationMember']", 'to': "orm['sentry.User']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) + }, + 'sentry.organizationaccessrequest': { + 'Meta': {'unique_together': "(('team', 'member'),)", 'object_name': 'OrganizationAccessRequest'}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'member': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.OrganizationMember']"}), + 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Team']"}) + }, + 'sentry.organizationavatar': { + 'Meta': {'object_name': 'OrganizationAvatar'}, + 'avatar_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), + 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']", 'unique': 'True', 'null': 'True', 'on_delete': 'models.SET_NULL'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ident': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'avatar'", 'unique': 'True', 'to': "orm['sentry.Organization']"}) + }, + 'sentry.organizationintegration': { + 'Meta': {'unique_together': "(('organization', 'integration'),)", 'object_name': 'OrganizationIntegration'}, + 'config': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), + 'default_auth_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'integration': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Integration']"}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}) + }, + 'sentry.organizationmember': { + 'Meta': {'unique_together': "(('organization', 'user'), ('organization', 'email'))", 'object_name': 'OrganizationMember'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}), + 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}), + 'has_global_access': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'member_set'", 'to': "orm['sentry.Organization']"}), + 'role': ('django.db.models.fields.CharField', [], {'default': "'member'", 'max_length': '32'}), + 'teams': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['sentry.Team']", 'symmetrical': 'False', 'through': "orm['sentry.OrganizationMemberTeam']", 'blank': 'True'}), + 'token': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + 'type': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '50', 'blank': 'True'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'blank': 'True', 'related_name': "'sentry_orgmember_set'", 'null': 'True', 'to': "orm['sentry.User']"}) + }, + 'sentry.organizationmemberteam': { + 'Meta': {'unique_together': "(('team', 'organizationmember'),)", 'object_name': 'OrganizationMemberTeam', 'db_table': "'sentry_organizationmember_teams'"}, + 'id': ('sentry.db.models.fields.bounded.BoundedAutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'organizationmember': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.OrganizationMember']"}), + 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Team']"}) + }, + 'sentry.organizationonboardingtask': { + 'Meta': {'unique_together': "(('organization', 'task'),)", 'object_name': 'OrganizationOnboardingTask'}, + 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'date_completed': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'task': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}) + }, + 'sentry.organizationoption': { + 'Meta': {'unique_together': "(('organization', 'key'),)", 'object_name': 'OrganizationOption', 'db_table': "'sentry_organizationoptions'"}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), + 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) + }, + 'sentry.processingissue': { + 'Meta': {'unique_together': "(('project', 'checksum', 'type'),)", 'object_name': 'ProcessingIssue'}, + 'checksum': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_index': 'True'}), + 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}) + }, + 'sentry.project': { + 'Meta': {'unique_together': "(('team', 'slug'), ('organization', 'slug'))", 'object_name': 'Project'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'first_event': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'flags': ('django.db.models.fields.BigIntegerField', [], {'default': '0', 'null': 'True'}), + 'forced_color': ('django.db.models.fields.CharField', [], {'max_length': '6', 'null': 'True', 'blank': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), + 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'public': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'null': 'True'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Team']"}), + 'teams': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'teams'", 'symmetrical': 'False', 'through': "orm['sentry.ProjectTeam']", 'to': "orm['sentry.Team']"}) + }, + 'sentry.projectbookmark': { + 'Meta': {'unique_together': "(('project_id', 'user'),)", 'object_name': 'ProjectBookmark'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.projectdsymfile': { + 'Meta': {'unique_together': "(('project', 'uuid'),)", 'object_name': 'ProjectDSymFile'}, + 'cpu_name': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'object_name': ('django.db.models.fields.TextField', [], {}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), + 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '36'}) + }, + 'sentry.projectintegration': { + 'Meta': {'unique_together': "(('project', 'integration'),)", 'object_name': 'ProjectIntegration'}, + 'config': ('sentry.db.models.fields.encrypted.EncryptedJsonField', [], {'default': '{}'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'integration': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Integration']"}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) + }, + 'sentry.projectkey': { + 'Meta': {'object_name': 'ProjectKey'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'key_set'", 'to': "orm['sentry.Project']"}), + 'public_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}), + 'rate_limit_count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'rate_limit_window': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'roles': ('django.db.models.fields.BigIntegerField', [], {'default': '1'}), + 'secret_key': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'sentry.projectoption': { + 'Meta': {'unique_together': "(('project', 'key'),)", 'object_name': 'ProjectOption', 'db_table': "'sentry_projectoptions'"}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) + }, + 'sentry.projectplatform': { + 'Meta': {'unique_together': "(('project_id', 'platform'),)", 'object_name': 'ProjectPlatform'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'platform': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) + }, + 'sentry.projectsymcachefile': { + 'Meta': {'unique_together': "(('project', 'dsym_file'),)", 'object_name': 'ProjectSymCacheFile'}, + 'cache_file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), + 'checksum': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'dsym_file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ProjectDSymFile']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), + 'version': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) + }, + 'sentry.projectteam': { + 'Meta': {'unique_together': "(('project', 'team'),)", 'object_name': 'ProjectTeam'}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'team': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Team']"}) + }, + 'sentry.rawevent': { + 'Meta': {'unique_together': "(('project', 'event_id'),)", 'object_name': 'RawEvent'}, + 'data': ('sentry.db.models.fields.node.NodeField', [], {'null': 'True', 'blank': 'True'}), + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) + }, + 'sentry.release': { + 'Meta': {'unique_together': "(('organization', 'version'),)", 'object_name': 'Release'}, + 'authors': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), + 'commit_count': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_released': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'date_started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_commit_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'last_deploy_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'new_groups': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), + 'owner': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True', 'blank': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'projects': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'releases'", 'symmetrical': 'False', 'through': "orm['sentry.ReleaseProject']", 'to': "orm['sentry.Project']"}), + 'ref': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), + 'total_deploys': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '250'}) + }, + 'sentry.releasecommit': { + 'Meta': {'unique_together': "(('release', 'commit'), ('release', 'order'))", 'object_name': 'ReleaseCommit'}, + 'commit': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Commit']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'order': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) + }, + 'sentry.releaseenvironment': { + 'Meta': {'unique_together': "(('organization_id', 'release_id', 'environment_id'),)", 'object_name': 'ReleaseEnvironment', 'db_table': "'sentry_environmentrelease'"}, + 'environment_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'db_index': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'release_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}) + }, + 'sentry.releasefile': { + 'Meta': {'unique_together': "(('release', 'ident'),)", 'object_name': 'ReleaseFile'}, + 'dist': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Distribution']", 'null': 'True'}), + 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ident': ('django.db.models.fields.CharField', [], {'max_length': '40'}), + 'name': ('django.db.models.fields.TextField', [], {}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True'}), + 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) + }, + 'sentry.releaseheadcommit': { + 'Meta': {'unique_together': "(('repository_id', 'release'),)", 'object_name': 'ReleaseHeadCommit'}, + 'commit': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Commit']"}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}), + 'repository_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {}) + }, + 'sentry.releaseproject': { + 'Meta': {'unique_together': "(('project', 'release'),)", 'object_name': 'ReleaseProject', 'db_table': "'sentry_release_project'"}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'new_groups': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'null': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'release': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Release']"}) + }, + 'sentry.repository': { + 'Meta': {'unique_together': "(('organization_id', 'name'), ('organization_id', 'provider', 'external_id'))", 'object_name': 'Repository'}, + 'config': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'integration_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'organization_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'provider': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True'}) + }, + 'sentry.reprocessingreport': { + 'Meta': {'unique_together': "(('project', 'event_id'),)", 'object_name': 'ReprocessingReport'}, + 'datetime': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) + }, + 'sentry.rule': { + 'Meta': {'object_name': 'Rule'}, + 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}) + }, + 'sentry.savedsearch': { + 'Meta': {'unique_together': "(('project', 'name'),)", 'object_name': 'SavedSearch'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'owner': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']", 'null': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'query': ('django.db.models.fields.TextField', [], {}) + }, + 'sentry.savedsearchuserdefault': { + 'Meta': {'unique_together': "(('project', 'user'),)", 'object_name': 'SavedSearchUserDefault', 'db_table': "'sentry_savedsearch_userdefault'"}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}), + 'savedsearch': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.SavedSearch']"}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.scheduleddeletion': { + 'Meta': {'unique_together': "(('app_label', 'model_name', 'object_id'),)", 'object_name': 'ScheduledDeletion'}, + 'aborted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'actor_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'data': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_scheduled': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2018, 2, 1, 0, 0)'}), + 'guid': ('django.db.models.fields.CharField', [], {'default': "'050a88498b6f4d10a17133f1726e3115'", 'unique': 'True', 'max_length': '32'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'in_progress': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'model_name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'object_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {}) + }, + 'sentry.scheduledjob': { + 'Meta': {'object_name': 'ScheduledJob'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_scheduled': ('django.db.models.fields.DateTimeField', [], {}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'payload': ('jsonfield.fields.JSONField', [], {'default': '{}'}) + }, + 'sentry.servicehook': { + 'Meta': {'object_name': 'ServiceHook'}, + 'actor_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'application': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ApiApplication']", 'null': 'True'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'events': ('sentry.db.models.fields.array.ArrayField', [], {'of': ('django.db.models.fields.TextField', [], {})}), + 'guid': ('django.db.models.fields.CharField', [], {'max_length': '32', 'unique': 'True', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'secret': ('sentry.db.models.fields.encrypted.EncryptedTextField', [], {'default': "'9fd2a1b0471c4cab89a9f77e30c714454e5f0e4a99724bc38356706b19142f5b'"}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0', 'db_index': 'True'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}), + 'version': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) + }, + 'sentry.tagkey': { + 'Meta': {'unique_together': "(('project_id', 'key'),)", 'object_name': 'TagKey', 'db_table': "'sentry_filterkey'"}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'label': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), + 'values_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) + }, + 'sentry.tagvalue': { + 'Meta': {'unique_together': "(('project_id', 'key', 'value'),)", 'object_name': 'TagValue', 'db_table': "'sentry_filtervalue'", 'index_together': "(('project_id', 'key', 'last_seen'),)"}, + 'data': ('sentry.db.models.fields.gzippeddict.GzippedDictField', [], {'null': 'True', 'blank': 'True'}), + 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'db_index': 'True'}), + 'project_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'null': 'True', 'db_index': 'True'}), + 'times_seen': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'sentry.team': { + 'Meta': {'unique_together': "(('organization', 'slug'),)", 'object_name': 'Team'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']"}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), + 'status': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'default': '0'}) + }, + 'sentry.user': { + 'Meta': {'object_name': 'User', 'db_table': "'auth_user'"}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedAutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_managed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_password_expired': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'last_active': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_password_change': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_column': "'first_name'", 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'session_nonce': ('django.db.models.fields.CharField', [], {'max_length': '12', 'null': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}) + }, + 'sentry.useravatar': { + 'Meta': {'object_name': 'UserAvatar'}, + 'avatar_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}), + 'file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.File']", 'unique': 'True', 'null': 'True', 'on_delete': 'models.SET_NULL'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ident': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32', 'db_index': 'True'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'avatar'", 'unique': 'True', 'to': "orm['sentry.User']"}) + }, + 'sentry.useremail': { + 'Meta': {'unique_together': "(('user', 'email'),)", 'object_name': 'UserEmail'}, + 'date_hash_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'related_name': "'emails'", 'to': "orm['sentry.User']"}), + 'validation_hash': ('django.db.models.fields.CharField', [], {'default': "u'H6fqPtDx5KdojV17nmFrb6y3z3wDNWXn'", 'max_length': '32'}) + }, + 'sentry.useridentity': { + 'Meta': {'unique_together': "(('user', 'identity'),)", 'object_name': 'UserIdentity'}, + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'identity': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Identity']"}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.userip': { + 'Meta': {'unique_together': "(('user', 'ip_address'),)", 'object_name': 'UserIP'}, + 'first_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'ip_address': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), + 'last_seen': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}) + }, + 'sentry.useroption': { + 'Meta': {'unique_together': "(('user', 'project', 'key'), ('user', 'organization', 'key'))", 'object_name': 'UserOption'}, + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'key': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'organization': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Organization']", 'null': 'True'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']", 'null': 'True'}), + 'user': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.User']"}), + 'value': ('sentry.db.models.fields.encrypted.EncryptedPickledObjectField', [], {}) + }, + 'sentry.userreport': { + 'Meta': {'unique_together': "(('project', 'event_id'),)", 'object_name': 'UserReport', 'index_together': "(('project', 'event_id'), ('project', 'date_added'))"}, + 'comments': ('django.db.models.fields.TextField', [], {}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}), + 'event_id': ('django.db.models.fields.CharField', [], {'max_length': '32'}), + 'event_user_id': ('sentry.db.models.fields.bounded.BoundedBigIntegerField', [], {'null': 'True'}), + 'group': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Group']", 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'project': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.Project']"}) + }, + 'sentry.versiondsymfile': { + 'Meta': {'unique_together': "(('dsym_file', 'version', 'build'),)", 'object_name': 'VersionDSymFile'}, + 'build': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}), + 'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'dsym_app': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.DSymApp']"}), + 'dsym_file': ('sentry.db.models.fields.foreignkey.FlexibleForeignKey', [], {'to': "orm['sentry.ProjectDSymFile']", 'null': 'True'}), + 'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_key': 'True'}), + 'version': ('django.db.models.fields.CharField', [], {'max_length': '32'}) + } + } + + complete_apps = ['sentry']
628f41d2053b26272daa2de44bfb867c03ca9637
2024-05-29 21:32:06
Scott Cooper
test(ui): Fix flake in transaction overview (#71660)
false
Fix flake in transaction overview (#71660)
test
diff --git a/static/app/views/performance/transactionSummary/transactionOverview/index.spec.tsx b/static/app/views/performance/transactionSummary/transactionOverview/index.spec.tsx index 2e1bed46fa8f58..3075c33a88d3d5 100644 --- a/static/app/views/performance/transactionSummary/transactionOverview/index.spec.tsx +++ b/static/app/views/performance/transactionSummary/transactionOverview/index.spec.tsx @@ -565,9 +565,11 @@ describe('Performance > TransactionSummary', function () { // It renders the web vitals widget await screen.findByRole('heading', {name: 'Web Vitals'}); - const vitalStatues = screen.getAllByTestId('vital-status'); - expect(vitalStatues).toHaveLength(3); + await waitFor(() => { + expect(screen.getAllByTestId('vital-status')).toHaveLength(3); + }); + const vitalStatues = screen.getAllByTestId('vital-status'); expect(vitalStatues[0]).toHaveTextContent('31%'); expect(vitalStatues[1]).toHaveTextContent('65%'); expect(vitalStatues[2]).toHaveTextContent('3%');
4f71b8edbfcedeae8fdab432279b09eeadf93a87
2024-05-08 02:09:00
Leander Rodrigues
feat(highlights): Variety of fixes/changes to highlights work (#70355)
false
Variety of fixes/changes to highlights work (#70355)
feat
diff --git a/static/app/components/events/eventTags/eventTagsTree.spec.tsx b/static/app/components/events/eventTags/eventTagsTree.spec.tsx index 97835c16abe864..55ecad83f7247d 100644 --- a/static/app/components/events/eventTags/eventTagsTree.spec.tsx +++ b/static/app/components/events/eventTags/eventTagsTree.spec.tsx @@ -2,7 +2,12 @@ import {EventFixture} from 'sentry-fixture/event'; import {OrganizationFixture} from 'sentry-fixture/organization'; import {initializeOrg} from 'sentry-test/initializeOrg'; -import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; +import { + render, + renderGlobalModal, + screen, + userEvent, +} from 'sentry-test/reactTestingLibrary'; import {EventTags} from 'sentry/components/events/eventTags'; @@ -54,6 +59,7 @@ describe('EventTagsTree', function () { ].concat(emptyBranchTags); const event = EventFixture({tags}); + const referrer = 'event-tags-table'; it('avoids tag tree without query param or flag', function () { render(<EventTags projectSlug={project.slug} event={event} />, {organization}); @@ -160,29 +166,65 @@ describe('EventTagsTree', function () { { tag: {key: 'transaction', value: 'abc123'}, labelText: 'View this transaction', + validateLink: () => { + const linkElement = screen.getByRole('link', {name: 'abc123'}); + const href = linkElement.attributes.getNamedItem('href'); + expect(href?.value).toContain( + `/organizations/${organization.slug}/performance/summary/` + ); + expect(href?.value).toContain(`project=${project.id}`); + expect(href?.value).toContain('transaction=abc123'); + expect(href?.value).toContain(`referrer=${referrer}`); + }, }, { tag: {key: 'replay_id', value: 'def456'}, labelText: 'View this replay', + validateLink: () => { + const linkElement = screen.getByRole('link', {name: 'def456'}); + expect(linkElement).toHaveAttribute( + 'href', + `/organizations/${organization.slug}/replays/def456/?referrer=${referrer}` + ); + }, }, { tag: {key: 'replayId', value: 'ghi789'}, labelText: 'View this replay', + validateLink: () => { + const linkElement = screen.getByRole('link', {name: 'ghi789'}); + expect(linkElement).toHaveAttribute( + 'href', + `/organizations/${organization.slug}/replays/ghi789/?referrer=${referrer}` + ); + }, }, { tag: {key: 'external-link', value: 'https://example.com'}, labelText: 'Visit this external link', + validateLink: async () => { + renderGlobalModal(); + const linkElement = screen.getByText('https://example.com'); + await userEvent.click(linkElement); + expect(screen.getByTestId('external-link-warning')).toBeInTheDocument(); + }, }, - ])("renders unique links for '$tag.key' tag", async ({tag, labelText}) => { - const featuredOrganization = OrganizationFixture({features: ['event-tags-tree-ui']}); - const uniqueTagsEvent = EventFixture({tags: [tag]}); - render(<EventTags projectSlug={project.slug} event={uniqueTagsEvent} />, { - organization: featuredOrganization, - }); - const dropdown = screen.getByLabelText('Tag Actions Menu'); - await userEvent.click(dropdown); - expect(screen.getByLabelText(labelText)).toBeInTheDocument(); - }); + ])( + "renders unique links for '$tag.key' tag", + async ({tag, labelText, validateLink}) => { + const featuredOrganization = OrganizationFixture({ + features: ['event-tags-tree-ui'], + }); + const uniqueTagsEvent = EventFixture({tags: [tag], projectID: project.id}); + render(<EventTags projectSlug={project.slug} event={uniqueTagsEvent} />, { + organization: featuredOrganization, + }); + const dropdown = screen.getByLabelText('Tag Actions Menu'); + await userEvent.click(dropdown); + expect(screen.getByLabelText(labelText)).toBeInTheDocument(); + await validateLink(); + } + ); it('renders error message tooltips instead of dropdowns', function () { const featuredOrganization = OrganizationFixture({features: ['event-tags-tree-ui']}); diff --git a/static/app/components/events/eventTags/eventTagsTreeRow.tsx b/static/app/components/events/eventTags/eventTagsTreeRow.tsx index 2a06c168c1c5fa..4406672c895f64 100644 --- a/static/app/components/events/eventTags/eventTagsTreeRow.tsx +++ b/static/app/components/events/eventTags/eventTagsTreeRow.tsx @@ -1,4 +1,5 @@ import {Fragment, useState} from 'react'; +import {Link} from 'react-router'; import styled from '@emotion/styled'; import * as qs from 'query-string'; @@ -8,6 +9,7 @@ import {DropdownMenu} from 'sentry/components/dropdownMenu'; import type {TagTreeContent} from 'sentry/components/events/eventTags/eventTagsTree'; import EventTagsValue from 'sentry/components/events/eventTags/eventTagsValue'; import {AnnotatedTextErrors} from 'sentry/components/events/meta/annotatedText/annotatedTextErrors'; +import ExternalLink from 'sentry/components/links/externalLink'; import Version from 'sentry/components/version'; import VersionHoverCard from 'sentry/components/versionHoverCard'; import {IconEllipsis} from 'sentry/icons'; @@ -43,10 +45,8 @@ export default function EventTagsTreeRow({ config = {}, ...props }: EventTagsTreeRowProps) { - const organization = useOrganization(); const originalTag = content.originalTag; - const tagMeta = content.meta?.value?.['']; - const tagErrors = tagMeta?.err ?? []; + const tagErrors = content.meta?.value?.['']?.err ?? []; const hasTagErrors = tagErrors.length > 0 && !config?.disableActions; const hasStem = !isLast && objectIsEmpty(content.subtree); @@ -66,20 +66,6 @@ export default function EventTagsTreeRow({ </TreeRow> ); } - const tagValue = - originalTag.key === 'release' && !config?.disableRichValue ? ( - <VersionHoverCard - organization={organization} - projectSlug={projectSlug} - releaseVersion={content.value} - showUnderline - underlineColor="linkUnderline" - > - <Version version={content.value} truncate /> - </VersionHoverCard> - ) : ( - <EventTagsValue tag={originalTag} meta={tagMeta} withOnlyFormattedText /> - ); const tagActions = hasTagErrors ? ( <TreeValueErrors data-test-id="tag-tree-row-errors"> @@ -104,7 +90,14 @@ export default function EventTagsTreeRow({ </TreeKey> </TreeKeyTrunk> <TreeValueTrunk> - <TreeValue hasErrors={hasTagErrors}>{tagValue}</TreeValue> + <TreeValue hasErrors={hasTagErrors}> + <EventTagsTreeValue + config={config} + content={content} + event={event} + projectSlug={projectSlug} + /> + </TreeValue> {!config?.disableActions && tagActions} </TreeValueTrunk> </TreeRow> @@ -124,7 +117,7 @@ function EventTagsTreeRowDropdown({ return null; } - const referrer = 'event-tags-tree'; + const referrer = 'event-tags-table'; const query = generateQueryWithTag({referrer}, originalTag); const searchQuery = `?${qs.stringify(query)}`; @@ -217,6 +210,86 @@ function EventTagsTreeRowDropdown({ ); } +function EventTagsTreeValue({ + config, + content, + event, + projectSlug, +}: Pick<EventTagsTreeRowProps, 'config' | 'content' | 'event' | 'projectSlug'>) { + const organization = useOrganization(); + const {originalTag} = content; + const tagMeta = content.meta?.value?.['']; + if (!originalTag) { + return null; + } + + const defaultValue = ( + <EventTagsValue tag={originalTag} meta={tagMeta} withOnlyFormattedText /> + ); + + if (config?.disableRichValue) { + return defaultValue; + } + + let tagValue = defaultValue; + const referrer = 'event-tags-table'; + switch (originalTag.key) { + case 'release': + tagValue = ( + <VersionHoverCard + organization={organization} + projectSlug={projectSlug} + releaseVersion={content.value} + showUnderline + underlineColor="linkUnderline" + > + <Version version={content.value} truncate /> + </VersionHoverCard> + ); + break; + case 'transaction': + const transactionQuery = qs.stringify({ + project: event.projectID, + transaction: content.value, + referrer, + }); + const transactionDestination = `/organizations/${organization.slug}/performance/summary/?${transactionQuery}`; + tagValue = ( + <TagLinkText> + <Link to={transactionDestination}>{content.value}</Link> + </TagLinkText> + ); + break; + case 'replayId': + case 'replay_id': + const replayQuery = qs.stringify({referrer}); + const replayDestination = `/organizations/${organization.slug}/replays/${encodeURIComponent(content.value)}/?${replayQuery}`; + tagValue = ( + <TagLinkText> + <Link to={replayDestination}>{content.value}</Link> + </TagLinkText> + ); + break; + default: + tagValue = defaultValue; + } + + return !isUrl(content.value) ? ( + tagValue + ) : ( + <TagLinkText> + <ExternalLink + onClick={e => { + e.preventDefault(); + openNavigateToExternalLinkModal({linkText: content.value}); + }} + > + {content.value} + </ExternalLink> + </TagLinkText> + ); +} + const TreeRow = styled('div')<{hasErrors: boolean}>` border-radius: ${space(0.5)}; padding-left: ${space(1)}; @@ -252,6 +325,7 @@ const TreeSpacer = styled('div')<{hasStem: boolean; spacerCount: number}>` border-right: 1px solid ${p => (p.hasStem ? p.theme.border : 'transparent')}; margin-right: -1px; height: 100%; + width: ${p => (p.spacerCount - 1) * 20 + 3}px; `; const TreeBranchIcon = styled('div')<{hasErrors: boolean}>` @@ -269,8 +343,7 @@ const TreeKeyTrunk = styled('div')<{spacerCount: number}>` display: grid; height: 100%; align-items: center; - grid-template-columns: ${p => - p.spacerCount > 0 ? `${(p.spacerCount - 1) * 20 + 3}px 1rem 1fr` : '1fr'}; + grid-template-columns: ${p => (p.spacerCount > 0 ? `auto 1rem 1fr` : '1fr')}; `; const TreeValueTrunk = styled('div')` @@ -321,3 +394,8 @@ const TreeValueErrors = styled('div')` height: 20px; margin-right: ${space(0.75)}; `; + +const TagLinkText = styled('span')` + color: ${p => p.theme.linkColor}; + margin: 0; +`; diff --git a/static/app/components/events/highlights/editHighlightsModal.spec.tsx b/static/app/components/events/highlights/editHighlightsModal.spec.tsx index 78d8ee0cdff44b..e41bc5936d6f53 100644 --- a/static/app/components/events/highlights/editHighlightsModal.spec.tsx +++ b/static/app/components/events/highlights/editHighlightsModal.spec.tsx @@ -20,6 +20,7 @@ import { } from 'sentry/components/events/highlights/util.spec'; import ModalStore from 'sentry/stores/modalStore'; import type {Project} from 'sentry/types'; +import * as analytics from 'sentry/utils/analytics'; describe('EditHighlightsModal', function () { const organization = OrganizationFixture(); @@ -54,6 +55,7 @@ describe('EditHighlightsModal', function () { tags: ['presetTag'], }; const closeModal = jest.fn(); + const analyticsSpy = jest.spyOn(analytics, 'trackAnalytics'); function renderModal(editHighlightModalProps?: Partial<EditHighlightsModalProps>) { act(() => { @@ -92,6 +94,10 @@ describe('EditHighlightsModal', function () { const defaultButton = screen.getByRole('button', {name: 'Use Defaults'}); await userEvent.click(defaultButton); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.edit_modal.use_default_clicked', + expect.anything() + ); expect(screen.queryByTestId('highlights-empty-message')).not.toBeInTheDocument(); const updateProjectMock = MockApiClient.addMockResponse({ @@ -101,6 +107,10 @@ describe('EditHighlightsModal', function () { }); const cancelButton = screen.getByRole('button', {name: 'Cancel'}); await userEvent.click(cancelButton); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.edit_modal.cancel_clicked', + expect.anything() + ); expect(updateProjectMock).not.toHaveBeenCalled(); expect(closeModal).toHaveBeenCalled(); @@ -109,6 +119,10 @@ describe('EditHighlightsModal', function () { renderModal({highlightContext: {}, highlightTags: []}); const saveButton = screen.getByRole('button', {name: 'Apply to Project'}); await userEvent.click(saveButton); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.edit_modal.save_clicked', + expect.anything() + ); expect(updateProjectMock).toHaveBeenCalled(); expect(closeModal).toHaveBeenCalled(); }); @@ -124,7 +138,6 @@ describe('EditHighlightsModal', function () { // Existing Tags and Context Keys should be highlighted const previewSection = screen.getByTestId('highlights-preview-section'); expect(screen.queryByTestId('highlights-empty-message')).not.toBeInTheDocument(); - highlightTags.forEach(tag => { const tagItem = within(previewSection).getByText(tag, {selector: 'div'}); expect(tagItem).toBeInTheDocument(); @@ -136,9 +149,28 @@ describe('EditHighlightsModal', function () { const contextItem = within(previewSection).getByText(titleString); expect(contextItem).toBeInTheDocument(); }); + const previewCtxButtons = screen.queryAllByTestId('highlights-remove-ctx'); expect(previewCtxButtons).toHaveLength(highlightContextTitles.length); + await userEvent.click(previewTagButtons[0]); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.edit_modal.remove_tag', + expect.anything() + ); + expect(screen.queryAllByTestId('highlights-remove-tag')).toHaveLength( + previewTagButtons.length - 1 + ); + + await userEvent.click(previewCtxButtons[0]); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.edit_modal.remove_context_key', + expect.anything() + ); + expect(screen.queryAllByTestId('highlights-remove-ctx')).toHaveLength( + previewCtxButtons.length - 1 + ); + // Default should unselect the current values const defaultButton = screen.getByRole('button', {name: 'Use Defaults'}); await userEvent.click(defaultButton); @@ -204,6 +236,11 @@ describe('EditHighlightsModal', function () { expect(removeButton).toBeEnabled(); }); await Promise.all(tagTestPromises); + expect(analyticsSpy).toHaveBeenCalledTimes(8); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.edit_modal.add_tag', + expect.anything() + ); // All event tags should be present now await userEvent.click(screen.getByRole('button', {name: 'Apply to Project'})); @@ -265,8 +302,12 @@ describe('EditHighlightsModal', function () { } ); await Promise.all(ctxTestPromises); - - // These come from the event, and existing highlights + expect(analyticsSpy).toHaveBeenCalledTimes(5); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.edit_modal.add_context_key', + expect.anything() + ); + // Combine existing highlight context titles, with new ones that were selected above const allHighlightCtxTitles = highlightContextTitles.concat([ 'Keyboard: switches', 'Client Os: Version', @@ -300,4 +341,25 @@ describe('EditHighlightsModal', function () { ); expect(closeModal).toHaveBeenCalled(); }); + + it('should update sections from search input', async function () { + renderModal(); + const tagCount = TEST_EVENT_TAGS.length; + expect(screen.getAllByTestId('highlight-tag-option')).toHaveLength(tagCount); + const tagInput = screen.getByTestId('highlights-tag-search'); + await userEvent.type(tagInput, 'le'); + expect(screen.getAllByTestId('highlight-tag-option')).toHaveLength(3); // handled, level, release + await userEvent.clear(tagInput); + expect(screen.getAllByTestId('highlight-tag-option')).toHaveLength(tagCount); + + const ctxCount = Object.values(TEST_EVENT_CONTEXTS) + .flatMap(Object.keys) + .filter(k => k !== 'type').length; + expect(screen.getAllByTestId('highlight-context-option')).toHaveLength(ctxCount); + const contextInput = screen.getByTestId('highlights-context-search'); + await userEvent.type(contextInput, 'name'); // client_os.name, runtime.name + expect(screen.getAllByTestId('highlight-context-option')).toHaveLength(2); + await userEvent.clear(contextInput); + expect(screen.getAllByTestId('highlight-context-option')).toHaveLength(ctxCount); + }); }); diff --git a/static/app/components/events/highlights/editHighlightsModal.tsx b/static/app/components/events/highlights/editHighlightsModal.tsx index 5fa1c82e7f5b5d..dd49989da7c737 100644 --- a/static/app/components/events/highlights/editHighlightsModal.tsx +++ b/static/app/components/events/highlights/editHighlightsModal.tsx @@ -17,7 +17,9 @@ import { getHighlightContextData, getHighlightTagData, } from 'sentry/components/events/highlights/util'; -import {IconAdd, IconInfo, IconSubtract} from 'sentry/icons'; +import type {InputProps} from 'sentry/components/input'; +import {InputGroup} from 'sentry/components/inputGroup'; +import {IconAdd, IconInfo, IconSearch, IconSubtract} from 'sentry/icons'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Event, Project} from 'sentry/types'; @@ -64,10 +66,10 @@ function EditPreviewHighlightSection({ highlightContext, }); const highlightContextRows = highlightContextDataItems.reduce<React.ReactNode[]>( - (rowList, {alias, data}, i) => { + (rowList, {alias, data}) => { const meta = getContextMeta(event, alias); - const newRows = data.map((item, j) => ( - <Fragment key={`edit-highlight-ctx-${i}-${j}`}> + const newRows = data.map(item => ( + <Fragment key={`edit-highlight-ctx-${alias}-${item.key}`}> <EditButton aria-label={`Remove from highlights`} icon={<IconSubtract />} @@ -90,8 +92,8 @@ function EditPreviewHighlightSection({ ); const highlightTagItems = getHighlightTagData({event, highlightTags}); - const highlightTagRows = highlightTagItems.map((content, i) => ( - <Fragment key={`edit-highlight-tag-${i}`}> + const highlightTagRows = highlightTagItems.map(content => ( + <Fragment key={`edit-highlight-tag-${content.originalTag.key}`}> <EditButton aria-label={`Remove from highlights`} icon={<IconSubtract />} @@ -150,10 +152,14 @@ function EditTagHighlightSection({ onAddTag, ...props }: EditTagHighlightSectionProps) { - const tagData = event.tags.map(tag => tag.key); + const [tagFilter, setTagFilter] = useState(''); + const tagData = event.tags + .filter(tag => tag.key?.includes(tagFilter)) + .map(tag => tag.key); const tagColumnSize = Math.ceil(tagData.length / columnCount); const tagColumns: React.ReactNode[] = []; const highlightTagsSet = new Set(highlightTags); + for (let i = 0; i < tagData.length; i += tagColumnSize) { tagColumns.push( <EditHighlightColumn key={`tag-column-${i}`}> @@ -170,7 +176,11 @@ function EditTagHighlightSection({ title={isDisabled && t('Already highlighted')} tooltipProps={{delay: 500}} /> - <HighlightKey disabled={isDisabled} aria-disabled={isDisabled}> + <HighlightKey + disabled={isDisabled} + aria-disabled={isDisabled} + data-test-id="highlight-tag-option" + > {tagKey} </HighlightKey> </EditTagContainer> @@ -181,7 +191,15 @@ function EditTagHighlightSection({ } return ( <EditHighlightSection {...props}> - <Subtitle>{t('Tags')}</Subtitle> + <Subtitle> + <SubtitleText>{t('Tags')}</SubtitleText> + <SectionFilterInput + placeholder={t('Search Tags')} + value={tagFilter} + onChange={e => setTagFilter(e.target.value)} + data-test-id="highlights-tag-search" + /> + </Subtitle> <EditHighlightSectionContent columnCount={columnCount}> {tagColumns} </EditHighlightSectionContent> @@ -203,6 +221,7 @@ function EditContextHighlightSection({ onAddContextKey, ...props }: EditContextHighlightSectionProps) { + const [ctxFilter, setCtxFilter] = useState(''); const ctxDisableMap: Record<string, Set<string>> = Object.entries( highlightContext ).reduce( @@ -220,42 +239,66 @@ function EditContextHighlightSection({ {} ); const ctxItems = Object.entries(ctxData); - const ctxColumnSize = Math.ceil(ctxItems.length / columnCount); + const filteredCtxItems = ctxItems + .map<[string, string[]]>(([contextType, contextKeys]) => { + const filteredContextKeys = contextKeys.filter( + contextKey => contextKey.includes(ctxFilter) || contextType.includes(ctxFilter) + ); + return [contextType, filteredContextKeys]; + }) + .filter(([_contextType, contextKeys]) => contextKeys.length !== 0); + const ctxColumnSize = Math.ceil(filteredCtxItems.length / columnCount); const contextColumns: React.ReactNode[] = []; - for (let i = 0; i < ctxItems.length; i += ctxColumnSize) { + for (let i = 0; i < filteredCtxItems.length; i += ctxColumnSize) { contextColumns.push( <EditHighlightColumn key={`ctx-column-${i}`}> - {ctxItems.slice(i, i + ctxColumnSize).map(([contextType, contextKeys], j) => ( - <EditContextContainer key={`ctxv-item-${i}-${j}`}> - <ContextType>{contextType}</ContextType> - {contextKeys.map((contextKey, k) => { - const isDisabled = ctxDisableMap[contextType]?.has(contextKey) ?? false; - return ( - <Fragment key={`ctx-key-${i}-${j}-${k}`}> - <EditButton - aria-label={`Add ${contextKey} from ${contextType} context to highlights`} - icon={<IconAdd />} - size="xs" - onClick={() => onAddContextKey(contextType, contextKey)} - disabled={isDisabled} - title={isDisabled && t('Already highlighted')} - tooltipProps={{delay: 500}} - /> - <HighlightKey disabled={isDisabled} aria-disabled={isDisabled}> - {contextKey} - </HighlightKey> - </Fragment> - ); - })} - </EditContextContainer> - ))} + {filteredCtxItems + .slice(i, i + ctxColumnSize) + .map(([contextType, contextKeys], j) => { + return ( + <EditContextContainer key={`ctxv-item-${i}-${j}`}> + <ContextType>{contextType}</ContextType> + {contextKeys.map((contextKey, k) => { + const isDisabled = ctxDisableMap[contextType]?.has(contextKey) ?? false; + return ( + <Fragment key={`ctx-key-${i}-${j}-${k}`}> + <EditButton + aria-label={`Add ${contextKey} from ${contextType} context to highlights`} + icon={<IconAdd />} + size="xs" + onClick={() => onAddContextKey(contextType, contextKey)} + disabled={isDisabled} + title={isDisabled && t('Already highlighted')} + tooltipProps={{delay: 500}} + /> + <HighlightKey + disabled={isDisabled} + aria-disabled={isDisabled} + data-test-id="highlight-context-option" + > + {contextKey} + </HighlightKey> + </Fragment> + ); + })} + </EditContextContainer> + ); + })} </EditHighlightColumn> ); } return ( <EditHighlightSection {...props}> - <Subtitle>{t('Context')}</Subtitle> + <Subtitle> + <SubtitleText>{t('Context')}</SubtitleText> + <SectionFilterInput + placeholder={t('Search Context')} + value={ctxFilter} + onChange={e => setCtxFilter(e.target.value)} + data-test-id="highlights-context-search" + /> + </Subtitle> <EditHighlightSectionContent columnCount={columnCount}> {contextColumns} </EditHighlightSectionContent> @@ -334,12 +377,12 @@ export default function EditHighlightsModal({ highlightTags={highlightTags} highlightContext={highlightContext} onRemoveTag={tagKey => { - trackAnalytics('edit_highlights.remove_tag_key', {organization}); + trackAnalytics('highlights.edit_modal.remove_tag', {organization}); setHighlightTags(highlightTags.filter(tag => tag !== tagKey)); }} - onRemoveContextKey={(contextType, contextKey) => + onRemoveContextKey={(contextType, contextKey) => { + trackAnalytics('highlights.edit_modal.remove_context_key', {organization}); setHighlightContext(() => { - trackAnalytics('edit_highlights.remove_context_key', {organization}); const {[contextType]: highlightContextKeys, ...newHighlightContext} = highlightContext; const newHighlightContextKeys = (highlightContextKeys ?? []).filter( @@ -351,8 +394,8 @@ export default function EditHighlightsModal({ ...newHighlightContext, [contextType]: newHighlightContextKeys, }; - }) - } + }); + }} project={project} data-test-id="highlights-preview-section" /> @@ -361,7 +404,7 @@ export default function EditHighlightsModal({ columnCount={columnCount} highlightTags={highlightTags} onAddTag={tagKey => { - trackAnalytics('edit_highlights.add_tag_key', {organization}); + trackAnalytics('highlights.edit_modal.add_tag', {organization}); setHighlightTags([...highlightTags, tagKey]); }} data-test-id="highlights-tag-section" @@ -371,7 +414,7 @@ export default function EditHighlightsModal({ columnCount={columnCount} highlightContext={highlightContext} onAddContextKey={(contextType, contextKey) => { - trackAnalytics('edit_highlights.add_context_key', {organization}); + trackAnalytics('highlights.edit_modal.add_context_key', {organization}); setHighlightContext({ ...highlightContext, [contextType]: [...(highlightContext[contextType] ?? []), contextKey], @@ -388,7 +431,7 @@ export default function EditHighlightsModal({ <ButtonBar gap={1}> <Button onClick={() => { - trackAnalytics('edit_highlights.cancel_clicked', {organization}); + trackAnalytics('highlights.edit_modal.cancel_clicked', {organization}); closeModal(); }} size="sm" @@ -398,7 +441,9 @@ export default function EditHighlightsModal({ {highlightPreset && ( <Button onClick={() => { - trackAnalytics('edit_highlights.use_default_clicked', {organization}); + trackAnalytics('highlights.edit_modal.use_default_clicked', { + organization, + }); setHighlightContext(highlightPreset.context); setHighlightTags(highlightPreset.tags); }} @@ -410,7 +455,7 @@ export default function EditHighlightsModal({ <Button disabled={isLoading} onClick={() => { - trackAnalytics('edit_highlights.save_clicked', {organization}); + trackAnalytics('highlights.edit_modal.save_clicked', {organization}); saveHighlights({highlightContext, highlightTags}); }} priority="primary" @@ -424,15 +469,33 @@ export default function EditHighlightsModal({ ); } +function SectionFilterInput(props: InputProps) { + return ( + <InputGroup> + <InputGroup.LeadingItems disablePointerEvents> + <IconSearch color="subText" size="xs" /> + </InputGroup.LeadingItems> + <InputGroup.Input size="xs" autoComplete="off" {...props} /> + </InputGroup> + ); +} + const Title = styled('h3')` font-size: ${p => p.theme.fontSizeLarge}; `; -const Subtitle = styled('h4')` - font-size: ${p => p.theme.fontSizeMedium}; +const Subtitle = styled('div')` border-bottom: 1px solid ${p => p.theme.border}; margin-bottom: ${space(1.5)}; padding-bottom: ${space(0.5)}; + display: flex; + align-items: center; + justify-content: space-between; +`; + +const SubtitleText = styled('h4')` + font-size: ${p => p.theme.fontSizeMedium}; + margin-bottom: 0; `; const FooterInfo = styled('div')` diff --git a/static/app/components/events/highlights/highlightsDataSection.spec.tsx b/static/app/components/events/highlights/highlightsDataSection.spec.tsx index f21ffcdf95ea58..f70a54aa2efd02 100644 --- a/static/app/components/events/highlights/highlightsDataSection.spec.tsx +++ b/static/app/components/events/highlights/highlightsDataSection.spec.tsx @@ -5,7 +5,9 @@ import {ProjectFixture} from 'sentry-fixture/project'; import {render, screen} from 'sentry-test/reactTestingLibrary'; +import * as modal from 'sentry/actionCreators/modal'; import HighlightsDataSection from 'sentry/components/events/highlights/highlightsDataSection'; +import * as analytics from 'sentry/utils/analytics'; HighlightsDataSection; @@ -28,6 +30,9 @@ describe('HighlightsDataSection', function () { browser: ['name', 'version'], }; const highlightContextTitles = ['User: email', 'Browser: name', 'Browser: version']; + const analyticsSpy = jest.spyOn(analytics, 'trackAnalytics'); + const modalSpy = jest.spyOn(modal, 'openModal'); + it('renders an empty state', async function () { MockApiClient.addMockResponse({ url: `/projects/${organization.slug}/${project.slug}/`, @@ -45,8 +50,20 @@ describe('HighlightsDataSection', function () { expect(screen.getByText('Event Highlights')).toBeInTheDocument(); expect(screen.getByTestId('loading-indicator')).toBeInTheDocument(); expect(await screen.findByText("There's nothing here...")).toBeInTheDocument(); - expect(screen.getByRole('button', {name: 'Edit'})).toBeInTheDocument(); expect(screen.getByRole('button', {name: 'Add Highlights'})).toBeInTheDocument(); + const viewAllButton = screen.getByRole('button', {name: 'View All'}); + await viewAllButton.click(); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.issue_details.view_all_clicked', + expect.anything() + ); + const editButton = screen.getByRole('button', {name: 'Edit'}); + await editButton.click(); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.issue_details.edit_clicked', + expect.anything() + ); + expect(modalSpy).toHaveBeenCalled(); }); it('renders highlights from the detailed project API response', async function () { diff --git a/static/app/components/events/highlights/highlightsDataSection.tsx b/static/app/components/events/highlights/highlightsDataSection.tsx index c90d45dd63d167..53d6046b602a74 100644 --- a/static/app/components/events/highlights/highlightsDataSection.tsx +++ b/static/app/components/events/highlights/highlightsDataSection.tsx @@ -23,8 +23,9 @@ import { getHighlightContextData, getHighlightTagData, } from 'sentry/components/events/highlights/util'; +import useFeedbackWidget from 'sentry/components/feedback/widget/useFeedbackWidget'; import LoadingIndicator from 'sentry/components/loadingIndicator'; -import {IconEdit} from 'sentry/icons'; +import {IconEdit, IconMegaphone} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import type {Event, Group, Project} from 'sentry/types'; @@ -68,7 +69,7 @@ export default function HighlightsDataSection({ const viewAllButton = viewAllRef ? ( <Button onClick={() => { - trackAnalytics('highlights_section.view_all_clicked', {organization}); + trackAnalytics('highlights.issue_details.view_all_clicked', {organization}); viewAllRef?.current?.scrollIntoView({behavior: 'smooth'}); }} size="xs" @@ -130,7 +131,7 @@ export default function HighlightsDataSection({ }); function openEditHighlightsModal() { - trackAnalytics('highlights_section.edit_clicked', {organization}); + trackAnalytics('highlights.issue_details.edit_clicked', {organization}); openModal( deps => ( <EditHighlightsModal @@ -158,6 +159,7 @@ export default function HighlightsDataSection({ type="event-highlights" actions={ <ButtonBar gap={1}> + <HighlightsFeedback /> {viewAllButton} <Button size="xs" @@ -196,6 +198,31 @@ export default function HighlightsDataSection({ ); } +function HighlightsFeedback() { + const buttonRef = useRef<HTMLButtonElement>(null); + const feedback = useFeedbackWidget({ + buttonRef, + messagePlaceholder: t( + 'How can we make tags, context or highlights more useful to you?' + ), + }); + + if (!feedback) { + return null; + } + + return ( + <Button + ref={buttonRef} + aria-label={t('Give Feedback')} + icon={<IconMegaphone />} + size={'xs'} + > + {t('Feedback')} + </Button> + ); +} + const HighlightContainer = styled(TreeContainer)<{columnCount: number}>` margin-top: 0; margin-bottom: ${space(2)}; diff --git a/static/app/components/events/highlights/highlightsSettingsForm.spec.tsx b/static/app/components/events/highlights/highlightsSettingsForm.spec.tsx index a4f30b91627ebe..b3ddf8b249d291 100644 --- a/static/app/components/events/highlights/highlightsSettingsForm.spec.tsx +++ b/static/app/components/events/highlights/highlightsSettingsForm.spec.tsx @@ -4,6 +4,7 @@ import {ProjectFixture} from 'sentry-fixture/project'; import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; import HighlightsSettingsForm from 'sentry/components/events/highlights/highlightsSettingsForm'; +import * as analytics from 'sentry/utils/analytics'; describe('HighlightsSettingForm', function () { const organization = OrganizationFixture({features: ['event-tags-tree-ui']}); @@ -13,6 +14,7 @@ describe('HighlightsSettingForm', function () { browser: ['name', 'version'], }; const project = ProjectFixture({highlightContext, highlightTags}); + const analyticsSpy = jest.spyOn(analytics, 'trackAnalytics'); beforeEach(async function () { MockApiClient.addMockResponse({ @@ -53,6 +55,10 @@ describe('HighlightsSettingForm', function () { data: {highlightTags: [...highlightTags, newTag]}, }) ); + expect(analyticsSpy).toHaveBeenCalledWith( + 'highlights.project_settings.updated_manually', + expect.anything() + ); }); it('should allow the Highlight Context field to mutate highlights', async function () { diff --git a/static/app/components/events/highlights/highlightsSettingsForm.tsx b/static/app/components/events/highlights/highlightsSettingsForm.tsx index f76203edc4121b..633bfb3d54ca0e 100644 --- a/static/app/components/events/highlights/highlightsSettingsForm.tsx +++ b/static/app/components/events/highlights/highlightsSettingsForm.tsx @@ -51,7 +51,7 @@ export default function HighlightsSettingsForm({ }), data => (updatedProject ? updatedProject : data) ); - trackAnalytics('project_settings.updated_highlights', {organization}); + trackAnalytics('highlights.project_settings.updated_manually', {organization}); addSuccessMessage(`Successfully updated highlights for '${project.name}'`); }, }; diff --git a/static/app/components/modals/navigateToExternalLinkModal.tsx b/static/app/components/modals/navigateToExternalLinkModal.tsx index d553fe1361c478..9a76f8678176fb 100644 --- a/static/app/components/modals/navigateToExternalLinkModal.tsx +++ b/static/app/components/modals/navigateToExternalLinkModal.tsx @@ -18,7 +18,7 @@ function NavigateToExternalLinkModal({Body, closeModal, Header, linkText}: Props <h2>{t('Heads up')}</h2> </Header> <Body> - <p> + <p data-test-id="external-link-warning"> {t( "You're leaving Sentry and will be redirected to the following external website:" )} diff --git a/static/app/utils/analytics/issueAnalyticsEvents.tsx b/static/app/utils/analytics/issueAnalyticsEvents.tsx index fd7391a8269035..ebed6329810e4c 100644 --- a/static/app/utils/analytics/issueAnalyticsEvents.tsx +++ b/static/app/utils/analytics/issueAnalyticsEvents.tsx @@ -63,6 +63,16 @@ export type IssueEventParameters = { platform?: string; project_id?: string; }; + 'highlights.edit_modal.add_context_key': {}; + 'highlights.edit_modal.add_tag': {}; + 'highlights.edit_modal.cancel_clicked': {}; + 'highlights.edit_modal.remove_context_key': {}; + 'highlights.edit_modal.remove_tag': {}; + 'highlights.edit_modal.save_clicked': {}; + 'highlights.edit_modal.use_default_clicked': {}; + 'highlights.issue_details.edit_clicked': {}; + 'highlights.issue_details.view_all_clicked': {}; + 'highlights.project_settings.updated_manually': {}; 'integrations.integration_reinstall_clicked': { provider: string; }; @@ -275,6 +285,18 @@ export const issueEventMap: Record<IssueEventKey, string | null> = { 'event_cause.docs_clicked': 'Event Cause Docs Clicked', 'event_cause.snoozed': 'Event Cause Snoozed', 'event_cause.dismissed': 'Event Cause Dismissed', + 'highlights.edit_modal.add_context_key': 'Highlights: Add Context in Edit Modal', + 'highlights.edit_modal.add_tag': 'Highlights: Add Tag in Edit Modal', + 'highlights.edit_modal.cancel_clicked': 'Highlights: Cancel from Edit Modal', + 'highlights.edit_modal.remove_context_key': 'Highlights: Remove Context in Edit Modal', + 'highlights.edit_modal.remove_tag': 'Highlights: Remove Tag in Edit Modal', + 'highlights.edit_modal.save_clicked': 'Highlights: Save from Edit Modal', + 'highlights.edit_modal.use_default_clicked': + 'Highlights: Defaults Applied from Edit Modal', + 'highlights.issue_details.edit_clicked': 'Highlights: Open Edit Modal', + 'highlights.issue_details.view_all_clicked': 'Highlights: View All Clicked', + 'highlights.project_settings.updated_manually': + 'Highlights: Updated Manually from Settings', 'issue_details.escalating_feedback_received': 'Issue Details: Escalating Feedback Received', 'issue_details.escalating_issues_banner_feedback_received':
bbae99f907a856ddd98218364e9290a5c121610d
2024-05-04 00:57:40
Michelle Zhang
feat(replay): add device breadcrumbs (#70265)
false
add device breadcrumbs (#70265)
feat
diff --git a/static/app/utils/replays/getFrameDetails.tsx b/static/app/utils/replays/getFrameDetails.tsx index 080528c74f2bd7..458f889b62db6a 100644 --- a/static/app/utils/replays/getFrameDetails.tsx +++ b/static/app/utils/replays/getFrameDetails.tsx @@ -15,6 +15,7 @@ import { IconKeyDown, IconLocation, IconMegaphone, + IconMobile, IconSort, IconTerminal, IconUser, @@ -24,6 +25,9 @@ import {t, tct} from 'sentry/locale'; import {TabKey} from 'sentry/utils/replays/hooks/useActiveReplayTab'; import type { BreadcrumbFrame, + DeviceBatteryFrame, + DeviceConnectivityFrame, + DeviceOrientationFrame, ErrorFrame, FeedbackFrame, LargestContentfulPaintFrame, @@ -350,6 +354,30 @@ const MAPPER_FOR_FRAME: Record<string, (frame) => Details> = { title: frame.description, icon: <IconSort size="xs" rotated />, }), + 'device.connectivity': (frame: DeviceConnectivityFrame) => ({ + color: 'pink300', + description: frame.data.state, + tabKey: TabKey.BREADCRUMBS, + title: 'Device Connectivity', + icon: <IconMobile size="xs" />, + }), + 'device.battery': (frame: DeviceBatteryFrame) => ({ + color: 'pink300', + description: tct('Device was at [percent]% battery and [charging]', { + percent: frame.data.level, + charging: frame.data.charging ? 'charging' : 'not charging', + }), + tabKey: TabKey.BREADCRUMBS, + title: 'Device Battery', + icon: <IconMobile size="xs" />, + }), + 'device.orientation': (frame: DeviceOrientationFrame) => ({ + color: 'pink300', + description: frame.data.position, + tabKey: TabKey.BREADCRUMBS, + title: 'Device Orientation', + icon: <IconMobile size="xs" />, + }), }; const MAPPER_DEFAULT = (frame): Details => ({ diff --git a/static/app/utils/replays/replayReader.tsx b/static/app/utils/replays/replayReader.tsx index 349606fe7537cc..76ccb221b2c909 100644 --- a/static/app/utils/replays/replayReader.tsx +++ b/static/app/utils/replays/replayReader.tsx @@ -467,6 +467,9 @@ export default class ReplayReader { 'replay.init', 'replay.mutations', 'feedback', + 'device.battery', + 'device.connectivity', + 'device.orientation', ].includes(frame.category) ), ...this._errors, diff --git a/static/app/utils/replays/types.tsx b/static/app/utils/replays/types.tsx index 668f82413dd81f..fa92aea491f0e1 100644 --- a/static/app/utils/replays/types.tsx +++ b/static/app/utils/replays/types.tsx @@ -18,13 +18,35 @@ import invariant from 'invariant'; import type {HydratedA11yFrame} from 'sentry/utils/replays/hydrateA11yFrame'; // TODO: more types get added here -type MobileBreadcrumbTypes = { - category: 'ui.tap'; - data: any; - message: string; - timestamp: number; - type: string; -}; +type MobileBreadcrumbTypes = + | { + category: 'ui.tap'; + data: any; + message: string; + timestamp: number; + type: string; + } + | { + category: 'device.battery'; + data: {charging: boolean; level: number}; + timestamp: number; + type: string; + message?: string; + } + | { + category: 'device.connectivity'; + data: {state: 'offline' | 'wifi' | 'cellular' | 'ethernet'}; + timestamp: number; + type: string; + message?: string; + } + | { + category: 'device.orientation'; + data: {position: 'landscape' | 'portrait'}; + timestamp: number; + type: string; + message?: string; + }; /** * Extra breadcrumb types not included in `@sentry/replay` @@ -231,11 +253,17 @@ export type MultiClickFrame = HydratedBreadcrumb<'ui.multiClick'>; export type MutationFrame = HydratedBreadcrumb<'replay.mutations'>; export type NavFrame = HydratedBreadcrumb<'navigation'>; export type SlowClickFrame = HydratedBreadcrumb<'ui.slowClickDetected'>; +export type DeviceBatteryFrame = HydratedBreadcrumb<'device.battery'>; +export type DeviceConnectivityFrame = HydratedBreadcrumb<'device.connectivity'>; +export type DeviceOrientationFrame = HydratedBreadcrumb<'device.orientation'>; // This list must match each of the categories used in `HydratedBreadcrumb` above // and any app-specific types that we hydrate (ie: replay.init). export const BreadcrumbCategories = [ 'console', + 'device.battery', + 'device.connectivity', + 'device.orientation', 'navigation', 'replay.init', 'replay.mutations', diff --git a/static/app/views/replays/detail/breadcrumbs/useBreadcrumbFilters.tsx b/static/app/views/replays/detail/breadcrumbs/useBreadcrumbFilters.tsx index 4aca1b83298465..3410f2b5d6ad31 100644 --- a/static/app/views/replays/detail/breadcrumbs/useBreadcrumbFilters.tsx +++ b/static/app/views/replays/detail/breadcrumbs/useBreadcrumbFilters.tsx @@ -50,6 +50,7 @@ const TYPE_TO_LABEL: Record<string, string> = { keydown: 'KeyDown', input: 'Input', tap: 'User Tap', + device: 'Device', }; const OPORCATEGORY_TO_TYPE: Record<string, keyof typeof TYPE_TO_LABEL> = { @@ -75,6 +76,9 @@ const OPORCATEGORY_TO_TYPE: Record<string, keyof typeof TYPE_TO_LABEL> = { 'ui.keyDown': 'keydown', 'ui.input': 'input', feedback: 'feedback', + 'device.battery': 'device', + 'device.connectivity': 'device', + 'device.orientation': 'device', }; function typeToLabel(val: string): string { @@ -111,7 +115,9 @@ function useBreadcrumbFilters({frames}: Options): Return { // flips OPORCATERGORY_TO_TYPE and prevents overwriting nav entry, nav entry becomes nav: ['navigation','navigation.push'] const TYPE_TO_OPORCATEGORY = Object.entries(OPORCATEGORY_TO_TYPE).reduce( (dict, [key, value]) => - dict[value] ? {...dict, [value]: [dict[value], key]} : {...dict, [value]: key}, + dict[value] + ? {...dict, [value]: [dict[value], key].flat()} + : {...dict, [value]: key}, {} ); const OpOrCategory = type.flatMap(theType => TYPE_TO_OPORCATEGORY[theType]);
4c13721d122e9b034b0dcfd99aea9c3a6c91d8e5
2024-05-30 22:57:21
anthony sottile
ref: fix typing for jira.views.sentry_issue_details (#71747)
false
fix typing for jira.views.sentry_issue_details (#71747)
ref
diff --git a/pyproject.toml b/pyproject.toml index 15680aeb30c289..08635f4b78e780 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -299,7 +299,6 @@ module = [ "sentry.integrations.jira.client", "sentry.integrations.jira.integration", "sentry.integrations.jira.views.base", - "sentry.integrations.jira.views.sentry_issue_details", "sentry.integrations.jira.webhooks.base", "sentry.integrations.jira.webhooks.issue_updated", "sentry.integrations.jira_server.client", diff --git a/src/sentry/integrations/jira/views/sentry_issue_details.py b/src/sentry/integrations/jira/views/sentry_issue_details.py index d4b9ff435a81ac..99376c9e69e999 100644 --- a/src/sentry/integrations/jira/views/sentry_issue_details.py +++ b/src/sentry/integrations/jira/views/sentry_issue_details.py @@ -1,11 +1,13 @@ from __future__ import annotations import logging -from collections.abc import Mapping, Sequence +from collections.abc import Mapping from functools import reduce from typing import Any from urllib.parse import quote +from django.db.models.query import QuerySet +from django.http.request import HttpRequest from django.http.response import HttpResponseBase from jwt import ExpiredSignatureError from rest_framework.request import Request @@ -54,7 +56,7 @@ def get_release_url(group: Group, release: str) -> str: ) -def build_context(group: Group) -> Mapping[str, Any]: +def build_context(group: Group) -> dict[str, Any]: result, stats_24hr = get_serialized_and_stats(group, "24h") _, stats_14d = get_serialized_and_stats(group, "14d") @@ -98,11 +100,8 @@ class JiraSentryIssueDetailsView(JiraSentryUIBaseView): html_file = "sentry/integrations/jira-issue.html" - def handle_groups(self, groups: Sequence[Group]) -> Response: - response_context = {"groups": []} - for group in groups: - context = build_context(group) - response_context["groups"].append(context) + def handle_groups(self, groups: QuerySet[Group]) -> Response: + response_context = {"groups": [build_context(group) for group in groups]} logger.info( "issue_hook.response", @@ -111,7 +110,7 @@ def handle_groups(self, groups: Sequence[Group]) -> Response: return self.get_response(response_context) - def dispatch(self, request: Request, *args, **kwargs) -> HttpResponseBase: + def dispatch(self, request: HttpRequest, *args, **kwargs) -> HttpResponseBase: try: return super().dispatch(request, *args, **kwargs) except ApiError as exc: diff --git a/src/sentry/models/group.py b/src/sentry/models/group.py index 9bff82c2235911..5cb27abcc6072e 100644 --- a/src/sentry/models/group.py +++ b/src/sentry/models/group.py @@ -390,7 +390,7 @@ def get_groups_by_external_issue( integration: RpcIntegration, organizations: Sequence[Organization], external_issue_key: str, - ) -> QuerySet: + ) -> QuerySet[Group]: from sentry.models.grouplink import GroupLink from sentry.models.integrations.external_issue import ExternalIssue from sentry.services.hybrid_cloud.integration import integration_service
e3736807807d52d2fef57b5f429a947432c0559d
2024-02-27 05:27:15
Dan Fuller
fix(perf): Don't use `.last()` when fetching `ApiTokenReplica`. (#65844)
false
Don't use `.last()` when fetching `ApiTokenReplica`. (#65844)
fix
diff --git a/src/sentry/api/authentication.py b/src/sentry/api/authentication.py index 95797372a150db..bdcf1eaa5dca3d 100644 --- a/src/sentry/api/authentication.py +++ b/src/sentry/api/authentication.py @@ -321,8 +321,9 @@ def authenticate_token(self, request: Request, token_str: str) -> tuple[Any, Any if not token: if SiloMode.get_current_mode() == SiloMode.REGION: - atr = token = ApiTokenReplica.objects.filter(token=token_str).last() - if not atr: + try: + atr = token = ApiTokenReplica.objects.get(token=token_str) + except ApiTokenReplica.DoesNotExist: raise AuthenticationFailed("Invalid token") user = user_service.get_user(user_id=atr.user_id) application_is_inactive = not atr.application_is_active
6801cb71d39548f6f4514d712d0fa1e36efb0ce5
2023-10-17 01:31:53
Alex Zaslavsky
feat(backup): Support import decryption (#58128)
false
Support import decryption (#58128)
feat
diff --git a/src/sentry/backup/exports.py b/src/sentry/backup/exports.py index b9e16a812c0d64..ebfdc342a72452 100644 --- a/src/sentry/backup/exports.py +++ b/src/sentry/backup/exports.py @@ -1,14 +1,9 @@ from __future__ import annotations import io -import tarfile from typing import BinaryIO, Type import click -from cryptography.fernet import Fernet -from cryptography.hazmat.backends import default_backend -from cryptography.hazmat.primitives import hashes, serialization -from cryptography.hazmat.primitives.asymmetric import padding from django.db.models.base import Model from sentry.backup.dependencies import ( @@ -17,7 +12,7 @@ get_model_name, sorted_dependencies, ) -from sentry.backup.helpers import Filter +from sentry.backup.helpers import Filter, create_encrypted_export_tarball from sentry.backup.scopes import ExportScope from sentry.services.hybrid_cloud.import_export.model import ( RpcExportError, @@ -47,7 +42,7 @@ def __init__(self, context: RpcExportError) -> None: def _export( - dest, + dest: BinaryIO, scope: ExportScope, *, encrypt_with: BinaryIO | None = None, @@ -151,47 +146,11 @@ def get_exporter_for_model(model: Type[Model]): dest_wrapper.detach() return - # Generate a new DEK (data encryption key), and use that DEK to encrypt the JSON being exported. - pem = encrypt_with.read() - data_encryption_key = Fernet.generate_key() - backup_encryptor = Fernet(data_encryption_key) - encrypted_json_export = backup_encryptor.encrypt(json.dumps(json_export).encode("utf-8")) - - # Encrypt the newly minted DEK using symmetric public key encryption. - dek_encryption_key = serialization.load_pem_public_key(pem, default_backend()) - sha256 = hashes.SHA256() - mgf = padding.MGF1(algorithm=sha256) - oaep_padding = padding.OAEP(mgf=mgf, algorithm=sha256, label=None) - encrypted_dek = dek_encryption_key.encrypt(data_encryption_key, oaep_padding) # type: ignore - - # Generate a tarball with 3 files: - # - # 1. The DEK we minted, name "data.key". - # 2. The public key we used to encrypt that DEK, named "key.pub". - # 3. The exported JSON data, encrypted with that DEK, named "export.json". - # - # The upshot: to decrypt the exported JSON data, you need the plaintext (decrypted) DEK. But to - # decrypt the DEK, you need the private key associated with the included public key, which - # you've hopefully kept in a safe, trusted location. - # - # Note that the supplied file names are load-bearing - ex, changing to `data.key` to `foo.key` - # risks breaking assumptions that the decryption side will make on the other end! - tar_buffer = io.BytesIO() - with tarfile.open(fileobj=tar_buffer, mode="w") as tar: - json_info = tarfile.TarInfo("export.json") - json_info.size = len(encrypted_json_export) - tar.addfile(json_info, fileobj=io.BytesIO(encrypted_json_export)) - key_info = tarfile.TarInfo("data.key") - key_info.size = len(encrypted_dek) - tar.addfile(key_info, fileobj=io.BytesIO(encrypted_dek)) - pub_info = tarfile.TarInfo("key.pub") - pub_info.size = len(pem) - tar.addfile(pub_info, fileobj=io.BytesIO(pem)) - dest.write(tar_buffer.getvalue()) + dest.write(create_encrypted_export_tarball(json_export, encrypt_with).getvalue()) def export_in_user_scope( - dest, + dest: BinaryIO, *, encrypt_with: BinaryIO | None = None, user_filter: set[str] | None = None, @@ -217,7 +176,7 @@ def export_in_user_scope( def export_in_organization_scope( - dest, + dest: BinaryIO, *, encrypt_with: BinaryIO | None = None, org_filter: set[str] | None = None, @@ -244,7 +203,7 @@ def export_in_organization_scope( def export_in_config_scope( - dest, + dest: BinaryIO, *, encrypt_with: BinaryIO | None = None, indent: int = 2, @@ -269,7 +228,7 @@ def export_in_config_scope( def export_in_global_scope( - dest, + dest: BinaryIO, *, encrypt_with: BinaryIO | None = None, indent: int = 2, diff --git a/src/sentry/backup/helpers.py b/src/sentry/backup/helpers.py index ae3c6f81db4724..3ed8e2d095b47e 100644 --- a/src/sentry/backup/helpers.py +++ b/src/sentry/backup/helpers.py @@ -1,14 +1,21 @@ from __future__ import annotations +import io +import tarfile from datetime import datetime, timedelta, timezone from enum import Enum from functools import lru_cache -from typing import Generic, NamedTuple, Type, TypeVar +from typing import BinaryIO, Generic, NamedTuple, Type, TypeVar +from cryptography.fernet import Fernet +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes, serialization +from cryptography.hazmat.primitives.asymmetric import padding from django.core.serializers.json import DjangoJSONEncoder from django.db import models from sentry.backup.scopes import RelocationScope +from sentry.utils import json # Django apps we take care to never import or export from. EXCLUDED_APPS = frozenset(("auth", "contenttypes", "fixtures")) @@ -27,6 +34,110 @@ def default(self, obj): return super().default(obj) +def create_encrypted_export_tarball( + json_export: json.JSONData, encrypt_with: BinaryIO +) -> io.BytesIO: + """ + Generate a tarball with 3 files: + + 1. The DEK we minted, name "data.key". + 2. The public key we used to encrypt that DEK, named "key.pub". + 3. The exported JSON data, encrypted with that DEK, named "export.json". + + The upshot: to decrypt the exported JSON data, you need the plaintext (decrypted) DEK. But to + decrypt the DEK, you need the private key associated with the included public key, which + you've hopefully kept in a safe, trusted location. + + Note that the supplied file names are load-bearing - ex, changing to `data.key` to `foo.key` + risks breaking assumptions that the decryption side will make on the other end! + """ + + # Generate a new DEK (data encryption key), and use that DEK to encrypt the JSON being exported. + pem = encrypt_with.read() + data_encryption_key = Fernet.generate_key() + backup_encryptor = Fernet(data_encryption_key) + encrypted_json_export = backup_encryptor.encrypt(json.dumps(json_export).encode("utf-8")) + + # Encrypt the newly minted DEK using asymmetric public key encryption. + dek_encryption_key = serialization.load_pem_public_key(pem, default_backend()) + sha256 = hashes.SHA256() + mgf = padding.MGF1(algorithm=sha256) + oaep_padding = padding.OAEP(mgf=mgf, algorithm=sha256, label=None) + encrypted_dek = dek_encryption_key.encrypt(data_encryption_key, oaep_padding) # type: ignore + + # Generate the tarball and write it to to a new output stream. + tar_buffer = io.BytesIO() + with tarfile.open(fileobj=tar_buffer, mode="w") as tar: + json_info = tarfile.TarInfo("export.json") + json_info.size = len(encrypted_json_export) + tar.addfile(json_info, fileobj=io.BytesIO(encrypted_json_export)) + key_info = tarfile.TarInfo("data.key") + key_info.size = len(encrypted_dek) + tar.addfile(key_info, fileobj=io.BytesIO(encrypted_dek)) + pub_info = tarfile.TarInfo("key.pub") + pub_info.size = len(pem) + tar.addfile(pub_info, fileobj=io.BytesIO(pem)) + + return tar_buffer + + +def decrypt_encrypted_tarball(tarball: BinaryIO, decrypt_with: BinaryIO) -> str: + """ + A tarball encrypted by a call to `_export` with `encrypt_with` set has some specific properties (filenames, etc). This method handles all of those, and decrypts using the provided private key into an in-memory JSON string. + """ + + export = None + encrypted_dek = None + public_key_pem = None + private_key_pem = decrypt_with.read() + with tarfile.open(fileobj=tarball, mode="r") as tar: + for member in tar.getmembers(): + if member.isfile(): + file = tar.extractfile(member) + if file is None: + raise ValueError(f"Could not extract file for {member.name}") + + content = file.read() + if member.name == "export.json": + export = content.decode("utf-8") + elif member.name == "data.key": + encrypted_dek = content + elif member.name == "key.pub": + public_key_pem = content + else: + raise ValueError(f"Unknown tarball entity {member.name}") + + if export is None or encrypted_dek is None or public_key_pem is None: + raise ValueError("A required file was missing from the temporary test tarball") + + # Compare the public and private key, to ensure that they are a match. + private_key = serialization.load_pem_private_key( + private_key_pem, + password=None, + backend=default_backend(), + ) + generated_public_key_pem = private_key.public_key().public_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PublicFormat.SubjectPublicKeyInfo, + ) + if public_key_pem != generated_public_key_pem: + raise ValueError( + "The public key does not match that generated by the `decrypt_with` private key." + ) + + # Decrypt the DEK, then use it to decrypt the underlying JSON + decrypted_dek = private_key.decrypt( # type: ignore + encrypted_dek, + padding.OAEP( + mgf=padding.MGF1(algorithm=hashes.SHA256()), + algorithm=hashes.SHA256(), + label=None, + ), + ) + decryptor = Fernet(decrypted_dek) + return decryptor.decrypt(export).decode("utf-8") + + def get_final_derivations_of(model: Type) -> set[Type]: """A "final" derivation of the given `model` base class is any non-abstract class for the "sentry" app with `BaseModel` as an ancestor. Top-level calls to this class should pass in diff --git a/src/sentry/backup/imports.py b/src/sentry/backup/imports.py index 05267db8db7d01..2d9aef46dd1590 100644 --- a/src/sentry/backup/imports.py +++ b/src/sentry/backup/imports.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Iterator, Optional, Tuple, Type +from typing import BinaryIO, Iterator, Optional, Tuple, Type import click from django.conf import settings @@ -11,7 +11,7 @@ from rest_framework.serializers import ValidationError as DjangoRestFrameworkValidationError from sentry.backup.dependencies import NormalizedModelName, PrimaryKeyMap, get_model, get_model_name -from sentry.backup.helpers import EXCLUDED_APPS, Filter, ImportFlags +from sentry.backup.helpers import EXCLUDED_APPS, Filter, ImportFlags, decrypt_encrypted_tarball from sentry.backup.scopes import ImportScope from sentry.silo import unguarded_write from sentry.utils import json @@ -25,9 +25,10 @@ def _import( - src, + src: BinaryIO, scope: ImportScope, *, + decrypt_with: BinaryIO | None = None, flags: ImportFlags | None = None, filter_by: Filter | None = None, printer=click.echo, @@ -49,7 +50,14 @@ def _import( org_model_name = get_model_name(Organization) org_member_model_name = get_model_name(OrganizationMember) - start = src.tell() + # TODO(getsentry#team-ospo/190): Reading the entire export into memory as a string is quite + # wasteful - in the future, we should explore chunking strategies to enable a smaller memory + # footprint when processing super large (>100MB) exports. + content = ( + decrypt_encrypted_tarball(src, decrypt_with) + if decrypt_with is not None + else src.read().decode("utf-8") + ) filters = [] if filter_by is not None: filters.append(filter_by) @@ -73,7 +81,7 @@ def _import( # deserializer does no such thing, and actually loads the entire JSON into memory! If we # don't want to choke on large imports, we'll need use a truly "chunkable" JSON # importing library like ijson for this. - for obj in serializers.deserialize("json", src, stream=True): + for obj in serializers.deserialize("json", content): o = obj.object model_name = get_model_name(o) if model_name == user_model_name: @@ -98,7 +106,7 @@ def _import( break elif filter_by.model == User: seen_first_user_model = False - for obj in serializers.deserialize("json", src, stream=True): + for obj in serializers.deserialize("json", content): o = obj.object model_name = get_model_name(o) if model_name == user_model_name: @@ -121,13 +129,11 @@ def _import( filters.append(email_filter) - src.seek(start) - # The input JSON blob should already be ordered by model kind. We simply break up 1 JSON blob # with N model kinds into N json blobs with 1 model kind each. def yield_json_models(src) -> Iterator[Tuple[NormalizedModelName, str]]: # TODO(getsentry#team-ospo/190): Better error handling for unparsable JSON. - models = json.load(src) + models = json.loads(content) last_seen_model_name: Optional[NormalizedModelName] = None batch: list[Type[Model]] = [] for model in models: @@ -228,8 +234,9 @@ def do_write(): def import_in_user_scope( - src, + src: BinaryIO, *, + decrypt_with: BinaryIO | None = None, flags: ImportFlags | None = None, user_filter: set[str] | None = None, printer=click.echo, @@ -246,6 +253,7 @@ def import_in_user_scope( return _import( src, ImportScope.User, + decrypt_with=decrypt_with, flags=flags, filter_by=Filter(User, "username", user_filter) if user_filter is not None else None, printer=printer, @@ -253,8 +261,9 @@ def import_in_user_scope( def import_in_organization_scope( - src, + src: BinaryIO, *, + decrypt_with: BinaryIO | None = None, flags: ImportFlags | None = None, org_filter: set[str] | None = None, printer=click.echo, @@ -275,6 +284,7 @@ def import_in_organization_scope( return _import( src, ImportScope.Organization, + decrypt_with=decrypt_with, flags=flags, filter_by=Filter(Organization, "slug", org_filter) if org_filter is not None else None, printer=printer, @@ -282,8 +292,9 @@ def import_in_organization_scope( def import_in_config_scope( - src, + src: BinaryIO, *, + decrypt_with: BinaryIO | None = None, flags: ImportFlags | None = None, user_filter: set[str] | None = None, printer=click.echo, @@ -305,13 +316,20 @@ def import_in_config_scope( return _import( src, ImportScope.Config, + decrypt_with=decrypt_with, flags=flags, filter_by=Filter(User, "username", user_filter) if user_filter is not None else None, printer=printer, ) -def import_in_global_scope(src, *, flags: ImportFlags | None = None, printer=click.echo): +def import_in_global_scope( + src: BinaryIO, + *, + decrypt_with: BinaryIO | None = None, + flags: ImportFlags | None = None, + printer=click.echo, +): """ Perform an import in the `Global` scope, meaning that all models will be imported from the provided source file. Because a `Global` import is really only useful when restoring to a fresh @@ -319,4 +337,10 @@ def import_in_global_scope(src, *, flags: ImportFlags | None = None, printer=cli superuser privileges are not sanitized. This method can be thought of as a "pure" backup/restore, simply serializing and deserializing a (partial) snapshot of the database state. """ - return _import(src, ImportScope.Global, flags=flags, printer=printer) + return _import( + src, + ImportScope.Global, + decrypt_with=decrypt_with, + flags=flags, + printer=printer, + ) diff --git a/src/sentry/runner/commands/backup.py b/src/sentry/runner/commands/backup.py index 117e7ad7aa582a..eb914553683b7a 100644 --- a/src/sentry/runner/commands/backup.py +++ b/src/sentry/runner/commands/backup.py @@ -15,6 +15,12 @@ from sentry.runner.decorators import configuration from sentry.utils import json +DECRYPT_WITH_HELP = """A path to a file containing a private key with which to decrypt a tarball + previously encrypted using an `export ... --encrypt_with=<PUBLIC_KEY>` command. + The private key provided via this flag should be the complement of the public + key used to encrypt the tarball (this public key is included in the tarball + itself).""" + ENCRYPT_WITH_HELP = """A path to the a public key with which to encrypt this export. If this flag is enabled and points to a valid key, the output file will be a tarball containing 3 constituent files: 1. An encrypted JSON file called @@ -105,6 +111,11 @@ def import_(): @import_.command(name="users") @click.argument("src", type=click.File("rb")) [email protected]( + "--decrypt_with", + type=click.File("rb"), + help=DECRYPT_WITH_HELP, +) @click.option( "--filter_usernames", default="", @@ -120,13 +131,14 @@ def import_(): ) @click.option("--silent", "-q", default=False, is_flag=True, help="Silence all debug output.") @configuration -def import_users(src, filter_usernames, merge_users, silent): +def import_users(src, decrypt_with, filter_usernames, merge_users, silent): """ Import the Sentry users from an exported JSON file. """ import_in_user_scope( src, + decrypt_with=decrypt_with, flags=ImportFlags(merge_users=merge_users), user_filter=parse_filter_arg(filter_usernames), printer=(lambda *args, **kwargs: None) if silent else click.echo, @@ -135,6 +147,11 @@ def import_users(src, filter_usernames, merge_users, silent): @import_.command(name="organizations") @click.argument("src", type=click.File("rb")) [email protected]( + "--decrypt_with", + type=click.File("rb"), + help=DECRYPT_WITH_HELP, +) @click.option( "--filter_org_slugs", default="", @@ -151,13 +168,14 @@ def import_users(src, filter_usernames, merge_users, silent): ) @click.option("--silent", "-q", default=False, is_flag=True, help="Silence all debug output.") @configuration -def import_organizations(src, filter_org_slugs, merge_users, silent): +def import_organizations(src, decrypt_with, filter_org_slugs, merge_users, silent): """ Import the Sentry organizations, and all constituent Sentry users, from an exported JSON file. """ import_in_organization_scope( src, + decrypt_with=decrypt_with, flags=ImportFlags(merge_users=merge_users), org_filter=parse_filter_arg(filter_org_slugs), printer=(lambda *args, **kwargs: None) if silent else click.echo, @@ -166,6 +184,11 @@ def import_organizations(src, filter_org_slugs, merge_users, silent): @import_.command(name="config") @click.argument("src", type=click.File("rb")) [email protected]( + "--decrypt_with", + type=click.File("rb"), + help=DECRYPT_WITH_HELP, +) @click.option("--silent", "-q", default=False, is_flag=True, help="Silence all debug output.") @click.option( "--merge_users", @@ -180,13 +203,14 @@ def import_organizations(src, filter_org_slugs, merge_users, silent): help=OVERWRITE_CONFIGS_HELP, ) @configuration -def import_config(src, merge_users, overwrite_configs, silent): +def import_config(src, decrypt_with, merge_users, overwrite_configs, silent): """ Import all configuration and administrator accounts needed to set up this Sentry instance. """ import_in_config_scope( src, + decrypt_with=decrypt_with, flags=ImportFlags(merge_users=merge_users, overwrite_configs=overwrite_configs), printer=(lambda *args, **kwargs: None) if silent else click.echo, ) @@ -194,6 +218,11 @@ def import_config(src, merge_users, overwrite_configs, silent): @import_.command(name="global") @click.argument("src", type=click.File("rb")) [email protected]( + "--decrypt_with", + type=click.File("rb"), + help=DECRYPT_WITH_HELP, +) @click.option( "--overwrite_configs", default=False, @@ -202,13 +231,14 @@ def import_config(src, merge_users, overwrite_configs, silent): ) @click.option("--silent", "-q", default=False, is_flag=True, help="Silence all debug output.") @configuration -def import_global(src, silent, overwrite_configs): +def import_global(src, decrypt_with, silent, overwrite_configs): """ Import all Sentry data from an exported JSON file. """ import_in_global_scope( src, + decrypt_with=decrypt_with, flags=ImportFlags(overwrite_configs=overwrite_configs), printer=(lambda *args, **kwargs: None) if silent else click.echo, ) diff --git a/src/sentry/testutils/helpers/backups.py b/src/sentry/testutils/helpers/backups.py index 3e7d01fc42f849..7ccbe7736642ea 100644 --- a/src/sentry/testutils/helpers/backups.py +++ b/src/sentry/testutils/helpers/backups.py @@ -1,7 +1,6 @@ from __future__ import annotations import io -import tarfile import tempfile from copy import deepcopy from datetime import datetime, timedelta @@ -10,10 +9,9 @@ from typing import Tuple from uuid import uuid4 -from cryptography.fernet import Fernet from cryptography.hazmat.backends import default_backend -from cryptography.hazmat.primitives import hashes, serialization -from cryptography.hazmat.primitives.asymmetric import padding, rsa +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.primitives.asymmetric import rsa from django.apps import apps from django.conf import settings from django.core.management import call_command @@ -30,6 +28,7 @@ export_in_user_scope, ) from sentry.backup.findings import ComparatorFindings +from sentry.backup.helpers import decrypt_encrypted_tarball from sentry.backup.imports import import_in_global_scope from sentry.backup.scopes import ExportScope from sentry.backup.validate import validate @@ -183,45 +182,8 @@ def export_to_encrypted_tarball( # Read the files in the generated tarball. This bit of code assume the file names, but that is # part of the encrypt/decrypt tar-ing API, so we need to ensure that these exact names are # present and contain the data we expect. - export = None - encrypted_dek = None - pub_key = None - with tarfile.open(tar_file_path, "r") as tar: - for member in tar.getmembers(): - if member.isfile(): - file = tar.extractfile(member) - if file is None: - raise AssertionError(f"Could not extract file for {member.name}") - - content = file.read() - if member.name == "export.json": - export = content.decode("utf-8") - elif member.name == "data.key": - encrypted_dek = content - elif member.name == "key.pub": - pub_key = content - else: - raise AssertionError(f"Unknown tarball entity {member.name}") - - if export is None or encrypted_dek is None or pub_key is None: - raise AssertionError("A required file was missing from the temporary test tarball") - - # Decrypt the DEK, then use it to decrypt the underlying JSON. - private_key = serialization.load_pem_private_key( - private_key_pem, - password=None, # Use the password here if the PEM was encrypted - backend=default_backend(), - ) - decrypted_dek = private_key.decrypt( # type: ignore - encrypted_dek, - padding.OAEP( - mgf=padding.MGF1(algorithm=hashes.SHA256()), - algorithm=hashes.SHA256(), - label=None, - ), - ) - decryptor = Fernet(decrypted_dek) - return json.loads(decryptor.decrypt(export)) + with open(tar_file_path, "rb") as f: + return json.loads(decrypt_encrypted_tarball(f, io.BytesIO(private_key_pem))) # No arguments, so we lazily cache the result after the first calculation. @@ -278,7 +240,7 @@ def import_export_then_validate(method_name: str, *, reset_pks: bool = True) -> clear_database(reset_pks=reset_pks) # Write the contents of the "expected" JSON file into the now clean database. - with open(tmp_expect) as tmp_file: + with open(tmp_expect, "rb") as tmp_file: import_in_global_scope(tmp_file, printer=NOOP_PRINTER) # Validate that the "expected" and "actual" JSON matches. @@ -320,7 +282,7 @@ def import_export_from_fixture_then_validate( fixture_file_path = get_fixture_path("backup", fixture_file_name) with open(fixture_file_path) as backup_file: expect = json.load(backup_file) - with open(fixture_file_path) as fixture_file: + with open(fixture_file_path, "rb") as fixture_file: import_in_global_scope(fixture_file, printer=NOOP_PRINTER) res = validate( diff --git a/tests/sentry/backup/test_exhaustive.py b/tests/sentry/backup/test_exhaustive.py index 213cb0b3fc9564..2340b6693f3032 100644 --- a/tests/sentry/backup/test_exhaustive.py +++ b/tests/sentry/backup/test_exhaustive.py @@ -58,9 +58,9 @@ def test_uniqueness_clean_pks(self): # Now import twice, so that all random values in the export (UUIDs etc) are identical, # to test that these are properly replaced and handled. - with open(tmp_expect) as tmp_file: + with open(tmp_expect, "rb") as tmp_file: import_in_global_scope(tmp_file, printer=NOOP_PRINTER) - with open(tmp_expect) as tmp_file: + with open(tmp_expect, "rb") as tmp_file: # Back-to-back global scope imports are disallowed (global scope assume a clean # database), so use organization scope instead. # @@ -82,9 +82,9 @@ def test_uniqueness_dirty_pks(self): # Now import twice, so that all random values in the export (UUIDs etc) are identical, # to test that these are properly replaced and handled. - with open(tmp_expect) as tmp_file: + with open(tmp_expect, "rb") as tmp_file: import_in_global_scope(tmp_file, printer=NOOP_PRINTER) - with open(tmp_expect) as tmp_file: + with open(tmp_expect, "rb") as tmp_file: # Back-to-back global scope imports are disallowed (global scope assume a clean # database), so use organization scope followed by config scope instead. import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) diff --git a/tests/sentry/backup/test_imports.py b/tests/sentry/backup/test_imports.py index 270bfabfcce058..fdee7577855f59 100644 --- a/tests/sentry/backup/test_imports.py +++ b/tests/sentry/backup/test_imports.py @@ -1,15 +1,22 @@ from __future__ import annotations +import io +import tarfile import tempfile from copy import deepcopy from datetime import date, datetime from functools import cached_property from os import environ from pathlib import Path +from typing import Tuple from unittest.mock import patch import pytest import urllib3.exceptions +from cryptography.fernet import Fernet +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives import hashes, serialization +from cryptography.hazmat.primitives.asymmetric import padding from django.utils import timezone from rest_framework.serializers import ValidationError @@ -48,6 +55,7 @@ BackupTestCase, clear_database, export_to_file, + generate_rsa_key_pair, ) from sentry.testutils.hybrid_cloud import use_split_dbs from sentry.utils import json @@ -119,7 +127,7 @@ def test_user_sanitized_in_user_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = Path(tmp_dir).joinpath(f"{self._testMethodName}.json") self.generate_tmp_json_file(tmp_path) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope(tmp_file, printer=NOOP_PRINTER) assert User.objects.count() == 4 @@ -152,7 +160,7 @@ def test_user_sanitized_in_organization_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = Path(tmp_dir).joinpath(f"{self._testMethodName}.json") self.generate_tmp_json_file(tmp_path) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) assert User.objects.count() == 4 @@ -185,7 +193,7 @@ def test_users_unsanitized_in_config_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = Path(tmp_dir).joinpath(f"{self._testMethodName}.json") self.generate_tmp_json_file(tmp_path) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_config_scope(tmp_file, printer=NOOP_PRINTER) assert User.objects.count() == 4 @@ -225,7 +233,7 @@ def test_users_unsanitized_in_global_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = Path(tmp_dir).joinpath(f"{self._testMethodName}.json") self.generate_tmp_json_file(tmp_path) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_global_scope(tmp_file, printer=NOOP_PRINTER) assert User.objects.count() == 4 @@ -271,7 +279,7 @@ def test_generate_suffix_for_already_taken_organization(self): # Note that we have created an organization with the same name as one we are about to # import. self.create_organization(owner=self.user, name="some-org") - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) assert Organization.objects.count() == 2 @@ -295,7 +303,7 @@ def test_generate_suffix_for_already_taken_username(self): ) json.dump(same_username_user + copy_of_same_username_user, tmp_file) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope(tmp_file, printer=NOOP_PRINTER) assert User.objects.count() == 3 @@ -315,7 +323,7 @@ def test_bad_invalid_user(self): model["fields"]["username"] = "x" * 129 json.dump(models, tmp_file) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: with pytest.raises(ValidationError): import_in_user_scope(tmp_file, printer=NOOP_PRINTER) @@ -338,7 +346,7 @@ def test_good_regional_user_ip_in_user_scope(self, mock_geo_by_addr): model["fields"]["ip_address"] = "8.8.8.8" json.dump(models, tmp_file) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope(tmp_file, printer=NOOP_PRINTER) assert UserIP.objects.count() == 1 @@ -369,7 +377,7 @@ def test_good_regional_user_ip_in_global_scope(self, mock_geo_by_addr): model["fields"]["ip_address"] = "8.8.8.8" json.dump(models, tmp_file) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_global_scope(tmp_file, printer=NOOP_PRINTER) assert UserIP.objects.count() == 1 @@ -393,7 +401,7 @@ def test_bad_invalid_user_ip(self): m["fields"]["ip_address"] = "0.1.2.3.4.5.6.7.8.9.abc.def" json.dump(list(models), tmp_file) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: with pytest.raises(ValidationError): import_in_user_scope(tmp_file, printer=NOOP_PRINTER) @@ -409,7 +417,7 @@ def test_bad_invalid_user_option(self): m["fields"]["value"] = '"MiddleEarth/Gondor"' json.dump(list(models), tmp_file) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: with pytest.raises(ValidationError): import_in_user_scope(tmp_file, printer=NOOP_PRINTER) @@ -430,7 +438,7 @@ def test_import_signaling_user(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope(tmp_file, printer=NOOP_PRINTER) assert User.objects.count() == 1 @@ -450,7 +458,7 @@ def test_import_signaling_organization(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) assert Organization.objects.count() == 1 @@ -502,7 +510,7 @@ def test_user_import_scoping(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope(tmp_file, printer=NOOP_PRINTER) self.verify_model_inclusion(ImportScope.User) @@ -511,7 +519,7 @@ def test_organization_import_scoping(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) self.verify_model_inclusion(ImportScope.Organization) @@ -520,7 +528,7 @@ def test_config_import_scoping(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_config_scope(tmp_file, printer=NOOP_PRINTER) self.verify_model_inclusion(ImportScope.Config) @@ -529,11 +537,123 @@ def test_global_import_scoping(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_global_scope(tmp_file, printer=NOOP_PRINTER) self.verify_model_inclusion(ImportScope.Global) +class DecryptionTests(ImportTestCase): + """ + Ensures that decryption actually works. We only test one model for each scope, because it's + extremely unlikely that a failed decryption will leave only part of the data unmangled. + """ + + @staticmethod + def encrypt_json_fixture(tmp_dir) -> Tuple[Path, Path]: + good_file_path = get_fixture_path("backup", "fresh-install.json") + (priv_key_pem, pub_key_pem) = generate_rsa_key_pair() + + tmp_priv_key_path = Path(tmp_dir).joinpath("key") + with open(tmp_priv_key_path, "wb") as f: + f.write(priv_key_pem) + + tmp_pub_key_path = Path(tmp_dir).joinpath("key.pub") + with open(tmp_pub_key_path, "wb") as f: + f.write(pub_key_pem) + + with open(good_file_path) as f: + json_data = json.load(f) + + tmp_tarball_path = Path(tmp_dir).joinpath("input.tar") + with open(tmp_tarball_path, "wb") as i, open(tmp_pub_key_path, "rb") as p: + pem = p.read() + data_encryption_key = Fernet.generate_key() + backup_encryptor = Fernet(data_encryption_key) + encrypted_json_export = backup_encryptor.encrypt(json.dumps(json_data).encode("utf-8")) + + dek_encryption_key = serialization.load_pem_public_key(pem, default_backend()) + sha256 = hashes.SHA256() + mgf = padding.MGF1(algorithm=sha256) + oaep_padding = padding.OAEP(mgf=mgf, algorithm=sha256, label=None) + encrypted_dek = dek_encryption_key.encrypt(data_encryption_key, oaep_padding) # type: ignore + + tar_buffer = io.BytesIO() + with tarfile.open(fileobj=tar_buffer, mode="w") as tar: + json_info = tarfile.TarInfo("export.json") + json_info.size = len(encrypted_json_export) + tar.addfile(json_info, fileobj=io.BytesIO(encrypted_json_export)) + key_info = tarfile.TarInfo("data.key") + key_info.size = len(encrypted_dek) + tar.addfile(key_info, fileobj=io.BytesIO(encrypted_dek)) + pub_info = tarfile.TarInfo("key.pub") + pub_info.size = len(pem) + tar.addfile(pub_info, fileobj=io.BytesIO(pem)) + + i.write(tar_buffer.getvalue()) + + return (tmp_tarball_path, tmp_priv_key_path) + + def test_user_import_decryption(self): + with tempfile.TemporaryDirectory() as tmp_dir: + (tmp_tarball_path, tmp_priv_key_path) = self.encrypt_json_fixture(tmp_dir) + assert User.objects.count() == 0 + + with open(tmp_tarball_path, "rb") as tmp_tarball_file, open( + tmp_priv_key_path, "rb" + ) as tmp_priv_key_file: + import_in_user_scope( + tmp_tarball_file, decrypt_with=tmp_priv_key_file, printer=NOOP_PRINTER + ) + + assert User.objects.count() > 0 + + def test_organization_import_decryption(self): + with tempfile.TemporaryDirectory() as tmp_dir: + (tmp_tarball_path, tmp_priv_key_path) = self.encrypt_json_fixture(tmp_dir) + assert Organization.objects.count() == 0 + + with open(tmp_tarball_path, "rb") as tmp_tarball_file, open( + tmp_priv_key_path, "rb" + ) as tmp_priv_key_file: + import_in_organization_scope( + tmp_tarball_file, decrypt_with=tmp_priv_key_file, printer=NOOP_PRINTER + ) + + assert Organization.objects.count() > 0 + + def test_config_import_decryption(self): + with tempfile.TemporaryDirectory() as tmp_dir: + (tmp_tarball_path, tmp_priv_key_path) = self.encrypt_json_fixture(tmp_dir) + assert UserRole.objects.count() == 0 + + with open(tmp_tarball_path, "rb") as tmp_tarball_file, open( + tmp_priv_key_path, "rb" + ) as tmp_priv_key_file: + import_in_config_scope( + tmp_tarball_file, decrypt_with=tmp_priv_key_file, printer=NOOP_PRINTER + ) + + assert UserRole.objects.count() > 0 + + def test_global_import_decryption(self): + with tempfile.TemporaryDirectory() as tmp_dir: + (tmp_tarball_path, tmp_priv_key_path) = self.encrypt_json_fixture(tmp_dir) + assert Organization.objects.count() == 0 + assert User.objects.count() == 0 + assert UserRole.objects.count() == 0 + + with open(tmp_tarball_path, "rb") as tmp_tarball_file, open( + tmp_priv_key_path, "rb" + ) as tmp_priv_key_file: + import_in_global_scope( + tmp_tarball_file, decrypt_with=tmp_priv_key_file, printer=NOOP_PRINTER + ) + + assert Organization.objects.count() > 0 + assert User.objects.count() > 0 + assert UserRole.objects.count() > 0 + + class FilterTests(ImportTestCase): """ Ensures that filtering operations include the correct models. @@ -545,7 +665,7 @@ def test_import_filter_users(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope(tmp_file, user_filter={"user_2"}, printer=NOOP_PRINTER) # Count users, but also count a random model naively derived from just `User` alone, like @@ -568,7 +688,7 @@ def test_export_filter_users_shared_email(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope( tmp_file, user_filter={"user_1", "user_2", "user_3"}, printer=NOOP_PRINTER ) @@ -589,7 +709,7 @@ def test_import_filter_users_empty(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_user_scope(tmp_file, user_filter=set(), printer=NOOP_PRINTER) assert User.objects.count() == 0 @@ -610,7 +730,7 @@ def test_import_filter_orgs_single(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, org_filter={"org-b"}, printer=NOOP_PRINTER) assert Organization.objects.count() == 1 @@ -645,7 +765,7 @@ def test_import_filter_orgs_multiple(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope( tmp_file, org_filter={"org-a", "org-c"}, printer=NOOP_PRINTER ) @@ -682,7 +802,7 @@ def test_import_filter_orgs_empty(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, org_filter=set(), printer=NOOP_PRINTER) assert Organization.objects.count() == 0 @@ -766,7 +886,7 @@ def test_colliding_api_token(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_global_scope(tmp_file, printer=NOOP_PRINTER) # Ensure that old tokens have not been mutated. @@ -786,7 +906,7 @@ def test_colliding_api_token(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, Monitor)) @@ -811,13 +931,13 @@ def test_colliding_monitor(self): assert Monitor.objects.count() == 1 assert Monitor.objects.filter(guid=colliding.guid).count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) assert Monitor.objects.count() == 2 assert Monitor.objects.filter(guid=colliding.guid).count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, OrgAuthToken)) @@ -850,7 +970,7 @@ def test_colliding_org_auth_token(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) assert OrgAuthToken.objects.count() == 2 @@ -862,7 +982,7 @@ def test_colliding_org_auth_token(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, ProjectKey)) @@ -888,14 +1008,14 @@ def test_colliding_project_key(self): assert ProjectKey.objects.filter(public_key=colliding.public_key).count() == 1 assert ProjectKey.objects.filter(secret_key=colliding.secret_key).count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) assert ProjectKey.objects.count() == 4 assert ProjectKey.objects.filter(public_key=colliding.public_key).count() == 1 assert ProjectKey.objects.filter(secret_key=colliding.secret_key).count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @pytest.mark.xfail( @@ -940,7 +1060,7 @@ def test_colliding_query_subscription(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_organization_scope(tmp_file, printer=NOOP_PRINTER) assert SnubaQuery.objects.count() > 1 @@ -952,7 +1072,7 @@ def test_colliding_query_subscription(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, ControlOption, Option, Relay, RelayUsage, UserRole)) @@ -995,7 +1115,7 @@ def test_colliding_configs_overwrite_configs_enabled_in_config_scope(self): assert RelayUsage.objects.count() == 1 assert UserRole.objects.count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_config_scope( tmp_file, flags=ImportFlags(overwrite_configs=True), printer=NOOP_PRINTER ) @@ -1017,7 +1137,7 @@ def test_colliding_configs_overwrite_configs_enabled_in_config_scope(self): for i, actual_permission in enumerate(actual_user_role.permissions): assert actual_permission == old_user_role_permissions[i] - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, ControlOption, Option, Relay, RelayUsage, UserRole)) @@ -1056,7 +1176,7 @@ def test_colliding_configs_overwrite_configs_disabled_in_config_scope(self): assert RelayUsage.objects.count() == 1 assert UserRole.objects.count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_config_scope( tmp_file, flags=ImportFlags(overwrite_configs=False), printer=NOOP_PRINTER ) @@ -1078,7 +1198,7 @@ def test_colliding_configs_overwrite_configs_disabled_in_config_scope(self): assert len(actual_user_role.permissions) == 1 assert actual_user_role.permissions[0] == "other.admin" - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, ControlOption, Option, Relay, RelayUsage, UserRole)) @@ -1121,7 +1241,7 @@ def test_colliding_configs_overwrite_configs_enabled_in_global_scope(self): assert RelayUsage.objects.count() == 1 assert UserRole.objects.count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_global_scope( tmp_file, flags=ImportFlags(overwrite_configs=True), printer=NOOP_PRINTER ) @@ -1143,7 +1263,7 @@ def test_colliding_configs_overwrite_configs_enabled_in_global_scope(self): for i, actual_permission in enumerate(actual_user_role.permissions): assert actual_permission == old_user_role_permissions[i] - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, ControlOption, Option, Relay, RelayUsage, UserRole)) @@ -1182,7 +1302,7 @@ def test_colliding_configs_overwrite_configs_disabled_in_global_scope(self): assert RelayUsage.objects.count() == 1 assert UserRole.objects.count() == 1 - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: import_in_global_scope( tmp_file, flags=ImportFlags(overwrite_configs=False), printer=NOOP_PRINTER ) @@ -1204,7 +1324,7 @@ def test_colliding_configs_overwrite_configs_disabled_in_global_scope(self): assert len(actual_user_role.permissions) == 1 assert actual_user_role.permissions[0] == "other.admin" - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, Email, User, UserEmail, UserIP)) @@ -1213,7 +1333,7 @@ def test_colliding_user_with_merging_enabled_in_user_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: self.create_exhaustive_user(username="owner", email="[email protected]") import_in_user_scope( tmp_file, @@ -1236,7 +1356,7 @@ def test_colliding_user_with_merging_enabled_in_user_scope(self): assert UserEmail.objects.filter(email__icontains="existing@").exists() assert not UserEmail.objects.filter(email__icontains="importing@").exists() - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, Email, User, UserEmail, UserIP)) @@ -1245,7 +1365,7 @@ def test_colliding_user_with_merging_disabled_in_user_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: self.create_exhaustive_user(username="owner", email="[email protected]") import_in_user_scope( tmp_file, @@ -1268,7 +1388,7 @@ def test_colliding_user_with_merging_disabled_in_user_scope(self): assert UserEmail.objects.filter(email__icontains="existing@").exists() assert UserEmail.objects.filter(email__icontains="importing@").exists() - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets( @@ -1280,7 +1400,7 @@ def test_colliding_user_with_merging_enabled_in_organization_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: owner = self.create_exhaustive_user(username="owner", email="[email protected]") self.create_organization("some-org", owner=owner) import_in_organization_scope( @@ -1333,7 +1453,7 @@ def test_colliding_user_with_merging_enabled_in_organization_scope(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets( @@ -1345,7 +1465,7 @@ def test_colliding_user_with_merging_disabled_in_organization_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: owner = self.create_exhaustive_user(username="owner", email="[email protected]") self.create_organization("some-org", owner=owner) import_in_organization_scope( @@ -1403,7 +1523,7 @@ def test_colliding_user_with_merging_disabled_in_organization_scope(self): == 1 ) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, Email, User, UserEmail, UserIP, UserPermission)) @@ -1412,7 +1532,7 @@ def test_colliding_user_with_merging_enabled_in_config_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: self.create_exhaustive_user( username="owner", email="[email protected]", is_admin=True ) @@ -1438,7 +1558,7 @@ def test_colliding_user_with_merging_enabled_in_config_scope(self): assert UserEmail.objects.filter(email__icontains="existing@").exists() assert not UserEmail.objects.filter(email__icontains="importing@").exists() - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) @targets(mark(COLLISION_TESTED, Email, User, UserEmail, UserIP, UserPermission)) @@ -1447,7 +1567,7 @@ def test_colliding_user_with_merging_disabled_in_config_scope(self): with tempfile.TemporaryDirectory() as tmp_dir: tmp_path = self.export_to_tmp_file_and_clear_database(tmp_dir) - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: self.create_exhaustive_user( username="owner", email="[email protected]", is_admin=True ) @@ -1473,7 +1593,7 @@ def test_colliding_user_with_merging_disabled_in_config_scope(self): assert UserEmail.objects.filter(email__icontains="existing@").exists() assert UserEmail.objects.filter(email__icontains="importing@").exists() - with open(tmp_path) as tmp_file: + with open(tmp_path, "rb") as tmp_file: return json.load(tmp_file) diff --git a/tests/sentry/runner/commands/test_backup.py b/tests/sentry/runner/commands/test_backup.py index b96c796d776400..b0fe9128b38839 100644 --- a/tests/sentry/runner/commands/test_backup.py +++ b/tests/sentry/runner/commands/test_backup.py @@ -6,6 +6,7 @@ from click.testing import CliRunner from django.db import IntegrityError +from sentry.backup.helpers import create_encrypted_export_tarball from sentry.runner.commands.backup import compare, export, import_ from sentry.silo.base import SiloMode from sentry.testutils.cases import TestCase, TransactionTestCase @@ -115,36 +116,53 @@ def test_user_scope_export_filter_usernames(self): cli_import_then_export("users", export_args=["--filter_usernames", "[email protected]"]) +def cli_encrypted_import_then_export(scope: str): + with tempfile.TemporaryDirectory() as tmp_dir: + (priv_key_pem, pub_key_pem) = generate_rsa_key_pair() + + tmp_priv_key_path = Path(tmp_dir).joinpath("key") + with open(tmp_priv_key_path, "wb") as f: + f.write(priv_key_pem) + + tmp_pub_key_path = Path(tmp_dir).joinpath("key.pub") + with open(tmp_pub_key_path, "wb") as f: + f.write(pub_key_pem) + + with open(GOOD_FILE_PATH) as f: + data = json.load(f) + + tmp_input_path = Path(tmp_dir).joinpath("input.tar") + with open(tmp_input_path, "wb") as i, open(tmp_pub_key_path, "rb") as p: + i.write(create_encrypted_export_tarball(data, p).getvalue()) + + rv = CliRunner().invoke( + import_, [scope, str(tmp_input_path), "--decrypt_with", str(tmp_priv_key_path)] + ) + assert rv.exit_code == 0, rv.output + + tmp_output_path = Path(tmp_dir).joinpath("output.tar") + rv = CliRunner().invoke( + export, [scope, str(tmp_output_path), "--encrypt_with", str(tmp_pub_key_path)] + ) + assert rv.exit_code == 0, rv.output + + class GoodImportExportCommandEncryptionTests(TransactionTestCase): """ Ensure that encryption using an `--encrypt_with` file works as expected. """ - def encryption_export_args(self, tmp_dir) -> list[str]: - tmp_pub_key_path = Path(tmp_dir).joinpath("key.pub") - (_, public_key_pem) = generate_rsa_key_pair() - public_key_str = public_key_pem.decode("utf-8") - with open(tmp_pub_key_path, "w") as f: - f.write(public_key_str) - return ["--encrypt_with", str(tmp_pub_key_path)] - def test_global_scope_encryption(self): - with tempfile.TemporaryDirectory() as tmp_dir: - cli_import_then_export("global", export_args=self.encryption_export_args(tmp_dir)) + cli_encrypted_import_then_export("global") def test_config_scope_encryption(self): - with tempfile.TemporaryDirectory() as tmp_dir: - cli_import_then_export("config", export_args=self.encryption_export_args(tmp_dir)) + cli_encrypted_import_then_export("config") def test_organization_scope_encryption(self): - with tempfile.TemporaryDirectory() as tmp_dir: - cli_import_then_export( - "organizations", export_args=self.encryption_export_args(tmp_dir) - ) + cli_encrypted_import_then_export("organizations") def test_user_scope_encryption(self): - with tempfile.TemporaryDirectory() as tmp_dir: - cli_import_then_export("users", export_args=self.encryption_export_args(tmp_dir)) + cli_encrypted_import_then_export("users") class BadImportExportDomainErrorTests(TransactionTestCase):
500b7a15af4d40ded6a53979c3d980e36deb72f5
2024-07-30 22:18:08
anthony sottile
ref: match type in TypeDict (#75242)
false
match type in TypeDict (#75242)
ref
diff --git a/src/sentry/incidents/endpoints/serializers/alert_rule.py b/src/sentry/incidents/endpoints/serializers/alert_rule.py index 4c6745f70d83dc..da38300c53a618 100644 --- a/src/sentry/incidents/endpoints/serializers/alert_rule.py +++ b/src/sentry/incidents/endpoints/serializers/alert_rule.py @@ -85,7 +85,7 @@ class AlertRuleSerializerResponse(AlertRuleSerializerResponseOptional): status: int query: str aggregate: str - timeWindow: int + timeWindow: float resolution: float thresholdPeriod: int triggers: list[dict]
0b9e791ec8b6f9a62733dfde70ef0b0d76915f25
2023-03-10 06:11:10
Evan Purkhiser
ref(py): Move sentry-app authorizations endpoint to SENTRY_APP_INSTALLATION_URLS (#45612)
false
Move sentry-app authorizations endpoint to SENTRY_APP_INSTALLATION_URLS (#45612)
ref
diff --git a/src/sentry/api/urls.py b/src/sentry/api/urls.py index 2daea9f4d8f927..ad4b398ad7557f 100644 --- a/src/sentry/api/urls.py +++ b/src/sentry/api/urls.py @@ -2341,6 +2341,11 @@ SentryAppInstallationDetailsEndpoint.as_view(), name="sentry-api-0-sentry-app-installation-details", ), + url( + r"^(?P<uuid>[^\/]+)/authorizations/$", + SentryAppAuthorizationsEndpoint.as_view(), + name="sentry-api-0-sentry-app-installation-authorizations", + ), url( r"^(?P<uuid>[^\/]+)/external-requests/$", SentryAppInstallationExternalRequestsEndpoint.as_view(), @@ -2596,11 +2601,6 @@ SentryAppsStatsEndpoint.as_view(), name="sentry-api-0-sentry-apps-stats", ), - url( - r"^sentry-app-installations/(?P<uuid>[^\/]+)/authorizations/$", - SentryAppAuthorizationsEndpoint.as_view(), - name="sentry-api-0-sentry-app-authorizations", - ), url( r"^organizations/(?P<organization_slug>[^\/]+)/sentry-app-components/$", OrganizationSentryAppComponentsEndpoint.as_view(), diff --git a/src/sentry/utils/sdk.py b/src/sentry/utils/sdk.py index fe68bbdb92d92a..3d03f04db5f729 100644 --- a/src/sentry/utils/sdk.py +++ b/src/sentry/utils/sdk.py @@ -42,7 +42,7 @@ "sentry-api-0-organization-external-user-details": settings.SAMPLED_DEFAULT_RATE, # integration platform "external-issues": settings.SAMPLED_DEFAULT_RATE, - "sentry-api-0-sentry-app-authorizations": settings.SAMPLED_DEFAULT_RATE, + "sentry-api-0-sentry-app-installation-authorizations": settings.SAMPLED_DEFAULT_RATE, # integrations "sentry-extensions-jira-issue-hook": 0.05, "sentry-extensions-vercel-webhook": settings.SAMPLED_DEFAULT_RATE, diff --git a/tests/sentry/api/endpoints/test_sentry_app_authorizations.py b/tests/sentry/api/endpoints/test_sentry_app_authorizations.py index 056e648a843067..d2256459c149ae 100644 --- a/tests/sentry/api/endpoints/test_sentry_app_authorizations.py +++ b/tests/sentry/api/endpoints/test_sentry_app_authorizations.py @@ -9,7 +9,7 @@ class TestSentryAppAuthorizations(APITestCase): - endpoint = "sentry-api-0-sentry-app-authorizations" + endpoint = "sentry-api-0-sentry-app-installation-authorizations" method = "post" def setUp(self):
9612b09ee47d4363df1d4d80600795f8d1da1d86
2022-07-01 16:39:48
Priscila Oliveira
ref(codeowners): Add server-side-sampling to file (#36299)
false
Add server-side-sampling to file (#36299)
ref
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7a98f1dc2051b0..7b016b522671b2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -367,6 +367,8 @@ yarn.lock @getsentry/owners-js-deps /static/app/views/settings/project/sampling/ @getsentry/telemetry-experience /tests/js/spec/views/settings/project/sampling/ @getsentry/telemetry-experience +/static/app/views/settings/project/server-side-sampling/ @getsentry/telemetry-experience +/tests/js/spec/views/settings/project/server-side-sampling/ @getsentry/telemetry-experience /static/app/utils/metrics/ @getsentry/telemetry-experience /tests/js/spec/utils/metrics/ @getsentry/telemetry-experience /static/app/actionCreators/metrics.tsx @getsentry/telemetry-experience
b503521a4c8a2eeb47f44d4c62b1cc2931ea9008
2024-04-01 23:55:43
anthony sottile
ref: remove some deprecated functions from Interface (#68006)
false
remove some deprecated functions from Interface (#68006)
ref
diff --git a/src/sentry/interfaces/base.py b/src/sentry/interfaces/base.py index 7c9c5f8c074ddd..70b404d77c7962 100644 --- a/src/sentry/interfaces/base.py +++ b/src/sentry/interfaces/base.py @@ -164,24 +164,3 @@ def to_email_html(self, event, **kwargs): if not body: return "" return f"<pre>{escape(body)}</pre>" - - # deprecated stuff. These were deprecated in late 2018, once - # determined they are unused we can kill them. - - def get_path(self): - from warnings import warn - - warn(DeprecationWarning("Replaced with .path")) - return self.path - - def get_alias(self): - from warnings import warn - - warn(DeprecationWarning("Replaced with .path")) - return self.path - - def get_slug(self): - from warnings import warn - - warn(DeprecationWarning("Replaced with .path")) - return self.path
14a6b2c8a27e64b613c81e81b12b1ffa6bd0fbce
2023-03-06 14:39:54
Riccardo Busetti
feat(sourcemaps): Add logic to insert data into new debug ids table (#44885)
false
Add logic to insert data into new debug ids table (#44885)
feat
diff --git a/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.js b/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.js new file mode 100644 index 00000000000000..18ff1bece90284 --- /dev/null +++ b/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.js @@ -0,0 +1,4 @@ +/* eslint-disable */ +function helloWorld() { + alert('HelloWorld'); +} \ No newline at end of file diff --git a/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.min.js b/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.min.js new file mode 100644 index 00000000000000..24d2a4b1a0593d --- /dev/null +++ b/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.min.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +function helloWorld(){alert("HelloWorld")} \ No newline at end of file diff --git a/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.min.js.map b/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.min.js.map new file mode 100644 index 00000000000000..3f178bf92b9a4b --- /dev/null +++ b/fixtures/artifact_bundle_debug_ids/files/_/_/bundle1.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle1.js.map","sources":["bundle1.js"],"names":["helloWorld","alert"],"mappings":"AACA,SAASA,aACLC,MAAM,YAAY,CACtB"} \ No newline at end of file diff --git a/fixtures/artifact_bundle_debug_ids/files/_/_/index.js b/fixtures/artifact_bundle_debug_ids/files/_/_/index.js new file mode 100644 index 00000000000000..25e6aa3167959f --- /dev/null +++ b/fixtures/artifact_bundle_debug_ids/files/_/_/index.js @@ -0,0 +1,127 @@ +/* global exports */ +Object.defineProperty(exports, '__esModule', {value: true}); +const tslib_1 = require('tslib'); +const hub_1 = require('@sentry/core'); +/** + * This calls a function on the current hub. + * @param method function to call on hub. + * @param args to pass to function. + */ +function callOnHub(method) { + const args = []; + for (let _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + const hub = hub_1.getCurrentHub(); + if (hub && hub[method]) { + // tslint:disable-next-line:no-unsafe-any + return hub[method].apply(hub, tslib_1.__spread(args)); + } + throw new Error( + 'No hub defined or ' + method + ' was not found on the hub, please open a bug report.' + ); +} +/** + * Captures an exception event and sends it to Sentry. + * + * @param exception An exception-like object. + * @returns The generated eventId. + */ +function captureException(exception) { + let syntheticException; + try { + throw new Error('Sentry syntheticException'); + } catch (error) { + syntheticException = error; + } + return callOnHub('captureException', exception, { + originalException: exception, + syntheticException, + }); +} +exports.captureException = captureException; +/** + * Captures a message event and sends it to Sentry. + * + * @param message The message to send to Sentry. + * @param level Define the level of the message. + * @returns The generated eventId. + */ +function captureMessage(message, level) { + let syntheticException; + try { + throw new Error(message); + } catch (exception) { + syntheticException = exception; + } + return callOnHub('captureMessage', message, level, { + originalException: message, + syntheticException, + }); +} +exports.captureMessage = captureMessage; +/** + * Captures a manually created event and sends it to Sentry. + * + * @param event The event to send to Sentry. + * @returns The generated eventId. + */ +function captureEvent(event) { + return callOnHub('captureEvent', event); +} +exports.captureEvent = captureEvent; +/** + * Records a new breadcrumb which will be attached to future events. + * + * Breadcrumbs will be added to subsequent events to provide more context on + * user's actions prior to an error or crash. + * + * @param breadcrumb The breadcrumb to record. + */ +function addBreadcrumb(breadcrumb) { + callOnHub('addBreadcrumb', breadcrumb); +} +exports.addBreadcrumb = addBreadcrumb; +/** + * Callback to set context information onto the scope. + * @param callback Callback function that receives Scope. + */ +function configureScope(callback) { + callOnHub('configureScope', callback); +} +exports.configureScope = configureScope; +/** + * Creates a new scope with and executes the given operation within. + * The scope is automatically removed once the operation + * finishes or throws. + * + * This is essentially a convenience function for: + * + * pushScope(); + * callback(); + * popScope(); + * + * @param callback that will be enclosed into push/popScope. + */ +function withScope(callback) { + callOnHub('withScope', callback); +} +exports.withScope = withScope; +/** + * Calls a function on the latest client. Use this with caution, it's meant as + * in "internal" helper so we don't need to expose every possible function in + * the shim. It is not guaranteed that the client actually implements the + * function. + * + * @param method The method to call on the client/client. + * @param args Arguments to pass to the client/fontend. + */ +function _callOnClient(method) { + const args = []; + for (let _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + callOnHub.apply(void 0, tslib_1.__spread(['_invokeClient', method], args)); +} +exports._callOnClient = _callOnClient; +// # sourceMappingURL=index.js.map diff --git a/fixtures/artifact_bundle_debug_ids/files/_/_/index.js.map b/fixtures/artifact_bundle_debug_ids/files/_/_/index.js.map new file mode 100644 index 00000000000000..228b29c766c6d2 --- /dev/null +++ b/fixtures/artifact_bundle_debug_ids/files/_/_/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js.map","sources":["index.js"],"names":["Object","defineProperty","exports","value","tslib_1","require","hub_1","callOnHub","method","args","let","_i","arguments","length","hub","getCurrentHub","apply","__spread","Error","captureException","exception","syntheticException","error","originalException","captureMessage","message","level","captureEvent","event","addBreadcrumb","breadcrumb","configureScope","callback","withScope","_callOnClient"],"mappings":"AACAA,OAAOC,eAAeC,QAAS,aAAc,CAACC,MAAO,IAAI,CAAC,EAC1D,MAAMC,QAAUC,QAAQ,OAAO,EAC/B,MAAMC,MAAQD,QAAQ,cAAc,EAMpC,SAASE,UAAUC,QACjB,MAAMC,KAAO,GACb,IAAKC,IAAIC,GAAK,EAAGA,GAAKC,UAAUC,OAAQF,EAAE,GAAI,CAC5CF,KAAKE,GAAK,GAAKC,UAAUD,GAC3B,CACA,MAAMG,IAAMR,MAAMS,cAAc,EAChC,GAAID,KAAOA,IAAIN,QAAS,CAEtB,OAAOM,IAAIN,QAAQQ,MAAMF,IAAKV,QAAQa,SAASR,IAAI,CAAC,CACtD,CACA,MAAM,IAAIS,MACR,qBAAuBV,OAAS,sDAClC,CACF,CAOA,SAASW,iBAAiBC,WACxBV,IAAIW,mBACJ,IACE,MAAM,IAAIH,MAAM,2BAA2B,CAG7C,CAFE,MAAOI,OACPD,mBAAqBC,KACvB,CACA,OAAOf,UAAU,mBAAoBa,UAAW,CAC9CG,kBAAmBH,UACnBC,mBAAAA,kBACF,CAAC,CACH,CACAnB,QAAQiB,iBAAmBA,iBAQ3B,SAASK,eAAeC,QAASC,OAC/BhB,IAAIW,mBACJ,IACE,MAAM,IAAIH,MAAMO,OAAO,CAGzB,CAFE,MAAOL,WACPC,mBAAqBD,SACvB,CACA,OAAOb,UAAU,iBAAkBkB,QAASC,MAAO,CACjDH,kBAAmBE,QACnBJ,mBAAAA,kBACF,CAAC,CACH,CACAnB,QAAQsB,eAAiBA,eAOzB,SAASG,aAAaC,OACpB,OAAOrB,UAAU,eAAgBqB,KAAK,CACxC,CACA1B,QAAQyB,aAAeA,aASvB,SAASE,cAAcC,YACrBvB,UAAU,gBAAiBuB,UAAU,CACvC,CACA5B,QAAQ2B,cAAgBA,cAKxB,SAASE,eAAeC,UACtBzB,UAAU,iBAAkByB,QAAQ,CACtC,CACA9B,QAAQ6B,eAAiBA,eAczB,SAASE,UAAUD,UACjBzB,UAAU,YAAayB,QAAQ,CACjC,CACA9B,QAAQ+B,UAAYA,UAUpB,SAASC,cAAc1B,QACrB,MAAMC,KAAO,GACb,IAAKC,IAAIC,GAAK,EAAGA,GAAKC,UAAUC,OAAQF,EAAE,GAAI,CAC5CF,KAAKE,GAAK,GAAKC,UAAUD,GAC3B,CACAJ,UAAUS,MAAM,KAAK,EAAGZ,QAAQa,SAAS,CAAC,gBAAiBT,QAASC,IAAI,CAAC,CAC3E,CACAP,QAAQgC,cAAgBA"} \ No newline at end of file diff --git a/fixtures/artifact_bundle_debug_ids/files/_/_/index.min.js b/fixtures/artifact_bundle_debug_ids/files/_/_/index.min.js new file mode 100644 index 00000000000000..2207e03abb66a9 --- /dev/null +++ b/fixtures/artifact_bundle_debug_ids/files/_/_/index.min.js @@ -0,0 +1,2 @@ +/* eslint-disable */ +Object.defineProperty(exports,"__esModule",{value:true});const tslib_1=require("tslib");const hub_1=require("@sentry/core");function callOnHub(method){const args=[];for(let _i=1;_i<arguments.length;_i++){args[_i-1]=arguments[_i]}const hub=hub_1.getCurrentHub();if(hub&&hub[method]){return hub[method].apply(hub,tslib_1.__spread(args))}throw new Error("No hub defined or "+method+" was not found on the hub, please open a bug report.")}function captureException(exception){let syntheticException;try{throw new Error("Sentry syntheticException")}catch(error){syntheticException=error}return callOnHub("captureException",exception,{originalException:exception,syntheticException:syntheticException})}exports.captureException=captureException;function captureMessage(message,level){let syntheticException;try{throw new Error(message)}catch(exception){syntheticException=exception}return callOnHub("captureMessage",message,level,{originalException:message,syntheticException:syntheticException})}exports.captureMessage=captureMessage;function captureEvent(event){return callOnHub("captureEvent",event)}exports.captureEvent=captureEvent;function addBreadcrumb(breadcrumb){callOnHub("addBreadcrumb",breadcrumb)}exports.addBreadcrumb=addBreadcrumb;function configureScope(callback){callOnHub("configureScope",callback)}exports.configureScope=configureScope;function withScope(callback){callOnHub("withScope",callback)}exports.withScope=withScope;function _callOnClient(method){const args=[];for(let _i=1;_i<arguments.length;_i++){args[_i-1]=arguments[_i]}callOnHub.apply(void 0,tslib_1.__spread(["_invokeClient",method],args))}exports._callOnClient=_callOnClient; \ No newline at end of file diff --git a/fixtures/artifact_bundle_debug_ids/manifest.json b/fixtures/artifact_bundle_debug_ids/manifest.json new file mode 100644 index 00000000000000..ebfaa8dab8ca39 --- /dev/null +++ b/fixtures/artifact_bundle_debug_ids/manifest.json @@ -0,0 +1,43 @@ +{ + "org": "__org__", + "release": "__release__", + "files": { + "files/_/_/index.js": { + "url": "~/index.js", + "type": "source" + }, + "files/_/_/index.min.js": { + "url": "~/index.min.js", + "type": "minified_source", + "headers": { + "Debug-id": "Eb6e60f1-65ff-4f6f-Adff-f1bbeDEd627b", + "Sourcemap": "index.js.map" + } + }, + "files/_/_/index.js.map": { + "url": "~/index.js.map", + "type": "source_map", + "headers": { + "debug-id": "Eb6e60f1-65ff-4f6f-Adff-f1bbeDEd627b" + } + }, + "files/_/_/bundle1.js": { + "url": "~/bundle1.js", + "type": "soure" + }, + "files/_/_/bundle1.min.js": { + "url": "~/bundle1.js", + "type": "minified_source", + "headers": { + "Debug-id": "Eb6e60f1asd1bbeDEd627b-1232xwzsd", + "Sourcemap": "bundle1.js.map" + } + }, + "files/_/_/bundle1.map.js": { + "url": "~/bundle1.js", + "headers": { + "Debug-id": "Eb6e60f1asd1bbeDEd627b-1232xwzsd" + } + } + } +} diff --git a/src/sentry/api/bases/organization.py b/src/sentry/api/bases/organization.py index d865790743e384..3e50f038be313a 100644 --- a/src/sentry/api/bases/organization.py +++ b/src/sentry/api/bases/organization.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Any +from typing import Any, Optional, Set import sentry_sdk from django.core.cache import cache @@ -441,7 +441,11 @@ def get_projects( # type: ignore[override] ) def has_release_permission( - self, request: Request, organization: Organization, release: Release + self, + request: Request, + organization: Organization, + release: Optional[Release] = None, + project_ids: Optional[Set[int]] = None, ) -> bool: """ Does the given request have permission to access this release, based @@ -459,16 +463,28 @@ def has_release_permission( if getattr(request, "auth", None) and request.auth.id: actor_id = "apikey:%s" % request.auth.id if actor_id is not None: - project_ids = sorted(self.get_requested_project_ids_unchecked(request)) + requested_project_ids = project_ids + if requested_project_ids is None: + requested_project_ids = self.get_requested_project_ids_unchecked(request) key = "release_perms:1:%s" % hash_values( - [actor_id, organization.id, release.id] + project_ids + [actor_id, organization.id, release.id if release is not None else 0] + + sorted(requested_project_ids) ) has_perms = cache.get(key) if has_perms is None: - has_perms = ReleaseProject.objects.filter( - release=release, project__in=self.get_projects(request, organization) - ).exists() + projects = self.get_projects(request, organization, project_ids=project_ids) + # XXX(iambriccardo): The logic here is that you have access to this release if any of your projects + # associated with this release you have release permissions to. This is a bit of + # a problem because anyone can add projects to a release, so this check is easy + # to defeat. + if release is not None: + has_perms = ReleaseProject.objects.filter( + release=release, project__in=projects + ).exists() + else: + has_perms = len(projects) > 0 + if key is not None and actor_id is not None: cache.set(key, has_perms, 60) - return has_perms # type: ignore[no-any-return] + return has_perms diff --git a/src/sentry/api/endpoints/chunk.py b/src/sentry/api/endpoints/chunk.py index eaa3726d5ab36a..f84f55c1bad76d 100644 --- a/src/sentry/api/endpoints/chunk.py +++ b/src/sentry/api/endpoints/chunk.py @@ -9,7 +9,7 @@ from rest_framework.request import Request from rest_framework.response import Response -from sentry import options +from sentry import features, options from sentry.api.base import pending_silo_endpoint from sentry.api.bases.organization import OrganizationEndpoint, OrganizationReleasePermission from sentry.models import FileBlob @@ -31,6 +31,8 @@ "bcsymbolmaps", # BCSymbolMaps and associated PLists/UuidMaps "il2cpp", # Il2cpp LineMappingJson files "portablepdbs", # Portable PDB debug file + # TODO: This is currently turned on by a feature flag + # "artifact_bundles", # Artifact bundles containing source maps. ) @@ -79,6 +81,13 @@ def get(self, request: Request, organization) -> Response: # If user overridden upload url prefix, we want an absolute, versioned endpoint, with user-configured prefix url = absolute_uri(relative_url, endpoint) + # TODO: artifact bundles are still feature flagged. + accept = CHUNK_UPLOAD_ACCEPT + if features.has( + "organizations:artifact-bundles", organization=organization, actor=request.user + ): + accept += ("artifact_bundles",) + return Response( { "url": url, @@ -89,7 +98,7 @@ def get(self, request: Request, organization) -> Response: "concurrency": MAX_CONCURRENCY, "hashAlgorithm": HASH_ALGORITHM, "compression": ["gzip"], - "accept": CHUNK_UPLOAD_ACCEPT, + "accept": accept, } ) diff --git a/src/sentry/api/endpoints/organization_artifactbundle_assemble.py b/src/sentry/api/endpoints/organization_artifactbundle_assemble.py new file mode 100644 index 00000000000000..c9a4355854cb86 --- /dev/null +++ b/src/sentry/api/endpoints/organization_artifactbundle_assemble.py @@ -0,0 +1,90 @@ +import jsonschema +from rest_framework.request import Request +from rest_framework.response import Response + +from sentry.api.base import region_silo_endpoint +from sentry.api.bases.organization import OrganizationReleasesBaseEndpoint +from sentry.api.exceptions import ResourceDoesNotExist +from sentry.models import Project, ProjectStatus +from sentry.tasks.assemble import ( + AssembleTask, + ChunkFileState, + get_assemble_status, + set_assemble_status, +) +from sentry.utils import json + + +@region_silo_endpoint +class OrganizationArtifactBundleAssembleEndpoint(OrganizationReleasesBaseEndpoint): + def post(self, request: Request, organization) -> Response: + """ + Assembles an artifact bundle and stores the debug ids in the database. + """ + schema = { + "type": "object", + "properties": { + "projects": {"type": "array", "items": {"type": "string"}}, + "checksum": {"type": "string", "pattern": "^[0-9a-f]{40}$"}, + "chunks": { + "type": "array", + "items": {"type": "string", "pattern": "^[0-9a-f]{40}$"}, + }, + }, + "required": ["checksum", "chunks", "projects"], + "additionalProperties": False, + } + + try: + data = json.loads(request.body) + jsonschema.validate(data, schema) + except jsonschema.ValidationError as e: + return Response({"error": str(e).splitlines()[0]}, status=400) + except Exception: + return Response({"error": "Invalid json body"}, status=400) + + projects = set(data.get("projects", [])) + if len(projects) == 0: + return Response({"error": "You need to specify at least one project"}, status=400) + + project_ids = Project.objects.filter( + organization=organization, status=ProjectStatus.VISIBLE, slug__in=projects + ).values_list("id", flat=True) + if len(project_ids) != len(projects): + return Response({"error": "One or more projects are invalid"}, status=400) + + if not self.has_release_permission(request, organization, project_ids=set(project_ids)): + raise ResourceDoesNotExist + + checksum = data.get("checksum") + chunks = data.get("chunks", []) + + state, detail = get_assemble_status(AssembleTask.ARTIFACTS, organization.id, checksum) + if state == ChunkFileState.OK: + return Response({"state": state, "detail": None, "missingChunks": []}, status=200) + elif state is not None: + return Response({"state": state, "detail": detail, "missingChunks": []}) + + # There is neither a known file nor a cached state, so we will + # have to create a new file. Assure that there are checksums. + # If not, we assume this is a poll and report NOT_FOUND + if not chunks: + return Response({"state": ChunkFileState.NOT_FOUND, "missingChunks": []}, status=200) + + set_assemble_status( + AssembleTask.ARTIFACTS, organization.id, checksum, ChunkFileState.CREATED + ) + + from sentry.tasks.assemble import assemble_artifacts + + assemble_artifacts.apply_async( + kwargs={ + "org_id": organization.id, + "project_ids": list(project_ids), + "version": None, + "checksum": checksum, + "chunks": chunks, + } + ) + + return Response({"state": ChunkFileState.CREATED, "missingChunks": []}, status=200) diff --git a/src/sentry/api/endpoints/organization_release_assemble.py b/src/sentry/api/endpoints/organization_release_assemble.py index 9a19411437249c..4b07ad3b267be6 100644 --- a/src/sentry/api/endpoints/organization_release_assemble.py +++ b/src/sentry/api/endpoints/organization_release_assemble.py @@ -78,6 +78,7 @@ def post(self, request: Request, organization, version) -> Response: assemble_artifacts.apply_async( kwargs={ "org_id": organization.id, + "project_ids": [], "version": version, "checksum": checksum, "chunks": chunks, diff --git a/src/sentry/api/urls.py b/src/sentry/api/urls.py index 9688c817734c31..297821f19ec549 100644 --- a/src/sentry/api/urls.py +++ b/src/sentry/api/urls.py @@ -197,6 +197,9 @@ from .endpoints.organization_activity import OrganizationActivityEndpoint from .endpoints.organization_api_key_details import OrganizationApiKeyDetailsEndpoint from .endpoints.organization_api_key_index import OrganizationApiKeyIndexEndpoint +from .endpoints.organization_artifactbundle_assemble import ( + OrganizationArtifactBundleAssembleEndpoint, +) from .endpoints.organization_auditlogs import OrganizationAuditLogsEndpoint from .endpoints.organization_auth_provider_details import OrganizationAuthProviderDetailsEndpoint from .endpoints.organization_auth_provider_send_reminders import ( @@ -1103,6 +1106,11 @@ OrganizationAvatarEndpoint.as_view(), name="sentry-api-0-organization-avatar", ), + url( + r"^(?P<organization_slug>[^\/]+)/artifactbundle/assemble/$", + OrganizationArtifactBundleAssembleEndpoint.as_view(), + name="sentry-api-0-organization-artifactbundle-assemble", + ), url( r"^(?P<organization_slug>[^\/]+)/config/integrations/$", OrganizationConfigIntegrationsEndpoint.as_view(), diff --git a/src/sentry/apidocs/public_exclusion_list.py b/src/sentry/apidocs/public_exclusion_list.py index 45a77c0d45f978..3228f175095397 100644 --- a/src/sentry/apidocs/public_exclusion_list.py +++ b/src/sentry/apidocs/public_exclusion_list.py @@ -132,6 +132,9 @@ from sentry.api.endpoints.organization_activity import OrganizationActivityEndpoint from sentry.api.endpoints.organization_api_key_details import OrganizationApiKeyDetailsEndpoint from sentry.api.endpoints.organization_api_key_index import OrganizationApiKeyIndexEndpoint +from sentry.api.endpoints.organization_artifactbundle_assemble import ( + OrganizationArtifactBundleAssembleEndpoint, +) from sentry.api.endpoints.organization_auditlogs import OrganizationAuditLogsEndpoint from sentry.api.endpoints.organization_auth_provider_details import ( OrganizationAuthProviderDetailsEndpoint, @@ -747,6 +750,7 @@ OrganizationMemberIndexEndpoint, ExternalUserEndpoint, ExternalUserDetailsEndpoint, + OrganizationArtifactBundleAssembleEndpoint, OrganizationIntegrationRequestEndpoint, OrganizationInviteRequestIndexEndpoint, OrganizationInviteRequestDetailsEndpoint, diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index cacbb006c8bb49..7d3bc660a643f2 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -1012,6 +1012,8 @@ def SOCIAL_AUTH_DEFAULT_USERNAME(): SENTRY_FEATURES = { # Enables user registration. "auth:register": True, + # Enables the new artifact bundle uploads + "organizations:artifact-bundles": False, # Enables tagging javascript errors from the browser console. "organizations:javascript-console-error-tag": False, # Enables codecov integration for stacktrace highlighting. diff --git a/src/sentry/features/__init__.py b/src/sentry/features/__init__.py index b7e2c2261d6346..acbdd208667210 100644 --- a/src/sentry/features/__init__.py +++ b/src/sentry/features/__init__.py @@ -229,6 +229,7 @@ default_manager.add("organizations:codecov-stacktrace-integration-v2", OrganizationFeature, True) default_manager.add("organizations:auto-enable-codecov", OrganizationFeature) default_manager.add("organizations:codecov-commit-sha-from-git-blame", OrganizationFeature, True) +default_manager.add("organizations:artifact-bundles", OrganizationFeature, True) # Project scoped features default_manager.add("projects:alert-filters", ProjectFeature) diff --git a/src/sentry/models/artifactbundle.py b/src/sentry/models/artifactbundle.py index 2279cc267ded68..1edd39ea93c7cb 100644 --- a/src/sentry/models/artifactbundle.py +++ b/src/sentry/models/artifactbundle.py @@ -1,4 +1,5 @@ from enum import Enum +from typing import List, Optional, Tuple from django.db import models from django.utils import timezone @@ -19,9 +20,17 @@ class SourceFileType(Enum): INDEXED_RAM_BUNDLE = 4 @classmethod - def choices(cls): + def choices(cls) -> List[Tuple[int, str]]: return [(key.value, key.name) for key in cls] + @classmethod + def from_lowercase_key(cls, lowercase_key: str) -> Optional["SourceFileType"]: + for key in cls: + if key.name.lower() == lowercase_key: + return SourceFileType(key.value) + + return None + @region_silo_only_model class ArtifactBundle(Model): diff --git a/src/sentry/tasks/assemble.py b/src/sentry/tasks/assemble.py index 9907c1bfebdac3..7f0956f2dc98d4 100644 --- a/src/sentry/tasks/assemble.py +++ b/src/sentry/tasks/assemble.py @@ -1,14 +1,23 @@ import hashlib import logging from os import path +from typing import List, Optional, Tuple from django.db import IntegrityError, router +from symbolic import SymbolicError, normalize_debug_id from sentry import options from sentry.api.serializers import serialize from sentry.cache import default_cache from sentry.db.models.fields import uuid -from sentry.models import File, Organization, Release, ReleaseFile +from sentry.models import Distribution, File, Organization, Release, ReleaseFile +from sentry.models.artifactbundle import ( + ArtifactBundle, + DebugIdArtifactBundle, + ProjectArtifactBundle, + ReleaseArtifactBundle, + SourceFileType, +) from sentry.models.releasefile import ReleaseArchive, update_artifact_index from sentry.tasks.base import instrumented_task from sentry.utils import metrics @@ -153,7 +162,7 @@ def assemble_dif(project_id, name, checksum, chunks, debug_id=None, **kwargs): ) finally: if delete_file: - file.delete() + file.delete() # type:ignore class AssembleArtifactsError(Exception): @@ -231,10 +240,87 @@ def _store_single_files(archive: ReleaseArchive, meta: dict, count_as_artifacts: _upsert_release_file(file, None, _simple_update, kwargs, extra_fields) +def _normalize_headers(headers: dict) -> dict: + return {k.lower(): v for k, v in headers.items()} + + +def _normalize_debug_id(debug_id: Optional[str]) -> Optional[str]: + try: + return normalize_debug_id(debug_id) + except SymbolicError: + return None + + +def _extract_debug_ids_from_manifest(manifest: dict) -> List[Tuple[SourceFileType, str]]: + debug_ids_with_types = [] + + files = manifest.get("files", {}) + for file_path, info in files.items(): + headers = _normalize_headers(info.get("headers", {})) + if (debug_id := headers.get("debug-id", None)) is not None: + debug_id = _normalize_debug_id(debug_id) + file_type = info.get("type", None) + if ( + debug_id is not None + and file_type is not None + and (source_file_type := SourceFileType.from_lowercase_key(file_type)) is not None + ): + debug_ids_with_types.append((source_file_type, debug_id)) + + return debug_ids_with_types + + +def _create_artifact_bundle( + release: Optional[Release], + dist: Optional[Distribution], + org_id: int, + project_ids: List[int], + archive_file: File, + artifact_count: int, +) -> bool: + with ReleaseArchive(archive_file.getfile()) as archive: + debug_ids_with_types = _extract_debug_ids_from_manifest(archive.manifest) + + if len(debug_ids_with_types) > 0: + artifact_bundle = ArtifactBundle.objects.create( + organization_id=org_id, + bundle_id=uuid.uuid4().hex, + file=archive_file, + artifact_count=artifact_count, + ) + + if release: + ReleaseArtifactBundle.objects.create( + organization_id=org_id, + release_name=release.version if release else None, + dist_id=dist.id if dist else None, + artifact_bundle=artifact_bundle, + ) + + for project_id in project_ids: + ProjectArtifactBundle.objects.create( + organization_id=org_id, + project_id=project_id, + artifact_bundle=artifact_bundle, + ) + + for source_file_type, debug_id in debug_ids_with_types: + DebugIdArtifactBundle.objects.create( + organization_id=org_id, + debug_id=debug_id, + artifact_bundle=artifact_bundle, + source_file_type=source_file_type.value, + ) + + return True + + return False + + @instrumented_task(name="sentry.tasks.assemble.assemble_artifacts", queue="assemble") -def assemble_artifacts(org_id, version, checksum, chunks, **kwargs): +def assemble_artifacts(org_id, project_ids, version, checksum, chunks, **kwargs): """ - Creates release files from an uploaded artifact bundle. + Creates a release file or artifact bundle from an uploaded bundle given the checksums of its chunks. """ try: organization = Organization.objects.get_from_cache(pk=org_id) @@ -251,7 +337,8 @@ def assemble_artifacts(org_id, version, checksum, chunks, **kwargs): archive_filename, checksum, chunks, - file_type="release.bundle", + # If we have a veraion we are going to create a release bundle otherwise an artifact bundle. + file_type="release.bundle" if version else "artifact.bundle", ) # If not file has been created this means that the file failed to @@ -275,42 +362,52 @@ def assemble_artifacts(org_id, version, checksum, chunks, **kwargs): raise AssembleArtifactsError("organization does not match uploaded bundle") release_name = manifest.get("release") - if release_name != version: + if version and release_name != version: raise AssembleArtifactsError("release does not match uploaded bundle") - try: - release = Release.objects.get(organization_id=organization.id, version=release_name) - except Release.DoesNotExist: - raise AssembleArtifactsError("release does not exist") + release = None + if version: + try: + release = Release.objects.get( + organization_id=organization.id, version=release_name + ) + except Release.DoesNotExist: + raise AssembleArtifactsError("release does not exist") dist_name = manifest.get("dist") dist = None - if dist_name: + if release and dist_name: dist = release.add_dist(dist_name) - num_files = len(manifest.get("files", {})) + artifact_count = len(manifest.get("files", {})) + min_artifact_count = options.get("processing.release-archive-min-files") + saved_as_archive = False - meta = { # Required for release file creation - "organization_id": organization.id, - "release_id": release.id, - "dist_id": dist.id if dist else dist, - } + # If we receive a version, it means that we want to create a ReleaseFile, otherwise we will create + # an ArtifactBundle. + if version and artifact_count >= min_artifact_count: + if release is None: + raise AssembleArtifactsError("release does not exist") - saved_as_archive = False - min_size = options.get("processing.release-archive-min-files") - if num_files >= min_size: try: update_artifact_index(release, dist, bundle) saved_as_archive = True except Exception as exc: logger.error("Unable to update artifact index", exc_info=exc) + elif version is None: + _create_artifact_bundle(release, dist, org_id, project_ids, bundle, artifact_count) + saved_as_archive = True if not saved_as_archive: + meta = { + "organization_id": organization.id, + "release_id": release.id, + "dist_id": dist.id if dist else dist, + } _store_single_files(archive, meta, True) # Count files extracted, to compare them to release files endpoint - metrics.incr("tasks.assemble.extracted_files", amount=num_files) - + metrics.incr("tasks.assemble.extracted_files", amount=artifact_count) except AssembleArtifactsError as e: set_assemble_status( AssembleTask.ARTIFACTS, org_id, checksum, ChunkFileState.ERROR, detail=str(e) diff --git a/src/sentry/testutils/factories.py b/src/sentry/testutils/factories.py index af10ffe8e50617..4cac70561d2a93 100644 --- a/src/sentry/testutils/factories.py +++ b/src/sentry/testutils/factories.py @@ -500,11 +500,13 @@ def create_release_file(release_id, file=None, name=None, dist_id=None): @staticmethod @exempt_from_silo_limits() - def create_artifact_bundle(org, release, project=None, extra_files=None): + def create_artifact_bundle( + org, release, project=None, extra_files=None, fixture_path="artifact_bundle" + ): import zipfile bundle = io.BytesIO() - bundle_dir = get_fixture_path("artifact_bundle") + bundle_dir = get_fixture_path(fixture_path) with zipfile.ZipFile(bundle, "w", zipfile.ZIP_DEFLATED) as zipfile: for path, content in (extra_files or {}).items(): zipfile.writestr(path, content) diff --git a/tests/sentry/api/endpoints/test_chunk_upload.py b/tests/sentry/api/endpoints/test_chunk_upload.py index f51d2b187fcd00..ca6b30db26d408 100644 --- a/tests/sentry/api/endpoints/test_chunk_upload.py +++ b/tests/sentry/api/endpoints/test_chunk_upload.py @@ -48,6 +48,19 @@ def test_chunk_parameters(self): assert response.data["url"] == options.get("system.upload-url-prefix") + self.url + def test_accept_with_feature_flag_enabled_and_disabled(self): + with self.feature({"organizations:artifact-bundles": False}): + response = self.client.get( + self.url, HTTP_AUTHORIZATION=f"Bearer {self.token.token}", format="json" + ) + assert "artifact_bundles" not in response.data["accept"] + + with self.feature({"organizations:artifact-bundles": True}): + response = self.client.get( + self.url, HTTP_AUTHORIZATION=f"Bearer {self.token.token}", format="json" + ) + assert "artifact_bundles" in response.data["accept"] + def test_relative_url_support(self): # Starting `[email protected]` we added a support for relative chunk-uploads urls diff --git a/tests/sentry/api/endpoints/test_organization_artifactbundle_assemble.py b/tests/sentry/api/endpoints/test_organization_artifactbundle_assemble.py new file mode 100644 index 00000000000000..7df7f2e794209d --- /dev/null +++ b/tests/sentry/api/endpoints/test_organization_artifactbundle_assemble.py @@ -0,0 +1,180 @@ +from hashlib import sha1 +from unittest.mock import patch + +from django.core.files.base import ContentFile +from django.urls import reverse + +from sentry.constants import ObjectStatus +from sentry.models import ApiToken, FileBlob, FileBlobOwner +from sentry.tasks.assemble import ChunkFileState, assemble_artifacts +from sentry.testutils import APITestCase +from sentry.testutils.silo import region_silo_test + + +@region_silo_test +class OrganizationArtifactBundleAssembleTest(APITestCase): + def setUp(self): + self.organization = self.create_organization(owner=self.user) + self.token = ApiToken.objects.create(user=self.user, scope_list=["project:write"]) + self.project = self.create_project() + self.url = reverse( + "sentry-api-0-organization-artifactbundle-assemble", + args=[self.organization.slug], + ) + + def test_assemble_json_schema(self): + response = self.client.post( + self.url, data={"lol": "test"}, HTTP_AUTHORIZATION=f"Bearer {self.token.token}" + ) + assert response.status_code == 400, response.content + + checksum = sha1(b"1").hexdigest() + response = self.client.post( + self.url, + data={"checksum": "invalid"}, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + assert response.status_code == 400, response.content + + response = self.client.post( + self.url, + data={"checksum": checksum}, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + assert response.status_code == 400, response.content + + response = self.client.post( + self.url, + data={"checksum": checksum, "chunks": []}, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + assert response.status_code == 400, response.content + + response = self.client.post( + self.url, + data={"checksum": checksum, "chunks": [], "projects": []}, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + assert response.status_code == 400, response.content + + response = self.client.post( + self.url, + data={"checksum": checksum, "chunks": [], "projects": [self.project.id]}, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + assert response.status_code == 400, response.content + + response = self.client.post( + self.url, + data={"checksum": checksum, "chunks": [], "projects": [self.project.slug]}, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + assert response.status_code == 200, response.content + assert response.data["state"] == ChunkFileState.NOT_FOUND + + def test_assemble_with_invalid_projects(self): + bundle_file = self.create_artifact_bundle() + total_checksum = sha1(bundle_file).hexdigest() + + blob1 = FileBlob.from_file(ContentFile(bundle_file)) + FileBlobOwner.objects.get_or_create(organization_id=self.organization.id, blob=blob1) + + # We want to test also with a project that has a status != VISIBLE. + pending_deletion_project = self.create_project(status=ObjectStatus.PENDING_DELETION) + + response = self.client.post( + self.url, + data={ + "checksum": total_checksum, + "chunks": [blob1.checksum], + "projects": [pending_deletion_project.slug, "myslug", "anotherslug"], + }, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + + assert response.status_code == 400, response.content + assert response.data["error"] == "One or more projects are invalid" + + @patch("sentry.tasks.assemble.assemble_artifacts") + def test_assemble(self, mock_assemble_artifacts): + bundle_file = self.create_artifact_bundle() + total_checksum = sha1(bundle_file).hexdigest() + + blob1 = FileBlob.from_file(ContentFile(bundle_file)) + FileBlobOwner.objects.get_or_create(organization_id=self.organization.id, blob=blob1) + + response = self.client.post( + self.url, + data={ + "checksum": total_checksum, + "chunks": [blob1.checksum], + "projects": [self.project.slug], + }, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + + assert response.status_code == 200, response.content + assert response.data["state"] == ChunkFileState.CREATED + assert set(response.data["missingChunks"]) == set() + + mock_assemble_artifacts.apply_async.assert_called_once_with( + kwargs={ + "org_id": self.organization.id, + "project_ids": [self.project.id], + "version": None, + "chunks": [blob1.checksum], + "checksum": total_checksum, + } + ) + + def test_assemble_response(self): + bundle_file = self.create_artifact_bundle() + total_checksum = sha1(bundle_file).hexdigest() + blob1 = FileBlob.from_file(ContentFile(bundle_file)) + + assemble_artifacts( + org_id=self.organization.id, + project_ids=[], + version=self.release.version, + checksum=total_checksum, + chunks=[blob1.checksum], + ) + + response = self.client.post( + self.url, + data={ + "checksum": total_checksum, + "chunks": [blob1.checksum], + "projects": [self.project.slug], + }, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + + assert response.status_code == 200, response.content + assert response.data["state"] == ChunkFileState.OK + + def test_dif_error_response(self): + bundle_file = b"invalid" + total_checksum = sha1(bundle_file).hexdigest() + blob1 = FileBlob.from_file(ContentFile(bundle_file)) + + assemble_artifacts( + org_id=self.organization.id, + project_ids=[], + version=self.release.version, + checksum=total_checksum, + chunks=[blob1.checksum], + ) + + response = self.client.post( + self.url, + data={ + "checksum": total_checksum, + "chunks": [blob1.checksum], + "projects": [self.project.slug], + }, + HTTP_AUTHORIZATION=f"Bearer {self.token.token}", + ) + + assert response.status_code == 200, response.content + assert response.data["state"] == ChunkFileState.ERROR diff --git a/tests/sentry/api/endpoints/test_organization_release_assemble.py b/tests/sentry/api/endpoints/test_organization_release_assemble.py index bbfe4f5124c3ad..540614a4994eb6 100644 --- a/tests/sentry/api/endpoints/test_organization_release_assemble.py +++ b/tests/sentry/api/endpoints/test_organization_release_assemble.py @@ -72,6 +72,7 @@ def test_assemble(self, mock_assemble_artifacts): mock_assemble_artifacts.apply_async.assert_called_once_with( kwargs={ "org_id": self.organization.id, + "project_ids": [], "version": self.release.version, "chunks": [blob1.checksum], "checksum": total_checksum, @@ -85,6 +86,7 @@ def test_assemble_response(self): assemble_artifacts( org_id=self.organization.id, + project_ids=[], version=self.release.version, checksum=total_checksum, chunks=[blob1.checksum], @@ -106,6 +108,7 @@ def test_dif_error_response(self): assemble_artifacts( org_id=self.organization.id, + project_ids=[], version=self.release.version, checksum=total_checksum, chunks=[blob1.checksum], diff --git a/tests/sentry/tasks/test_assemble.py b/tests/sentry/tasks/test_assemble.py index 3dfc24384c1650..91290c10aca57f 100644 --- a/tests/sentry/tasks/test_assemble.py +++ b/tests/sentry/tasks/test_assemble.py @@ -6,6 +6,12 @@ from django.core.files.base import ContentFile from sentry.models import FileBlob, FileBlobOwner, ReleaseFile +from sentry.models.artifactbundle import ( + DebugIdArtifactBundle, + ProjectArtifactBundle, + ReleaseArtifactBundle, + SourceFileType, +) from sentry.models.debugfile import ProjectDebugFile from sentry.models.releasefile import read_artifact_index from sentry.tasks.assemble import ( @@ -191,7 +197,53 @@ class AssembleArtifactsTest(BaseAssembleTest): def setUp(self): super().setUp() - def test_artifacts(self): + def test_artifacts_with_debug_ids(self): + bundle_file = self.create_artifact_bundle( + fixture_path="artifact_bundle_debug_ids", project=self.project.id + ) + blob1 = FileBlob.from_file(ContentFile(bundle_file)) + total_checksum = sha1(bundle_file).hexdigest() + + expected_source_file_types = [SourceFileType.MINIFIED_SOURCE, SourceFileType.SOURCE_MAP] + expected_debug_ids = ["eb6e60f1-65ff-4f6f-adff-f1bbeded627b"] + + assemble_artifacts( + org_id=self.organization.id, + project_ids=[self.project.id], + version=None, + checksum=total_checksum, + chunks=[blob1.checksum], + ) + + assert self.release.count_artifacts() == 0 + + status, details = get_assemble_status( + AssembleTask.ARTIFACTS, self.organization.id, total_checksum + ) + assert status == ChunkFileState.OK + assert details is None + + for debug_id in expected_debug_ids: + debug_id_artifact_bundles = DebugIdArtifactBundle.objects.filter( + organization_id=self.organization.id, debug_id=debug_id + ) + assert len(debug_id_artifact_bundles) == 2 + assert debug_id_artifact_bundles[0].artifact_bundle.file.size == len(bundle_file) + # We check also if the source file types are equal. + for index, entry in enumerate(debug_id_artifact_bundles): + assert entry.source_file_type == expected_source_file_types[index].value + + release_artifact_bundle = ReleaseArtifactBundle.objects.filter( + organization_id=self.organization.id + ) + assert len(release_artifact_bundle) == 0 + + project_artifact_bundles = ProjectArtifactBundle.objects.filter( + project_id=self.project.id + ) + assert len(project_artifact_bundles) == 1 + + def test_artifacts_without_debug_ids(self): bundle_file = self.create_artifact_bundle() blob1 = FileBlob.from_file(ContentFile(bundle_file)) total_checksum = sha1(bundle_file).hexdigest() @@ -209,6 +261,7 @@ def test_artifacts(self): assemble_artifacts( org_id=self.organization.id, + project_ids=[], version=self.release.version, checksum=total_checksum, chunks=[blob1.checksum], @@ -248,6 +301,7 @@ def test_artifacts_invalid_org(self): assemble_artifacts( org_id=self.organization.id, + project_ids=[], version=self.release.version, checksum=total_checksum, chunks=[blob1.checksum], @@ -265,6 +319,7 @@ def test_artifacts_invalid_release(self): assemble_artifacts( org_id=self.organization.id, + project_ids=[], version=self.release.version, checksum=total_checksum, chunks=[blob1.checksum], @@ -282,6 +337,7 @@ def test_artifacts_invalid_zip(self): assemble_artifacts( org_id=self.organization.id, + project_ids=[], version=self.release.version, checksum=total_checksum, chunks=[blob1.checksum], @@ -306,6 +362,7 @@ def test_failing_update(self, _): ): assemble_artifacts( org_id=self.organization.id, + project_ids=[], version=self.release.version, checksum=total_checksum, chunks=[blob1.checksum],
e07f330406ac9106b409f8798329f15595894f54
2020-06-16 23:57:40
Abhijeet Prasad
feat(deps): Update JS SDK to 5.17.0 (#19395)
false
Update JS SDK to 5.17.0 (#19395)
feat
diff --git a/package.json b/package.json index 1e87250971dbec..e650bff029ed25 100644 --- a/package.json +++ b/package.json @@ -20,12 +20,12 @@ "@emotion/babel-preset-css-prop": "^10.0.27", "@emotion/core": "^10.0.27", "@emotion/styled": "^10.0.27", - "@sentry/apm": "5.16.0-beta.5", - "@sentry/browser": "5.16.0-beta.5", - "@sentry/integrations": "5.16.0-beta.5", + "@sentry/apm": "5.17.0", + "@sentry/browser": "5.17.0", + "@sentry/integrations": "5.17.0", "@sentry/release-parser": "^0.6.0", "@sentry/rrweb": "^0.1.1", - "@sentry/utils": "5.16.0-beta.5", + "@sentry/utils": "5.17.0", "@types/classnames": "^2.2.0", "@types/clipboard": "^2.0.1", "@types/color": "^3.0.0", @@ -132,7 +132,7 @@ "devDependencies": { "@babel/plugin-transform-react-jsx-source": "^7.2.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.3.1", - "@sentry/node": "5.16.0-beta.5", + "@sentry/node": "5.17.0", "@storybook/addon-a11y": "^5.3.3", "@storybook/addon-actions": "^5.3.3", "@storybook/addon-docs": "^5.3.3", diff --git a/yarn.lock b/yarn.lock index 113492704daf51..80f7a94912da9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1823,76 +1823,76 @@ react-lifecycles-compat "^3.0.4" warning "^3.0.0" -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.16.0-beta.5.tgz#ca715ea1ae8da1194d44fbbab7b6e4c3815491ec" - integrity sha512-sN2WWnx7TPMY95qk+rFoawCA8duCRzRYtRC3otQ3lp8KR0a9bnfVHDlQFntw/tp4tMSstX5YotJTalM7eI9dew== - dependencies: - "@sentry/browser" "5.16.0-beta.5" - "@sentry/hub" "5.16.0-beta.5" - "@sentry/minimal" "5.16.0-beta.5" - "@sentry/types" "5.16.0-beta.5" - "@sentry/utils" "5.16.0-beta.5" +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.17.0.tgz#c3e6d07f4f488f77c8677cdc8d0e2fb58e302d72" + integrity sha512-raJcPa04TP8mVocSTHe0PdULpRWhw0NaLq9Rk8KCTFBJvLsgzY2krph5/LgEfBBX78vWt70FrwSw+DdIfYIJ6g== + dependencies: + "@sentry/browser" "5.17.0" + "@sentry/hub" "5.17.0" + "@sentry/minimal" "5.17.0" + "@sentry/types" "5.17.0" + "@sentry/utils" "5.17.0" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.16.0-beta.5.tgz#e230cd34950731ad702e6b728bbeeea9c7e4d14a" - integrity sha512-DTmvGDehbTLlic8ocO3xT32MaKs8WktDdAFT+xJlCbdnIuM3IYi/ucgKbbVDEIt+W0EuZzUofAaMWf5w/B+Xpg== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.17.0.tgz#0c3796cb02df3ec8db13341564fae0bc83e148c5" + integrity sha512-++pXpCHtdek1cRUwVeLvlxUJ2w1s+eiC9qN1N+7+HdAjHpBz2/tA1sKBCqwwVQZ490Cf2GLll9Ao7fuPPmveRQ== dependencies: - "@sentry/core" "5.16.0-beta.5" - "@sentry/types" "5.16.0-beta.5" - "@sentry/utils" "5.16.0-beta.5" + "@sentry/core" "5.17.0" + "@sentry/types" "5.17.0" + "@sentry/utils" "5.17.0" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.16.0-beta.5.tgz#e0fb8e91a6278b811b938380fab21b11acd07676" - integrity sha512-WLqfVgWl6bHjrx0RS+hy5NDko3EqVGyQ0sjl3tBgl38Rttcvs5V+5NRqBqL7UJXupVCB+uVO77ocnFzHYF6OBw== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.17.0.tgz#b2deef95465c766076d5cffd8534a67100f9b821" + integrity sha512-Kfx4rGKDC7V1YJjTGJXyl12VVHxM8Cjpu61YOyF8kXoXXg9u06C3n0G1dmfzLQERKXasUVMtXRBdKx/OjYpl1g== dependencies: - "@sentry/hub" "5.16.0-beta.5" - "@sentry/minimal" "5.16.0-beta.5" - "@sentry/types" "5.16.0-beta.5" - "@sentry/utils" "5.16.0-beta.5" + "@sentry/hub" "5.17.0" + "@sentry/minimal" "5.17.0" + "@sentry/types" "5.17.0" + "@sentry/utils" "5.17.0" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.16.0-beta.5.tgz#80310af8aac6bd183171e9756bfb3f14bff0e9d9" - integrity sha512-+IxvYSSUNPsk5sLD3LydoLt+vXchC2bb2CsOnI3+anXsaYKR9PCYgIQ6+6vBitwWASQkoiw9Jyqr4dmjufi5Bg== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.17.0.tgz#b7d255ca3f766385911d9414af97f388e869d996" + integrity sha512-lyUbEmshwaMYdAzy4iwgizgvKODVVloB2trnefpq90AuWCdvzcxMLIGULx1ou+KohccqdNorYICKWeuRscKq5A== dependencies: - "@sentry/types" "5.16.0-beta.5" - "@sentry/utils" "5.16.0-beta.5" + "@sentry/types" "5.17.0" + "@sentry/utils" "5.17.0" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.16.0-beta.5.tgz#4c55d81ec0e145625b974cfc9b37974103bd3550" - integrity sha512-MR6pWG9WJqytn4ZA+Y84rV7gA9pNucGrh2LzaJyHCnpVVPQFgmjw8dn7v2YGqdywCQQV49YZXW9H2+cB/q57Vw== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-5.17.0.tgz#afff7759d82111de030b4a6703388c423fdbe6e7" + integrity sha512-H4CLH+fej/EjbI5WKXnAVkyVK3MeHUcTMbnjPcUlAsxpu1+PckFzpw3t4S5la9WGwcfL3WDo24b+fb4iKf9t4Q== dependencies: - "@sentry/types" "5.16.0-beta.5" - "@sentry/utils" "5.16.0-beta.5" + "@sentry/types" "5.17.0" + "@sentry/utils" "5.17.0" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.16.0-beta.5.tgz#6b8aa1913b79537dc69f2636a6ee94a12cd6e950" - integrity sha512-noGo5MJQf/7ureXyxWomGJbFwiFrQuTlrgZ5ZXwCCtnH4Qh5wlrusSmKgIs0/P42UtmiOLuExcQPtDgT4Z9y6Q== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.17.0.tgz#b40e4b4109b098840277def3b51cc20ae6767164" + integrity sha512-v8xfkySXKrliZO6er6evlVe/ViUcqN0O8BhGyauK28Mf+KnKEOs5W6oWbt4qCDIttw9ynKIYyRrkAl/9oUR76A== dependencies: - "@sentry/hub" "5.16.0-beta.5" - "@sentry/types" "5.16.0-beta.5" + "@sentry/hub" "5.17.0" + "@sentry/types" "5.17.0" tslib "^1.9.3" -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.16.0-beta.5.tgz#74f1014b4a0798a927578ca04b570e460733ca70" - integrity sha512-2zBtIoQaMyoGYYw9wb8Q76NuRhlofzVPz9q1oNR4uIKUhufbeDQr3ncrHPU19jqR8ui55MnFTyTdO75MjjQQfQ== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.17.0.tgz#9e4cd0596702e3d45caddc9bdf12d47acc276f0b" + integrity sha512-gaM+LNjQc7Wm+RG4f7KGZ/+An8RQ9/8CkJDB/DP4qwufsaIrcg1dZa6KeAUnh3KaXZ+ZuPji+agCIV/AQU4x8g== dependencies: - "@sentry/apm" "5.16.0-beta.5" - "@sentry/core" "5.16.0-beta.5" - "@sentry/hub" "5.16.0-beta.5" - "@sentry/types" "5.16.0-beta.5" - "@sentry/utils" "5.16.0-beta.5" + "@sentry/apm" "5.17.0" + "@sentry/core" "5.17.0" + "@sentry/hub" "5.17.0" + "@sentry/types" "5.17.0" + "@sentry/utils" "5.17.0" cookie "^0.3.1" https-proxy-agent "^4.0.0" lru_map "^0.3.3" @@ -1908,17 +1908,17 @@ resolved "https://registry.yarnpkg.com/@sentry/rrweb/-/rrweb-0.1.1.tgz#1e2ef7381d5c5725ea3bf3ac20987d50eee83dd1" integrity sha512-bFzZ+NVaGFpkmBvSHsvM/Pc/wiy7UeP/ICofkY2iY5PwiRHpZCX5hLrLYA7o921VR847EKZB44fQYWZC1YFB1Q== -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.16.0-beta.5.tgz#1735cd2a24a9259b301eb2f115c5db4422a948b0" - integrity sha512-/ARDVbBJIGCQywmzpX1x/EhSu3fJtyaaOE/ZGFAgHk4oTQKmw36ZgwksKYCsaEv5A0b7c+99/RwzWht1+SNh7Q== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.17.0.tgz#b8d245ac7d5caa749c549e9f72aab2d6522afe63" + integrity sha512-1z8EXzvg8GcsBNnSXgB5/G7mz2PwmMt9mjOrVG1jhtSGH1c7WvB32F5boqoMcjIJmy5MrBGaaXwrF/RRJrwUQg== -"@sentry/[email protected]": - version "5.16.0-beta.5" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.16.0-beta.5.tgz#36c96c93a0ccef33f1a039320a8ddc58d3d416a9" - integrity sha512-c93f04s2YE4yTWrfgQlFv/V8UQzJuf4ZvpJDssRhbuz1CiRNzPvCQsvEwuKJW2jgCaDjPD9r8KVws4FkGOKmcA== +"@sentry/[email protected]": + version "5.17.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.17.0.tgz#b809b067665f3ebaea77ba7b5d1d1d14a4ed76cb" + integrity sha512-qn8WgZcSkV/rx0ezp9q/xFjP7aMaYZO1/JYLXV4o6pYrQ9tvMmmwAZT39FpJunhhbkR36WNEuRB9C2K250cb/A== dependencies: - "@sentry/types" "5.16.0-beta.5" + "@sentry/types" "5.17.0" tslib "^1.9.3" "@storybook/addon-a11y@^5.3.3":
4bcbb751eb285c9e01c9da5f2135dd7c883a27a8
2022-05-19 22:53:17
edwardgou-sentry
feat(discover): adds a referrer for auth token requests (#34771)
false
adds a referrer for auth token requests (#34771)
feat
diff --git a/src/sentry/api/endpoints/organization_events.py b/src/sentry/api/endpoints/organization_events.py index cfb1f9dc426e07..4370a5e37bd759 100644 --- a/src/sentry/api/endpoints/organization_events.py +++ b/src/sentry/api/endpoints/organization_events.py @@ -42,6 +42,8 @@ "api.dashboards.worldmapwidget", } +API_TOKEN_REFERRER = "api.auth-token.events" + class OrganizationEventsV2Endpoint(OrganizationEventsV2EndpointBase): def get(self, request: Request, organization) -> Response: @@ -154,7 +156,11 @@ def get(self, request: Request, organization) -> Response: sentry_sdk.set_tag("performance.metrics_enhanced", metrics_enhanced) allow_metric_aggregates = request.GET.get("preventMetricAggregates") != "1" - referrer = referrer if referrer in ALLOWED_EVENTS_REFERRERS else "api.organization-events" + # Force the referrer to "api.auth-token.events" for events requests authorized through a bearer token + if request.auth: + referrer = API_TOKEN_REFERRER + elif referrer not in ALLOWED_EVENTS_REFERRERS: + referrer = "api.organization-events" def data_fn(offset, limit): query_details = { diff --git a/tests/snuba/api/endpoints/test_organization_events_v2.py b/tests/snuba/api/endpoints/test_organization_events_v2.py index 35d69d8473ea02..9c20d73f279ca9 100644 --- a/tests/snuba/api/endpoints/test_organization_events_v2.py +++ b/tests/snuba/api/endpoints/test_organization_events_v2.py @@ -9801,6 +9801,37 @@ def test_empty_referrer(self, mock): _, kwargs = mock.call_args self.assertEqual(kwargs["referrer"], self.referrer) + @mock.patch("sentry.snuba.discover.query") + def test_api_token_referrer(self, mock): + mock.return_value = {} + # Project ID cannot be inffered when using an org API key, so that must + # be passed in the parameters + api_key = ApiKey.objects.create(organization=self.organization, scope_list=["org:read"]) + + project = self.create_project() + data = load_data("transaction", timestamp=before_now(hours=1)) + self.store_event(data=data, project_id=project.id) + + query = {"field": ["project.name", "environment"], "project": [project.id]} + + features = {"organizations:discover-basic": True} + features.update(self.features) + url = reverse( + self.viewname, + kwargs={"organization_slug": self.organization.slug}, + ) + + with self.feature(features): + self.client.get( + url, + query, + format="json", + HTTP_AUTHORIZATION=b"Basic " + b64encode(f"{api_key.key}:".encode()), + ) + + _, kwargs = mock.call_args + self.assertEqual(kwargs["referrer"], "api.auth-token.events") + def test_limit_number_of_fields(self): self.create_project() for i in range(1, 25):
d3dafb6f88e8ce26db8d80bf138756866ffc9749
2022-05-26 04:04:34
Evan Purkhiser
fix(ui): Don't show chart labels when loading in releaseAdoption (#35025)
false
Don't show chart labels when loading in releaseAdoption (#35025)
fix
diff --git a/static/app/views/releases/detail/overview/sidebar/releaseAdoption.tsx b/static/app/views/releases/detail/overview/sidebar/releaseAdoption.tsx index 58d9aba39a1a0a..ee27f0845b7d8c 100644 --- a/static/app/views/releases/detail/overview/sidebar/releaseAdoption.tsx +++ b/static/app/views/releases/detail/overview/sidebar/releaseAdoption.tsx @@ -260,22 +260,24 @@ function ReleaseAdoption({ </SidebarSection> )} <RelativeBox> - <ChartLabel top="0px"> - <ChartTitle - title={t('Sessions Adopted')} - icon={ - <QuestionTooltip - position="top" - title={t( - 'Adoption compares the sessions of a release with the total sessions for this project.' - )} - size="sm" - /> - } - /> - </ChartLabel> + {!loading && ( + <ChartLabel top="0px"> + <ChartTitle + title={t('Sessions Adopted')} + icon={ + <QuestionTooltip + position="top" + title={t( + 'Adoption compares the sessions of a release with the total sessions for this project.' + )} + size="sm" + /> + } + /> + </ChartLabel> + )} - {hasUsers && ( + {!loading && hasUsers && ( <ChartLabel top="140px"> <ChartTitle title={t('Users Adopted')}
345e363e215e970e94bb66218152bddc3b0f5476
2025-01-10 23:07:34
Richard Roggenkemper
chore(issue-details): Remove tag preview section divider (#83215)
false
Remove tag preview section divider (#83215)
chore
diff --git a/static/app/views/issueDetails/streamline/issueTagsPreview.tsx b/static/app/views/issueDetails/streamline/issueTagsPreview.tsx index d5f493e8ddcfc9..49f2f94cc0d42d 100644 --- a/static/app/views/issueDetails/streamline/issueTagsPreview.tsx +++ b/static/app/views/issueDetails/streamline/issueTagsPreview.tsx @@ -38,7 +38,6 @@ export default function IssueTagsPreview({ return ( <LoadingContainer style={{paddingTop: space(1)}}> <Placeholder width="320px" height="95px" /> - <SectionDivider /> </LoadingContainer> ); } @@ -54,7 +53,6 @@ export default function IssueTagsPreview({ <TagPreviewDistribution key={tag.key} tag={tag} /> ))} </TagsPreview> - <SectionDivider /> </Fragment> ); } @@ -87,14 +85,3 @@ const LoadingContainer = styled('div')` padding-top: ${space(1)}; display: flex; `; - -const SectionDivider = styled('div')` - border-left: 1px solid ${p => p.theme.translucentBorder}; - display: flex; - align-items: center; - margin: ${space(1)}; - - @media (max-width: ${p => p.theme.breakpoints.small}) { - display: none; - } -`;
2dbe5785ac59c09b72d725c7e36e89deda74abdc
2023-07-20 02:08:44
Alberto Leal
fix(api): Fix MultipleChoiceField custom error message (#53184)
false
Fix MultipleChoiceField custom error message (#53184)
fix
diff --git a/src/sentry/api/fields/multiplechoice.py b/src/sentry/api/fields/multiplechoice.py index 5b150714748a24..39d41a6140da87 100644 --- a/src/sentry/api/fields/multiplechoice.py +++ b/src/sentry/api/fields/multiplechoice.py @@ -1,11 +1,11 @@ from rest_framework import serializers +ERROR_MESSAGES = { + "invalid_choice": ("Select a valid choice. {value} is not one of " "the available choices.") +} -class MultipleChoiceField(serializers.Field): - error_messages = { - "invalid_choice": ("Select a valid choice. {value} is not one of " "the available choices.") - } +class MultipleChoiceField(serializers.Field): def __init__(self, choices=None, *args, **kwargs): self.choices = set(choices or ()) super().__init__(*args, **kwargs) @@ -18,7 +18,7 @@ def to_internal_value(self, data): for item in data: if item not in self.choices: raise serializers.ValidationError( - self.error_messages["invalid_choice"].format(value=item) + ERROR_MESSAGES["invalid_choice"].format(value=item) ) return data raise serializers.ValidationError("Please provide a valid list.") diff --git a/tests/sentry/api/endpoints/test_api_tokens.py b/tests/sentry/api/endpoints/test_api_tokens.py index 0e0c0843a74890..95a6d522f521db 100644 --- a/tests/sentry/api/endpoints/test_api_tokens.py +++ b/tests/sentry/api/endpoints/test_api_tokens.py @@ -60,6 +60,20 @@ def test_never_cache(self): == "max-age=0, no-cache, no-store, must-revalidate, private" ) + def test_invalid_choice(self): + self.login_as(self.user) + url = reverse("sentry-api-0-api-tokens") + response = self.client.post( + url, + data={ + "scopes": [ + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + ] + }, + ) + assert response.status_code == 400 + assert not ApiToken.objects.filter(user=self.user).exists() + @control_silo_test(stable=True) class ApiTokensDeleteTest(APITestCase):
526b3a743cc0edf06732d1681a1681b375ba0148
2021-08-07 03:19:33
Alberto Leal
fix(spans): Indent last span of the span group chain (#27727)
false
Indent last span of the span group chain (#27727)
fix
diff --git a/static/app/components/events/interfaces/spans/spanBar.tsx b/static/app/components/events/interfaces/spans/spanBar.tsx index bee7a2f311042f..f703f386841807 100644 --- a/static/app/components/events/interfaces/spans/spanBar.tsx +++ b/static/app/components/events/interfaces/spans/spanBar.tsx @@ -118,7 +118,6 @@ type SpanBarProps = { | ((props: {orgSlug: string; eventSlug: string}) => void) | undefined; fetchEmbeddedChildrenState: FetchEmbeddedChildrenState; - hasCollapsedSpanGroup: boolean; toggleSpanGroup: (() => void) | undefined; }; @@ -310,7 +309,6 @@ class SpanBar extends React.Component<SpanBarProps, SpanBarState> { continuingTreeDepths, span, showSpanTree, - hasCollapsedSpanGroup, } = this.props; const spanID = getSpanID(span); @@ -366,31 +364,6 @@ class SpanBar extends React.Component<SpanBarProps, SpanBarState> { ); } - if (hasCollapsedSpanGroup) { - connectorBars.push( - <ConnectorBar - style={{ - right: '16px', - height: `${ROW_HEIGHT / 2}px`, - top: '0', - }} - key={`${spanID}-last-top`} - orphanBranch={false} - /> - ); - - return ( - <TreeConnector - isLast - hasToggler={hasToggler} - orphanBranch={isOrphanSpan(span)} - hasCollapsedSpanGroup - > - {connectorBars} - </TreeConnector> - ); - } - return ( <TreeConnector isLast={isLast} diff --git a/static/app/components/events/interfaces/spans/spanGroupBar.tsx b/static/app/components/events/interfaces/spans/spanGroupBar.tsx index 70c15c26f5d83b..95e22d97827c91 100644 --- a/static/app/components/events/interfaces/spans/spanGroupBar.tsx +++ b/static/app/components/events/interfaces/spans/spanGroupBar.tsx @@ -36,7 +36,7 @@ import * as DividerHandlerManager from './dividerHandlerManager'; import * as ScrollbarManager from './scrollbarManager'; import SpanBarCursorGuide from './spanBarCursorGuide'; import {MeasurementMarker} from './styles'; -import {EnhancedSpan, ProcessedSpanType, SpanGroupProps, TreeDepthType} from './types'; +import {EnhancedSpan, ProcessedSpanType, TreeDepthType} from './types'; import { getMeasurementBounds, getMeasurements, @@ -414,17 +414,4 @@ class SpanGroupBar extends React.Component<Props> { } } -export function isCollapsedSpanGroup({ - spanGrouping, - showSpanGroup, - toggleSpanGroup, -}: SpanGroupProps) { - return ( - Array.isArray(spanGrouping) && - spanGrouping.length !== 0 && - !showSpanGroup && - typeof toggleSpanGroup === 'function' - ); -} - export default SpanGroupBar; diff --git a/static/app/components/events/interfaces/spans/spanTree.tsx b/static/app/components/events/interfaces/spans/spanTree.tsx index 0dd9a4fa6c73d4..323ded6f31ce75 100644 --- a/static/app/components/events/interfaces/spans/spanTree.tsx +++ b/static/app/components/events/interfaces/spans/spanTree.tsx @@ -6,12 +6,11 @@ import {MessageRow} from 'app/components/performance/waterfall/messageRow'; import {pickBarColor} from 'app/components/performance/waterfall/utils'; import {t, tct} from 'app/locale'; import {Organization} from 'app/types'; -import {assert} from 'app/types/utils'; import {DragManagerChildrenProps} from './dragManager'; import {ScrollbarManagerChildrenProps, withScrollbarManager} from './scrollbarManager'; import SpanBar from './spanBar'; -import SpanGroupBar, {isCollapsedSpanGroup} from './spanGroupBar'; +import SpanGroupBar from './spanGroupBar'; import { EnhancedProcessedSpanType, EnhancedSpan, @@ -188,36 +187,13 @@ class SpanTree extends React.Component<PropType> { acc.spanTree.push(infoMessage); } - const {span} = payload; + const spanNumber = acc.spanNumber; + const {span, treeDepth, continuingTreeDepths} = payload; - let spanNumber = acc.spanNumber; - - const key = getSpanID(span, `span-${spanNumber}`); - const isLast = payload.isLastSibling; - const isRoot = type === 'root_span'; - const spanBarColor: string = pickBarColor(getSpanOperation(span)); - const numOfSpanChildren = payload.numOfSpanChildren; - const treeDepth = payload.treeDepth; - const continuingTreeDepths = payload.continuingTreeDepths; - - acc.numOfFilteredSpansAbove = 0; - acc.numOfSpansOutOfViewAbove = 0; - - const hasCollapsedSpanGroup: boolean = - (payload.type === 'span' || payload.type === 'root_span') && - isCollapsedSpanGroup({ - spanGrouping: payload.spanGrouping, - showSpanGroup: payload.showSpanGroup, - toggleSpanGroup: payload.toggleSpanGroup, - }); - - if (hasCollapsedSpanGroup) { - assert(payload.type === 'span' || payload.type === 'root_span'); - // If the span has a collapsed span group, then we render it above the associated span. - // The associated span will be the last span of the span group. + if (payload.type === 'span_group_chain') { acc.spanTree.push( <SpanGroupBar - key={`${key}-span-group`} + key={`${spanNumber}-span-group`} event={waterfallModel.event} span={span} generateBounds={generateBounds} @@ -228,15 +204,21 @@ class SpanTree extends React.Component<PropType> { toggleSpanGroup={payload.toggleSpanGroup as () => void} /> ); - - spanNumber = spanNumber + 1; + acc.spanNumber = spanNumber + 1; + return acc; } + const key = getSpanID(span, `span-${spanNumber}`); + const isLast = payload.isLastSibling; + const isRoot = type === 'root_span'; + const spanBarColor: string = pickBarColor(getSpanOperation(span)); + const numOfSpanChildren = payload.numOfSpanChildren; + + acc.numOfFilteredSpansAbove = 0; + acc.numOfSpansOutOfViewAbove = 0; + let toggleSpanGroup: (() => void) | undefined = undefined; - if ( - (payload.type === 'span' || payload.type === 'root_span') && - !payload.spanGrouping - ) { + if (payload.type === 'span') { toggleSpanGroup = payload.toggleSpanGroup; } @@ -261,7 +243,6 @@ class SpanTree extends React.Component<PropType> { showEmbeddedChildren={payload.showEmbeddedChildren} toggleEmbeddedChildren={payload.toggleEmbeddedChildren} fetchEmbeddedChildrenState={payload.fetchEmbeddedChildrenState} - hasCollapsedSpanGroup={hasCollapsedSpanGroup} toggleSpanGroup={toggleSpanGroup} /> ); diff --git a/static/app/components/events/interfaces/spans/spanTreeModel.tsx b/static/app/components/events/interfaces/spans/spanTreeModel.tsx index ff52e020b319ce..ccd3f04f2ab9aa 100644 --- a/static/app/components/events/interfaces/spans/spanTreeModel.tsx +++ b/static/app/components/events/interfaces/spans/spanTreeModel.tsx @@ -219,26 +219,29 @@ class SpanTreeModel { (spanGrouping === undefined || (Array.isArray(spanGrouping) && spanGrouping.length === 0)); - // For a collapsed span group chain to be useful, we prefer span groupings - // that are two or more spans. - // Since there is no concept of "backtracking" when constructing the span tree, - // we will need to reconstruct the tree depth information. This is only neccessary - // when the span group chain is hidden/collapsed. if ( isLastSpanOfGroup && Array.isArray(spanGrouping) && - spanGrouping.length === 1 && + spanGrouping.length >= 1 && !showSpanGroup ) { - const treeDepthEntryFoo = isOrphanSpan(spanGrouping[0].span) - ? ({type: 'orphan', depth: spanGrouping[0].treeDepth} as OrphanTreeDepth) - : spanGrouping[0].treeDepth; + // We always want to indent the last span of the span group chain + treeDepth = treeDepth + 1; - if (!spanGrouping[0].isLastSibling) { - continuingTreeDepths = [...continuingTreeDepths, treeDepthEntryFoo]; + // For a collapsed span group chain to be useful, we prefer span groupings + // that are two or more spans. + // Since there is no concept of "backtracking" when constructing the span tree, + // we will need to reconstruct the tree depth information. This is only neccessary + // when the span group chain is hidden/collapsed. + if (spanGrouping.length === 1) { + const treeDepthEntryFoo = isOrphanSpan(spanGrouping[0].span) + ? ({type: 'orphan', depth: spanGrouping[0].treeDepth} as OrphanTreeDepth) + : spanGrouping[0].treeDepth; + + if (!spanGrouping[0].isLastSibling) { + continuingTreeDepths = [...continuingTreeDepths, treeDepthEntryFoo]; + } } - - treeDepth = treeDepth + 1; } // Criteria for propagating information about the span group to the last span of the span group chain @@ -255,16 +258,12 @@ class SpanTreeModel { fetchEmbeddedChildrenState: this.fetchEmbeddedChildrenState, showEmbeddedChildren: this.showEmbeddedChildren, toggleEmbeddedChildren: this.toggleEmbeddedChildren, - spanGrouping: spanGroupingCriteria ? spanGrouping : undefined, toggleSpanGroup: - spanGroupingCriteria && toggleSpanGroup + spanGroupingCriteria && toggleSpanGroup && !showSpanGroup ? toggleSpanGroup : isFirstSpanOfGroup && this.showSpanGroup && !hideSpanTree ? this.toggleSpanGroup : undefined, - showSpanGroup: - (spanGroupingCriteria && toggleSpanGroup === undefined && this.showSpanGroup) || - (spanGroupingCriteria && toggleSpanGroup !== undefined && showSpanGroup), }; const treeDepthEntry = isOrphanSpan(this.span) @@ -367,11 +366,36 @@ class SpanTreeModel { return [...descendants]; } + if ( + isLastSpanOfGroup && + Array.isArray(spanGrouping) && + spanGrouping.length > 1 && + !showSpanGroup && + wrappedSpan.type === 'span' + ) { + const spanGroupChain: EnhancedProcessedSpanType = { + type: 'span_group_chain', + span: this.span, + treeDepth: treeDepth - 1, + continuingTreeDepths, + spanGrouping, + showSpanGroup, + toggleSpanGroup: wrappedSpan.toggleSpanGroup, + }; + + return [ + spanGroupChain, + {...wrappedSpan, toggleSpanGroup: undefined}, + ...descendants, + ]; + } + if ( isFirstSpanOfGroup && this.showSpanGroup && !hideSpanTree && - descendants.length <= 1 + descendants.length <= 1 && + wrappedSpan.type === 'span' ) { // If we know the descendants will be one span or less, we remove the "regroup" feature (therefore hide it) // by setting toggleSpanGroup to be undefined for the first span of the group chain. diff --git a/static/app/components/events/interfaces/spans/types.tsx b/static/app/components/events/interfaces/spans/types.tsx index 0d348569cfaf9c..185e0389b112e8 100644 --- a/static/app/components/events/interfaces/spans/types.tsx +++ b/static/app/components/events/interfaces/spans/types.tsx @@ -71,13 +71,12 @@ export type EnhancedSpan = | ({ type: 'root_span'; span: SpanType; - } & CommonEnhancedProcessedSpanType & - SpanGroupProps) + } & CommonEnhancedProcessedSpanType) | ({ type: 'span'; span: SpanType; - } & CommonEnhancedProcessedSpanType & - SpanGroupProps); + toggleSpanGroup: (() => void) | undefined; + } & CommonEnhancedProcessedSpanType); // ProcessedSpanType with additional information export type EnhancedProcessedSpanType = @@ -93,7 +92,13 @@ export type EnhancedProcessedSpanType = | { type: 'out_of_view'; span: SpanType; - }; + } + | ({ + type: 'span_group_chain'; + span: SpanType; + treeDepth: number; + continuingTreeDepths: Array<TreeDepthType>; + } & SpanGroupProps); export type SpanEntry = { type: 'spans'; diff --git a/static/app/components/performance/waterfall/treeConnector.tsx b/static/app/components/performance/waterfall/treeConnector.tsx index 48e64491114713..2610201dec354c 100644 --- a/static/app/components/performance/waterfall/treeConnector.tsx +++ b/static/app/components/performance/waterfall/treeConnector.tsx @@ -22,17 +22,12 @@ export const ConnectorBar = styled('div')<{orphanBranch: boolean}>` type TogglerTypes = OmitHtmlDivProps<{ hasToggler?: boolean; isLast?: boolean; - hasCollapsedSpanGroup?: boolean; }>; export const TreeConnector = styled('div')<TogglerTypes & {orphanBranch: boolean}>` height: ${p => (p.isLast ? ROW_HEIGHT / 2 : ROW_HEIGHT)}px; width: 100%; border-left: ${p => { - if (p.hasCollapsedSpanGroup) { - return '1px solid transparent'; - } - return `1px ${p.orphanBranch ? 'dashed' : 'solid'} ${p.theme.border}`; }}; position: absolute; @@ -43,11 +38,8 @@ export const TreeConnector = styled('div')<TogglerTypes & {orphanBranch: boolean height: 1px; border-bottom: ${p => `1px ${p.orphanBranch ? 'dashed' : 'solid'} ${p.theme.border};`}; - left: ${p => (p.hasCollapsedSpanGroup ? `${TOGGLE_BORDER_BOX / 2}px` : '0')}; - width: ${p => - p.hasCollapsedSpanGroup - ? `${TREE_TOGGLE_CONTAINER_WIDTH - TOGGLE_BORDER_BOX / 2 - 2}px` - : '100%'}; + left: 0; + width: 100%; position: absolute; bottom: ${p => (p.isLast ? '0' : '50%')}; } diff --git a/tests/js/spec/components/events/interfaces/spans/spanTreeModel.spec.tsx b/tests/js/spec/components/events/interfaces/spans/spanTreeModel.spec.tsx index 6c4ebe771aa23b..a322ca65c24bab 100644 --- a/tests/js/spec/components/events/interfaces/spans/spanTreeModel.spec.tsx +++ b/tests/js/spec/components/events/interfaces/spans/spanTreeModel.spec.tsx @@ -220,8 +220,6 @@ describe('SpanTreeModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -251,8 +249,6 @@ describe('SpanTreeModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -282,8 +278,6 @@ describe('SpanTreeModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -309,8 +303,6 @@ describe('SpanTreeModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, ]; @@ -400,8 +392,6 @@ describe('SpanTreeModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -424,8 +414,6 @@ describe('SpanTreeModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, } ); diff --git a/tests/js/spec/components/events/interfaces/spans/waterfallModel.spec.tsx b/tests/js/spec/components/events/interfaces/spans/waterfallModel.spec.tsx index f4e4dc0e31f98e..c0f183c28431bc 100644 --- a/tests/js/spec/components/events/interfaces/spans/waterfallModel.spec.tsx +++ b/tests/js/spec/components/events/interfaces/spans/waterfallModel.spec.tsx @@ -115,9 +115,6 @@ describe('WaterfallModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, - toggleSpanGroup: undefined, }, { type: 'span', @@ -140,8 +137,6 @@ describe('WaterfallModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -182,8 +177,6 @@ describe('WaterfallModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -209,8 +202,6 @@ describe('WaterfallModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -253,8 +244,6 @@ describe('WaterfallModel', () => { showEmbeddedChildren: false, toggleEmbeddedChildren: expect.any(Function), fetchEmbeddedChildrenState: 'idle', - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, ]; @@ -515,8 +504,6 @@ describe('WaterfallModel', () => { { ...fullWaterfall[0], numOfSpanChildren: 0, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, ]); @@ -544,16 +531,12 @@ describe('WaterfallModel', () => { { ...fullWaterfall[0], numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { ...fullWaterfall[1], isLastSibling: true, numOfSpanChildren: 0, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, ]); @@ -589,8 +572,6 @@ describe('WaterfallModel', () => { ...fullWaterfall[0], treeDepth: 0, numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -598,8 +579,6 @@ describe('WaterfallModel', () => { treeDepth: 1, isLastSibling: true, numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -612,8 +591,6 @@ describe('WaterfallModel', () => { treeDepth: 2, isLastSibling: true, numOfSpanChildren: 0, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, ]); @@ -649,33 +626,29 @@ describe('WaterfallModel', () => { }); // expect 1 or more spans are grouped - expect(spans).toHaveLength(2); + expect(spans).toHaveLength(3); + assert(fullWaterfall[1].type === 'span'); const collapsedWaterfallExpected = [ { ...fullWaterfall[0], numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { - ...fullWaterfall[1], + type: 'span_group_chain', + treeDepth: 1, + continuingTreeDepths: fullWaterfall[1].continuingTreeDepths, span: { ...fullWaterfall[1].span, parent_span_id: 'foo', span_id: 'bar', }, - isLastSibling: true, - numOfSpanChildren: 0, - treeDepth: 1, spanGrouping: [ { ...fullWaterfall[1], isLastSibling: true, numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -687,14 +660,24 @@ describe('WaterfallModel', () => { }, isLastSibling: true, numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, ], showSpanGroup: false, toggleSpanGroup: expect.any(Function), }, + { + ...fullWaterfall[1], + span: { + ...fullWaterfall[1].span, + parent_span_id: 'foo', + span_id: 'bar', + }, + isLastSibling: true, + numOfSpanChildren: 0, + treeDepth: 2, + toggleSpanGroup: undefined, + }, ]; expect(spans).toEqual(collapsedWaterfallExpected); @@ -716,8 +699,6 @@ describe('WaterfallModel', () => { ...fullWaterfall[0], numOfSpanChildren: 1, treeDepth: 0, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -725,8 +706,6 @@ describe('WaterfallModel', () => { isLastSibling: true, numOfSpanChildren: 1, treeDepth: 1, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: expect.any(Function), }, { @@ -739,8 +718,6 @@ describe('WaterfallModel', () => { isLastSibling: true, numOfSpanChildren: 1, treeDepth: 2, - spanGrouping: undefined, - showSpanGroup: false, toggleSpanGroup: undefined, }, { @@ -753,32 +730,7 @@ describe('WaterfallModel', () => { isLastSibling: true, numOfSpanChildren: 0, treeDepth: 3, - spanGrouping: [ - { - ...fullWaterfall[1], - isLastSibling: true, - numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, - toggleSpanGroup: expect.any(Function), - }, - { - ...fullWaterfall[1], - span: { - ...fullWaterfall[1].span, - parent_span_id: event.entries[0].data[0].span_id, - span_id: 'foo', - }, - treeDepth: 2, - isLastSibling: true, - numOfSpanChildren: 1, - spanGrouping: undefined, - showSpanGroup: false, - toggleSpanGroup: undefined, - }, - ], - showSpanGroup: true, - toggleSpanGroup: expect.any(Function), + toggleSpanGroup: undefined, }, ]); @@ -791,7 +743,7 @@ describe('WaterfallModel', () => { viewEnd: 1, }); - expect(spans).toHaveLength(2); + expect(spans).toHaveLength(3); expect(spans).toEqual(collapsedWaterfallExpected); }); });
b02d1c0299a135a11fbc0111dfd8f943bffc3518
2021-06-29 23:08:45
Chris Fuller
feat(workflow): Adding Release Adoption Labels (#26893)
false
Adding Release Adoption Labels (#26893)
feat
diff --git a/src/sentry/api/endpoints/organization_release_details.py b/src/sentry/api/endpoints/organization_release_details.py index 527ca0db99f36e..1bff7d78a9a850 100644 --- a/src/sentry/api/endpoints/organization_release_details.py +++ b/src/sentry/api/endpoints/organization_release_details.py @@ -422,7 +422,7 @@ def get(self, request, organization, version): return Response({"detail": "invalid sort"}, status=400) with_adoption_stages = with_adoption_stages and features.has( - "organizations:release-adoption-stage", organization + "organizations:release-adoption-stage", organization, actor=request.user ) return Response( diff --git a/src/sentry/api/endpoints/organization_releases.py b/src/sentry/api/endpoints/organization_releases.py index 6f798d5b99cdc3..ee0791e406cc95 100644 --- a/src/sentry/api/endpoints/organization_releases.py +++ b/src/sentry/api/endpoints/organization_releases.py @@ -268,7 +268,7 @@ def get(self, request, organization): queryset = add_date_filter_to_queryset(queryset, filter_params) with_adoption_stages = with_adoption_stages and features.has( - "organizations:release-adoption-stage", organization + "organizations:release-adoption-stage", organization, actor=request.user ) return self.paginate( diff --git a/static/app/types/index.tsx b/static/app/types/index.tsx index 8b12adb39ab8d1..87cfd9d71614ee 100644 --- a/static/app/types/index.tsx +++ b/static/app/types/index.tsx @@ -1468,6 +1468,7 @@ type ReleaseData = { firstReleaseVersion: string | null; lastReleaseVersion: string | null; }; + adoptionStages?: {}; }; type BaseRelease = { diff --git a/static/app/views/releases/list/index.tsx b/static/app/views/releases/list/index.tsx index c02ea1e445a032..ddf0bc4eaa55de 100644 --- a/static/app/views/releases/list/index.tsx +++ b/static/app/views/releases/list/index.tsx @@ -80,6 +80,7 @@ class ReleasesList extends AsyncView<Props, State> { summaryStatsPeriod: statsPeriod, per_page: 20, flatten: activeSort === SortOption.DATE ? 0 : 1, + adoptionStages: 1, status: activeStatus === StatusOption.ARCHIVED ? ReleaseStatus.Archived diff --git a/static/app/views/releases/list/releaseHealth/content.tsx b/static/app/views/releases/list/releaseHealth/content.tsx index 2cc1fb57742467..d8b9995c495aaf 100644 --- a/static/app/views/releases/list/releaseHealth/content.tsx +++ b/static/app/views/releases/list/releaseHealth/content.tsx @@ -38,10 +38,12 @@ type Props = { showPlaceholders: boolean; isTopRelease: boolean; getHealthData: ReleaseHealthRequestRenderProps['getHealthData']; + adoptionStages?: Record<string, {stage: string; unadopted: string; adopted: string}>; }; const Content = ({ projects, + adoptionStages, releaseVersion, location, organization, @@ -50,10 +52,16 @@ const Content = ({ isTopRelease, getHealthData, }: Props) => { + const adoption_map = { + not_adopted: 'Not Adopted', + adopted: 'Adopted', + replaced: 'Replaced', + }; + const hasAdoptionStages: boolean = adoptionStages !== undefined; return ( <Fragment> <Header> - <Layout> + <Layout hasAdoptionStages={hasAdoptionStages}> <Column>{t('Project Name')}</Column> <AdoptionColumn> <GuideAnchor @@ -64,6 +72,7 @@ const Content = ({ {t('Adoption')} </GuideAnchor> </AdoptionColumn> + {adoptionStages && <Column>{t('Status')}</Column>} <CrashFreeRateColumn>{t('Crash Free Rate')}</CrashFreeRateColumn> <CountColumn> <span>{t('Count')}</span> @@ -127,7 +136,7 @@ const Content = ({ return ( <ProjectRow key={`${releaseVersion}-${slug}-health`}> - <Layout> + <Layout hasAdoptionStages={hasAdoptionStages}> <Column> <ProjectBadge project={project} avatarSize={16} /> </Column> @@ -150,6 +159,16 @@ const Content = ({ )} </AdoptionColumn> + {adoptionStages && ( + <Column> + {adoptionStages[project.slug] ? ( + adoption_map[adoptionStages[project.slug].stage] + ) : ( + <NotAvailable /> + )} + </Column> + )} + <CrashFreeRateColumn> {showPlaceholders ? ( <StyledPlaceholder width="60px" /> @@ -274,23 +293,52 @@ const ProjectRow = styled(PanelItem)` } `; -const Layout = styled('div')` +const Layout = styled('div')<{hasAdoptionStages?: boolean}>` display: grid; - grid-template-columns: 1fr 1.4fr 0.6fr 0.7fr; + ${p => + p.hasAdoptionStages + ? ` + grid-template-columns: 1fr 1.4fr 0.5fr 0.6fr 0.7fr; + ` + : ` + grid-template-columns: 1fr 1.4fr 0.6fr 0.7fr; + `} + grid-column-gap: ${space(1)}; align-items: center; width: 100%; @media (min-width: ${p => p.theme.breakpoints[0]}) { - grid-template-columns: 1fr 1fr 1fr 0.5fr 0.5fr 0.5fr; + ${p => + p.hasAdoptionStages + ? ` + grid-template-columns: 1fr 1fr 0.5fr 1fr 0.5fr 0.5fr 0.5fr; + ` + : ` + grid-template-columns: 1fr 1fr 1fr 0.5fr 0.5fr 0.5fr; + `} } @media (min-width: ${p => p.theme.breakpoints[1]}) { - grid-template-columns: 1fr 0.8fr 1fr 0.5fr 0.5fr 0.6fr; + ${p => + p.hasAdoptionStages + ? ` + grid-template-columns: 1fr 0.8fr 0.5fr 1fr 0.5fr 0.5fr 0.6fr; + ` + : ` + grid-template-columns: 1fr 0.8fr 1fr 0.5fr 0.5fr 0.6fr; + `} } @media (min-width: ${p => p.theme.breakpoints[3]}) { - grid-template-columns: 1fr 0.8fr 1fr 1fr 0.5fr 0.5fr 0.5fr; + ${p => + p.hasAdoptionStages + ? ` + grid-template-columns: 1fr 0.8fr 0.5fr 1fr 1fr 0.5fr 0.5fr 0.5fr; + ` + : ` + grid-template-columns: 1fr 0.8fr 1fr 1fr 0.5fr 0.5fr 0.5fr; + `} } `; diff --git a/static/app/views/releases/list/releaseHealth/index.tsx b/static/app/views/releases/list/releaseHealth/index.tsx index b97b652a9fd860..3b1208f27066e9 100644 --- a/static/app/views/releases/list/releaseHealth/index.tsx +++ b/static/app/views/releases/list/releaseHealth/index.tsx @@ -76,6 +76,7 @@ class ReleaseHealth extends Component<Props> { organization={organization} activeDisplay={activeDisplay} releaseVersion={release.version} + adoptionStages={release.adoptionStages} projects={projectsToShow} location={location} showPlaceholders={showPlaceholders}
099638a9250bcac463b4d0af51517da0000ed480
2021-04-15 22:37:05
Billy Vong
build(ci): Use webpack development mode for acceptance tests (#25265)
false
Use webpack development mode for acceptance tests (#25265)
build
diff --git a/package.json b/package.json index 4a4963045db20f..148a6678de1ca7 100644 --- a/package.json +++ b/package.json @@ -221,7 +221,7 @@ "watch-api-docs": "sane 'yarn build-derefed-docs' api-docs", "build-css": "NODE_ENV=production yarn webpack --config=config/webpack.css.config.js", "build-chartcuterie-config": "NODE_ENV=production yarn webpack --config=config/webpack.chartcuterie.config.js", - "build-acceptance": "IS_ACCEPTANCE_TEST=1 yarn build-production", + "build-acceptance": "IS_ACCEPTANCE_TEST=1 NODE_ENV=production yarn webpack --mode development", "build-production": "NODE_ENV=production yarn webpack --mode production", "build": "yarn build-production --output-path=public", "validate-api-examples": "yarn install-api-docs && cd api-docs && yarn openapi-examples-validator ./openapi.json --no-additional-properties"
c00c1b2955778f0fe1513ea1d7b37aaa943758b3
2024-01-25 03:13:58
Michelle Zhang
fix(feedback): account for 'other' platform in replay section (#63784)
false
account for 'other' platform in replay section (#63784)
fix
diff --git a/static/app/components/feedback/feedbackItem/feedbackReplay.tsx b/static/app/components/feedback/feedbackItem/feedbackReplay.tsx index e792515e578faf..35d6764ac8becc 100644 --- a/static/app/components/feedback/feedbackItem/feedbackReplay.tsx +++ b/static/app/components/feedback/feedbackItem/feedbackReplay.tsx @@ -28,7 +28,7 @@ export default function FeedbackReplay({eventData, feedbackItem, organization}: useHaveSelectedProjectsSentAnyReplayEvents(); const platformSupported = replayPlatforms.includes(feedbackItem.platform); - if (!platformSupported) { + if (!platformSupported && !(feedbackItem.platform === 'other')) { return ( <ReplayUnsupportedAlert primaryAction="create"
ebec8a78981e06572a5cbf7e1ae4753d5e9f19c9
2019-02-20 04:56:00
Dan Fuller
fix(api): Fix has:user queries in search
false
Fix has:user queries in search
fix
diff --git a/src/sentry/utils/snuba.py b/src/sentry/utils/snuba.py index 3a4f102ef4a260..b424da8b7c8e93 100644 --- a/src/sentry/utils/snuba.py +++ b/src/sentry/utils/snuba.py @@ -106,6 +106,7 @@ 'contexts.value': 'contexts.value', # misc 'release': 'tags[sentry:release]', + 'user': 'sentry:user', }
5924f07a6add5bf330f1d00290cfbcff95f2ece4
2022-02-03 02:08:23
Kev
feat(anomalies): Add anomalies tab backed by local storage (#31400)
false
Add anomalies tab backed by local storage (#31400)
feat
diff --git a/static/app/routes.tsx b/static/app/routes.tsx index 3e9a48058cb11f..b3440110c8563c 100644 --- a/static/app/routes.tsx +++ b/static/app/routes.tsx @@ -1263,6 +1263,13 @@ function buildRoutes() { } component={SafeLazyLoad} /> + <Route + path="anomalies/" + componentPromise={() => + import('sentry/views/performance/transactionSummary/transactionAnomalies') + } + component={SafeLazyLoad} + /> <Route path="spans/"> <IndexRoute componentPromise={() => diff --git a/static/app/utils/performance/anomalies/anomaliesQuery.tsx b/static/app/utils/performance/anomalies/anomaliesQuery.tsx new file mode 100644 index 00000000000000..dada882e5fad76 --- /dev/null +++ b/static/app/utils/performance/anomalies/anomaliesQuery.tsx @@ -0,0 +1,98 @@ +import {EventsStatsData} from 'sentry/types'; +import { + DiscoverQueryProps, + GenericChildrenProps, +} from 'sentry/utils/discover/genericDiscoverQuery'; +import localStorage from 'sentry/utils/localStorage'; +import withApi from 'sentry/utils/withApi'; + +const transformedAnomalyDevKey = 'dev.anomalyPayload.transformed'; + +type AnomaliesProps = {}; +type RequestProps = DiscoverQueryProps & AnomaliesProps; + +export type ChildrenProps = Omit<GenericChildrenProps<AnomaliesProps>, 'tableData'> & { + data: AnomalyPayload | null; +}; + +type Props = RequestProps & { + children: (props: ChildrenProps) => React.ReactNode; +}; + +type AnomalyConfidence = 'high' | 'low'; + +// Should match events stats data in format. +type AnomalyStatsData = { + data: EventsStatsData; + start?: number; + end?: number; +}; + +export type AnomalyInfo = { + confidence: AnomalyConfidence; + start: number; + end: number; + id: string; + expected: number; + received: number; +}; + +export type AnomalyPayload = { + y: AnomalyStatsData; + yhat_upper: AnomalyStatsData; + yhat_lower: AnomalyStatsData; + anomalies: AnomalyInfo[]; // Anomaly info describes what the anomaly service determines is an 'anomaly area'. +}; + +function transformStatsTimes(stats: AnomalyStatsData) { + stats.data.forEach(d => (d[0] = d[0] * 1000)); + stats.data = stats.data.slice((stats.data.length * 4) / 6, stats.data.length); + return stats; +} +function transformAnomaliesTimes(anoms: AnomalyInfo[]) { + anoms.forEach(a => { + a.start = a.start * 1000; + a.end = a.end * 1000; + }); + return anoms; +} + +/** + * All this code is temporary while in development so a local dev env isn't required. + * TODO(k-fish): Remove this after EA. + */ +function getLocalPayload(): AnomalyPayload | null { + const rawTransformed = localStorage.getItem(transformedAnomalyDevKey); + if (rawTransformed) { + const transformedData: AnomalyPayload = JSON.parse(rawTransformed || '{}'); + + if (transformedData) { + transformedData.y = transformStatsTimes(transformedData.y); + transformedData.yhat_upper = transformStatsTimes(transformedData.yhat_upper); + transformedData.yhat_lower = transformStatsTimes(transformedData.yhat_lower); + transformedData.anomalies = transformAnomaliesTimes(transformedData.anomalies); + return transformedData; + } + } + + localStorage.setItem(transformedAnomalyDevKey, ''); // Set the key so it shows up automatically if this feature is enabled. + + return null; +} + +function AnomaliesSeriesQuery(props: Props) { + const data = getLocalPayload(); // TODO(k-fish): Replace with api request when service is enabled. + + return ( + <div> + {props.children({ + data, + isLoading: false, + error: null, + pageLinks: null, + })} + </div> + ); +} + +export default withApi(AnomaliesSeriesQuery); diff --git a/static/app/views/performance/transactionSummary/header.tsx b/static/app/views/performance/transactionSummary/header.tsx index e870ea48d43174..97f6bd8c272cac 100644 --- a/static/app/views/performance/transactionSummary/header.tsx +++ b/static/app/views/performance/transactionSummary/header.tsx @@ -22,6 +22,7 @@ import Breadcrumb from 'sentry/views/performance/breadcrumb'; import {getCurrentLandingDisplay, LandingDisplayField} from '../landing/utils'; import {MetricsSwitch} from '../metricsSwitch'; +import {anomaliesRouteWithQuery} from './transactionAnomalies/utils'; import {eventsRouteWithQuery} from './transactionEvents/utils'; import {spansRouteWithQuery} from './transactionSpans/utils'; import {tagsRouteWithQuery} from './transactionTags/utils'; @@ -54,6 +55,10 @@ const TAB_ANALYTICS: Partial<Record<Tab, AnalyticInfo>> = { eventKey: 'performance_views.spans.spans_tab_clicked', eventName: 'Performance Views: Spans tab clicked', }, + [Tab.Anomalies]: { + eventKey: 'performance_views.anomalies.anomalies_tab_clicked', + eventName: 'Performance Views: Anomalies tab clicked', + }, }; type Props = { @@ -238,6 +243,7 @@ class TransactionHeader extends React.Component<Props> { const tagsTarget = tagsRouteWithQuery(routeQuery); const eventsTarget = eventsRouteWithQuery(routeQuery); const spansTarget = spansRouteWithQuery(routeQuery); + const anomaliesTarget = anomaliesRouteWithQuery(routeQuery); return ( <Layout.Header> @@ -302,6 +308,20 @@ class TransactionHeader extends React.Component<Props> { <FeatureBadge type="new" noTooltip /> </ListLink> </Feature> + <Feature + organization={organization} + features={['organizations:performance-anomaly-detection-ui']} + > + <ListLink + data-test-id="anomalies-tab" + to={anomaliesTarget} + isActive={() => currentTab === Tab.Anomalies} + onClick={this.trackTabClick(Tab.Anomalies)} + > + {t('Anomalies')} + <FeatureBadge type="alpha" noTooltip /> + </ListLink> + </Feature> </StyledNavTabs> </React.Fragment> </Layout.Header> diff --git a/static/app/views/performance/transactionSummary/tabs.tsx b/static/app/views/performance/transactionSummary/tabs.tsx index f0bcb714bd56b8..e74a26d6ba0c4c 100644 --- a/static/app/views/performance/transactionSummary/tabs.tsx +++ b/static/app/views/performance/transactionSummary/tabs.tsx @@ -4,6 +4,7 @@ enum Tab { Tags, Events, Spans, + Anomalies, } export default Tab; diff --git a/static/app/views/performance/transactionSummary/transactionAnomalies/anomaliesTable.tsx b/static/app/views/performance/transactionSummary/transactionAnomalies/anomaliesTable.tsx new file mode 100644 index 00000000000000..c40d58fbf97571 --- /dev/null +++ b/static/app/views/performance/transactionSummary/transactionAnomalies/anomaliesTable.tsx @@ -0,0 +1,154 @@ +import {ReactNode} from 'react'; +import styled from '@emotion/styled'; +import {Location} from 'history'; + +import GridEditable, { + COL_WIDTH_UNDEFINED, + GridColumnOrder, +} from 'sentry/components/gridEditable'; +import SortLink from 'sentry/components/gridEditable/sortLink'; +import {t} from 'sentry/locale'; +import {Organization} from 'sentry/types'; +import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers'; +import {ColumnType, fieldAlignment} from 'sentry/utils/discover/fields'; +import {AnomalyInfo} from 'sentry/utils/performance/anomalies/anomaliesQuery'; + +type Props = { + anomalies?: AnomalyInfo[]; + location: Location; + organization: Organization; + isLoading: boolean; +}; + +const transformRow = (anom: AnomalyInfo): TableDataRowWithExtras => { + return { + anomaly: `#${anom.id}`, + confidence: anom.confidence, + timestamp: new Date(anom.start), + timeInterval: anom.end - anom.start, + expected: anom.expected, + received: anom.received, + }; +}; + +export default function AnomaliesTable(props: Props) { + const {location, organization, isLoading, anomalies} = props; + + const data: TableDataRowWithExtras[] = anomalies?.map(transformRow) || []; + + return ( + <GridEditable + isLoading={isLoading} + data={data} + columnOrder={Object.values(COLUMNS)} + columnSortBy={[]} + grid={{ + renderHeadCell, + renderBodyCell: renderBodyCellWithMeta(location, organization), + }} + location={location} + /> + ); +} + +function renderHeadCell(column: TableColumn, _index: number): ReactNode { + const align = fieldAlignment(column.key, COLUMN_TYPE[column.key]); + return ( + <SortLink + title={column.name} + align={align} + direction={undefined} + canSort={false} + generateSortLink={() => undefined} + /> + ); +} + +function renderBodyCellWithMeta(location: Location, organization: Organization) { + return (column: TableColumn, dataRow: TableDataRowWithExtras): React.ReactNode => { + const fieldRenderer = getFieldRenderer(column.key, COLUMN_TYPE); + + if (column.key === 'confidence') { + return ( + <ConfidenceCell> + {dataRow.confidence === 'low' ? ( + <LowConfidence>{t('Low Confidence')}</LowConfidence> + ) : ( + <HighConfidence>{t('High Confidence')}</HighConfidence> + )} + </ConfidenceCell> + ); + } + + return fieldRenderer(dataRow, {location, organization}); + }; +} + +const LowConfidence = styled('div')` + color: ${p => p.theme.yellow300}; +`; +const HighConfidence = styled('div')` + color: ${p => p.theme.red300}; +`; + +const ConfidenceCell = styled('div')` + text-align: left; + justify-self: flex-end; + flex-grow: 1; +`; + +type TableColumnKey = + | 'anomaly' + | 'confidence' + | 'timeInterval' + | 'timestamp' + | 'expected' + | 'received'; + +type TableColumn = GridColumnOrder<TableColumnKey>; + +type TableDataRow = Record<TableColumnKey, any>; + +type TableDataRowWithExtras = TableDataRow & {}; + +const COLUMNS: Record<TableColumnKey, TableColumn> = { + anomaly: { + key: 'anomaly', + name: t('Anomaly'), + width: COL_WIDTH_UNDEFINED, + }, + confidence: { + key: 'confidence', + name: t('Confidence'), + width: COL_WIDTH_UNDEFINED, + }, + timeInterval: { + key: 'timeInterval', + name: t('Time Interval'), + width: COL_WIDTH_UNDEFINED, + }, + timestamp: { + key: 'timestamp', + name: t('Timestamp'), + width: COL_WIDTH_UNDEFINED, + }, + expected: { + key: 'expected', + name: t('Expected'), + width: COL_WIDTH_UNDEFINED, + }, + received: { + key: 'received', + name: t('Received'), + width: COL_WIDTH_UNDEFINED, + }, +}; + +const COLUMN_TYPE: Record<TableColumnKey, ColumnType> = { + anomaly: 'string', + confidence: 'string', + timeInterval: 'duration', + timestamp: 'date', + expected: 'number', + received: 'number', +}; diff --git a/static/app/views/performance/transactionSummary/transactionAnomalies/anomalyChart.tsx b/static/app/views/performance/transactionSummary/transactionAnomalies/anomalyChart.tsx new file mode 100644 index 00000000000000..1a59d1a2b87d15 --- /dev/null +++ b/static/app/views/performance/transactionSummary/transactionAnomalies/anomalyChart.tsx @@ -0,0 +1,77 @@ +import {InjectedRouter, withRouter} from 'react-router'; +import {Location} from 'history'; + +import ChartZoom from 'sentry/components/charts/chartZoom'; +import LineChart from 'sentry/components/charts/lineChart'; +import {normalizeDateTimeParams} from 'sentry/components/organizations/pageFilters/parse'; +import {t} from 'sentry/locale'; +import {DateString} from 'sentry/types'; +import {Series} from 'sentry/types/echarts'; +import {getUtcToLocalDateObject} from 'sentry/utils/dates'; +import {axisLabelFormatter, tooltipFormatter} from 'sentry/utils/discover/charts'; + +type Props = { + data: Series[]; + statsPeriod: string | undefined; + start: DateString; + end: DateString; + height?: number; + location: Location; + router: InjectedRouter; +}; + +const _AnomalyChart = (props: Props) => { + const { + data, + location, + statsPeriod, + height, + router, + start: propsStart, + end: propsEnd, + } = props; + + const start = propsStart ? getUtcToLocalDateObject(propsStart) : null; + const end = propsEnd ? getUtcToLocalDateObject(propsEnd) : null; + const {utc} = normalizeDateTimeParams(location.query); + + const legend = { + right: 10, + top: 5, + data: [t('High Confidence'), t('Low Confidence')], + }; + + const chartOptions = { + seriesOptions: { + showSymbol: false, + }, + height, + tooltip: { + trigger: 'axis' as const, + valueFormatter: tooltipFormatter, + }, + xAxis: undefined, + yAxis: { + axisLabel: { + // p50() coerces the axis to be time based + formatter: (value: number) => axisLabelFormatter(value, 'p50()'), + }, + }, + }; + + return ( + <ChartZoom + router={router} + period={statsPeriod} + start={start} + end={end} + utc={utc === 'true'} + > + {zoomRenderProps => ( + <LineChart {...zoomRenderProps} series={data} legend={legend} {...chartOptions} /> + )} + </ChartZoom> + ); +}; + +export const AnomalyChart = withRouter(_AnomalyChart); diff --git a/static/app/views/performance/transactionSummary/transactionAnomalies/content.tsx b/static/app/views/performance/transactionSummary/transactionAnomalies/content.tsx new file mode 100644 index 00000000000000..3406d35a2b78d0 --- /dev/null +++ b/static/app/views/performance/transactionSummary/transactionAnomalies/content.tsx @@ -0,0 +1,267 @@ +import {useMemo} from 'react'; +import styled from '@emotion/styled'; +import {Location} from 'history'; +import pick from 'lodash/pick'; + +import MarkArea from 'sentry/components/charts/components/markArea'; +import MarkLine from 'sentry/components/charts/components/markLine'; +import {LineChartSeries} from 'sentry/components/charts/lineChart'; +import * as Layout from 'sentry/components/layouts/thirds'; +import {t} from 'sentry/locale'; +import space from 'sentry/styles/space'; +import {Organization} from 'sentry/types'; +import EventView from 'sentry/utils/discover/eventView'; +import AnomaliesQuery, { + AnomalyInfo, + AnomalyPayload, +} from 'sentry/utils/performance/anomalies/anomaliesQuery'; +import theme from 'sentry/utils/theme'; +import _DurationChart from 'sentry/views/performance/charts/chart'; + +import {GenericPerformanceWidget} from '../../landing/widgets/components/performanceWidget'; +import {WidgetEmptyStateWarning} from '../../landing/widgets/components/selectableList'; +import {QueryDefinition, WidgetDataResult} from '../../landing/widgets/types'; +import { + PerformanceWidgetSetting, + WIDGET_DEFINITIONS, +} from '../../landing/widgets/widgetDefinitions'; +import {SetStateAction} from '../types'; + +import AnomaliesTable from './anomaliesTable'; +import {AnomalyChart} from './anomalyChart'; + +type Props = { + location: Location; + organization: Organization; + eventView: EventView; + projectId: string; + setError: SetStateAction<string | undefined>; + transactionName: string; +}; + +const anomalyAreaName = (anomaly: AnomalyInfo) => `#${anomaly.id}`; +const transformAnomalyToArea = ( + anomaly: AnomalyInfo +): [{name: string; xAxis: number}, {xAxis: number}] => [ + {name: anomalyAreaName(anomaly), xAxis: anomaly.start}, + {xAxis: anomaly.end}, +]; + +const transformAnomalyData = (_: any, results: {data: AnomalyPayload}) => { + const data: LineChartSeries[] = []; + const resultData = results.data; + + if (!resultData) { + return { + isLoading: false, + isErrored: false, + data: undefined, + hasData: false, + loading: false, + }; + } + + data.push({ + seriesName: 'tpm()', + data: resultData.y.data.map(([name, [{count}]]) => ({ + name, + value: count, + })), + }); + data.push({ + seriesName: 'tpm() lower bound', + data: resultData.yhat_lower.data.map(([name, [{count}]]) => ({ + name, + value: count, + })), + }); + data.push({ + seriesName: 'tpm() upper bound', + data: resultData.yhat_upper.data.map(([name, [{count}]]) => ({ + name, + value: count, + })), + }); + + const anomalies = results.data.anomalies; + const highConfidenceAreas = anomalies + .filter(a => a.confidence === 'high') + .map(transformAnomalyToArea); + const highConfidenceLines = anomalies + .filter(a => a.confidence === 'high') + .map(area => ({xAxis: area.start, name: anomalyAreaName(area)})); + + const lowConfidenceAreas = anomalies + .filter(a => a.confidence === 'low') + .map(transformAnomalyToArea); + const lowConfidenceLines = anomalies + .filter(a => a.confidence === 'low') + .map(area => ({xAxis: area.start, name: anomalyAreaName(area)})); + + data.push({ + seriesName: 'High Confidence', + color: theme.red300, + data: [], + silent: true, + markLine: MarkLine({ + animation: false, + lineStyle: {color: theme.red300, type: 'solid', width: 1, opacity: 1.0}, + data: highConfidenceLines, + label: { + show: true, + rotate: 90, + color: theme.red300, + position: 'insideEndBottom', + fontSize: '10', + offset: [5, 5], + formatter: obj => `${(obj.data as any).name}`, + }, + }), + markArea: MarkArea({ + itemStyle: { + color: theme.red300, + opacity: 0.2, + }, + label: { + show: false, + }, + data: highConfidenceAreas, + }), + }); + + data.push({ + seriesName: 'Low Confidence', + color: theme.yellow200, + data: [], + markLine: MarkLine({ + animation: false, + lineStyle: {color: theme.yellow200, type: 'solid', width: 1, opacity: 1.0}, + data: lowConfidenceLines, + label: { + show: true, + rotate: 90, + color: theme.yellow300, + position: 'insideEndBottom', + fontSize: '10', + offset: [5, 5], + formatter: obj => `${(obj.data as any).name}`, + }, + }), + markArea: MarkArea({ + itemStyle: { + color: theme.yellow200, + opacity: 0.2, + }, + label: { + show: false, + }, + data: lowConfidenceAreas, + }), + }); + + return { + isLoading: false, + isErrored: false, + data, + hasData: true, + loading: false, + }; +}; + +type AnomalyData = WidgetDataResult & ReturnType<typeof transformAnomalyData>; + +type DataType = { + chart: AnomalyData; +}; + +function Anomalies(props: Props) { + const height = 250; + const chartColor = theme.charts.colors[0]; + + const chart = useMemo<QueryDefinition<DataType, WidgetDataResult>>(() => { + return { + fields: '', + component: provided => ( + <AnomaliesQuery + orgSlug={props.organization.slug} + location={props.location} + eventView={props.eventView} + {...pick(provided, 'children')} + /> + ), + transform: transformAnomalyData, + }; + }, []); + + return ( + <GenericPerformanceWidget<DataType> + {...props} + title={t('Transaction Count')} + titleTooltip={t( + 'Represents transaction count across time, with added visualizations to highlight anomalies in your data.' + )} + fields={['']} + chartSetting={PerformanceWidgetSetting.TPM_AREA} + chartDefinition={WIDGET_DEFINITIONS[PerformanceWidgetSetting.TPM_AREA]} + Subtitle={() => <div />} + HeaderActions={() => <div />} + EmptyComponent={WidgetEmptyStateWarning} + Queries={{ + chart, + }} + Visualizations={[ + { + component: provided => { + const data = + provided.widgetData.chart.data?.map(series => { + if (series.seriesName !== 'tpm()') { + series.lineStyle = {type: 'dashed', color: chartColor, width: 1.5}; + } + if (series.seriesName === 'score') { + series.lineStyle = {color: theme.red400}; + } + return series; + }) ?? []; + + return ( + <AnomalyChart + {...provided} + data={data} + height={height} + statsPeriod={undefined} + start={null} + end={null} + /> + ); + }, + height, + }, + ]} + /> + ); +} + +function AnomaliesContent(props: Props) { + return ( + <Layout.Main fullWidth> + <Anomalies {...props} /> + <TableContainer> + <AnomaliesQuery + orgSlug={props.organization.slug} + location={props.location} + eventView={props.eventView} + > + {({data}) => ( + <AnomaliesTable anomalies={data?.anomalies} {...props} isLoading={false} /> + )} + </AnomaliesQuery> + </TableContainer> + </Layout.Main> + ); +} + +const TableContainer = styled('div')` + margin-top: ${space(2)}; +`; + +export default AnomaliesContent; diff --git a/static/app/views/performance/transactionSummary/transactionAnomalies/index.tsx b/static/app/views/performance/transactionSummary/transactionAnomalies/index.tsx new file mode 100644 index 00000000000000..9e7adf992c2ca0 --- /dev/null +++ b/static/app/views/performance/transactionSummary/transactionAnomalies/index.tsx @@ -0,0 +1,47 @@ +import {Location} from 'history'; + +import {t} from 'sentry/locale'; +import {Organization, Project} from 'sentry/types'; +import withOrganization from 'sentry/utils/withOrganization'; +import withProjects from 'sentry/utils/withProjects'; + +import PageLayout from '../pageLayout'; +import Tab from '../tabs'; + +import AnomaliesContent from './content'; +import {generateAnomaliesEventView} from './utils'; + +type Props = { + location: Location; + organization: Organization; + projects: Project[]; +}; + +function TransactionAnomalies(props: Props) { + const {location, organization, projects} = props; + + return ( + <PageLayout + location={location} + organization={organization} + projects={projects} + tab={Tab.Anomalies} + generateEventView={generateAnomaliesEventView} + getDocumentTitle={getDocumentTitle} + childComponent={AnomaliesContent} + /> + ); +} + +function getDocumentTitle(transactionName: string): string { + const hasTransactionName = + typeof transactionName === 'string' && String(transactionName).trim().length > 0; + + if (hasTransactionName) { + return [String(transactionName).trim(), t('Performance')].join(' - '); + } + + return [t('Summary'), t('Performance')].join(' - '); +} + +export default withProjects(withOrganization(TransactionAnomalies)); diff --git a/static/app/views/performance/transactionSummary/transactionAnomalies/types.tsx b/static/app/views/performance/transactionSummary/transactionAnomalies/types.tsx new file mode 100644 index 00000000000000..de80a7d1388a14 --- /dev/null +++ b/static/app/views/performance/transactionSummary/transactionAnomalies/types.tsx @@ -0,0 +1,10 @@ +export enum AnomalyTable { + ANOMALY = 'anomaly', + CONFIDENCE = 'confidence', + TIME_INTERVAL = 'timeInterval', + TIMESTAMP = 'timestamp', + EXPECTED = 'expected', + RECEIVED = 'received', +} + +export type AnomalySort = AnomalyTable; diff --git a/static/app/views/performance/transactionSummary/transactionAnomalies/utils.tsx b/static/app/views/performance/transactionSummary/transactionAnomalies/utils.tsx new file mode 100644 index 00000000000000..b71bb689fa92d8 --- /dev/null +++ b/static/app/views/performance/transactionSummary/transactionAnomalies/utils.tsx @@ -0,0 +1,65 @@ +import {Location, Query} from 'history'; + +import EventView from 'sentry/utils/discover/eventView'; +import {decodeScalar} from 'sentry/utils/queryString'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; + +export function generateAnomaliesRoute({orgSlug}: {orgSlug: String}): string { + return `/organizations/${orgSlug}/performance/summary/anomalies/`; +} + +export function anomaliesRouteWithQuery({ + orgSlug, + transaction, + projectID, + query, +}: { + orgSlug: string; + transaction: string; + query: Query; + projectID?: string | string[]; +}) { + const pathname = generateAnomaliesRoute({ + orgSlug, + }); + + return { + pathname, + query: { + transaction, + project: projectID, + environment: query.environment, + statsPeriod: query.statsPeriod, + start: query.start, + end: query.end, + query: query.query, + }, + }; +} + +export function generateAnomaliesEventView({ + location, + transactionName, +}: { + location: Location; + transactionName: string; +}): EventView { + const query = decodeScalar(location.query.query, ''); + const conditions = new MutableSearch(query); + + conditions.setFilterValues('transaction', [transactionName]); + + const eventView = EventView.fromNewQueryWithLocation( + { + id: undefined, + version: 2, + name: transactionName, + fields: ['tpm()'], // TODO(k-fish): Modify depending on api url later. + query: conditions.formatString(), + projects: [], + }, + location + ); + + return eventView; +} diff --git a/tests/js/sentry-test/performance/initializePerformanceData.ts b/tests/js/sentry-test/performance/initializePerformanceData.ts index ea9b0b529d9a24..b75c5c92496111 100644 --- a/tests/js/sentry-test/performance/initializePerformanceData.ts +++ b/tests/js/sentry-test/performance/initializePerformanceData.ts @@ -9,12 +9,14 @@ import { SuspectSpan, } from 'sentry/utils/performance/suspectSpans/types'; -export function initializeData(settings?: { +export interface initializeDataSettings { query?: {}; features?: string[]; projects?: Project[]; project?: Project; -}) { +} + +export function initializeData(settings?: initializeDataSettings) { const _defaultProject = TestStubs.Project(); const _settings = { query: {}, diff --git a/tests/js/spec/views/performance/transactionAnomalies/index.spec.tsx b/tests/js/spec/views/performance/transactionAnomalies/index.spec.tsx new file mode 100644 index 00000000000000..01fa23093779e1 --- /dev/null +++ b/tests/js/spec/views/performance/transactionAnomalies/index.spec.tsx @@ -0,0 +1,43 @@ +import { + initializeData as _initializeData, + initializeDataSettings, +} from 'sentry-test/performance/initializePerformanceData'; +import {act, cleanup, mountWithTheme, screen} from 'sentry-test/reactTestingLibrary'; + +import ProjectsStore from 'sentry/stores/projectsStore'; +import {OrganizationContext} from 'sentry/views/organizationContext'; +import TransactionAnomalies from 'sentry/views/performance/transactionSummary/transactionAnomalies'; + +const initializeData = (settings: initializeDataSettings) => { + const data = _initializeData(settings); + + act(() => void ProjectsStore.loadInitialData(data.organization.projects)); + return data; +}; + +const WrappedComponent = data => { + return ( + <OrganizationContext.Provider value={data.organization}> + <TransactionAnomalies {...data} />, + </OrganizationContext.Provider> + ); +}; + +describe('AnomaliesTab', function () { + afterEach(cleanup); + it('renders basic UI elements with flag', async function () { + const initialData = initializeData({ + features: ['performance-view', 'performance-anomaly-detection-ui'], + query: {project: '1', transaction: 'transaction'}, + }); + mountWithTheme( + <WrappedComponent + organization={initialData.organization} + location={initialData.router.location} + />, + {context: initialData.routerContext} + ); + + expect(await screen.findByText('Transaction Count')).toBeInTheDocument(); + }); +});
9f4330b1171f4829f94a72a687a1cac71d780a9a
2019-10-18 20:48:47
Burak Yigit Kaya
fix(typo): Remove trailing ')' from asset build logs (#15176)
false
Remove trailing ')' from asset build logs (#15176)
fix
diff --git a/src/sentry/utils/distutils/commands/base.py b/src/sentry/utils/distutils/commands/base.py index 805517af21505b..2339c76007d8dc 100644 --- a/src/sentry/utils/distutils/commands/base.py +++ b/src/sentry/utils/distutils/commands/base.py @@ -140,7 +140,7 @@ def _setup_js_deps(self): sys.exit(1) if node_version[2] is not None: - log.info(u"using node ({0}))".format(node_version)) + log.info(u"using node ({0})".format(node_version)) self._run_yarn_command(["install", "--production", "--pure-lockfile", "--quiet"]) def _run_command(self, cmd, env=None): @@ -152,7 +152,7 @@ def _run_command(self, cmd, env=None): raise def _run_yarn_command(self, cmd, env=None): - log.debug(u"yarn path: ({0}))".format(YARN_PATH)) + log.debug(u"yarn path: ({0})".format(YARN_PATH)) self._run_command([YARN_PATH] + cmd, env=env) def update_manifests(self):
cc3a93b7675bca623475f2bb0ba8b56b6e4f6228
2020-05-22 03:19:58
Evan Purkhiser
feat(alerts): Add new metricField (#18927)
false
Add new metricField (#18927)
feat
diff --git a/src/sentry/static/sentry/app/utils/discover/eventView.tsx b/src/sentry/static/sentry/app/utils/discover/eventView.tsx index 517742b093cb6e..a999184ad179e0 100644 --- a/src/sentry/static/sentry/app/utils/discover/eventView.tsx +++ b/src/sentry/static/sentry/app/utils/discover/eventView.tsx @@ -23,6 +23,7 @@ import { ColumnType, isAggregateField, getAggregateAlias, + generateFieldAsString, } from './fields'; import {getSortField} from './fieldRenderers'; import {CHART_AXIS_OPTIONS, DisplayModes, DISPLAY_MODE_OPTIONS} from './types'; @@ -84,16 +85,6 @@ export function isFieldSortable(field: Field, tableMeta?: MetaType): boolean { return !!getSortKeyFromField(field, tableMeta); } -const generateFieldAsString = (col: Column): string => { - if (col.kind === 'field') { - return col.field; - } - - const aggregation = col.function[0]; - const parameters = col.function.slice(1).filter(i => i); - return `${aggregation}(${parameters.join(',')})`; -}; - const decodeFields = (location: Location): Array<Field> => { const {query} = location; if (!query || !query.field) { diff --git a/src/sentry/static/sentry/app/utils/discover/fields.tsx b/src/sentry/static/sentry/app/utils/discover/fields.tsx index cb070431376f90..c36e5266a79309 100644 --- a/src/sentry/static/sentry/app/utils/discover/fields.tsx +++ b/src/sentry/static/sentry/app/utils/discover/fields.tsx @@ -50,7 +50,7 @@ export type QueryFieldValue = } | { kind: 'function'; - function: [Aggregation, string, AggregationRefinement]; + function: [AggregationKey, string, AggregationRefinement]; }; // Column is just an alias of a Query value @@ -222,20 +222,16 @@ export const AGGREGATIONS = { }, } as const; -assert( - AGGREGATIONS as Readonly< - { - [key in keyof typeof AGGREGATIONS]: { - parameters: Readonly<AggregateParameter[]>; - // null means to inherit from the column. - outputType: null | ColumnType; - isSortable: boolean; - }; - } - > -); +assert(AGGREGATIONS as Readonly<{[key in keyof typeof AGGREGATIONS]: Aggregation}>); + +export type AggregationKey = keyof typeof AGGREGATIONS | ''; -export type Aggregation = keyof typeof AGGREGATIONS | ''; +export type Aggregation = { + parameters: Readonly<AggregateParameter[]>; + // null means to inherit from the column. + outputType: null | ColumnType; + isSortable: boolean; +}; /** * Refer to src/sentry/snuba/events.py, search for Columns @@ -313,7 +309,7 @@ export const FIELDS = { } as const; assert(FIELDS as Readonly<{[key in keyof typeof FIELDS]: ColumnType}>); -export type Fields = keyof typeof FIELDS | string | ''; +export type FieldKey = keyof typeof FIELDS | string | ''; // This list should be removed with the tranaction-events feature flag. export const TRACING_FIELDS = [ @@ -345,7 +341,7 @@ export function explodeFieldString(field: string): Column { return { kind: 'function', function: [ - results[1] as Aggregation, + results[1] as AggregationKey, results[2], results[3] as AggregationRefinement, ], @@ -355,6 +351,16 @@ export function explodeFieldString(field: string): Column { return {kind: 'field', field}; } +export function generateFieldAsString(value: QueryFieldValue): string { + if (value.kind === 'field') { + return value.field; + } + + const aggregation = value.function[0]; + const parameters = value.function.slice(1).filter(i => i); + return `${aggregation}(${parameters.join(',')})`; +} + export function explodeField(field: Field): Column { const results = explodeFieldString(field.field); diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx index 7e30d627a2b822..abbc64442b1380 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/columnEditCollection.tsx @@ -13,10 +13,11 @@ import {t} from 'app/locale'; import {SelectValue, OrganizationSummary} from 'app/types'; import space from 'app/styles/space'; import theme from 'app/utils/theme'; -import {Column, AGGREGATIONS, FIELDS, TRACING_FIELDS} from 'app/utils/discover/fields'; +import {Column} from 'app/utils/discover/fields'; -import {FieldValue, FieldValueKind} from './types'; +import {FieldValue} from './types'; import {QueryField} from './queryField'; +import {generateFieldOptions} from '../utils'; type Props = { // Input columns @@ -52,7 +53,7 @@ class ColumnEditCollection extends React.Component<Props, State> { draggingTargetIndex: void 0, left: void 0, top: void 0, - fieldOptions: this.generateFieldOptions(), + fieldOptions: this.fieldOptions, }; componentDidMount() { @@ -87,71 +88,15 @@ class ColumnEditCollection extends React.Component<Props, State> { portal: HTMLElement | null = null; dragGhostRef = React.createRef<HTMLDivElement>(); - generateFieldOptions() { - const {organization, tagKeys} = this.props; - - let fields = Object.keys(FIELDS); - let functions = Object.keys(AGGREGATIONS); - - // Strip tracing features if the org doesn't have access. - if (!organization.features.includes('transaction-events')) { - fields = fields.filter(item => !TRACING_FIELDS.includes(item)); - functions = functions.filter(item => !TRACING_FIELDS.includes(item)); - } - const fieldOptions: Record<string, SelectValue<FieldValue>> = {}; - - // Index items by prefixed keys as custom tags - // can overlap both fields and function names. - // Having a mapping makes finding the value objects easier - // later as well. - functions.forEach(func => { - const ellipsis = AGGREGATIONS[func].parameters.length ? '\u2026' : ''; - fieldOptions[`function:${func}`] = { - label: `${func}(${ellipsis})`, - value: { - kind: FieldValueKind.FUNCTION, - meta: { - name: func, - parameters: AGGREGATIONS[func].parameters, - }, - }, - }; - }); - - fields.forEach(field => { - fieldOptions[`field:${field}`] = { - label: field, - value: { - kind: FieldValueKind.FIELD, - meta: { - name: field, - dataType: FIELDS[field], - }, - }, - }; + get fieldOptions() { + return generateFieldOptions({ + organization: this.props.organization, + tagKeys: this.props.tagKeys, }); - - if (tagKeys !== null) { - tagKeys.forEach(tag => { - const tagValue = - FIELDS.hasOwnProperty(tag) || AGGREGATIONS.hasOwnProperty(tag) - ? `tags[${tag}]` - : tag; - fieldOptions[`tag:${tag}`] = { - label: tag, - value: { - kind: FieldValueKind.TAG, - meta: {name: tagValue, dataType: 'string'}, - }, - }; - }); - } - - return fieldOptions; } syncFields() { - this.setState({fieldOptions: this.generateFieldOptions()}); + this.setState({fieldOptions: this.fieldOptions}); } keyForColumn(column: Column, isGhost: boolean): string { diff --git a/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx b/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx index 0c030d80f782cd..d0dd9bf87a56ef 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/table/queryField.tsx @@ -40,9 +40,17 @@ type Props = { fieldOptions: FieldOptions; /** * The number of columns to render. Columns that do not have a parameter will - * render an empty parameter placeholder. + * render an empty parameter placeholder. Leave blank to avoid adding spacers. */ - gridColumns: number; + gridColumns?: number; + /** + * Filter the options in the primary selector. Useful if you only want to + * show a subset of selectable items. + * + * NOTE: This is different from passing an already filtered fieldOptions + * list, as tag items in the list may be used as parameters to functions. + */ + filterPrimaryOptions?: (option: SelectValue<FieldValue>) => boolean; onChange: (fieldValue: QueryFieldValue) => void; }; @@ -200,7 +208,7 @@ class QueryField extends React.Component<Props> { field && field.kind === FieldValueKind.FUNCTION && field.meta.parameters.length > 0 && - fieldValue.kind === 'function' + fieldValue.kind === FieldValueKind.FUNCTION ) { parameterDescriptions = field.meta.parameters.map( (param, index: number): ParameterDescription => { @@ -253,7 +261,6 @@ class QueryField extends React.Component<Props> { } renderParameterInputs(parameters: ParameterDescription[]): React.ReactNode[] { - const {gridColumns} = this.props; const inputs = parameters.map((descriptor: ParameterDescription, index: number) => { if (descriptor.kind === 'column' && descriptor.options.length > 0) { return ( @@ -316,8 +323,9 @@ class QueryField extends React.Component<Props> { // Add enough disabled inputs to fill the grid up. // We always have 1 input. - const requiredInputs = gridColumns - inputs.length - 1; - if (requiredInputs > 0) { + const {gridColumns} = this.props; + const requiredInputs = (gridColumns ?? inputs.length + 1) - inputs.length - 1; + if (gridColumns !== undefined && requiredInputs > 0) { for (let i = 0; i < requiredInputs; i++) { inputs.push(<BlankSpace key={i} />); } @@ -327,12 +335,16 @@ class QueryField extends React.Component<Props> { } render() { - const {className, takeFocus, gridColumns} = this.props; + const {className, takeFocus, filterPrimaryOptions} = this.props; const {field, fieldOptions, parameterDescriptions} = this.getFieldData(); + const allFieldOptions = filterPrimaryOptions + ? Object.values(fieldOptions).filter(filterPrimaryOptions) + : Object.values(fieldOptions); + const selectProps: React.ComponentProps<SelectControl> = { name: 'field', - options: Object.values(fieldOptions), + options: Object.values(allFieldOptions), placeholder: t('(Required)'), value: field, onChange: this.handleFieldChange, @@ -362,8 +374,10 @@ class QueryField extends React.Component<Props> { }, }; + const parameters = this.renderParameterInputs(parameterDescriptions); + return ( - <Container className={className} gridColumns={gridColumns}> + <Container className={className} gridColumns={parameters.length + 1}> <SelectControl {...selectProps} styles={styles} @@ -382,7 +396,7 @@ class QueryField extends React.Component<Props> { ), }} /> - {this.renderParameterInputs(parameterDescriptions)} + {parameters} </Container> ); } diff --git a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx index 7a6891feda228d..8c76d8f02501a9 100644 --- a/src/sentry/static/sentry/app/views/eventsV2/utils.tsx +++ b/src/sentry/static/sentry/app/views/eventsV2/utils.tsx @@ -4,7 +4,7 @@ import {browserHistory} from 'react-router'; import {tokenizeSearch, stringifyQueryObject} from 'app/utils/tokenizeSearch'; import {t} from 'app/locale'; -import {Event, Organization, OrganizationSummary} from 'app/types'; +import {Event, Organization, OrganizationSummary, SelectValue} from 'app/types'; import {getTitle} from 'app/utils/events'; import {getUtcDateString} from 'app/utils/dates'; import {URL_PARAM} from 'app/constants/globalSelectionHeader'; @@ -14,14 +14,17 @@ import EventView from 'app/utils/discover/eventView'; import { Field, Column, + ColumnType, AGGREGATIONS, FIELDS, explodeFieldString, getAggregateAlias, + TRACING_FIELDS, + Aggregation, } from 'app/utils/discover/fields'; import {ALL_VIEWS, TRANSACTION_VIEWS} from './data'; -import {TableColumn, TableDataRow} from './table/types'; +import {TableColumn, TableDataRow, FieldValue, FieldValueKind} from './table/types'; export type QueryWithColumnState = | Query @@ -159,7 +162,7 @@ export function downloadAsCsv(tableData, columnOrder, filename) { } // A map between aggregate function names and its un-aggregated form -const TRANSFORM_AGGREGATES: {[field: string]: string} = { +const TRANSFORM_AGGREGATES = { p99: 'transaction.duration', p95: 'transaction.duration', p75: 'transaction.duration', @@ -169,7 +172,7 @@ const TRANSFORM_AGGREGATES: {[field: string]: string} = { impact: '', user_misery: '', error_rate: '', -}; +} as const; /** * Convert an aggregated query into one that does not have aggregates. @@ -376,3 +379,75 @@ export function getDiscoverLandingUrl(organization: OrganizationSummary): string } return `/organizations/${organization.slug}/discover/results/`; } + +type FieldGeneratorOpts = { + organization: OrganizationSummary; + tagKeys?: string[] | null; + aggregations?: Record<string, Aggregation>; + fields?: Record<string, ColumnType>; +}; + +export function generateFieldOptions({ + organization, + tagKeys, + aggregations = AGGREGATIONS, + fields = FIELDS, +}: FieldGeneratorOpts) { + let fieldKeys = Object.keys(fields); + let functions = Object.keys(aggregations); + + // Strip tracing features if the org doesn't have access. + if (!organization.features.includes('transaction-events')) { + fieldKeys = fieldKeys.filter(item => !TRACING_FIELDS.includes(item)); + functions = functions.filter(item => !TRACING_FIELDS.includes(item)); + } + const fieldOptions: Record<string, SelectValue<FieldValue>> = {}; + + // Index items by prefixed keys as custom tags can overlap both fields and + // function names. Having a mapping makes finding the value objects easier + // later as well. + functions.forEach(func => { + const ellipsis = aggregations[func].parameters.length ? '\u2026' : ''; + fieldOptions[`function:${func}`] = { + label: `${func}(${ellipsis})`, + value: { + kind: FieldValueKind.FUNCTION, + meta: { + name: func, + parameters: [...aggregations[func].parameters], + }, + }, + }; + }); + + fieldKeys.forEach(field => { + fieldOptions[`field:${field}`] = { + label: field, + value: { + kind: FieldValueKind.FIELD, + meta: { + name: field, + dataType: fields[field], + }, + }, + }; + }); + + if (tagKeys !== undefined && tagKeys !== null) { + tagKeys.forEach(tag => { + const tagValue = + fields.hasOwnProperty(tag) || AGGREGATIONS.hasOwnProperty(tag) + ? `tags[${tag}]` + : tag; + fieldOptions[`tag:${tag}`] = { + label: tag, + value: { + kind: FieldValueKind.TAG, + meta: {name: tagValue, dataType: 'string'}, + }, + }; + }); + } + + return fieldOptions; +} diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/metricField.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/metricField.tsx new file mode 100644 index 00000000000000..1d51ca66ee4f84 --- /dev/null +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/metricField.tsx @@ -0,0 +1,199 @@ +import React from 'react'; +import styled from '@emotion/styled'; +import {css} from '@emotion/core'; + +import FormField from 'app/views/settings/components/forms/formField'; +import {t, tct} from 'app/locale'; +import {QueryField} from 'app/views/eventsV2/table/queryField'; +import {generateFieldOptions} from 'app/views/eventsV2/utils'; +import {FieldValueKind} from 'app/views/eventsV2/table/types'; +import {Organization} from 'app/types'; +import space from 'app/styles/space'; +import FormModel from 'app/views/settings/components/forms/model'; +import Button from 'app/components/button'; +import Tooltip from 'app/components/tooltip'; +import { + explodeFieldString, + generateFieldAsString, + AggregationKey, + FieldKey, + AGGREGATIONS, + FIELDS, +} from 'app/utils/discover/fields'; + +import {Dataset} from './types'; + +type Props = Omit<FormField['props'], 'children' | 'help'> & { + organization: Organization; +}; + +const cannedAggregates = [ + { + match: /^count\(\)/, + name: 'Number of errors', + validDataset: [Dataset.ERRORS], + default: 'count()', + }, + { + match: /^count_unique\(user(\.id)?\)/, + name: 'Users affected', + validDataset: [Dataset.ERRORS], + default: 'count_unique(user)', + }, + { + match: /^(p[0-9]{2,3}|percentile\(transaction\.duration,[^)]+\))/, + name: 'Latency', + validDataset: [Dataset.TRANSACTIONS], + default: 'percentile(transaction.duration, 0.95)', + }, + { + match: /^apdex\([0-9.]+\)/, + name: 'Apdex', + validDataset: [Dataset.TRANSACTIONS], + default: 'apdex(300)', + }, + { + match: /^count\(\)/, + name: 'Throughput', + validDataset: [Dataset.TRANSACTIONS], + default: 'count()', + }, + { + match: /^error_rate\(\)/, + name: 'Error rate', + validDataset: [Dataset.TRANSACTIONS], + default: 'error_rate()', + }, +]; + +type OptionConfig = { + aggregations: AggregationKey[]; + fields: FieldKey[]; +}; + +const errorFieldConfig: OptionConfig = { + aggregations: ['count', 'count_unique'], + fields: ['user'], +}; + +const transactionFieldConfig: OptionConfig = { + aggregations: [ + 'avg', + 'percentile', + 'error_rate', + 'apdex', + 'count', + 'p50', + 'p75', + 'p95', + 'p99', + 'p100', + ], + fields: ['transaction.duration'], +}; + +const getFieldOptionConfig = (dataset: Dataset) => { + const config = dataset === Dataset.ERRORS ? errorFieldConfig : transactionFieldConfig; + + const aggregations = Object.fromEntries( + config.aggregations.map(key => [key, AGGREGATIONS[key]]) + ); + const fields = Object.fromEntries(config.fields.map(key => [key, FIELDS[key]])); + + return {aggregations, fields}; +}; + +const help = ({name, model}: {name: string; model: FormModel}) => { + const aggregate = model.getValue(name) as string; + + const presets = cannedAggregates + .filter(preset => preset.validDataset.includes(model.getValue('dataset') as Dataset)) + .map(preset => ({...preset, selected: preset.match.test(aggregate)})) + .map((preset, i, list) => ( + <React.Fragment key={preset.name}> + <Tooltip title={t('This preset is selected')} disabled={!preset.selected}> + <PresetLink + onClick={() => model.setValue(name, preset.default)} + isSelected={preset.selected} + > + {preset.name} + </PresetLink> + </Tooltip> + {i + 1 < list.length && ', '} + </React.Fragment> + )); + + return tct( + 'Choose an aggregate function. Not sure what to select, try a preset: [presets]', + {presets} + ); +}; + +const MetricField = ({organization, ...props}: Props) => ( + <FormField help={help} {...props}> + {({onChange, value, model}) => { + const dataset = model.getValue('dataset'); + + const fieldOptionsConfig = getFieldOptionConfig(dataset); + const fieldOptions = generateFieldOptions({organization, ...fieldOptionsConfig}); + const fieldValue = explodeFieldString(value ?? ''); + + const fieldKey = + fieldValue?.kind === FieldValueKind.FUNCTION + ? `function:${fieldValue.function[0]}` + : ''; + + const selectedField = fieldOptions[fieldKey]?.value; + const numParameters = + selectedField && + selectedField.kind === FieldValueKind.FUNCTION && + selectedField.meta.parameters.length; + + return ( + <React.Fragment> + <AggregateHeader> + <div>{t('Function')}</div> + {numParameters > 0 && <div>{t('Parameter')}</div>} + </AggregateHeader> + <QueryField + filterPrimaryOptions={option => option.value.kind === FieldValueKind.FUNCTION} + fieldOptions={fieldOptions} + fieldValue={fieldValue} + onChange={v => onChange(generateFieldAsString(v), {})} + /> + </React.Fragment> + ); + }} + </FormField> +); + +const AggregateHeader = styled('div')` + display: grid; + grid-auto-flow: column; + grid-auto-columns: 1fr; + grid-gap: ${space(1)}; + text-transform: uppercase; + font-size: ${p => p.theme.fontSizeSmall}; + color: ${p => p.theme.gray2}; + font-weight: bold; + margin-bottom: ${space(1)}; +`; + +const PresetLink = styled(Button)<{isSelected: boolean}>` + ${p => + p.isSelected && + css` + color: ${p.theme.gray4}; + &:hover, + &:focus { + color: ${p.theme.gray5}; + } + `} +`; + +PresetLink.defaultProps = { + priority: 'link', + borderless: true, +}; + +export default MetricField; diff --git a/src/sentry/static/sentry/app/views/settings/incidentRules/types.tsx b/src/sentry/static/sentry/app/views/settings/incidentRules/types.tsx index 6d8af7ec4568f0..896b694f44a865 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/types.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/types.tsx @@ -13,6 +13,11 @@ export enum AlertRuleAggregations { UNIQUE_USERS, } +export enum Dataset { + ERRORS, + TRANSACTIONS, +} + export type UnsavedTrigger = { // UnsavedTrigger can be apart of an Unsaved Alert Rule that does not have an // id yet diff --git a/tests/js/spec/views/settings/incidentRules/metricField.spec.jsx b/tests/js/spec/views/settings/incidentRules/metricField.spec.jsx new file mode 100644 index 00000000000000..a4955bb61c3b81 --- /dev/null +++ b/tests/js/spec/views/settings/incidentRules/metricField.spec.jsx @@ -0,0 +1,99 @@ +import React from 'react'; + +import {openMenu, selectByLabel} from 'sentry-test/select-new'; +import {mountWithTheme} from 'sentry-test/enzyme'; +import {initializeOrg} from 'sentry-test/initializeOrg'; + +import Form from 'app/views/settings/components/forms/form'; +import MetricField from 'app/views/settings/incidentRules/metricField'; +import {Dataset} from 'app/views/settings/incidentRules/types'; + +describe('MetricField', function() { + const {organization} = initializeOrg({ + organization: {features: ['transaction-events']}, + }); + + it('renders', function() { + mountWithTheme( + <Form initialData={{dataset: Dataset.ERRORS}}> + <MetricField name="metric" organization={organization} /> + </Form> + ); + }); + + it('has a select subset of error fields', function() { + const wrapper = mountWithTheme( + <Form initialData={{dataset: Dataset.ERRORS}}> + <MetricField name="metric" organization={organization} /> + </Form> + ); + openMenu(wrapper, {selector: 'QueryField'}); + + // two error aggregation configs + expect(wrapper.find('Option Option')).toHaveLength(2); + + // Select count_unique and verify the tags + selectByLabel(wrapper, 'count_unique(…)', {selector: 'QueryField'}); + openMenu(wrapper, {selector: 'QueryField', at: 1}); + + expect( + wrapper + .find('SelectControl') + .at(1) + .find('Option') + ).toHaveLength(1); + }); + + it('has a select subset of transaction fields', function() { + const wrapper = mountWithTheme( + <Form initialData={{dataset: Dataset.TRANSACTIONS}}> + <MetricField name="metric" organization={organization} /> + </Form> + ); + openMenu(wrapper, {selector: 'QueryField'}); + + // 10 error aggregate configs + expect(wrapper.find('Option Option')).toHaveLength(10); + + selectByLabel(wrapper, 'avg(…)', {selector: 'QueryField'}); + openMenu(wrapper, {selector: 'QueryField', at: 1}); + + expect( + wrapper + .find('SelectControl') + .at(1) + .find('Option') + ).toHaveLength(1); + }); + + it('maps field value to selected presets', function() { + const wrapper = mountWithTheme( + <Form initialData={{dataset: Dataset.TRANSACTIONS}}> + <MetricField name="metric" organization={organization} /> + </Form> + ); + selectByLabel(wrapper, 'error_rate()', {selector: 'QueryField'}); + + expect(wrapper.find('FieldHelp Button[isSelected=true]').text()).toEqual( + 'Error rate' + ); + + selectByLabel(wrapper, 'p95()', {selector: 'QueryField'}); + + expect(wrapper.find('FieldHelp Button[isSelected=true]').text()).toEqual('Latency'); + }); + + it('changes field values when selecting presets', function() { + const wrapper = mountWithTheme( + <Form initialData={{dataset: Dataset.TRANSACTIONS}}> + <MetricField name="metric" organization={organization} /> + </Form> + ); + + wrapper.find('FieldHelp button[aria-label="Error rate"]').simulate('click'); + + expect(wrapper.find('QueryField SingleValue SingleValue').text()).toEqual( + 'error_rate()' + ); + }); +});
daae2a92d4666304822b0d20daeece46f5122f3b
2023-07-13 05:25:30
Alberto Leal
chore(hybrid-cloud): Remove Integration model dependency in IntegrationRepositoryProvider. (#52691)
false
Remove Integration model dependency in IntegrationRepositoryProvider. (#52691)
chore
diff --git a/src/sentry/plugins/providers/integration_repository.py b/src/sentry/plugins/providers/integration_repository.py index a3f65738df7256..17b2053af4349d 100644 --- a/src/sentry/plugins/providers/integration_repository.py +++ b/src/sentry/plugins/providers/integration_repository.py @@ -15,6 +15,7 @@ from sentry.constants import ObjectStatus from sentry.integrations import IntegrationInstallation from sentry.models import Integration, Repository +from sentry.services.hybrid_cloud.integration import integration_service from sentry.shared_integrations.exceptions import IntegrationError from sentry.signals import repo_linked @@ -45,13 +46,21 @@ def get_installation( if integration_id is None: raise IntegrationError(f"{self.name} requires an integration id.") - integration_model = Integration.objects.get( - id=integration_id, - organizationintegration__organization_id=organization_id, - provider=self.repo_provider, + # Both the integration and the organization integration needs to exist for the installation to be valid. + + rpc_integration = integration_service.get_integration(integration_id=integration_id) + if rpc_integration is None: + raise Integration.DoesNotExist("Integration matching query does not exist.") + + rpc_org_integration = integration_service.get_organization_integration( + integration_id=integration_id, organization_id=organization_id ) + if rpc_org_integration is None: + raise Integration.DoesNotExist("Integration matching query does not exist.") - return integration_model.get_installation(organization_id) + return integration_service.get_installation( + integration=rpc_integration, organization_id=organization_id + ) def create_repository( self, diff --git a/src/sentry/testutils/cases.py b/src/sentry/testutils/cases.py index d3447bc51000d9..89fe74c1faeee2 100644 --- a/src/sentry/testutils/cases.py +++ b/src/sentry/testutils/cases.py @@ -1973,7 +1973,7 @@ def setUp(self): def add_create_repository_responses(self, repository_config): raise NotImplementedError(f"implement for {type(self).__module__}.{type(self).__name__}") - @assume_test_silo_mode(SiloMode.MONOLITH) + @assume_test_silo_mode(SiloMode.REGION) def create_repository( self, repository_config, integration_id, organization_slug=None, add_responses=True ): diff --git a/tests/sentry/integrations/bitbucket/test_repository.py b/tests/sentry/integrations/bitbucket/test_repository.py index f736e788e5b811..3f06500f81a25f 100644 --- a/tests/sentry/integrations/bitbucket/test_repository.py +++ b/tests/sentry/integrations/bitbucket/test_repository.py @@ -9,9 +9,12 @@ from sentry.integrations.bitbucket.repository import BitbucketRepositoryProvider from sentry.models import Integration, Repository from sentry.shared_integrations.exceptions import IntegrationError +from sentry.silo import SiloMode from sentry.testutils import IntegrationRepositoryTestCase, TestCase +from sentry.testutils.silo import assume_test_silo_mode, region_silo_test +@region_silo_test(stable=True) class BitbucketRepositoryProviderTest(TestCase): def setUp(self): super().setUp() @@ -94,13 +97,14 @@ def test_build_repository_config(self): ) organization = self.create_organization() - integration = Integration.objects.create( - provider="bitbucket", - external_id="bitbucket_external_id", - name="Hello world", - metadata={"base_url": "https://api.bitbucket.org", "shared_secret": "23456789"}, - ) - integration.add_organization(organization) + with assume_test_silo_mode(SiloMode.CONTROL): + integration = Integration.objects.create( + provider="bitbucket", + external_id="bitbucket_external_id", + name="Hello world", + metadata={"base_url": "https://api.bitbucket.org", "shared_secret": "23456789"}, + ) + integration.add_organization(organization) data = { "provider": "integrations:bitbucket", "identifier": full_repo_name, @@ -134,6 +138,7 @@ def test_get_repository_data_no_installation_id(self): assert "requires an integration id" in str(e) +@region_silo_test(stable=True) class BitbucketCreateRepositoryTestCase(IntegrationRepositoryTestCase): provider_name = "integrations:bitbucket" @@ -182,7 +187,8 @@ def test_create_repository_data_no_installation_id(self): def test_create_repository_data_integration_does_not_exist(self): integration_id = self.integration.id - self.integration.delete() + with assume_test_silo_mode(SiloMode.CONTROL): + self.integration.delete() response = self.create_repository(self.default_repository_config, integration_id) assert response.status_code == 404 diff --git a/tests/sentry/integrations/bitbucket_server/test_repository.py b/tests/sentry/integrations/bitbucket_server/test_repository.py index e28b653e517057..699f907a5b3e4a 100644 --- a/tests/sentry/integrations/bitbucket_server/test_repository.py +++ b/tests/sentry/integrations/bitbucket_server/test_repository.py @@ -21,34 +21,35 @@ from sentry.shared_integrations.exceptions import IntegrationError from sentry.silo import SiloMode from sentry.testutils import APITestCase -from sentry.testutils.silo import assume_test_silo_mode, control_silo_test +from sentry.testutils.silo import assume_test_silo_mode, region_silo_test -@control_silo_test(stable=True) +@region_silo_test(stable=True) class BitbucketServerRepositoryProviderTest(APITestCase): @cached_property def integration(self): - integration = Integration.objects.create( - provider="bitbucket_server", - name="Example Bitbucket", - metadata={"verify_ssl": False, "base_url": "https://bitbucket.example.com"}, - ) - identity_provider = IdentityProvider.objects.create( - external_id="bitbucket.example.com:sentry-test", type="bitbucket_server" - ) - identity = Identity.objects.create( - idp=identity_provider, - user=self.user, - scopes=(), - status=IdentityStatus.VALID, - data={ - "consumer_key": "sentry-test", - "private_key": EXAMPLE_PRIVATE_KEY, - "access_token": "access-token", - "access_token_secret": "access-token-secret", - }, - ) - integration.add_organization(self.organization, self.user, default_auth_id=identity.id) + with assume_test_silo_mode(SiloMode.CONTROL): + integration = Integration.objects.create( + provider="bitbucket_server", + name="Example Bitbucket", + metadata={"verify_ssl": False, "base_url": "https://bitbucket.example.com"}, + ) + identity_provider = IdentityProvider.objects.create( + external_id="bitbucket.example.com:sentry-test", type="bitbucket_server" + ) + identity = Identity.objects.create( + idp=identity_provider, + user=self.user, + scopes=(), + status=IdentityStatus.VALID, + data={ + "consumer_key": "sentry-test", + "private_key": EXAMPLE_PRIVATE_KEY, + "access_token": "access-token", + "access_token_secret": "access-token-secret", + }, + ) + integration.add_organization(self.organization, self.user, default_auth_id=identity.id) return integration @cached_property @@ -63,18 +64,17 @@ def test_get_client(self): @responses.activate def test_compare_commits(self): - with assume_test_silo_mode(SiloMode.MONOLITH): - repo = Repository.objects.create( - provider="bitbucket_server", - name="sentryuser/newsdiffs", - organization_id=self.organization.id, - config={ - "name": "sentryuser/newsdiffs", - "project": "sentryuser", - "repo": "newsdiffs", - }, - integration_id=self.integration.id, - ) + repo = Repository.objects.create( + provider="bitbucket_server", + name="sentryuser/newsdiffs", + organization_id=self.organization.id, + config={ + "name": "sentryuser/newsdiffs", + "project": "sentryuser", + "repo": "newsdiffs", + }, + integration_id=self.integration.id, + ) responses.add( responses.GET, @@ -110,18 +110,17 @@ def test_compare_commits(self): @responses.activate def test_compare_commits_with_two_pages(self): - with assume_test_silo_mode(SiloMode.MONOLITH): - repo = Repository.objects.create( - provider="bitbucket_server", - name="sentryuser/newsdiffs", - organization_id=self.organization.id, - config={ - "name": "sentryuser/newsdiffs", - "project": "sentryuser", - "repo": "newsdiffs", - }, - integration_id=self.integration.id, - ) + repo = Repository.objects.create( + provider="bitbucket_server", + name="sentryuser/newsdiffs", + organization_id=self.organization.id, + config={ + "name": "sentryuser/newsdiffs", + "project": "sentryuser", + "repo": "newsdiffs", + }, + integration_id=self.integration.id, + ) responses.add( responses.GET, @@ -240,14 +239,13 @@ def test_build_repository_config(self): } def test_repository_external_slug(self): - with assume_test_silo_mode(SiloMode.MONOLITH): - repo = Repository.objects.create( - provider="bitbucket_server", - name="sentryuser/newsdiffs", - organization_id=self.organization.id, - config={"name": "sentryuser/newsdiffs"}, - integration_id=self.integration.id, - ) + repo = Repository.objects.create( + provider="bitbucket_server", + name="sentryuser/newsdiffs", + organization_id=self.organization.id, + config={"name": "sentryuser/newsdiffs"}, + integration_id=self.integration.id, + ) result = self.provider.repository_external_slug(repo) assert result == repo.name diff --git a/tests/sentry/integrations/bitbucket_server/test_webhook.py b/tests/sentry/integrations/bitbucket_server/test_webhook.py index 7e541cb5af1b71..2d570afba5a0e3 100644 --- a/tests/sentry/integrations/bitbucket_server/test_webhook.py +++ b/tests/sentry/integrations/bitbucket_server/test_webhook.py @@ -3,8 +3,9 @@ from sentry.integrations.bitbucket_server.webhook import PROVIDER_NAME from sentry.models import Identity, IdentityProvider, Integration, Repository +from sentry.silo import SiloMode from sentry.testutils import APITestCase -from sentry.testutils.silo import control_silo_test +from sentry.testutils.silo import assume_test_silo_mode, region_silo_test from sentry_plugins.bitbucket.testutils import REFS_CHANGED_EXAMPLE PROVIDER = "bitbucket_server" @@ -63,13 +64,13 @@ def send_webhook(self) -> None: ) -@control_silo_test +@region_silo_test(stable=True) class WebhookGetTest(WebhookTestBase): def test_get_request_fails(self): self.get_error_response(self.organization.id, self.integration.id, status_code=405) -@control_silo_test +@region_silo_test(stable=True) class WebhookPostTest(WebhookTestBase): method = "post" @@ -92,7 +93,7 @@ def test_unregistered_event(self): ) -@control_silo_test +@region_silo_test(stable=True) class RefsChangedWebhookTest(WebhookTestBase): method = "post" @@ -107,7 +108,8 @@ def test_missing_integration(self): ) def test_simple(self): - self.integration.add_organization(self.organization, default_auth_id=self.identity.id) + with assume_test_silo_mode(SiloMode.CONTROL): + self.integration.add_organization(self.organization, default_auth_id=self.identity.id) self.create_repository() self.send_webhook() diff --git a/tests/sentry/integrations/gitlab/test_repository.py b/tests/sentry/integrations/gitlab/test_repository.py index f1a9f13a304e9e..4cb4f19857cae0 100644 --- a/tests/sentry/integrations/gitlab/test_repository.py +++ b/tests/sentry/integrations/gitlab/test_repository.py @@ -10,45 +10,48 @@ from sentry.silo import SiloMode from sentry.testutils import IntegrationRepositoryTestCase from sentry.testutils.asserts import assert_commit_shape -from sentry.testutils.silo import assume_test_silo_mode, control_silo_test +from sentry.testutils.silo import assume_test_silo_mode, region_silo_test from sentry.utils import json -@control_silo_test(stable=True) +@region_silo_test(stable=True) class GitLabRepositoryProviderTest(IntegrationRepositoryTestCase): provider_name = "integrations:gitlab" def setUp(self): super().setUp() - self.integration = Integration.objects.create( - provider="gitlab", - name="Example GitLab", - external_id="example.gitlab.com:getsentry", - metadata={ - "instance": "example.gitlab.com", - "domain_name": "example.gitlab.com/getsentry", - "verify_ssl": False, - "base_url": "https://example.gitlab.com", - "webhook_secret": "secret-token-value", - }, - ) - identity = Identity.objects.create( - idp=IdentityProvider.objects.create(type="gitlab", config={}, external_id="1234567890"), - user=self.user, - external_id="example.gitlab.com:4", - data={"access_token": "1234567890"}, - ) - self.integration.add_organization(self.organization, self.user, identity.id) - self.integration.get_provider().setup() - - self.default_repository_config = { - "path_with_namespace": "getsentry/example-repo", - "name_with_namespace": "Get Sentry / Example Repo", - "path": "example-repo", - "id": "123", - "web_url": "https://example.gitlab.com/getsentry/projects/example-repo", - } - self.gitlab_id = 123 + with assume_test_silo_mode(SiloMode.CONTROL): + self.integration = Integration.objects.create( + provider="gitlab", + name="Example GitLab", + external_id="example.gitlab.com:getsentry", + metadata={ + "instance": "example.gitlab.com", + "domain_name": "example.gitlab.com/getsentry", + "verify_ssl": False, + "base_url": "https://example.gitlab.com", + "webhook_secret": "secret-token-value", + }, + ) + identity = Identity.objects.create( + idp=IdentityProvider.objects.create( + type="gitlab", config={}, external_id="1234567890" + ), + user=self.user, + external_id="example.gitlab.com:4", + data={"access_token": "1234567890"}, + ) + self.integration.add_organization(self.organization, self.user, identity.id) + self.integration.get_provider().setup() + + self.default_repository_config = { + "path_with_namespace": "getsentry/example-repo", + "name_with_namespace": "Get Sentry / Example Repo", + "path": "example-repo", + "id": "123", + "web_url": "https://example.gitlab.com/getsentry/projects/example-repo", + } + self.gitlab_id = 123 @cached_property def provider(self): @@ -151,7 +154,8 @@ def test_create_repository_data_no_installation_id(self): def test_create_repository_data_integration_does_not_exist(self): integration_id = self.integration.id - self.integration.delete() + with assume_test_silo_mode(SiloMode.CONTROL): + self.integration.delete() response = self.create_repository(self.default_repository_config, integration_id) assert response.status_code == 404
9b5d224fbc10058f0a86e0b2b13ef70aba42e946
2018-11-08 06:36:20
Evan Purkhiser
ref(hooks): Group hooks by category (#10455)
false
Group hooks by category (#10455)
ref
diff --git a/src/sentry/static/sentry/app/stores/hookStore.jsx b/src/sentry/static/sentry/app/stores/hookStore.jsx index 4ab47a8399452e..ee7a4be93bbad7 100644 --- a/src/sentry/static/sentry/app/stores/hookStore.jsx +++ b/src/sentry/static/sentry/app/stores/hookStore.jsx @@ -1,25 +1,34 @@ import Reflux from 'reflux'; import _ from 'lodash'; -let validHookNames = new Set([ - 'component:org-members-view', - 'component:org-auth-view', - 'component:releases-tab', - 'component:sample-event', - 'footer', - 'settings:organization-navigation', - 'settings:organization-navigation-config', - 'organization:header', - 'organization:sidebar', +const validHookNames = new Set([ + // Additional routes 'routes', 'routes:admin', 'routes:organization', - 'issue:secondary-column', + + // Analytics and tracking hooks 'amplitude:event', 'analytics:event', 'analytics:log-experiment', - 'sidebar:organization-dropdown-menu', + + // Specific component customizations + 'component:org-auth-view', + 'component:org-members-view', + 'component:releases-tab', + 'component:sample-event', + + // Additional settings + 'settings:organization-navigation', + 'settings:organization-navigation-config', + + // Additional interface chrome + 'footer', + 'organization:header', 'sidebar:help-menu', + 'sidebar:organization-dropdown-menu', + + // Used to provide a component for integration features. 'integrations:feature-gates', // feature-disabled:<feature-flag> hooks should return components that will @@ -29,13 +38,17 @@ let validHookNames = new Set([ 'feature-disabled:data-forwarding', 'feature-disabled:custom-inbound-filters', 'feature-disabled:rate-limits', + + // TODO(epurkhiser): These are not used anymore and should be removed + 'issue:secondary-column', + 'organization:sidebar', ]); /** - * HookStore is used to allow extensability into Sentry's frontend via + * HookStore is used to allow extensibility into Sentry's frontend via * registration of 'hook functions'. * - * This functionality is primarly used by the SASS sentry.io product. + * This functionality is primarily used by the SASS sentry.io product. */ const HookStore = Reflux.createStore({ init() {
91ec3da5224baf40054acb8cf5503f636e021f12
2023-12-29 22:46:12
Evan Purkhiser
fix(ts): Add missing type to Tags (#62428)
false
Add missing type to Tags (#62428)
fix
diff --git a/fixtures/js-stubs/tags.ts b/fixtures/js-stubs/tags.ts index da40b2cbf31c56..f1ba902652d43f 100644 --- a/fixtures/js-stubs/tags.ts +++ b/fixtures/js-stubs/tags.ts @@ -1,6 +1,6 @@ import type {TagWithTopValues} from 'sentry/types'; -export function Tags(params = []): TagWithTopValues[] { +export function Tags(params: TagWithTopValues[] = []): TagWithTopValues[] { return [ { topValues: [
5b54bfb93392a4203db5a951928fbcc4bae9fa27
2018-10-03 23:00:56
Lauryn Brown
fix(integrations): Vsts handle missing fields in webhook request (#9704)
false
Vsts handle missing fields in webhook request (#9704)
fix
diff --git a/src/sentry/integrations/vsts/webhooks.py b/src/sentry/integrations/vsts/webhooks.py index 77c61ebdb90baa..a9b169ba8c97a3 100644 --- a/src/sentry/integrations/vsts/webhooks.py +++ b/src/sentry/integrations/vsts/webhooks.py @@ -1,6 +1,7 @@ from __future__ import absolute_import from .client import VstsApiClient +import logging from sentry.models import Identity, Integration, OrganizationIntegration, sync_group_assignee_inbound from sentry.api.base import Endpoint from sentry.app import raven @@ -11,6 +12,7 @@ UNSET = object() # Pull email from the string: u'lauryn <[email protected]>' EMAIL_PARSER = re.compile(r'<(.*)>') +logger = logging.getLogger('sentry.integrations') class WorkItemWebhook(Endpoint): @@ -44,9 +46,19 @@ def check_webhook_secret(self, request, integration): def handle_updated_workitem(self, data, integration): external_issue_key = data['resource']['workItemId'] - assigned_to = data['resource']['fields'].get('System.AssignedTo') - status_change = data['resource']['fields'].get('System.State') project = data['resourceContainers']['project']['id'] + try: + assigned_to = data['resource']['fields'].get('System.AssignedTo') + status_change = data['resource']['fields'].get('System.State') + except KeyError: + logger.info( + 'vsts.updated-workitem-fields-not-passed', + extra={ + 'payload': data, + 'integration_id': integration.id + } + ) + return # In the case that there are no fields sent, no syncing can be done self.handle_assign_to(integration, external_issue_key, assigned_to) self.handle_status_change( integration,
a78d4f7bf441774f492feef9c025a2fa75efdad7
2023-07-18 19:32:23
William Mak
fix(starfish): eps and epm calculated incorrectly (#52988)
false
eps and epm calculated incorrectly (#52988)
fix
diff --git a/src/sentry/api/bases/organization_events.py b/src/sentry/api/bases/organization_events.py index 431860ae4ff533..669054c323f55d 100644 --- a/src/sentry/api/bases/organization_events.py +++ b/src/sentry/api/bases/organization_events.py @@ -469,6 +469,8 @@ def get_event_stats_data( "eps()": "eps(%d)" % rollup, "tpm()": "tpm(%d)" % rollup, "tps()": "tps(%d)" % rollup, + "sps()": "sps(%d)" % rollup, + "spm()": "spm(%d)" % rollup, } query_columns = [column_map.get(column, column) for column in columns] diff --git a/tests/snuba/api/endpoints/test_organization_events_stats_span_metrics.py b/tests/snuba/api/endpoints/test_organization_events_stats_span_metrics.py new file mode 100644 index 00000000000000..32cae7dd83206b --- /dev/null +++ b/tests/snuba/api/endpoints/test_organization_events_stats_span_metrics.py @@ -0,0 +1,163 @@ +from datetime import timedelta + +import pytest +from django.urls import reverse + +from sentry.search.events import constants +from sentry.testutils import MetricsEnhancedPerformanceTestCase +from sentry.testutils.helpers.datetime import before_now, iso_format +from sentry.testutils.silo import region_silo_test + +pytestmark = pytest.mark.sentry_metrics + + +@region_silo_test +class OrganizationEventsStatsSpansMetricsEndpointTest(MetricsEnhancedPerformanceTestCase): + endpoint = "sentry-api-0-organization-events-stats" + METRIC_STRINGS = [ + "foo_transaction", + ] + + def setUp(self): + super().setUp() + self.login_as(user=self.user) + self.day_ago = before_now(days=1).replace(hour=10, minute=0, second=0, microsecond=0) + self.DEFAULT_METRIC_TIMESTAMP = self.day_ago + + self.url = reverse( + "sentry-api-0-organization-events-stats", + kwargs={"organization_slug": self.project.organization.slug}, + ) + self.features = { + "organizations:performance-use-metrics": True, + } + + def do_request(self, data, url=None, features=None): + if features is None: + features = {"organizations:discover-basic": True} + features.update(self.features) + with self.feature(features): + return self.client.get(self.url if url is None else url, data=data, format="json") + + # These throughput tests should roughly match the ones in OrganizationEventsStatsEndpointTest + def test_throughput_epm_hour_rollup(self): + # Each of these denotes how many events to create in each hour + event_counts = [6, 0, 6, 3, 0, 3] + for hour, count in enumerate(event_counts): + for minute in range(count): + self.store_span_metric( + 1, + internal_metric=constants.SELF_TIME_LIGHT, + timestamp=self.day_ago + timedelta(hours=hour, minutes=minute), + ) + + for axis in ["epm()", "spm()"]: + response = self.do_request( + data={ + "start": iso_format(self.day_ago), + "end": iso_format(self.day_ago + timedelta(hours=6)), + "interval": "1h", + "yAxis": axis, + "project": self.project.id, + "dataset": "spansMetrics", + }, + ) + assert response.status_code == 200, response.content + data = response.data["data"] + assert len(data) == 6 + assert response.data["meta"]["dataset"] == "spansMetrics" + + rows = data[0:6] + for test in zip(event_counts, rows): + assert test[1][1][0]["count"] == test[0] / (3600.0 / 60.0) + + def test_throughput_epm_day_rollup(self): + # Each of these denotes how many events to create in each minute + event_counts = [6, 0, 6, 3, 0, 3] + for hour, count in enumerate(event_counts): + for minute in range(count): + self.store_transaction_metric( + 1, + internal_metric=constants.SELF_TIME_LIGHT, + timestamp=self.day_ago + timedelta(hours=hour, minutes=minute), + ) + + for axis in ["epm()", "spm()"]: + response = self.do_request( + data={ + "start": iso_format(self.day_ago), + "end": iso_format(self.day_ago + timedelta(hours=24)), + "interval": "24h", + "yAxis": axis, + "project": self.project.id, + "dataset": "spansMetrics", + }, + ) + assert response.status_code == 200, response.content + data = response.data["data"] + assert len(data) == 2 + assert response.data["meta"]["dataset"] == "spansMetrics" + + assert data[0][1][0]["count"] == sum(event_counts) / (86400.0 / 60.0) + + def test_throughput_epm_hour_rollup_offset_of_hour(self): + # Each of these denotes how many events to create in each hour + event_counts = [6, 0, 6, 3, 0, 3] + for hour, count in enumerate(event_counts): + for minute in range(count): + self.store_transaction_metric( + 1, + internal_metric=constants.SELF_TIME_LIGHT, + timestamp=self.day_ago + timedelta(hours=hour, minutes=minute + 30), + ) + + for axis in ["epm()", "spm()"]: + response = self.do_request( + data={ + "start": iso_format(self.day_ago + timedelta(minutes=30)), + "end": iso_format(self.day_ago + timedelta(hours=6, minutes=30)), + "interval": "1h", + "yAxis": axis, + "project": self.project.id, + "dataset": "spansMetrics", + }, + ) + assert response.status_code == 200, response.content + data = response.data["data"] + assert len(data) == 6 + assert response.data["meta"]["dataset"] == "spansMetrics" + + rows = data[0:6] + for test in zip(event_counts, rows): + assert test[1][1][0]["count"] == test[0] / (3600.0 / 60.0) + + def test_throughput_eps_minute_rollup(self): + # Each of these denotes how many events to create in each minute + event_counts = [6, 0, 6, 3, 0, 3] + for minute, count in enumerate(event_counts): + for second in range(count): + self.store_transaction_metric( + 1, + internal_metric=constants.SELF_TIME_LIGHT, + timestamp=self.day_ago + timedelta(minutes=minute, seconds=second), + ) + + for axis in ["eps()", "sps()"]: + response = self.do_request( + data={ + "start": iso_format(self.day_ago), + "end": iso_format(self.day_ago + timedelta(minutes=6)), + "interval": "1m", + "yAxis": axis, + "project": self.project.id, + "dataset": "spansMetrics", + }, + ) + assert response.status_code == 200, response.content + data = response.data["data"] + assert len(data) == 6 + assert response.data["meta"]["dataset"] == "spansMetrics" + + rows = data[0:6] + for test in zip(event_counts, rows): + assert test[1][1][0]["count"] == test[0] / 60.0
87480102a117643bfa9998dcd423e07e068fe608
2023-08-11 02:45:13
Eric Hasegawa
fix(auth): Remove invalid scopes from test file (#54570)
false
Remove invalid scopes from test file (#54570)
fix
diff --git a/tests/sentry/api/endpoints/test_oauth_userinfo.py b/tests/sentry/api/endpoints/test_oauth_userinfo.py index ec1cb9eb0398e1..152863d3956cf0 100644 --- a/tests/sentry/api/endpoints/test_oauth_userinfo.py +++ b/tests/sentry/api/endpoints/test_oauth_userinfo.py @@ -85,7 +85,7 @@ def test_gets_profile_information(self): def test_gets_multiple_scopes(self): all_access_token = ApiToken.objects.create( - user=self.user, scope_list=["openid", "profile", "email", "address", "phone"] + user=self.user, scope_list=["openid", "profile", "email"] ) self.client.credentials(HTTP_AUTHORIZATION="Bearer " + all_access_token.token)
8349ad3e6ef1f5e2751d616a9dc17023ee0a2091
2021-10-22 22:34:06
edwardgou-sentry
fix(discover): Disable y axis equations when in world map view (#29515)
false
Disable y axis equations when in world map view (#29515)
fix
diff --git a/static/app/views/eventsV2/resultsChart.tsx b/static/app/views/eventsV2/resultsChart.tsx index 558fb142cfdadd..f763c49fe80fa5 100644 --- a/static/app/views/eventsV2/resultsChart.tsx +++ b/static/app/views/eventsV2/resultsChart.tsx @@ -17,6 +17,7 @@ import {t} from 'app/locale'; import {Organization} from 'app/types'; import {getUtcToLocalDateObject} from 'app/utils/dates'; import EventView from 'app/utils/discover/eventView'; +import {isEquation} from 'app/utils/discover/fields'; import { DisplayModes, MULTI_Y_AXIS_SUPPORTED_DISPLAY_MODES, @@ -251,6 +252,11 @@ class ResultsChartContainer extends Component<ContainerProps> { }; }); } + // Equations on World Map isn't supported on the events-geo endpoint + // Disabling equations as an option to prevent erroring out + if (eventView.getDisplayMode() === DisplayModes.WORLDMAP) { + yAxisOptions = yAxisOptions.filter(({value}) => !isEquation(value)); + } return ( <StyledPanel> diff --git a/tests/js/spec/views/eventsV2/resultsChart.spec.tsx b/tests/js/spec/views/eventsV2/resultsChart.spec.tsx index de05d650b52f02..d1c7e74fc6bbd0 100644 --- a/tests/js/spec/views/eventsV2/resultsChart.spec.tsx +++ b/tests/js/spec/views/eventsV2/resultsChart.spec.tsx @@ -113,4 +113,33 @@ describe('EventsV2 > ResultsChart', function () { } }); }); + + it('disables equation y-axis options when in World Map display mode', async function () { + eventView.display = DisplayModes.WORLDMAP; + eventView.fields = [ + {field: 'count()'}, + {field: 'count_unique(user)'}, + {field: 'equation|count() + 2'}, + ]; + const wrapper = mountWithTheme( + <ResultsChart + // @ts-expect-error + router={TestStubs.router()} + organization={organization} + eventView={eventView} + // @ts-expect-error + location={location} + onAxisChange={() => undefined} + onDisplayChange={() => undefined} + total={1} + confirmedQuery + yAxis={['count()']} + />, + initialData.routerContext + ); + const yAxisOptions = wrapper.find('ChartFooter').props().yAxisOptions; + expect(yAxisOptions.length).toEqual(2); + expect(yAxisOptions[0].value).toEqual('count()'); + expect(yAxisOptions[1].value).toEqual('count_unique(user)'); + }); });
35206b51ef1e019122b98abf6c03043193058b95
2024-06-06 03:55:25
Ryan Albrecht
ref: Move semverCompare into utils/versions/ (#71854)
false
Move semverCompare into utils/versions/ (#71854)
ref
diff --git a/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx b/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx index 588b96b6a808b0..34e41b8dda49f8 100644 --- a/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx +++ b/static/app/components/events/interfaces/crashContent/exception/actionableItemsUtils.tsx @@ -20,7 +20,7 @@ import {defined} from 'sentry/utils'; import {trackAnalytics} from 'sentry/utils/analytics'; import {useApiQuery} from 'sentry/utils/queryClient'; import useOrganization from 'sentry/utils/useOrganization'; -import {semverCompare} from 'sentry/utils/versions'; +import {semverCompare} from 'sentry/utils/versions/semverCompare'; import {projectProcessingIssuesMessages} from 'sentry/views/settings/project/projectProcessingIssues'; const MINIFIED_DATA_JAVA_EVENT_REGEX_MATCH = diff --git a/static/app/utils/useProjectSdkNeedsUpdate.tsx b/static/app/utils/useProjectSdkNeedsUpdate.tsx index 2efd4cb0add0d8..47e8065904680c 100644 --- a/static/app/utils/useProjectSdkNeedsUpdate.tsx +++ b/static/app/utils/useProjectSdkNeedsUpdate.tsx @@ -1,7 +1,7 @@ import type {Organization} from 'sentry/types/organization'; import {useQuery} from 'sentry/utils/queryClient'; import useApi from 'sentry/utils/useApi'; -import {semverCompare} from 'sentry/utils/versions'; +import {semverCompare} from 'sentry/utils/versions/semverCompare'; type Opts = { minVersion: string; diff --git a/static/app/utils/versions.tsx b/static/app/utils/versions.tsx new file mode 100644 index 00000000000000..a889526e798bfa --- /dev/null +++ b/static/app/utils/versions.tsx @@ -0,0 +1,8 @@ +import {semverCompare} from 'sentry/utils/versions/semverCompare'; + +/** + * This is here for getsentry + * + * @deprecated Import directly from sentry/utils/versions/semverCompare instead. + */ +export {semverCompare}; diff --git a/static/app/utils/versions.spec.tsx b/static/app/utils/versions/semverCompare.spec.tsx similarity index 96% rename from static/app/utils/versions.spec.tsx rename to static/app/utils/versions/semverCompare.spec.tsx index 1f6c669ecd55fd..ea59c1be0992f6 100644 --- a/static/app/utils/versions.spec.tsx +++ b/static/app/utils/versions/semverCompare.spec.tsx @@ -1,7 +1,7 @@ // Taken from https://gist.github.com/iwill/a83038623ba4fef6abb9efca87ae9ccb // returns -1 for smaller, 0 for equals, and 1 for greater than -import {semverCompare} from './versions'; +import {semverCompare} from './semverCompare'; function testVersion(v1: string, operator: '<' | '>' | '=', v2: string) { const result = semverCompare(v1, v2); diff --git a/static/app/utils/versions.ts b/static/app/utils/versions/semverCompare.ts similarity index 100% rename from static/app/utils/versions.ts rename to static/app/utils/versions/semverCompare.ts diff --git a/static/app/views/performance/database/useOutdatedSDKProjects.tsx b/static/app/views/performance/database/useOutdatedSDKProjects.tsx index d0aa5960158d10..23561c13e346f4 100644 --- a/static/app/views/performance/database/useOutdatedSDKProjects.tsx +++ b/static/app/views/performance/database/useOutdatedSDKProjects.tsx @@ -2,7 +2,7 @@ import uniqBy from 'lodash/uniqBy'; import ProjectsStore from 'sentry/stores/projectsStore'; import {useOrganizationSDKUpdates} from 'sentry/utils/useOrganizationSDKUpdates'; -import {semverCompare} from 'sentry/utils/versions'; +import {semverCompare} from 'sentry/utils/versions/semverCompare'; import {MIN_SDK_VERSION_BY_PLATFORM} from 'sentry/views/performance/database/settings'; interface Options {
2f3327ad2c9c37dcaf94053cfdc696bbc9ede5bb
2024-04-29 23:51:25
Evan Purkhiser
ref(ui): Use Button for "Change Photo" (#69901)
false
Use Button for "Change Photo" (#69901)
ref
diff --git a/static/app/components/avatarUploader.tsx b/static/app/components/avatarUploader.tsx index 51f7ecc7208b51..e0fd2c9b1ffb77 100644 --- a/static/app/components/avatarUploader.tsx +++ b/static/app/components/avatarUploader.tsx @@ -2,6 +2,7 @@ import {Component, createRef, Fragment} from 'react'; import styled from '@emotion/styled'; import {addErrorMessage} from 'sentry/actionCreators/indicator'; +import {Button} from 'sentry/components/button'; import Well from 'sentry/components/well'; import {AVATAR_URL_MAP} from 'sentry/constants'; import {t, tct} from 'sentry/locale'; @@ -419,7 +420,11 @@ class AvatarUploader extends Component<Props, State> { {src && <HiddenCanvas ref={this.canvas} />} {this.renderImageCrop()} <div className="form-group"> - {src && <a onClick={this.uploadClick}>{t('Change Photo')}</a>} + {src && ( + <Button priority="link" onClick={this.uploadClick}> + {t('Change Photo')} + </Button> + )} <UploadInput ref={this.file} type="file"
f52b937814f7135df0fed71565d41f44f90d7b58
2025-02-28 22:39:52
Evan Purkhiser
feat(uptime): Add span count next to trace IDs (#86084)
false
Add span count next to trace IDs (#86084)
feat
diff --git a/static/app/views/alerts/rules/uptime/details.tsx b/static/app/views/alerts/rules/uptime/details.tsx index c8cc0fb148ef18..fa9b7022c8c378 100644 --- a/static/app/views/alerts/rules/uptime/details.tsx +++ b/static/app/views/alerts/rules/uptime/details.tsx @@ -22,11 +22,6 @@ import useApi from 'sentry/utils/useApi'; import useOrganization from 'sentry/utils/useOrganization'; import useProjects from 'sentry/utils/useProjects'; import {makeAlertsPathname} from 'sentry/views/alerts/pathnames'; -import { - CheckStatus, - type CheckStatusBucket, - type UptimeRule, -} from 'sentry/views/alerts/rules/uptime/types'; import { setUptimeRuleData, useUptimeRule, @@ -35,6 +30,7 @@ import { import {UptimeDetailsSidebar} from './detailsSidebar'; import {DetailsTimeline} from './detailsTimeline'; import {StatusToggleButton} from './statusToggleButton'; +import {CheckStatus, type CheckStatusBucket, type UptimeRule} from './types'; import {UptimeChecksTable} from './uptimeChecksTable'; import {UptimeIssues} from './uptimeIssues'; diff --git a/static/app/views/alerts/rules/uptime/uptimeChecksGrid.tsx b/static/app/views/alerts/rules/uptime/uptimeChecksGrid.tsx index 3305a3c53fc8ad..93784fb3332fb6 100644 --- a/static/app/views/alerts/rules/uptime/uptimeChecksGrid.tsx +++ b/static/app/views/alerts/rules/uptime/uptimeChecksGrid.tsx @@ -1,16 +1,21 @@ import {useTheme} from '@emotion/react'; import styled from '@emotion/styled'; +import Tag from 'sentry/components/badge/tag'; import {DateTime} from 'sentry/components/dateTime'; import Duration from 'sentry/components/duration'; import type {GridColumnOrder} from 'sentry/components/gridEditable'; import GridEditable from 'sentry/components/gridEditable'; +import ExternalLink from 'sentry/components/links/externalLink'; import Link from 'sentry/components/links/link'; +import Placeholder from 'sentry/components/placeholder'; import {Tooltip} from 'sentry/components/tooltip'; import {t, tct} from 'sentry/locale'; import {space} from 'sentry/styles/space'; import {getShortEventId} from 'sentry/utils/events'; -import type {UptimeCheck} from 'sentry/views/alerts/rules/uptime/types'; +import {MutableSearch} from 'sentry/utils/tokenizeSearch'; +import type {UptimeCheck, UptimeRule} from 'sentry/views/alerts/rules/uptime/types'; +import {useEAPSpans} from 'sentry/views/insights/common/queries/useDiscover'; import { reasonToText, statusToText, @@ -19,6 +24,7 @@ import { type Props = { uptimeChecks: UptimeCheck[]; + uptimeRule: UptimeRule; }; /** @@ -27,7 +33,28 @@ type Props = { */ const EMPTY_TRACE = '00000000000000000000000000000000'; -export function UptimeChecksGrid({uptimeChecks}: Props) { +export function UptimeChecksGrid({uptimeRule, uptimeChecks}: Props) { + const traceIds = uptimeChecks?.map(check => check.traceId) ?? []; + + const {data: spanCounts, isPending: spanCountLoading} = useEAPSpans( + { + limit: 10, + enabled: traceIds.length > 0, + search: new MutableSearch('').addDisjunctionFilterValues('trace', traceIds), + fields: ['trace', 'count()'], + }, + 'uptime_checks' + ); + + const traceSpanCounts = spanCountLoading + ? undefined + : Object.fromEntries( + traceIds.map(traceId => [ + traceId, + Number(spanCounts.find(row => row.trace === traceId)?.['count()'] ?? 0), + ]) + ); + return ( <GridEditable emptyMessage={t('No matching uptime checks found')} @@ -44,7 +71,12 @@ export function UptimeChecksGrid({uptimeChecks}: Props) { grid={{ renderHeadCell: (col: GridColumnOrder) => <Cell>{col.name}</Cell>, renderBodyCell: (column, dataRow) => ( - <CheckInBodyCell column={column} check={dataRow} /> + <CheckInBodyCell + column={column} + uptimeRule={uptimeRule} + check={dataRow} + spanCount={traceSpanCounts?.[dataRow.traceId]} + /> ), }} /> @@ -54,9 +86,13 @@ export function UptimeChecksGrid({uptimeChecks}: Props) { function CheckInBodyCell({ check, column, + spanCount, + uptimeRule, }: { check: UptimeCheck; column: GridColumnOrder<keyof UptimeCheck>; + spanCount: number | undefined; + uptimeRule: UptimeRule; }) { const theme = useTheme(); @@ -112,15 +148,52 @@ function CheckInBodyCell({ </Cell> ); } - case 'traceId': + case 'traceId': { if (traceId === EMPTY_TRACE) { return <Cell />; } + + const learnMore = ( + <ExternalLink href="https://docs.sentry.io/product/alerts/uptime-monitoring/uptime-tracing/" /> + ); + + const badge = + spanCount === undefined ? ( + <Placeholder height="20px" width="70px" /> + ) : spanCount === 0 ? ( + <Tag + type="default" + borderStyle="dashed" + tooltipProps={{isHoverable: true}} + tooltipText={ + uptimeRule.traceSampling + ? tct( + 'No spans found in this trace. Configure your SDKs to see correlated spans across services. [learnMore:Learn more].', + {learnMore} + ) + : tct( + 'Span sampling is disabled. Enable sampling to collect trace data. [learnMore:Learn more].', + {learnMore} + ) + } + > + {t('0 spans')} + </Tag> + ) : ( + <Tag type="info">{t('%s spans', spanCount)}</Tag> + ); + return ( - <LinkCell to={`/performance/trace/${traceId}/`}> - {getShortEventId(String(traceId))} - </LinkCell> + <TraceCell> + {spanCount ? ( + <Link to={`/performance/trace/${traceId}/`}>{getShortEventId(traceId)}</Link> + ) : ( + getShortEventId(traceId) + )} + {badge} + </TraceCell> ); + } default: return <Cell>{check[column.key]}</Cell>; } @@ -139,9 +212,8 @@ const TimeCell = styled(Cell)` text-decoration-style: dotted; `; -const LinkCell = styled(Link)` - text-decoration: underline; - text-decoration-color: ${p => p.theme.subText}; - cursor: pointer; - text-decoration-style: dotted; +const TraceCell = styled(Cell)` + display: grid; + grid-template-columns: 65px auto; + gap: ${space(1)}; `; diff --git a/static/app/views/alerts/rules/uptime/uptimeChecksTable.tsx b/static/app/views/alerts/rules/uptime/uptimeChecksTable.tsx index c984a4e565a977..163542beee24f7 100644 --- a/static/app/views/alerts/rules/uptime/uptimeChecksTable.tsx +++ b/static/app/views/alerts/rules/uptime/uptimeChecksTable.tsx @@ -52,7 +52,7 @@ export function UptimeChecksTable({uptimeRule}: UptimeChecksTableProps) { {isPending ? ( <LoadingIndicator /> ) : ( - <UptimeChecksGrid uptimeChecks={uptimeChecks} /> + <UptimeChecksGrid uptimeRule={uptimeRule} uptimeChecks={uptimeChecks} /> )} <Pagination pageLinks={getResponseHeader?.('Link')} /> </Fragment> diff --git a/static/app/views/insights/uptime/utils/useUptimeRule.tsx b/static/app/views/insights/uptime/utils/useUptimeRule.tsx index 2b18dddab540f5..5d0428ad24a0b0 100644 --- a/static/app/views/insights/uptime/utils/useUptimeRule.tsx +++ b/static/app/views/insights/uptime/utils/useUptimeRule.tsx @@ -3,6 +3,7 @@ import { type QueryClient, setApiQueryData, useApiQuery, + type UseApiQueryOptions, } from 'sentry/utils/queryClient'; import useOrganization from 'sentry/utils/useOrganization'; import type {UptimeRule} from 'sentry/views/alerts/rules/uptime/types'; @@ -12,13 +13,16 @@ interface UseUptimeRuleOptions { uptimeRuleId: string; } -export function useUptimeRule({projectSlug, uptimeRuleId}: UseUptimeRuleOptions) { +export function useUptimeRule( + {projectSlug, uptimeRuleId}: UseUptimeRuleOptions, + options: Partial<UseApiQueryOptions<UptimeRule>> = {} +) { const organization = useOrganization(); const queryKey: ApiQueryKey = [ `/projects/${organization.slug}/${projectSlug}/uptime/${uptimeRuleId}/`, ]; - return useApiQuery<UptimeRule>(queryKey, {staleTime: 0}); + return useApiQuery<UptimeRule>(queryKey, {staleTime: 0, ...options}); } interface SetUptimeRuleDataOptions { diff --git a/static/app/views/issueDetails/groupUptimeChecks.spec.tsx b/static/app/views/issueDetails/groupUptimeChecks.spec.tsx index 16cb21af2a07db..6f71a4d547d467 100644 --- a/static/app/views/issueDetails/groupUptimeChecks.spec.tsx +++ b/static/app/views/issueDetails/groupUptimeChecks.spec.tsx @@ -4,6 +4,7 @@ import {OrganizationFixture} from 'sentry-fixture/organization'; import {ProjectFixture} from 'sentry-fixture/project'; import {RouterFixture} from 'sentry-fixture/routerFixture'; import {UptimeCheckFixture} from 'sentry-fixture/uptimeCheck'; +import {UptimeRuleFixture} from 'sentry-fixture/uptimeRule'; import {render, screen} from 'sentry-test/reactTestingLibrary'; @@ -48,6 +49,10 @@ describe('GroupUptimeChecks', () => { url: `/organizations/${organization.slug}/issues/${group.id}/events/recommended/`, body: event, }); + MockApiClient.addMockResponse({ + url: `/projects/org-slug/project-slug/uptime/123/`, + body: UptimeRuleFixture(), + }); }); it('renders the empty uptime check table', async () => { @@ -81,9 +86,7 @@ describe('GroupUptimeChecks', () => { expect(screen.getByRole('time')).toHaveTextContent(/Jan 1, 2025/); expect(screen.getByText(statusToText[uptimeCheck.checkStatus])).toBeInTheDocument(); expect(screen.getByText(`${uptimeCheck.durationMs}ms`)).toBeInTheDocument(); - expect( - screen.getByRole('link', {name: getShortEventId(uptimeCheck.traceId)}) - ).toHaveAttribute('href', `/performance/trace/${uptimeCheck.traceId}/`); + expect(screen.getByText(getShortEventId(uptimeCheck.traceId))).toBeInTheDocument(); expect(screen.getByText(uptimeCheck.regionName)).toBeInTheDocument(); }); }); diff --git a/static/app/views/issueDetails/groupUptimeChecks.tsx b/static/app/views/issueDetails/groupUptimeChecks.tsx index fb8eaacab45c9e..015a576c6171fd 100644 --- a/static/app/views/issueDetails/groupUptimeChecks.tsx +++ b/static/app/views/issueDetails/groupUptimeChecks.tsx @@ -13,6 +13,8 @@ import {EventListTable} from 'sentry/views/issueDetails/streamline/eventListTabl import {useUptimeIssueAlertId} from 'sentry/views/issueDetails/streamline/issueUptimeCheckTimeline'; import {useGroup} from 'sentry/views/issueDetails/useGroup'; +import {useUptimeRule} from '../insights/uptime/utils/useUptimeRule'; + export default function GroupUptimeChecks() { const organization = useOrganization(); const {groupId} = useParams<{groupId: string}>(); @@ -30,6 +32,14 @@ export default function GroupUptimeChecks() { const canFetchUptimeChecks = Boolean(organization.slug) && Boolean(group?.project.slug) && Boolean(uptimeAlertId); + const {data: uptimeRule} = useUptimeRule( + { + projectSlug: group?.project.slug ?? '', + uptimeRuleId: uptimeAlertId ?? '', + }, + {enabled: canFetchUptimeChecks} + ); + const {data: uptimeChecks, getResponseHeader} = useUptimeChecks( { orgSlug: organization.slug, @@ -47,7 +57,7 @@ export default function GroupUptimeChecks() { return <LoadingError onRetry={refetchGroup} />; } - if (isGroupPending || uptimeChecks === undefined) { + if (isGroupPending || uptimeChecks === undefined || uptimeRule === undefined) { return <LoadingIndicator />; } @@ -67,7 +77,7 @@ export default function GroupUptimeChecks() { previousDisabled, }} > - <UptimeChecksGrid uptimeChecks={uptimeChecks} /> + <UptimeChecksGrid uptimeRule={uptimeRule} uptimeChecks={uptimeChecks} /> </EventListTable> ); }
c05270f8cafe4975fbd0ecf4c079133ccb2ec1cf
2022-03-25 20:40:00
Nar Saynorath
fix(widget-builder): Change from Line -> Table in Add to Dashboard doesn't request table data (#32945)
false
Change from Line -> Table in Add to Dashboard doesn't request table data (#32945)
fix
diff --git a/static/app/views/dashboardsV2/widgetBuilder/widgetBuilder.tsx b/static/app/views/dashboardsV2/widgetBuilder/widgetBuilder.tsx index 4e6ea87a5afdad..11b83e655aa814 100644 --- a/static/app/views/dashboardsV2/widgetBuilder/widgetBuilder.tsx +++ b/static/app/views/dashboardsV2/widgetBuilder/widgetBuilder.tsx @@ -30,6 +30,7 @@ import { explodeField, generateFieldAsString, getAggregateAlias, + getColumnsAndAggregates, getColumnsAndAggregatesAsStrings, QueryFieldValue, } from 'sentry/utils/discover/fields'; @@ -362,8 +363,9 @@ function WidgetBuilder({ // This is so the widget can reflect the same columns as the table in Discover without requiring additional user input if (newDisplayType === DisplayType.TABLE) { normalized.forEach(query => { - query.columns = [...defaultWidgetQuery.columns]; - query.aggregates = [...defaultWidgetQuery.aggregates]; + const tableQuery = getColumnsAndAggregates(defaultTableColumns); + query.columns = [...tableQuery.columns]; + query.aggregates = [...tableQuery.aggregates]; query.fields = [...defaultTableColumns]; }); } else if (newDisplayType === displayType) { diff --git a/tests/js/spec/views/dashboardsV2/widgetBuilder/widgetBuilder.spec.tsx b/tests/js/spec/views/dashboardsV2/widgetBuilder/widgetBuilder.spec.tsx index 777feb9c95b431..8e8f56783248bb 100644 --- a/tests/js/spec/views/dashboardsV2/widgetBuilder/widgetBuilder.spec.tsx +++ b/tests/js/spec/views/dashboardsV2/widgetBuilder/widgetBuilder.spec.tsx @@ -106,6 +106,7 @@ describe('WidgetBuilder', function () { }; let eventsStatsMock: jest.Mock | undefined; + let eventsv2Mock: jest.Mock | undefined; beforeEach(function () { MockApiClient.addMockResponse({ @@ -123,7 +124,7 @@ describe('WidgetBuilder', function () { body: [], }); - MockApiClient.addMockResponse({ + eventsv2Mock = MockApiClient.addMockResponse({ url: '/organizations/org-slug/eventsv2/', method: 'GET', statusCode: 200, @@ -753,6 +754,43 @@ describe('WidgetBuilder', function () { expect(handleSave).toHaveBeenCalledTimes(1); }); + it('should properly query for table fields ', async function () { + const defaultWidgetQuery = { + name: '', + fields: ['title', 'count()'], + columns: ['title'], + aggregates: ['count()'], + conditions: '', + orderby: '', + }; + + const defaultTableColumns = ['title', 'count()', 'count_unique(user)', 'epm()']; + + renderTestComponent({ + query: { + source: DashboardWidgetSource.DISCOVERV2, + defaultWidgetQuery: urlEncode(defaultWidgetQuery), + displayType: DisplayType.LINE, + defaultTableColumns, + }, + }); + + expect(await screen.findByText('Line Chart')).toBeInTheDocument(); + userEvent.click(screen.getByText('Line Chart')); + userEvent.click(screen.getByText('Table')); + + await waitFor(() => { + expect(eventsv2Mock).toHaveBeenLastCalledWith( + '/organizations/org-slug/eventsv2/', + expect.objectContaining({ + query: expect.objectContaining({ + field: defaultTableColumns, + }), + }) + ); + }); + }); + it('should automatically add columns for top n widget charts according to the URL params', async function () { const defaultWidgetQuery = { name: '',
1b1e1ed83fa3ee7da1009b927efbd7af94609301
2022-05-17 12:07:40
Jan Michael Auer
ref(metrics): Honor snuba group limits without orderBy [TET-5] (#34287)
false
Honor snuba group limits without orderBy [TET-5] (#34287)
ref
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 376c8aa30e6997..105b8ca6201b0e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -351,6 +351,8 @@ build-utils/ @getsentry/owners-js-build /src/sentry/snuba/metrics/ @getsentry/metrics /src/sentry/api/endpoints/organization_metrics.py @getsentry/metrics +/src/sentry/api/endpoints/organization_sessions.py @getsentry/metrics +src/sentry/snuba/metrics/query.py @getsentry/metrics /tests/sentry/api/endpoints/test_organization_metric_data.py @getsentry/metrics /tests/sentry/api/endpoints/test_organization_metric_details.py @getsentry/metrics /tests/sentry/api/endpoints/test_organization_metric_tag_details.py @getsentry/metrics diff --git a/src/sentry/api/endpoints/organization_metrics.py b/src/sentry/api/endpoints/organization_metrics.py index 9278167a69d282..5b6fa16995740f 100644 --- a/src/sentry/api/endpoints/organization_metrics.py +++ b/src/sentry/api/endpoints/organization_metrics.py @@ -107,9 +107,6 @@ class OrganizationMetricsDataEndpoint(OrganizationEndpoint): Based on `OrganizationSessionsEndpoint`. """ - # XXX: this should be aligned with sessions_v2 (which is SNUBA_LIMIT = - # 5000), but that triggers another error when querying series, as combined - # with groupby/rollup, MAX_POINTS can be exceeded easily. default_per_page = 50 def get(self, request: Request, organization) -> Response: diff --git a/src/sentry/api/endpoints/organization_sessions.py b/src/sentry/api/endpoints/organization_sessions.py index 5c0ecf97f6b9d3..5a66deb1b2ec27 100644 --- a/src/sentry/api/endpoints/organization_sessions.py +++ b/src/sentry/api/endpoints/organization_sessions.py @@ -1,4 +1,5 @@ from contextlib import contextmanager +from typing import Optional import sentry_sdk from django.utils.datastructures import MultiValueDict @@ -23,8 +24,15 @@ def data_fn(offset: int, limit: int): with sentry_sdk.start_span( op="sessions.endpoint", description="build_sessions_query" ): + request_limit = None + if request.GET.get("per_page") is not None: + request_limit = limit + request_offset = None + if request.GET.get("cursor") is not None: + request_offset = offset + query = self.build_sessions_query( - request, organization, offset=offset, limit=limit + request, organization, offset=request_offset, limit=request_limit ) return release_health.run_sessions_query( @@ -39,7 +47,11 @@ def data_fn(offset: int, limit: int): ) def build_sessions_query( - self, request: Request, organization: Organization, offset: int, limit: int + self, + request: Request, + organization: Organization, + offset: Optional[int], + limit: Optional[int], ): try: params = self.get_filter_params(request, organization, date_filter_optional=True) diff --git a/src/sentry/api/utils.py b/src/sentry/api/utils.py index 7c169ec0c16f6a..290c7896495794 100644 --- a/src/sentry/api/utils.py +++ b/src/sentry/api/utils.py @@ -30,13 +30,13 @@ def get_datetime_from_stats_period(stats_period, now=None): raise InvalidParams(f"Invalid statsPeriod: {stats_period!r}") -def default_start_end_dates(now=None): +def default_start_end_dates(now=None, default_stats_period=MAX_STATS_PERIOD): if now is None: now = timezone.now() - return now - MAX_STATS_PERIOD, now + return now - default_stats_period, now -def get_date_range_from_params(params, optional=False): +def get_date_range_from_params(params, optional=False, default_stats_period=MAX_STATS_PERIOD): """ Gets a date range from standard date range params we pass to the api. @@ -53,12 +53,14 @@ def get_date_range_from_params(params, optional=False): If `start` end `end` are passed, validate them, convert to `datetime` and returns them if valid. :param optional: When True, if no params passed then return `(None, None)`. + :param default_stats_period: When set, this becomes the interval upon which default start and + and end dates are defined :return: A length 2 tuple containing start/end or raises an `InvalidParams` exception """ now = timezone.now() - start, end = default_start_end_dates(now) + start, end = default_start_end_dates(now, default_stats_period) stats_period = params.get("statsPeriod") stats_period_start = params.get("statsPeriodStart") diff --git a/src/sentry/release_health/duplex.py b/src/sentry/release_health/duplex.py index 9922ddc4ef5784..c4f5c3064816c9 100644 --- a/src/sentry/release_health/duplex.py +++ b/src/sentry/release_health/duplex.py @@ -54,7 +54,7 @@ ) from sentry.release_health.metrics import MetricsReleaseHealthBackend from sentry.release_health.sessions import SessionsReleaseHealthBackend -from sentry.snuba.metrics.query_builder import get_intervals +from sentry.snuba.metrics.utils import get_intervals from sentry.snuba.sessions import get_rollup_starts_and_buckets from sentry.snuba.sessions_v2 import QueryDefinition from sentry.tasks.base import instrumented_task diff --git a/src/sentry/release_health/metrics_sessions_v2.py b/src/sentry/release_health/metrics_sessions_v2.py index 92054314d3de48..ca226216c00bda 100644 --- a/src/sentry/release_health/metrics_sessions_v2.py +++ b/src/sentry/release_health/metrics_sessions_v2.py @@ -53,7 +53,6 @@ from sentry.snuba.metrics.query import QueryDefinition as MetricsQuery from sentry.snuba.metrics.utils import OrderByNotSupportedOverCompositeEntityException from sentry.snuba.sessions_v2 import ( - SNUBA_LIMIT, InvalidParams, QueryDefinition, finite_or_none, @@ -434,7 +433,6 @@ def run_sessions_query( primary_metric_field = _get_primary_field(list(fields.values()), query.raw_groupby) orderby = OrderBy(primary_metric_field, Direction.DESC) - max_groups = SNUBA_LIMIT // len(intervals) metrics_query = MetricsQuery( org_id, project_ids, @@ -445,7 +443,7 @@ def run_sessions_query( where=where, groupby=list({column for field in fields.values() for column in field.get_groupby()}), orderby=orderby, - limit=Limit(min(query.limit or max_groups, max_groups)), + limit=Limit(query.limit) if query.limit else None, offset=Offset(query.offset or 0), ) diff --git a/src/sentry/snuba/metrics/datasource.py b/src/sentry/snuba/metrics/datasource.py index 2691d45acfff17..86dec9c73147aa 100644 --- a/src/sentry/snuba/metrics/datasource.py +++ b/src/sentry/snuba/metrics/datasource.py @@ -8,13 +8,14 @@ __all__ = ("get_metrics", "get_tags", "get_tag_values", "get_series", "get_single_metric_info") import logging -from collections import defaultdict, deque +from collections import OrderedDict, defaultdict, deque from copy import copy -from dataclasses import replace +from dataclasses import dataclass, replace from operator import itemgetter -from typing import Any, Dict, Mapping, Optional, Sequence, Set, Tuple, Union +from typing import Any, Dict, List, Mapping, Optional, Sequence, Set, Tuple, Union -from snuba_sdk import Column, Condition, Function, Op, Request +from snuba_sdk import Column, Condition, Function, Op, Query, Request +from snuba_sdk.conditions import ConditionGroup from sentry.api.utils import InvalidParams from sentry.models import Project @@ -24,12 +25,11 @@ from sentry.snuba.metrics.fields import run_metrics_query from sentry.snuba.metrics.fields.base import get_derived_metrics, org_id_from_projects from sentry.snuba.metrics.naming_layer.mapping import get_mri, get_public_name_from_mri -from sentry.snuba.metrics.query import QueryDefinition +from sentry.snuba.metrics.query import Groupable, QueryDefinition from sentry.snuba.metrics.query_builder import ( ALLOWED_GROUPBY_COLUMNS, SnubaQueryBuilder, SnubaResultConverter, - get_intervals, ) from sentry.snuba.metrics.utils import ( AVAILABLE_OPERATIONS, @@ -43,6 +43,7 @@ NotSupportedOverCompositeEntityException, Tag, TagValue, + get_intervals, ) from sentry.snuba.sessions_v2 import InvalidField from sentry.utils.snuba import raw_snql_query @@ -420,6 +421,141 @@ def get_tag_values( return tags +@dataclass +class GroupLimitFilters: + """Fields and values to filter queries when exceeding the Snuba query limit. + + Snuba imposes a limit on the number of rows that can be queried and + returned. This limit can be exceeded when grouping metrics by one or more + tags. In this case, we take the first groups returned by Snuba and filter + subsequent queries with this set of tag values. + + Fields: + + - ``keys``: A tuple containing resolved tag names ("tag[123]") in the order + of the ``groupBy`` clause. + + - ``values``: A list of tuples containing the tag values of the group keys. + The list is in the order returned by Snuba. The tuple elements are ordered + like ``keys``. + + - ``conditions``: A list of raw snuba query conditions to filter subsequent + queries by. + """ + + keys: Tuple[Groupable] + values: List[Tuple[int]] + conditions: ConditionGroup + + +def _get_group_limit_filters( + query: QueryDefinition, results: List[Mapping[str, int]] +) -> Optional[GroupLimitFilters]: + if not query.groupby or not results: + return None + + # Translate the groupby fields of the query into their tag keys because these fields + # will be used to filter down and order the results of the 2nd query. + # For example, (project_id, transaction) is translated to (project_id, tags[3]) + keys = tuple( + resolve_tag_key(query.org_id, field) if field not in ALLOWED_GROUPBY_COLUMNS else field + for field in query.groupby + ) + + # Get an ordered list of tuples containing the values of the group keys. + # This needs to be deduplicated since in timeseries queries the same + # grouping key will reappear for every time bucket. + values = list(OrderedDict((tuple(row[col] for col in keys), None) for row in results).keys()) + conditions = [ + Condition(Function("tuple", [Column(k) for k in keys]), Op.IN, Function("tuple", values)) + ] + + # In addition to filtering down on the tuple combination of the fields in + # the group by columns, we need a separate condition for each of the columns + # in the group by with their respective values so Clickhouse can filter the + # results down before checking for the group by column combinations. + values_by_column = {col: list({row[col] for row in results}) for col in keys} + conditions += [ + Condition(Column(col), Op.IN, Function("tuple", col_values)) + for col, col_values in values_by_column.items() + ] + + return GroupLimitFilters(keys=keys, values=values, conditions=conditions) + + +def _apply_group_limit_filters(query: Query, filters: GroupLimitFilters) -> Query: + where = list(filters.conditions) + + for condition in query.where or []: + # If query is grouped by project_id, then we should remove the original + # condition project_id cause it might be more relaxed than the project_id + # condition in the second query. This does not improve performance, but the + # readability of the query. + if not ( + isinstance(condition, Condition) + and isinstance(condition.lhs, Column) + and condition.lhs.name == "project_id" + and "project_id" in filters.keys + ): + where.append(condition) + + # The initial query already selected the "page", so reset the offset + return query.set_where(where).set_offset(0) + + +def _sort_results_by_group_filters( + results: List[Mapping[str, Any]], filters: GroupLimitFilters +) -> List[Mapping[str, Any]]: + # Create a dictionary that has keys representing the ordered by tuples from the + # initial query, so that we are able to order it easily in the next code block + # If for example, we are grouping by (project_id, transaction) -> then this + # logic will output a dictionary that looks something like, where `tags[1]` + # represents transaction + # { + # (3, 2): [{"metric_id": 4, "project_id": 3, "tags[1]": 2, "p50": [11.0]}], + # (3, 3): [{"metric_id": 4, "project_id": 3, "tags[1]": 3, "p50": [5.0]}], + # } + rows_by_group_values = {} + for row in results: + group_values = tuple(row[col] for col in filters.keys) + rows_by_group_values.setdefault(group_values, []).append(row) + + # Order the results according to the results of the initial query, so that when + # the results dict is passed on to `SnubaResultsConverter`, it comes out ordered + # Ordered conditions might for example look something like this + # {..., ('project_id', 'tags[1]'): [(3, 3), (3, 2)]}, then we end up with + # { + # "totals": { + # "data": [ + # { + # "metric_id": 5, "project_id": 3, "tags[1]": 3, "count_unique": 5 + # }, + # { + # "metric_id": 5, "project_id": 3, "tags[1]": 2, "count_unique": 1 + # }, + # ] + # } + # } + + sorted = [] + for group_values in filters.values: + sorted += rows_by_group_values.get(group_values, []) + + return sorted + + +def _prune_extra_groups(results: dict, filters: GroupLimitFilters) -> None: + valid_values = set(filters.values) + for _entity, queries in results.items(): + for key, query_results in queries.items(): + filtered = [] + for row in query_results["data"]: + group_values = tuple(row[col] for col in filters.keys) + if group_values in valid_values: + filtered.append(row) + queries[key]["data"] = filtered + + def get_series(projects: Sequence[Project], query: QueryDefinition) -> dict: """Get time series for the given query""" intervals = list(get_intervals(query.start, query.end, query.granularity.granularity)) @@ -491,129 +627,82 @@ def get_series(projects: Sequence[Project], query: QueryDefinition) -> dict: query_builder = SnubaQueryBuilder(projects, query) snuba_queries, fields_in_entities = query_builder.get_snuba_queries() - # Translate the groupby fields of the query into their tag keys because these fields - # will be used to filter down and order the results of the 2nd query. - # For example, (project_id, transaction) is translated to (project_id, tags[3]) - groupby_tags = tuple( - resolve_tag_key(query.org_id, field) - if field not in ALLOWED_GROUPBY_COLUMNS - else field - for field in (query.groupby or []) - ) - - # Dictionary that contains the conditions that are required to be added to the where - # clause of the second query. In addition to filtering down on the tuple combination - # of the fields in the group by columns, we need a separate condition for each of - # the columns in the group by with their respective values so Clickhouse can - # filter the results down before checking for the group by column combinations. - ordered_tag_conditions = { - col: list({data_elem[col] for data_elem in initial_query_results}) - for col in groupby_tags - } - ordered_tag_conditions[groupby_tags] = [ - tuple(data_elem[col] for col in groupby_tags) for data_elem in initial_query_results - ] + group_limit_filters = _get_group_limit_filters(query, initial_query_results) + # This loop has constant time complexity as it will always have a maximum of + # three queries corresponding to the three available entities: + # ["metrics_sets", "metrics_distributions", "metrics_counters"] for entity, queries in snuba_queries.items(): results.setdefault(entity, {}) - # This loop has constant time complexity as it will always have a maximum of - # three queries corresponding to the three available entities - # ["metrics_sets", "metrics_distributions", "metrics_counters"] for key, snuba_query in queries.items(): - results[entity].setdefault(key, {"data": []}) - # If query is grouped by project_id, then we should remove the original - # condition project_id cause it might be more relaxed than the project_id - # condition in the second query - where = [] - for condition in snuba_query.where: - if not ( - isinstance(condition, Condition) - and isinstance(condition.lhs, Column) - and condition.lhs.name == "project_id" - and "project_id" in groupby_tags - ): - where += [condition] - - # Adds the conditions obtained from the previous query - for condition_key, condition_value in ordered_tag_conditions.items(): - if not condition_key or not condition_value: - # Safeguard to prevent adding empty conditions to the where clause - continue - - lhs_condition = ( - Function("tuple", [Column(col) for col in condition_key]) - if isinstance(condition_key, tuple) - else Column(condition_key) - ) - where += [ - Condition(lhs_condition, Op.IN, Function("tuple", condition_value)) - ] - snuba_query = snuba_query.set_where(where) + if group_limit_filters: + snuba_query = _apply_group_limit_filters(snuba_query, group_limit_filters) - # The initial query already selected the "page", so reset the offset - snuba_query = snuba_query.set_offset(0) request = Request( dataset=Dataset.Metrics.value, app_id="default", query=snuba_query ) - snuba_query_res = raw_snql_query( + snuba_result = raw_snql_query( request, use_cache=False, referrer=f"api.metrics.{key}.second_query" - ) - # Create a dictionary that has keys representing the ordered by tuples from the - # initial query, so that we are able to order it easily in the next code block - # If for example, we are grouping by (project_id, transaction) -> then this - # logic will output a dictionary that looks something like, where `tags[1]` - # represents transaction - # { - # (3, 2): [{"metric_id": 4, "project_id": 3, "tags[1]": 2, "p50": [11.0]}], - # (3, 3): [{"metric_id": 4, "project_id": 3, "tags[1]": 3, "p50": [5.0]}], - # } - snuba_query_data_dict = {} - for data_elem in snuba_query_res["data"]: - snuba_query_data_dict.setdefault( - tuple(data_elem[col] for col in groupby_tags), [] - ).append(data_elem) - - # Order the results according to the results of the initial query, so that when - # the results dict is passed on to `SnubaResultsConverter`, it comes out ordered - # Ordered conditions might for example look something like this - # {..., ('project_id', 'tags[1]'): [(3, 3), (3, 2)]}, then we end up with - # { - # "totals": { - # "data": [ - # { - # "metric_id": 5, "project_id": 3, "tags[1]": 3, "count_unique": 5 - # }, - # { - # "metric_id": 5, "project_id": 3, "tags[1]": 2, "count_unique": 1 - # }, - # ] - # } - # } - for group_tuple in ordered_tag_conditions[groupby_tags]: - results[entity][key]["data"] += snuba_query_data_dict.get(group_tuple, []) + )["data"] + + # Since we removed the orderBy from all subsequent queries, + # we need to sort the results manually. This is required for + # the paginator, since it always queries one additional row + # and removes it at the end. + if group_limit_filters: + snuba_result = _sort_results_by_group_filters( + snuba_result, group_limit_filters + ) + + results[entity][key] = {"data": snuba_result} + else: snuba_queries, fields_in_entities = SnubaQueryBuilder(projects, query).get_snuba_queries() + group_limit_filters = None + for entity, queries in snuba_queries.items(): results.setdefault(entity, {}) for key, snuba_query in queries.items(): - if snuba_query is None: - continue + if group_limit_filters: + snuba_query = _apply_group_limit_filters(snuba_query, group_limit_filters) request = Request( dataset=Dataset.Metrics.value, app_id="default", query=snuba_query ) - results[entity][key] = raw_snql_query( - request, use_cache=False, referrer=f"api.metrics.{key}" - ) + snuba_result = raw_snql_query( + request, + use_cache=False, + referrer=f"api.metrics.{key}", + )["data"] + + snuba_limit = snuba_query.limit.limit if snuba_query.limit else None + if not group_limit_filters and snuba_limit and len(snuba_result) == snuba_limit: + group_limit_filters = _get_group_limit_filters(query, snuba_result) + + # We're now applying a filter that past queries may not have + # had. To avoid partial results, remove extra groups that + # aren't in the filter retroactively. + if group_limit_filters: + _prune_extra_groups(results, group_limit_filters) + + results[entity][key] = {"data": snuba_result} assert projects converter = SnubaResultConverter( projects[0].organization_id, query, fields_in_entities, intervals, results ) + result_groups = converter.translate_results() + # It can occur, when we make queries that are not ordered, that we end up with a number of + # groups that doesn't meet the limit of the query for each of the entities, and hence they + # don't go through the pruning logic resulting in a total number of groups that is greater + # than the limit, and hence we need to prune those excess groups + if len(result_groups) > query.limit.limit: + result_groups = result_groups[0 : query.limit.limit] + return { "start": query.start, "end": query.end, "intervals": intervals, - "groups": converter.translate_results(), + "groups": result_groups, } diff --git a/src/sentry/snuba/metrics/query.py b/src/sentry/snuba/metrics/query.py index 2cc1b14d9e92d6..2881fde6d6b7ca 100644 --- a/src/sentry/snuba/metrics/query.py +++ b/src/sentry/snuba/metrics/query.py @@ -1,12 +1,15 @@ """ Classes needed to build a metrics query. Inspired by snuba_sdk.query. """ +import math from dataclasses import dataclass -from datetime import datetime +from datetime import datetime, timedelta from typing import Literal, Optional, Sequence, Union from snuba_sdk import Direction, Granularity, Limit, Offset from snuba_sdk.conditions import ConditionGroup -from .utils import MetricOperationType +from sentry.api.utils import InvalidParams + +from .utils import MAX_POINTS, MetricOperationType # TODO: Add __all__ to be consistent with sibling modules @@ -49,3 +52,33 @@ class QueryDefinition: histogram_buckets: int = 100 histogram_from: Optional[float] = None histogram_to: Optional[float] = None + + def __post_init__(self) -> None: + # Validate series limit + intervals_len = math.ceil( + (self.end - self.start).total_seconds() / self.granularity.granularity + ) + if self.limit is not None: + if self.limit.limit > MAX_POINTS: + raise InvalidParams( + f"Requested limit exceeds the maximum allowed limit of {MAX_POINTS}" + ) + if self.include_series: + if intervals_len * self.limit.limit > MAX_POINTS: + raise InvalidParams( + f"Requested interval of timedelta of " + f"{timedelta(seconds=self.granularity.granularity)} with statsPeriod " + f"timedelta of {self.end-self.start} is too granular for a per_page of " + f"{self.limit.limit} elements. Increase your interval, decrease your " + f"statsPeriod, or decrease your per_page parameter." + ) + else: + totals_limit = MAX_POINTS + if self.include_series: + # In a series query, we also need to factor in the len of the intervals + # array. The number of totals should never get so large that the + # intervals exceed MAX_POINTS, however at least a single group. + totals_limit = max(totals_limit // intervals_len, 1) + # Cannot set attribute directly because dataclass is frozen: + # https://docs.python.org/3/library/dataclasses.html#frozen-instances + object.__setattr__(self, "limit", Limit(totals_limit)) diff --git a/src/sentry/snuba/metrics/query_builder.py b/src/sentry/snuba/metrics/query_builder.py index 0508741492d938..ae2875c8e89c33 100644 --- a/src/sentry/snuba/metrics/query_builder.py +++ b/src/sentry/snuba/metrics/query_builder.py @@ -3,7 +3,6 @@ "SnubaQueryBuilder", "SnubaResultConverter", "get_date_range", - "get_intervals", "parse_field", "parse_query", "resolve_tags", @@ -50,6 +49,7 @@ UNALLOWED_TAGS, DerivedMetricParseException, MetricDoesNotExistException, + get_intervals, ) from sentry.snuba.sessions_v2 import ONE_DAY # TODO: unite metrics and sessions_v2 from sentry.snuba.sessions_v2 import AllowedResolution, InvalidField, finite_or_none @@ -222,8 +222,8 @@ def __init__(self, projects, query_params, paginator_kwargs: Optional[Dict] = No self.fields.append(parse_field(key, query_params)) self.orderby = self._parse_orderby(query_params) - self.limit: Optional[Limit] = self._parse_limit(query_params, paginator_kwargs) - self.offset: Optional[Offset] = self._parse_offset(query_params, paginator_kwargs) + self.limit: Optional[Limit] = self._parse_limit(paginator_kwargs) + self.offset: Optional[Offset] = self._parse_offset(paginator_kwargs) start, end, rollup = get_date_range(query_params) self.rollup = rollup @@ -244,9 +244,6 @@ def __init__(self, projects, query_params, paginator_kwargs: Optional[Dict] = No if not (self.include_series or self.include_totals): raise InvalidParams("Cannot omit both series and totals") - # Validates that time series limit will not exceed the snuba limit of 10,000 - self._validate_series_limit(query_params) - def to_query_definition(self) -> QueryDefinition: return QueryDefinition( org_id=org_id_from_projects(self._projects), @@ -288,52 +285,15 @@ def _parse_orderby(self, query_params): return MetricsOrderBy(field, direction) - def _parse_limit(self, query_params, paginator_kwargs): - if self.orderby: - return Limit(paginator_kwargs.get("limit")) - else: - per_page = query_params.get("per_page") - if per_page is not None: - # If order by is not None, it means we will have a `series` query which cannot be - # paginated, and passing a `per_page` url param to paginate the results is not - # possible - raise InvalidParams("'per_page' is only supported in combination with 'orderBy'") - return None + def _parse_limit(self, paginator_kwargs) -> Optional[Limit]: + if "limit" not in paginator_kwargs: + return + return Limit(paginator_kwargs["limit"]) - def _parse_offset(self, query_params, paginator_kwargs): - if self.orderby: - offset = paginator_kwargs.get("offset") - if offset: - return Offset(offset) - return None - else: - cursor = query_params.get("cursor") - if cursor is not None: - # If order by is not None, it means we will have a `series` query which cannot be - # paginated, and passing a `per_page` url param to paginate the results is not - # possible - raise InvalidParams("'cursor' is only supported in combination with 'orderBy'") - return None - - def _validate_series_limit(self, query_params): - if self.limit: - if ( - self.end - self.start - ).total_seconds() / self.rollup * self.limit.limit > MAX_POINTS: - raise InvalidParams( - f"Requested interval of {query_params.get('interval', '1h')} with statsPeriod of " - f"{query_params.get('statsPeriod')} is too granular for a per_page of " - f"{self.limit.limit} elements. Increase your interval, decrease your statsPeriod, " - f"or decrease your per_page parameter." - ) - - -def get_intervals(start: datetime, end: datetime, granularity: int): - assert granularity > 0 - delta = timedelta(seconds=granularity) - while start < end: - yield start - start += delta + def _parse_offset(self, paginator_kwargs) -> Optional[Offset]: + if "offset" not in paginator_kwargs: + return + return Offset(paginator_kwargs["offset"]) def get_date_range(params: Mapping) -> Tuple[datetime, datetime, int]: @@ -361,7 +321,7 @@ def get_date_range(params: Mapping) -> Tuple[datetime, datetime, int]: if ONE_DAY % interval != 0: raise InvalidParams("The interval should divide one day without a remainder.") - start, end = get_date_range_from_params(params) + start, end = get_date_range_from_params(params, default_stats_period=timedelta(days=1)) date_range = end - start @@ -447,7 +407,7 @@ def __build_totals_and_series_queries( groupby=groupby, select=select, where=where, - limit=limit or Limit(MAX_POINTS), + limit=limit, offset=offset or Offset(0), granularity=rollup, orderby=orderby, @@ -457,16 +417,11 @@ def __build_totals_and_series_queries( rv["totals"] = totals_query if self._query_definition.include_series: - series_query = totals_query.set_groupby( - (totals_query.groupby or []) + [Column(TS_COL_GROUP)] + series_limit = limit.limit * intervals_len + rv["series"] = totals_query.set_limit(series_limit).set_groupby( + list(totals_query.groupby or []) + [Column(TS_COL_GROUP)] ) - # In a series query, we also need to factor in the len of the intervals array - series_limit = MAX_POINTS - if limit: - series_limit = limit.limit * intervals_len - rv["series"] = series_query.set_limit(series_limit) - return rv def __update_query_dicts_with_component_entities( diff --git a/src/sentry/snuba/metrics/utils.py b/src/sentry/snuba/metrics/utils.py index 7b86660d26ecc3..0338609f83c0eb 100644 --- a/src/sentry/snuba/metrics/utils.py +++ b/src/sentry/snuba/metrics/utils.py @@ -30,11 +30,13 @@ "MetricEntity", "UNALLOWED_TAGS", "combine_dictionary_of_list_values", + "get_intervals", ) import re from abc import ABC +from datetime import datetime, timedelta from typing import ( Collection, Dict, @@ -211,3 +213,11 @@ class NotSupportedOverCompositeEntityException(DerivedMetricException): class OrderByNotSupportedOverCompositeEntityException(NotSupportedOverCompositeEntityException): ... + + +def get_intervals(start: datetime, end: datetime, granularity: int): + assert granularity > 0 + delta = timedelta(seconds=granularity) + while start < end: + yield start + start += delta diff --git a/tests/sentry/api/endpoints/test_organization_metric_data.py b/tests/sentry/api/endpoints/test_organization_metric_data.py index 4560d41ffb964c..f1c07f2cadefcb 100644 --- a/tests/sentry/api/endpoints/test_organization_metric_data.py +++ b/tests/sentry/api/endpoints/test_organization_metric_data.py @@ -32,6 +32,9 @@ def setUp(self): self.transaction_lcp_metric = indexer.record( self.project.organization.id, TransactionMRI.MEASUREMENTS_LCP.value ) + org_id = self.organization.id + self.session_metric = indexer.record(org_id, SessionMRI.SESSION.value) + self.session_error_metric = indexer.record(org_id, SessionMRI.ERROR.value) def test_missing_field(self): response = self.get_response(self.project.organization.slug) @@ -135,8 +138,8 @@ def test_orderby_tag(self): def test_pagination_limit_without_orderby(self): """ - Test that ensures an exception is raised when pagination `per_page` parameter is sent - without order by being set + Test that ensures a successful response is returned even when sending a per_page + without an orderBy """ response = self.get_response( self.organization.slug, @@ -144,26 +147,21 @@ def test_pagination_limit_without_orderby(self): groupBy="transaction", per_page=2, ) - assert response.status_code == 400 - assert response.json()["detail"] == ( - "'per_page' is only supported in combination with 'orderBy'" - ) + assert response.status_code == 200 def test_pagination_offset_without_orderby(self): """ - Test that ensures an exception is raised when pagination `per_page` parameter is sent - without order by being set + Test that ensures a successful response is returned even when requesting an offset + without an orderBy """ response = self.get_response( self.organization.slug, field=f"count({TransactionMetricKey.MEASUREMENTS_LCP.value})", groupBy="transaction", cursor=Cursor(0, 1), + statsPeriod="1h", ) - assert response.status_code == 400 - assert response.json()["detail"] == ( - "'cursor' is only supported in combination with 'orderBy'" - ) + assert response.status_code == 200, response.data def test_statsperiod_invalid(self): response = self.get_response( @@ -404,7 +402,6 @@ def test_limit_with_orderby_is_overridden_by_paginator_limit(self): groupBy="tag1", orderBy=f"p50({TransactionMetricKey.MEASUREMENTS_LCP.value})", per_page=1, - limit=2, ) groups = response.data["groups"] assert len(groups) == 1 @@ -824,6 +821,242 @@ def test_orderby_percentile_with_many_fields_multiple_entities_with_missing_data f"p50({TransactionMetricKey.MEASUREMENTS_LCP.value})": [expected_lcp_count], } + def test_limit_without_orderby(self): + """ + Test that ensures when an `orderBy` clause is not set, then we still get groups that fit + within the limit, and that are also with complete data from across the entities + """ + org_id = self.organization.id + + fcp_metric = indexer.record( + self.project.organization.id, TransactionMRI.MEASUREMENTS_FCP.value + ) + tag3 = indexer.record(org_id, "tag3") + value1 = indexer.record(org_id, "value1") + value2 = indexer.record(org_id, "value2") + value3 = indexer.record(org_id, "value3") + value4 = indexer.record(org_id, "value4") + + self._send_buckets( + [ + { + "org_id": org_id, + "project_id": self.project.id, + "metric_id": self.session_metric, + "timestamp": int(time.time()), + "tags": {tag3: value1}, + "type": "c", + "value": 10, + "retention_days": 90, + } + ], + entity="metrics_counters", + ) + self._send_buckets( + [ + { + "org_id": org_id, + "project_id": self.project.id, + "metric_id": fcp_metric, + "timestamp": int(time.time()), + "type": "d", + "value": [1], + "tags": {tag3: value}, + "retention_days": 90, + } + for value in ( + value2, + value3, + value4, + ) + ], + entity="metrics_distributions", + ) + response = self.get_success_response( + self.organization.slug, + field=[ + f"p50({TransactionMetricKey.MEASUREMENTS_LCP.value})", + f"p50({TransactionMetricKey.MEASUREMENTS_FCP.value})", + ], + statsPeriod="1h", + interval="1h", + groupBy="tag3", + per_page=2, + ) + + groups = response.data["groups"] + assert len(groups) == 2 + + # we don't know which of {value2, value3, value4} is returned, just that + # it can't be `value1`, which is only on the other metric + returned_values = {group["by"]["tag3"] for group in groups} + assert "value1" not in returned_values, returned_values + + def test_limit_without_orderby_excess_groups_pruned(self): + """ + Test that ensures that when requesting series data that is not ordered, if the limit of + each query is not met, thereby a limit is not applied to the aueries and we end up with + more groups than the limit then the excess number of groups should be pruned + """ + org_id = self.organization.id + user_ts = time.time() + + tag1 = indexer.record(org_id, "tag1") + group1 = indexer.record(org_id, "group1") + group2 = indexer.record(org_id, "group2") + group3 = indexer.record(org_id, "group3") + group4 = indexer.record(org_id, "group4") + group5 = indexer.record(org_id, "group5") + + self._send_buckets( + [ + { + "org_id": org_id, + "project_id": self.project.id, + "metric_id": self.session_metric, + "timestamp": (user_ts // 60 - 4) * 60, + "tags": {tag: tag_value}, + "type": "c", + "value": 10, + "retention_days": 90, + } + for tag, tag_value in ((tag1, group1), (tag1, group2)) + ], + entity="metrics_counters", + ) + self._send_buckets( + [ + { + "org_id": org_id, + "project_id": self.project.id, + "metric_id": self.session_error_metric, + "timestamp": user_ts, + "tags": {tag: value}, + "type": "s", + "value": numbers, + "retention_days": 90, + } + for tag, value, numbers in ( + (tag1, group2, list(range(3))), + (tag1, group3, list(range(3, 6))), + ) + ], + entity="metrics_sets", + ) + self._send_buckets( + [ + { + "org_id": org_id, + "project_id": self.project.id, + "metric_id": self.transaction_lcp_metric, + "timestamp": int(time.time()), + "type": "d", + "value": numbers, + "tags": {tag: value}, + "retention_days": 90, + } + for tag, value, numbers in ( + (tag1, group4, list(range(3))), + (tag1, group5, list(range(3, 6))), + ) + ], + entity="metrics_distributions", + ) + response = self.get_success_response( + self.organization.slug, + field=[ + f"p50({TransactionMetricKey.MEASUREMENTS_LCP.value})", + f"p50({TransactionMetricKey.MEASUREMENTS_FCP.value})", + SessionMetricKey.ERRORED.value, + "sum(sentry.sessions.session)", + ], + statsPeriod="1h", + interval="1h", + groupBy="tag1", + per_page=3, + ) + + groups = response.data["groups"] + assert len(groups) == 3 + + def test_limit_without_orderby_partial_groups_pruned(self): + """ + Test that ensures that when requesting series data that is not ordered, if the limit of + each query is met, thereby a limit is applied to the queries and we end up with + with groups that have complete data across all entities + """ + org_id = self.organization.id + user_ts = time.time() + + tag2 = indexer.record(org_id, "tag2") + b1 = indexer.record(org_id, "B1") + b2 = indexer.record(org_id, "B2") + b3 = indexer.record(org_id, "B3") + c1 = indexer.record(org_id, "C1") + a1 = indexer.record(org_id, "A1") + + self._send_buckets( + [ + { + "org_id": org_id, + "project_id": self.project.id, + "metric_id": self.session_metric, + "timestamp": (user_ts // 60 - 4) * 60, + "tags": {tag: tag_value}, + "type": "c", + "value": 10, + "retention_days": 90, + } + for tag, tag_value in ( + (tag2, a1), + (tag2, b1), + (tag2, c1), + ) + ], + entity="metrics_counters", + ) + self._send_buckets( + [ + { + "org_id": org_id, + "project_id": self.project.id, + "metric_id": self.session_error_metric, + "timestamp": user_ts, + "tags": {tag: value}, + "type": "s", + "value": numbers, + "retention_days": 90, + } + for tag, value, numbers in [ + (tag2, b2, list(range(3))), + (tag2, b3, list(range(3, 6))), + (tag2, c1, list(range(6, 9))), + (tag2, b1, list(range(18, 21))), + ] + ], + entity="metrics_sets", + ) + response = self.get_success_response( + self.organization.slug, + field=[ + f"p50({TransactionMetricKey.MEASUREMENTS_LCP.value})", + f"p50({TransactionMetricKey.MEASUREMENTS_FCP.value})", + SessionMetricKey.ERRORED.value, + "sum(sentry.sessions.session)", + ], + statsPeriod="1h", + interval="1h", + groupBy="tag2", + per_page=3, + ) + + groups = response.data["groups"] + assert len(groups) == 3 + returned_values = {group["by"]["tag2"] for group in groups} + # We need to make sure that B1 and C1 are in the returned groups as they are the + # ones with the most overlap + assert {"B1", "C1"}.issubset(returned_values) + def test_groupby_project(self): self.store_session(self.build_session(project_id=self.project2.id)) for _ in range(2): @@ -936,13 +1169,15 @@ def test_request_too_granular(self): field="sum(sentry.sessions.session)", statsPeriod="24h", interval="5m", + per_page=50, orderBy="-sum(sentry.sessions.session)", ) assert response.status_code == 400 assert response.json()["detail"] == ( - "Requested interval of 5m with statsPeriod of 24h is too granular for a per_page of " - "51 elements. Increase your interval, decrease your statsPeriod, or decrease your " - "per_page parameter." + f"Requested interval of timedelta of {timedelta(minutes=5)} with statsPeriod " + f"timedelta of {timedelta(hours=24)} is too granular " + f"for a per_page of 51 elements. Increase your interval, decrease your statsPeriod, " + f"or decrease your per_page parameter." ) @freeze_time((datetime.now() - timedelta(hours=1)).replace(minute=30)) diff --git a/tests/sentry/snuba/metrics/test_query_builder.py b/tests/sentry/snuba/metrics/test_query_builder.py index 2712605be89440..918506be44f7e2 100644 --- a/tests/sentry/snuba/metrics/test_query_builder.py +++ b/tests/sentry/snuba/metrics/test_query_builder.py @@ -334,7 +334,9 @@ def expected_query(match, select, extra_groupby, metric_name): ), Condition(Column("metric_id"), Op.IN, [resolve_weak(org_id, get_mri(metric_name))]), ], - limit=Limit(MAX_POINTS), + # totals: MAX_POINTS // (90d * 24h) + # series: totals * (90d * 24h) + limit=Limit(4) if not extra_groupby else Limit(8640), offset=Offset(0), granularity=query_definition.granularity, ) @@ -481,7 +483,7 @@ def test_build_snuba_query_derived_metrics(mock_now, mock_now2, monkeypatch): [resolve_weak(org_id, SessionMRI.SESSION.value)], ), ], - limit=Limit(MAX_POINTS), + limit=Limit(MAX_POINTS // 2) if key == "totals" else Limit(MAX_POINTS), offset=Offset(0), granularity=Granularity(query_definition.rollup), ) @@ -511,7 +513,7 @@ def test_build_snuba_query_derived_metrics(mock_now, mock_now2, monkeypatch): [resolve_weak(org_id, SessionMRI.ERROR.value)], ), ], - limit=Limit(MAX_POINTS), + limit=Limit(MAX_POINTS // 2) if key == "totals" else Limit(MAX_POINTS), offset=Offset(0), granularity=Granularity(query_definition.rollup), ) @@ -532,6 +534,7 @@ def test_build_snuba_query_orderby(mock_now, mock_now2, monkeypatch): "sum(sentry.sessions.session)", ], "orderBy": ["-sum(sentry.sessions.session)"], + "per_page": [2], } ) query_definition = APIQueryDefinition( @@ -566,7 +569,7 @@ def test_build_snuba_query_orderby(mock_now, mock_now2, monkeypatch): where=[ Condition(Column("org_id"), Op.EQ, 1), Condition(Column("project_id"), Op.IN, [1]), - Condition(Column("timestamp"), Op.GTE, datetime(2021, 5, 28, 0, tzinfo=pytz.utc)), + Condition(Column("timestamp"), Op.GTE, datetime(2021, 8, 25, 0, tzinfo=pytz.utc)), Condition(Column("timestamp"), Op.LT, datetime(2021, 8, 26, 0, tzinfo=pytz.utc)), Condition( Column(resolve_tag_key(org_id, "release"), entity=None), @@ -590,7 +593,7 @@ def test_build_snuba_query_orderby(mock_now, mock_now2, monkeypatch): where=[ Condition(Column("org_id"), Op.EQ, 1), Condition(Column("project_id"), Op.IN, [1]), - Condition(Column("timestamp"), Op.GTE, datetime(2021, 5, 28, 0, tzinfo=pytz.utc)), + Condition(Column("timestamp"), Op.GTE, datetime(2021, 8, 25, 0, tzinfo=pytz.utc)), Condition(Column("timestamp"), Op.LT, datetime(2021, 8, 26, 0, tzinfo=pytz.utc)), Condition( Column(resolve_tag_key(org_id, "release"), entity=None), @@ -600,7 +603,7 @@ def test_build_snuba_query_orderby(mock_now, mock_now2, monkeypatch): Condition(Column("metric_id"), Op.IN, [resolve(org_id, get_mri(metric_name))]), ], orderby=[OrderBy(select, Direction.DESC)], - limit=Limit(6480), + limit=Limit(72), offset=Offset(0), granularity=Granularity(query_definition.rollup), ) @@ -617,6 +620,7 @@ def test_build_snuba_query_with_derived_alias(mock_now, mock_now2, monkeypatch): "field": [ "p95(session.duration)", ], + "per_page": [2], } ) query_definition = APIQueryDefinition( @@ -663,7 +667,7 @@ def test_build_snuba_query_with_derived_alias(mock_now, mock_now2, monkeypatch): where=[ Condition(Column("org_id"), Op.EQ, 1), Condition(Column("project_id"), Op.IN, [1]), - Condition(Column("timestamp"), Op.GTE, datetime(2021, 5, 28, 0, tzinfo=pytz.utc)), + Condition(Column("timestamp"), Op.GTE, datetime(2021, 8, 25, 0, tzinfo=pytz.utc)), Condition(Column("timestamp"), Op.LT, datetime(2021, 8, 26, 0, tzinfo=pytz.utc)), Condition( Column(resolve_tag_key(org_id, "release"), entity=None), @@ -672,7 +676,7 @@ def test_build_snuba_query_with_derived_alias(mock_now, mock_now2, monkeypatch): ), Condition(Column("metric_id"), Op.IN, [resolve(org_id, SessionMRI.RAW_DURATION.value)]), ], - limit=Limit(MAX_POINTS), + limit=Limit(3), offset=Offset(0), granularity=Granularity(query_definition.rollup), ) @@ -686,7 +690,7 @@ def test_build_snuba_query_with_derived_alias(mock_now, mock_now2, monkeypatch): where=[ Condition(Column("org_id"), Op.EQ, 1), Condition(Column("project_id"), Op.IN, [1]), - Condition(Column("timestamp"), Op.GTE, datetime(2021, 5, 28, 0, tzinfo=pytz.utc)), + Condition(Column("timestamp"), Op.GTE, datetime(2021, 8, 25, 0, tzinfo=pytz.utc)), Condition(Column("timestamp"), Op.LT, datetime(2021, 8, 26, 0, tzinfo=pytz.utc)), Condition( Column(resolve_tag_key(org_id, "release"), entity=None), @@ -695,7 +699,7 @@ def test_build_snuba_query_with_derived_alias(mock_now, mock_now2, monkeypatch): ), Condition(Column("metric_id"), Op.IN, [resolve(org_id, SessionMRI.RAW_DURATION.value)]), ], - limit=Limit(MAX_POINTS), + limit=Limit(72), offset=Offset(0), granularity=Granularity(query_definition.rollup), ) diff --git a/tests/snuba/api/endpoints/test_organization_sessions.py b/tests/snuba/api/endpoints/test_organization_sessions.py index 7a034e53148a1f..c15ee93b489767 100644 --- a/tests/snuba/api/endpoints/test_organization_sessions.py +++ b/tests/snuba/api/endpoints/test_organization_sessions.py @@ -764,7 +764,7 @@ def test_duration_percentiles_groupby(self): def test_snuba_limit_exceeded(self): # 2 * 3 => only show two groups with patch("sentry.snuba.sessions_v2.SNUBA_LIMIT", 6), patch( - "sentry.release_health.metrics_sessions_v2.SNUBA_LIMIT", 6 + "sentry.snuba.metrics.query.MAX_POINTS", 6 ): response = self.do_request( @@ -804,7 +804,7 @@ def test_snuba_limit_exceeded_groupby_status(self): """Get consistent result when grouping by status""" # 2 * 3 => only show two groups with patch("sentry.snuba.sessions_v2.SNUBA_LIMIT", 6), patch( - "sentry.release_health.metrics_sessions_v2.SNUBA_LIMIT", 6 + "sentry.snuba.metrics.query.MAX_POINTS", 6 ): response = self.do_request(
e88984dc85ec2b3fd722cfe48019dcfd39076863
2024-02-12 23:31:20
Isabella Enriquez
fix(slack): Check that message is a group of blocks (#64910)
false
Check that message is a group of blocks (#64910)
fix
diff --git a/src/sentry/integrations/slack/notifications.py b/src/sentry/integrations/slack/notifications.py index 2c368a84f2c493..dc6e257675589d 100644 --- a/src/sentry/integrations/slack/notifications.py +++ b/src/sentry/integrations/slack/notifications.py @@ -64,7 +64,7 @@ def _get_attachments( def _notify_recipient( notification: BaseNotification, recipient: RpcActor, - attachments: list[SlackAttachment], + attachments: list[SlackAttachment] | SlackBlock, channel: str, integration: Integration, shared_context: Mapping[str, Any], @@ -75,7 +75,11 @@ def _notify_recipient( text = notification.get_notification_title(ExternalProviders.SLACK, shared_context) - if features.has("organizations:slack-block-kit", notification.organization): + # NOTE(isabella): we check that attachments consists of blocks in case the flag is turned on + # while a notification with the legacy format is being sent + if features.has("organizations:slack-block-kit", notification.organization) and isinstance( + local_attachments, dict + ): blocks = [] if text: # NOTE(isabella): with legacy attachments, the notification title was diff --git a/tests/sentry/integrations/slack/test_notifications.py b/tests/sentry/integrations/slack/test_notifications.py index a6287dd188207f..9d32403abe7109 100644 --- a/tests/sentry/integrations/slack/test_notifications.py +++ b/tests/sentry/integrations/slack/test_notifications.py @@ -3,7 +3,7 @@ import responses -from sentry.integrations.slack.notifications import send_notification_as_slack +from sentry.integrations.slack.notifications import _get_attachments, send_notification_as_slack from sentry.notifications.additional_attachment_manager import manager from sentry.testutils.cases import SlackActivityNotificationTest from sentry.testutils.helpers.notifications import DummyNotification @@ -17,6 +17,13 @@ def additional_attachment_generator(integration, organization): return {"title": organization.slug, "text": integration.id} +def additional_attachment_generator_block_kit(integration, organization): + return [ + {"type": "section", "text": {"type": "mrkdwn", "text": organization.slug}}, + {"type": "section", "text": {"type": "mrkdwn", "text": integration.id}}, + ] + + @region_silo_test class SlackNotificationsTest(SlackActivityNotificationTest): def setUp(self): @@ -44,6 +51,29 @@ def test_additional_attachment(self): assert attachments[1]["title"] == self.organization.slug assert attachments[1]["text"] == self.integration.id + @responses.activate + def test_additional_attachment_block_kit(self): + with self.feature("organizations:slack-block-kit"), mock.patch.dict( + manager.attachment_generators, + {ExternalProviders.SLACK: additional_attachment_generator_block_kit}, + ): + with self.tasks(): + send_notification_as_slack(self.notification, [self.user], {}, {}) + + data = parse_qs(responses.calls[0].request.body) + + assert "blocks" in data + assert "text" in data + assert data["text"][0] == "Notification Title" + + blocks = json.loads(data["blocks"][0]) + assert len(blocks) == 4 + + assert blocks[0]["text"]["text"] == "Notification Title" + assert blocks[1]["text"]["text"] == "*My Title* \n" + assert blocks[2]["text"]["text"] == self.organization.slug + assert blocks[3]["text"]["text"] == self.integration.id + @responses.activate def test_no_additional_attachment(self): with self.tasks(): @@ -58,3 +88,44 @@ def test_no_additional_attachment(self): assert len(attachments) == 1 assert attachments[0]["title"] == "My Title" + + @responses.activate + def test_no_additional_attachment_block_kit(self): + with self.feature("organizations:slack-block-kit"): + with self.tasks(): + send_notification_as_slack(self.notification, [self.user], {}, {}) + + data = parse_qs(responses.calls[0].request.body) + + assert "blocks" in data + assert "text" in data + assert data["text"][0] == "Notification Title" + + blocks = json.loads(data["blocks"][0]) + assert len(blocks) == 2 + + assert blocks[0]["text"]["text"] == "Notification Title" + assert blocks[1]["text"]["text"] == "*My Title* \n" + + @responses.activate + @mock.patch("sentry.integrations.slack.notifications._get_attachments") + def test_attachment_with_block_kit_flag(self, mock_attachment): + """ + Tests that notifications built with the legacy system can still send successfully with + the block kit flag enabled. + """ + mock_attachment.return_value = _get_attachments(self.notification, self.user, {}, {}) + + with self.feature("organizations:slack-block-kit"): + with self.tasks(): + send_notification_as_slack(self.notification, [self.user], {}, {}) + + data = parse_qs(responses.calls[0].request.body) + + assert "attachments" in data + assert data["text"][0] == "Notification Title" + + attachments = json.loads(data["attachments"][0]) + assert len(attachments) == 1 + + assert attachments[0]["title"] == "My Title"
b030c4c34c0449e50474b3044a91e2c78d3e8ad3
2024-06-04 18:56:41
Ogi
fix(stats): metrics stats name check (#71993)
false
metrics stats name check (#71993)
fix
diff --git a/static/app/views/organizationStats/usageStatsOrg.tsx b/static/app/views/organizationStats/usageStatsOrg.tsx index 4e7d18e6ebef5f..d9a79261b4ab69 100644 --- a/static/app/views/organizationStats/usageStatsOrg.tsx +++ b/static/app/views/organizationStats/usageStatsOrg.tsx @@ -437,12 +437,15 @@ class UsageStatsOrganization< }; orgStats.groups.forEach(group => { - const {outcome, category} = group.by; + const {outcome} = group.by; + // TODO(metrics): remove this when metrics category name is updated + const category = + group.by.category === DATA_CATEGORY_INFO.metrics.apiName + ? DATA_CATEGORY_INFO.metrics.plural + : group.by.category; + // HACK: The backend enum are singular, but the frontend enums are plural - if ( - dataCategory !== DATA_CATEGORY_INFO.metrics.plural && - !dataCategory.includes(`${category}`) - ) { + if (!dataCategory.includes(`${category}`)) { return; }
060638807540cbcf9f31cf66cbed8a63e99a1962
2023-06-06 22:54:46
Tony Xiao
fix(query-builder): Search non-nullable key for empty value (#50205)
false
Search non-nullable key for empty value (#50205)
fix
diff --git a/src/sentry/search/events/builder/discover.py b/src/sentry/search/events/builder/discover.py index a54e6bed54d4ce..d271b837a29b36 100644 --- a/src/sentry/search/events/builder/discover.py +++ b/src/sentry/search/events/builder/discover.py @@ -1331,7 +1331,7 @@ def _default_filter_converter( # Handle checks for existence if search_filter.operator in ("=", "!=") and search_filter.value.value == "": - if is_tag or is_context: + if is_tag or is_context or name in self.config.non_nullable_keys: return Condition(lhs, Op(search_filter.operator), value) else: # If not a tag, we can just check that the column is null. diff --git a/src/sentry/search/events/datasets/profile_functions.py b/src/sentry/search/events/datasets/profile_functions.py index 0fdb2977ca27f5..b3ccdbd52f4c06 100644 --- a/src/sentry/search/events/datasets/profile_functions.py +++ b/src/sentry/search/events/datasets/profile_functions.py @@ -74,7 +74,6 @@ class Column: Column(alias="platform.name", column="platform", kind=Kind.STRING), Column(alias="environment", column="environment", kind=Kind.STRING), Column(alias="release", column="release", kind=Kind.STRING), - Column(alias="retention_days", column="retention_days", kind=Kind.INTEGER), Column( alias="function.duration", column="percentiles", @@ -126,19 +125,13 @@ class ProfileFunctionsDatasetConfig(DatasetConfig): non_nullable_keys = { "project.id", "project_id", - "transaction_name", + "transaction", "timestamp", - "depth", - "parent_fingerprint", "fingerprint", - "name", + "function", "package", - "path", "is_application", - "platform", - "os_name", - "os_version", - "retention_days", + "platform.name", } def __init__(self, builder: builder.QueryBuilder): diff --git a/tests/sentry/search/events/builder/test_profile_functions.py b/tests/sentry/search/events/builder/test_profile_functions.py new file mode 100644 index 00000000000000..7e0d433b3dc797 --- /dev/null +++ b/tests/sentry/search/events/builder/test_profile_functions.py @@ -0,0 +1,71 @@ +from datetime import datetime, timedelta + +import pytest +from django.utils import timezone +from snuba_sdk.column import Column +from snuba_sdk.conditions import Condition, Op + +from sentry.search.events.builder.profile_functions import ProfileFunctionsQueryBuilder +from sentry.testutils.factories import Factories +from sentry.utils.snuba import Dataset + +# pin a timestamp for now so tests results dont change +now = datetime(2022, 10, 31, 0, 0, tzinfo=timezone.utc) +today = now.replace(hour=0, minute=0, second=0, microsecond=0) + + [email protected] +def params(): + organization = Factories.create_organization() + team = Factories.create_team(organization=organization) + project1 = Factories.create_project(organization=organization, teams=[team]) + project2 = Factories.create_project(organization=organization, teams=[team]) + + user = Factories.create_user() + Factories.create_team_membership(team=team, user=user) + + return { + "start": now - timedelta(days=7), + "end": now - timedelta(seconds=1), + "project_id": [project1.id, project2.id], + "project_objects": [project1, project2], + "organization_id": organization.id, + "user_id": user.id, + "team_id": [team.id], + } + + [email protected]( + "search,condition", + [ + pytest.param( + 'package:""', + Condition(Column("package"), Op("="), ""), + id="empty package", + ), + pytest.param( + '!package:""', + Condition(Column("package"), Op("!="), ""), + id="not empty package", + ), + pytest.param( + 'function:""', + Condition(Column("name"), Op("="), ""), + id="empty function", + ), + pytest.param( + '!function:""', + Condition(Column("name"), Op("!="), ""), + id="not empty function", + ), + ], +) [email protected]_db +def test_conditions(params, search, condition): + builder = ProfileFunctionsQueryBuilder( + Dataset.Functions, + params, + query=search, + selected_columns=["count()"], + ) + assert condition in builder.where diff --git a/tests/snuba/api/endpoints/test_organization_events.py b/tests/snuba/api/endpoints/test_organization_events.py index b8b7d9ed37e2ad..953ed8d715977a 100644 --- a/tests/snuba/api/endpoints/test_organization_events.py +++ b/tests/snuba/api/endpoints/test_organization_events.py @@ -5878,7 +5878,6 @@ def test_functions_dataset_simple(self, mock_snql_query): "project": "python", "release": "backend@1", "platform.name": "python", - "retention_days": 90, "package": "lib_foo", "environment": "development", "p50()": 34695708.0, @@ -5923,10 +5922,6 @@ def test_functions_dataset_simple(self, mock_snql_query): "name": "platform.name", "type": "String", }, - { - "name": "retention_days", - "type": "UInt16", - }, { "name": "package", "type": "String", @@ -5980,7 +5975,6 @@ def test_functions_dataset_simple(self, mock_snql_query): "platform.name", "environment", "release", - "retention_days", "count()", "examples()", "p50()", @@ -6015,7 +6009,6 @@ def test_functions_dataset_simple(self, mock_snql_query): "platform.name": None, "environment": None, "release": None, - "retention_days": None, "count()": None, "examples()": None, "p50()": "nanosecond",
d51469498b74ce40f3358bfbddd326a01e0b43ce
2021-07-01 05:18:17
Evan Purkhiser
ref(ui): Adjust bottom spacing on members settings search (#27051)
false
Adjust bottom spacing on members settings search (#27051)
ref
diff --git a/static/app/views/settings/components/defaultSearchBar.tsx b/static/app/views/settings/components/defaultSearchBar.tsx index 20db185dd626c6..3fd5b5ef635bbd 100644 --- a/static/app/views/settings/components/defaultSearchBar.tsx +++ b/static/app/views/settings/components/defaultSearchBar.tsx @@ -13,6 +13,6 @@ export const SearchWrapper = styled('div')` grid-template-columns: 1fr max-content; grid-gap: ${space(1.5)}; margin-top: ${space(4)}; - margin-bottom: ${space(1)}; + margin-bottom: ${space(1.5)}; position: relative; `;
26f4bb9783bbf7c63f770f31bb6ad7d372def332
2022-06-04 05:39:43
Taylan Gocmen
fix(alerts): If user isn't a member but has project access use first project in alert wizard (#35352)
false
If user isn't a member but has project access use first project in alert wizard (#35352)
fix
diff --git a/static/app/views/alerts/builder/projectProvider.tsx b/static/app/views/alerts/builder/projectProvider.tsx index a7ce52e2923d6e..16a4b3f86eec01 100644 --- a/static/app/views/alerts/builder/projectProvider.tsx +++ b/static/app/views/alerts/builder/projectProvider.tsx @@ -2,6 +2,7 @@ import {cloneElement, Fragment, isValidElement, useEffect} from 'react'; import {RouteComponentProps} from 'react-router'; import {fetchOrgMembers} from 'sentry/actionCreators/members'; +import {navigateTo} from 'sentry/actionCreators/navigation'; import Alert from 'sentry/components/alert'; import LoadingIndicator from 'sentry/components/loadingIndicator'; import {t} from 'sentry/locale'; @@ -38,7 +39,7 @@ function AlertBuilderProjectProvider(props: Props) { } ); const project = useFirstProject - ? projects.find(p => p.isMember) + ? projects.find(p => p.isMember) ?? (projects.length && projects[0]) : projects.find(({slug}) => slug === projectId); useEffect(() => { @@ -54,6 +55,16 @@ function AlertBuilderProjectProvider(props: Props) { return <LoadingIndicator />; } + // If there's no project show the project selector modal + if (!project && !fetchError) { + navigateTo( + hasAlertWizardV3 + ? `/organizations/${organization.slug}/alerts/wizard/?referrer=${props.location.query.referrer}&project=:projectId` + : `/organizations/${organization.slug}/alerts/:projectId/wizard/?referrer=${props.location.query.referrer}`, + props.router + ); + } + // if loaded, but project fetching states incomplete or project can't be found, project doesn't exist if (!project || fetchError) { return (
9bf499ad95030ed1112f117c5c1be59b2e036509
2022-09-06 17:27:34
Priscila Oliveira
ref(audit-log): log raw dynamic sampling changes - (#38452)
false
log raw dynamic sampling changes - (#38452)
ref
diff --git a/src/sentry/api/endpoints/project_details.py b/src/sentry/api/endpoints/project_details.py index 291618d7d99b1b..ee4ee3ce12a6f6 100644 --- a/src/sentry/api/endpoints/project_details.py +++ b/src/sentry/api/endpoints/project_details.py @@ -646,7 +646,8 @@ def put(self, request: Request, project) -> Response: if "dynamicSampling" in result: raw_dynamic_sampling = result["dynamicSampling"] fixed_rules = self._fix_rule_ids(project, raw_dynamic_sampling) - project.update_option("sentry:dynamic_sampling", fixed_rules) + if project.update_option("sentry:dynamic_sampling", fixed_rules): + changed_proj_settings["sentry:dynamic_sampling"] = result["dynamicSampling"] # TODO(dcramer): rewrite options to use standard API config if has_project_write:
0211233efea996a6a62a8b86f2f45aef0e62accb
2024-01-20 04:44:57
Yash Kamothi
fix(api): Stop relying and sending the token value (#63485)
false
Stop relying and sending the token value (#63485)
fix
diff --git a/fixtures/js-stubs/apiToken.tsx b/fixtures/js-stubs/apiToken.tsx index d54eab65fb6d26..2bb60f506736b1 100644 --- a/fixtures/js-stubs/apiToken.tsx +++ b/fixtures/js-stubs/apiToken.tsx @@ -12,6 +12,7 @@ export function ApiTokenFixture( refreshToken: 'refresh_token', expiresAt: new Date('Thu Jan 11 2018 18:01:41 GMT-0800 (PST)').toISOString(), state: 'active', + tokenLastCharacters: 'n123', ...params, }; } diff --git a/fixtures/js-stubs/sentryAppToken.tsx b/fixtures/js-stubs/sentryAppToken.tsx index 9cd6f6e6748a0b..a2263408c23677 100644 --- a/fixtures/js-stubs/sentryAppToken.tsx +++ b/fixtures/js-stubs/sentryAppToken.tsx @@ -12,6 +12,7 @@ export function SentryAppTokenFixture( application: null, id: '1', state: 'active', + tokenLastCharacters: 'oken', ...params, }; } diff --git a/static/app/types/user.tsx b/static/app/types/user.tsx index 3e5e4411fababc..c054a847ec6049 100644 --- a/static/app/types/user.tsx +++ b/static/app/types/user.tsx @@ -81,7 +81,7 @@ export interface InternalAppApiToken extends BaseApiToken { application: null; refreshToken: string; token: string; - tokenLastCharacters?: string; + tokenLastCharacters: string; } export type ApiApplication = { diff --git a/static/app/views/settings/account/apiTokenRow.spec.tsx b/static/app/views/settings/account/apiTokenRow.spec.tsx index cd554570ba7c23..1380dcb7d30707 100644 --- a/static/app/views/settings/account/apiTokenRow.spec.tsx +++ b/static/app/views/settings/account/apiTokenRow.spec.tsx @@ -25,12 +25,4 @@ describe('ApiTokenRow', () => { render(<ApiTokenRow onRemove={cb} token={token} />); expect(screen.queryByLabelText('Token preview')).toBeInTheDocument(); }); - - it('uses old logic when lastTokenCharacters field is not found', () => { - const token = ApiTokenFixture(); - - const cb = jest.fn(); - render(<ApiTokenRow onRemove={cb} token={token} />); - expect(screen.queryByLabelText('Token preview')).not.toBeInTheDocument(); - }); }); diff --git a/static/app/views/settings/account/apiTokenRow.tsx b/static/app/views/settings/account/apiTokenRow.tsx index c36508ad465199..3eb952f480e655 100644 --- a/static/app/views/settings/account/apiTokenRow.tsx +++ b/static/app/views/settings/account/apiTokenRow.tsx @@ -3,7 +3,6 @@ import styled from '@emotion/styled'; import {Button} from 'sentry/components/button'; import DateTime from 'sentry/components/dateTime'; import PanelItem from 'sentry/components/panels/panelItem'; -import TextCopyInput from 'sentry/components/textCopyInput'; import {IconSubtract} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; @@ -22,22 +21,14 @@ function ApiTokenRow({token, onRemove}: Props) { return ( <StyledPanelItem> <Controls> - {token.tokenLastCharacters ? ( - <TokenPreview aria-label={t('Token preview')}> - {tokenPreview( - getDynamicText({ - value: token.tokenLastCharacters, - fixed: 'ABCD', - }) - )} - </TokenPreview> - ) : ( - <InputWrapper> - <TextCopyInput> - {getDynamicText({value: token.token, fixed: 'CI_AUTH_TOKEN'})} - </TextCopyInput> - </InputWrapper> - )} + <TokenPreview aria-label={t('Token preview')}> + {tokenPreview( + getDynamicText({ + value: token.tokenLastCharacters, + fixed: 'ABCD', + }) + )} + </TokenPreview> <ButtonWrapper> <Button onClick={() => onRemove(token)} @@ -80,12 +71,6 @@ const Controls = styled('div')` margin-bottom: ${space(1)}; `; -const InputWrapper = styled('div')` - font-size: ${p => p.theme.fontSizeRelativeSmall}; - flex: 1; - margin-right: ${space(1)}; -`; - const Details = styled('div')` display: flex; margin-top: ${space(1)}; diff --git a/static/app/views/settings/account/apiTokens.tsx b/static/app/views/settings/account/apiTokens.tsx index 974afa749b9985..eb261ad8c5c5b2 100644 --- a/static/app/views/settings/account/apiTokens.tsx +++ b/static/app/views/settings/account/apiTokens.tsx @@ -48,13 +48,13 @@ export class ApiTokens extends DeprecatedAsyncView<Props, State> { this.setState( state => ({ - tokenList: state.tokenList?.filter(tk => tk.token !== token.token) ?? [], + tokenList: state.tokenList?.filter(tk => tk.id !== token.id) ?? [], }), async () => { try { await this.api.requestPromise('/api-tokens/', { method: 'DELETE', - data: {token: token.token}, + data: {tokenId: token.id}, }); addSuccessMessage(t('Removed token')); @@ -118,7 +118,7 @@ export class ApiTokens extends DeprecatedAsyncView<Props, State> { {tokenList?.map(token => ( <ApiTokenRow - key={token.token} + key={token.id} token={token} onRemove={this.handleRemoveToken} />