Dataset Viewer
Auto-converted to Parquet Duplicate
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
265fd75a34894da7fb64591512ca72c9d10850ab
2021-06-16 13:17:50
Matej Minar
feat(ui): Add release comparison feature flag (#26635)
false
Add release comparison feature flag (#26635)
feat
diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index dfc1a53547d1a8..933e2d7b9605ac 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -1003,6 +1003,8 @@ def create_partitioned_queues(name): "organizations:release-adoption-stage": False, # Store release bundles as zip files instead of single files "organizations:release-archives": False, + # Enable the new release details experience + "organizations:release-comparison": False, # Enable the project level transaction thresholds "organizations:project-transaction-threshold": False, # Enable percent displays in issue stream diff --git a/src/sentry/features/__init__.py b/src/sentry/features/__init__.py index 109255713cc70a..37c4909a79328e 100644 --- a/src/sentry/features/__init__.py +++ b/src/sentry/features/__init__.py @@ -118,6 +118,7 @@ default_manager.add("organizations:release-adoption-chart", OrganizationFeature, True) default_manager.add("organizations:release-adoption-stage", OrganizationFeature, True) default_manager.add("organizations:release-archives", OrganizationFeature) +default_manager.add("organizations:release-comparison", OrganizationFeature, True) default_manager.add("organizations:reprocessing-v2", OrganizationFeature) default_manager.add("organizations:required-email-verification", OrganizationFeature, True) # NOQA default_manager.add("organizations:rule-page", OrganizationFeature)
1b712426c2f3924daedaf87d96df473205c28726
2022-02-25 00:36:12
Mark Story
chore: Remove unused feature flags (#32010)
false
Remove unused feature flags (#32010)
chore
diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py index 5be8dd3a912574..eba50d480efa14 100644 --- a/src/sentry/conf/server.py +++ b/src/sentry/conf/server.py @@ -933,14 +933,10 @@ def create_partitioned_queues(name): "organizations:api-keys": False, # Enable multiple Apple app-store-connect sources per project. "organizations:app-store-connect-multiple": False, - # Enable explicit use of AND and OR in search. - "organizations:boolean-search": False, # Enable the linked event feature in the issue details breadcrumb. "organizations:breadcrumb-linked-event": False, # Enable change alerts for an org "organizations:change-alerts": True, - # Enable unfurling charts using the Chartcuterie service - "organizations:chart-unfurls": False, # Enable alerting based on crash free sessions/users "organizations:crash-rate-alerts": True, # Enable creating organizations within sentry (if SENTRY_SINGLE_ORGANIZATION @@ -950,8 +946,6 @@ def create_partitioned_queues(name): "organizations:discover": False, # Enable attaching arbitrary files to events. "organizations:event-attachments": True, - # Enable inline preview of attachments. - "organizations:event-attachments-viewer": True, # Enable Filters & Sampling in the org settings "organizations:filters-and-sampling": False, # Enable Dynamic Sampling errors in the org settings @@ -960,14 +954,10 @@ def create_partitioned_queues(name): "organizations:symbol-sources": True, # Allow organizations to configure custom external symbol sources. "organizations:custom-symbol-sources": True, - # Enable the events stream interface. - "organizations:events": False, # Enable discover 2 basic functions "organizations:discover-basic": True, # Enable discover 2 custom queries and saved queries "organizations:discover-query": True, - # Enable discover top events queries with other & higher options - "organizations:discover-top-events": False, # Allows an org to have a larger set of project ownership rules per project "organizations:higher-ownership-limit": False, # Enable Performance view @@ -990,8 +980,6 @@ def create_partitioned_queues(name): "organizations:custom-event-title": True, # Enable rule page. "organizations:rule-page": False, - # Enable improved syntax highlighting + autocomplete on unified search - "organizations:improved-search": False, # Enable incidents feature "organizations:incidents": False, # Flags for enabling CdcEventsDatasetSnubaSearchBackend in sentry.io. No effect in open-source @@ -1014,8 +1002,6 @@ def create_partitioned_queues(name): "organizations:release-health-check-metrics": False, # True if differences between the metrics and sessions backend should be reported "organizations:release-health-check-metrics-report": False, - # Enable metric aggregate in metric alert rule builder - "organizations:metric-alert-builder-aggregate": False, # Enable threshold period in metric alert rule builder "organizations:metric-alert-threshold-period": False, # Enable integration functionality to create and link groups to issues on @@ -1057,8 +1043,6 @@ def create_partitioned_queues(name): "organizations:issues-in-dashboards": False, # Enable widget viewer modal in dashboards "organizations:widget-viewer-modal": False, - # Enable navigation features between Discover and Dashboards - "organizations:connect-discover-and-dashboards": False, # Enable experimental performance improvements. "organizations:enterprise-perf": False, # Enable the API to importing CODEOWNERS for a project @@ -1101,8 +1085,6 @@ def create_partitioned_queues(name): "organizations:native-stack-trace-v2": False, # Enable version 2 of reprocessing (completely distinct from v1) "organizations:reprocessing-v2": False, - # Enable sorting+filtering by semantic version of a release - "organizations:semver": True, # Enable the UI for the overage alert settings "organizations:slack-overage-notifications": False, # Enable basic SSO functionality, providing configurable single sign on @@ -1114,16 +1096,12 @@ def create_partitioned_queues(name): "organizations:sso-saml2": True, # Enable workaround for migrating IdP instances "organizations:sso-migration": False, - # Return unhandled information on the issue level - "organizations:unhandled-issue-flag": True, # Enable percent-based conditions on issue rules "organizations:issue-percent-filters": True, # Enable the new images loaded design and features "organizations:images-loaded-v2": True, # Enable the mobile screenshots feature "organizations:mobile-screenshots": False, - # Store release bundles as zip files instead of single files - "organizations:release-archives": False, # Enable the release details performance section "organizations:release-comparison-performance": False, # Enable percent displays in issue stream diff --git a/src/sentry/features/__init__.py b/src/sentry/features/__init__.py index 7ec2bf29cb77f0..276f93a0902285 100644 --- a/src/sentry/features/__init__.py +++ b/src/sentry/features/__init__.py @@ -56,10 +56,7 @@ default_manager.add("organizations:alert-rule-status-page", OrganizationFeature, True) default_manager.add("organizations:alert-wizard-v3", OrganizationFeature, True) default_manager.add("organizations:api-keys", OrganizationFeature) -default_manager.add("organizations:boolean-search", OrganizationFeature) default_manager.add("organizations:breadcrumb-linked-event", OrganizationFeature, True) -default_manager.add("organizations:chart-unfurls", OrganizationFeature, True) -default_manager.add("organizations:connect-discover-and-dashboards", OrganizationFeature, True) default_manager.add("organizations:crash-rate-alerts", OrganizationFeature, True) default_manager.add("organizations:custom-event-title", OrganizationFeature) default_manager.add("organizations:dashboard-grid-layout", OrganizationFeature, True) @@ -67,11 +64,8 @@ default_manager.add("organizations:dashboards-template", OrganizationFeature, True) default_manager.add("organizations:sandbox-kill-switch", OrganizationFeature, True) default_manager.add("organizations:discover", OrganizationFeature) -default_manager.add("organizations:discover-top-events", OrganizationFeature, True) default_manager.add("organizations:discover-use-snql", OrganizationFeature, True) default_manager.add("organizations:enterprise-perf", OrganizationFeature) -default_manager.add("organizations:event-attachments-viewer", OrganizationFeature) -default_manager.add("organizations:events", OrganizationFeature) default_manager.add("organizations:filters-and-sampling", OrganizationFeature, True) default_manager.add("organizations:filters-and-sampling-error-rules", OrganizationFeature, True) default_manager.add("organizations:grouping-stacktrace-ui", OrganizationFeature, True) @@ -79,18 +73,16 @@ default_manager.add("organizations:grouping-tree-ui", OrganizationFeature, True) default_manager.add("organizations:higher-ownership-limit", OrganizationFeature) default_manager.add("organizations:images-loaded-v2", OrganizationFeature) -default_manager.add("organizations:improved-search", OrganizationFeature, True) default_manager.add("organizations:invite-members", OrganizationFeature) default_manager.add("organizations:invite-members-rate-limits", OrganizationFeature) -default_manager.add("organizations:issue-list-trend-sort", OrganizationFeature, True) default_manager.add("organizations:issue-list-removal-action", OrganizationFeature, True) +default_manager.add("organizations:issue-list-trend-sort", OrganizationFeature, True) default_manager.add("organizations:issue-percent-display", OrganizationFeature, True) default_manager.add("organizations:issue-percent-filters", OrganizationFeature, True) default_manager.add("organizations:issue-search-use-cdc-primary", OrganizationFeature, True) default_manager.add("organizations:issue-search-use-cdc-secondary", OrganizationFeature, True) default_manager.add("organizations:issues-in-dashboards", OrganizationFeature, True) default_manager.add("organizations:large-debug-files", OrganizationFeature) -default_manager.add("organizations:metric-alert-builder-aggregate", OrganizationFeature) default_manager.add("organizations:metric-alert-threshold-period", OrganizationFeature, True) default_manager.add("organizations:metrics", OrganizationFeature, True) default_manager.add("organizations:new-widget-builder-experience", OrganizationFeature, True) @@ -100,7 +92,9 @@ default_manager.add("organizations:mobile-screenshots", OrganizationFeature, True) default_manager.add("organizations:monitors", OrganizationFeature) default_manager.add("organizations:native-stack-trace-v2", OrganizationFeature, True) +default_manager.add("organizations:new-weekly-report", OrganizationFeature, True) default_manager.add("organizations:notification-all-recipients", OrganizationFeature, True) +# Only enabled in sentry.io to enable onboarding flows. default_manager.add("organizations:onboarding", OrganizationFeature) default_manager.add("organizations:org-subdomains", OrganizationFeature) default_manager.add("organizations:performance-chart-interpolation", OrganizationFeature, True) @@ -114,7 +108,6 @@ default_manager.add("organizations:project-event-date-limit", OrganizationFeature, True) default_manager.add("organizations:prompt-dashboards", OrganizationFeature) default_manager.add("organizations:related-events", OrganizationFeature) -default_manager.add("organizations:release-archives", OrganizationFeature) default_manager.add("organizations:release-comparison-performance", OrganizationFeature, True) default_manager.add("organizations:release-health-check-metrics", OrganizationFeature, True) default_manager.add("organizations:release-health-check-metrics-report", OrganizationFeature, True) @@ -122,17 +115,13 @@ default_manager.add("organizations:required-email-verification", OrganizationFeature, True) # NOQA default_manager.add("organizations:rule-page", OrganizationFeature) default_manager.add("organizations:selection-filters-v2", OrganizationFeature, True) -default_manager.add("organizations:semver", OrganizationFeature, True) default_manager.add("organizations:set-grouping-config", OrganizationFeature) default_manager.add("organizations:slack-overage-notifications", OrganizationFeature, True) default_manager.add("organizations:sso-migration", OrganizationFeature) default_manager.add("organizations:symbol-sources", OrganizationFeature) -default_manager.add("organizations:transaction-events", OrganizationFeature, True) default_manager.add("organizations:transaction-metrics-extraction", OrganizationFeature) -default_manager.add("organizations:unhandled-issue-flag", OrganizationFeature) default_manager.add("organizations:unified-span-view", OrganizationFeature, True) default_manager.add("organizations:weekly-report-debugging", OrganizationFeature, True) -default_manager.add("organizations:new-weekly-report", OrganizationFeature, True) default_manager.add("organizations:widget-library", OrganizationFeature, True) default_manager.add("organizations:widget-viewer-modal", OrganizationFeature, True) @@ -198,7 +187,6 @@ # features themselves in the manager with detections like this. requires_snuba = ( "organizations:discover", - "organizations:events", "organizations:global-views", "organizations:incidents", "organizations:minute-resolution-sessions", diff --git a/static/app/views/eventsV2/queryList.tsx b/static/app/views/eventsV2/queryList.tsx index 3037272d43578d..c95e1dc867a538 100644 --- a/static/app/views/eventsV2/queryList.tsx +++ b/static/app/views/eventsV2/queryList.tsx @@ -338,10 +338,7 @@ class QueryList extends React.Component<Props> { /> )} renderContextMenu={() => ( - <Feature - organization={organization} - features={['connect-discover-and-dashboards', 'dashboards-edit']} - > + <Feature organization={organization} features={['dashboards-edit']}> {({hasFeature}) => this.renderDropdownMenu(menuItems(hasFeature))} </Feature> )} diff --git a/tests/js/spec/components/smartSearchBar/index.spec.jsx b/tests/js/spec/components/smartSearchBar/index.spec.jsx index 0c00b7327f4deb..db544657def193 100644 --- a/tests/js/spec/components/smartSearchBar/index.spec.jsx +++ b/tests/js/spec/components/smartSearchBar/index.spec.jsx @@ -26,7 +26,7 @@ describe('SmartSearchBar', function () { key: 'firstRelease', name: 'firstRelease', }; - organization = TestStubs.Organization({id: '123', features: ['improved-search']}); + organization = TestStubs.Organization({id: '123'}); location = { pathname: '/organizations/org-slug/recent-searches/', diff --git a/tests/js/spec/views/eventsV2/queryList.spec.jsx b/tests/js/spec/views/eventsV2/queryList.spec.jsx index c604b3de8e3210..9061c12a33e865 100644 --- a/tests/js/spec/views/eventsV2/queryList.spec.jsx +++ b/tests/js/spec/views/eventsV2/queryList.spec.jsx @@ -204,9 +204,10 @@ describe('EventsV2 > QueryList', function () { card = wrapper.find('QueryCard').last(); const menuItems = card.find('MenuItemWrap'); - expect(menuItems.length).toEqual(2); - expect(menuItems.at(0).text()).toEqual('Duplicate Query'); - expect(menuItems.at(1).text()).toEqual('Delete Query'); + expect(menuItems.length).toEqual(3); + expect(menuItems.at(0).text()).toEqual('Add to Dashboard'); + expect(menuItems.at(1).text()).toEqual('Duplicate Query'); + expect(menuItems.at(2).text()).toEqual('Delete Query'); }); it('only renders Delete Query and Duplicate Query in context menu', async function () { diff --git a/tests/sentry/api/serializers/test_organization.py b/tests/sentry/api/serializers/test_organization.py index c2db2b6f7b0ee6..d4ed38f4e87cfe 100644 --- a/tests/sentry/api/serializers/test_organization.py +++ b/tests/sentry/api/serializers/test_organization.py @@ -37,7 +37,6 @@ def test_simple(self): "discover-basic", "discover-query", "event-attachments", - "event-attachments-viewer", "images-loaded-v2", "integrations-alert-rule", "integrations-chat-unfurl", @@ -52,13 +51,11 @@ def test_simple(self): "minute-resolution-sessions", "open-membership", "relay", - "semver", "shared-issues", "sso-basic", "sso-saml2", "symbol-sources", "team-insights", - "unhandled-issue-flag", } @mock.patch("sentry.features.batch_has")
e4c3d14395ad9cf10b403f2fe15555b9116e869d
2021-08-26 16:47:50
Priscila Oliveira
feat(debug-files): Allow multiple app store connect repos (#28170)
false
Allow multiple app store connect repos (#28170)
feat
diff --git a/static/app/stores/hookStore.tsx b/static/app/stores/hookStore.tsx index b747947e7ac8ea..6f4e7cda8f9c02 100644 --- a/static/app/stores/hookStore.tsx +++ b/static/app/stores/hookStore.tsx @@ -17,6 +17,7 @@ const validHookNames = new Set<HookName>([ 'analytics:log-experiment', 'component:disabled-member', 'component:disabled-member-tooltip', + 'component:disabled-app-store-connect-item', 'component:header-date-range', 'component:header-selector-items', 'component:global-notifications', diff --git a/static/app/types/hooks.tsx b/static/app/types/hooks.tsx index ec670feb3679cd..ebeb51285921e7 100644 --- a/static/app/types/hooks.tsx +++ b/static/app/types/hooks.tsx @@ -63,6 +63,11 @@ type MemberListHeaderProps = { members: Member[]; organization: Organization; }; +type DisabledAppStoreConnectItem = { + disabled: boolean; + onTrialStarted: () => void; + children: React.ReactElement; +}; type DisabledMemberTooltipProps = {children: React.ReactNode}; type DashboardHeadersProps = {organization: Organization}; @@ -76,6 +81,7 @@ export type ComponentHooks = { 'component:disabled-member': () => React.ComponentType<DisabledMemberViewProps>; 'component:member-list-header': () => React.ComponentType<MemberListHeaderProps>; 'component:disabled-member-tooltip': () => React.ComponentType<DisabledMemberTooltipProps>; + 'component:disabled-app-store-connect-item': () => React.ComponentType<DisabledAppStoreConnectItem>; 'component:dashboards-header': () => React.ComponentType<DashboardHeadersProps>; }; diff --git a/static/app/views/settings/projectDebugFiles/externalSources/customRepositories/index.tsx b/static/app/views/settings/projectDebugFiles/externalSources/customRepositories/index.tsx index 343c6103a5b8ce..1743cbfb7fb976 100644 --- a/static/app/views/settings/projectDebugFiles/externalSources/customRepositories/index.tsx +++ b/static/app/views/settings/projectDebugFiles/externalSources/customRepositories/index.tsx @@ -1,4 +1,4 @@ -import {useContext, useEffect} from 'react'; +import {Fragment, useContext, useEffect} from 'react'; import {InjectedRouter} from 'react-router'; import styled from '@emotion/styled'; import {Location} from 'history'; @@ -10,6 +10,7 @@ import {Client} from 'app/api'; import DropdownAutoComplete from 'app/components/dropdownAutoComplete'; import DropdownButton from 'app/components/dropdownButton'; import EmptyStateWarning from 'app/components/emptyStateWarning'; +import HookOrDefault from 'app/components/hookOrDefault'; import MenuItem from 'app/components/menuItem'; import {Panel, PanelBody, PanelHeader} from 'app/components/panels'; import AppStoreConnectContext from 'app/components/projects/appStoreConnectContext'; @@ -26,6 +27,11 @@ import { getRequestMessages, } from './utils'; +const HookedAppStoreConnectItem = HookOrDefault({ + hookName: 'component:disabled-app-store-connect-item', + defaultComponent: ({children}) => <Fragment>{children}</Fragment>, +}); + type Props = { api: Client; organization: Organization; @@ -49,16 +55,23 @@ function CustomRepositories({ openDebugFileSourceDialog(); }, [location.query, appStoreConnectContext]); - const hasAppConnectStoreFeatureFlag = + const hasAppStoreConnectFeatureFlag = !!organization.features?.includes('app-store-connect'); + const hasAppStoreConnectMultipleFeatureFlag = !!organization.features?.includes( + 'app-store-connect-multiple' + ); + + const hasAppStoreConnectRepo = !!repositories.find( + repository => repository.type === CustomRepoType.APP_STORE_CONNECT + ); + if ( - hasAppConnectStoreFeatureFlag && + hasAppStoreConnectFeatureFlag && !appStoreConnectContext && !dropDownItems.find( dropDownItem => dropDownItem.value === CustomRepoType.APP_STORE_CONNECT - ) && - !repositories.find(repository => repository.type === CustomRepoType.APP_STORE_CONNECT) + ) ) { dropDownItems.push({ value: CustomRepoType.APP_STORE_CONNECT, @@ -189,19 +202,34 @@ function CustomRepositories({ {t('Custom Repositories')} <DropdownAutoComplete alignMenu="right" - items={dropDownItems.map(dropDownItem => ({ - ...dropDownItem, - label: ( - <StyledMenuItem - onClick={event => { - event.preventDefault(); - handleAddRepository(dropDownItem.value); - }} - > - {dropDownItem.label} - </StyledMenuItem> - ), - }))} + items={dropDownItems.map(dropDownItem => { + const disabled = + dropDownItem.value === CustomRepoType.APP_STORE_CONNECT && + hasAppStoreConnectRepo && + !hasAppStoreConnectMultipleFeatureFlag; + + return { + ...dropDownItem, + label: ( + <HookedAppStoreConnectItem + disabled={disabled} + onTrialStarted={() => { + handleAddRepository(dropDownItem.value); + }} + > + <StyledMenuItem + onClick={event => { + event.preventDefault(); + handleAddRepository(dropDownItem.value); + }} + disabled={disabled} + > + {dropDownItem.label} + </StyledMenuItem> + </HookedAppStoreConnectItem> + ), + }; + })} > {({isOpen}) => ( <DropdownButton isOpen={isOpen} size="small">
30ef9dee0596cd665e1d5cf7b582611cfd33daed
2023-09-13 22:50:37
Seiji Chew
feat(slug): Prevent numeric sentry-doc integration slugs (#56057)
false
Prevent numeric sentry-doc integration slugs (#56057)
feat
diff --git a/src/sentry/api/endpoints/integrations/doc_integrations/index.py b/src/sentry/api/endpoints/integrations/doc_integrations/index.py index faec4bdc874f05..3695b3788979d7 100644 --- a/src/sentry/api/endpoints/integrations/doc_integrations/index.py +++ b/src/sentry/api/endpoints/integrations/doc_integrations/index.py @@ -40,12 +40,13 @@ def post(self, request: Request): data = request.json_body data["is_draft"] = True data["metadata"] = self.generate_incoming_metadata(request) - serializer = DocIntegrationSerializer(data=data) - if serializer.is_valid(): - doc_integration = serializer.save() - return Response( - serialize(doc_integration, request.user), - status=status.HTTP_201_CREATED, - ) - return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + if not serializer.is_valid(): + return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) + + doc_integration = serializer.save() + return Response( + serialize(doc_integration, request.user), + status=status.HTTP_201_CREATED, + ) diff --git a/src/sentry/api/serializers/rest_framework/doc_integration.py b/src/sentry/api/serializers/rest_framework/doc_integration.py index b0ce3de4333250..92ce240872f006 100644 --- a/src/sentry/api/serializers/rest_framework/doc_integration.py +++ b/src/sentry/api/serializers/rest_framework/doc_integration.py @@ -1,3 +1,5 @@ +import random +import string from typing import Any, MutableMapping from django.db import router, transaction @@ -6,6 +8,7 @@ from rest_framework import serializers from rest_framework.serializers import Serializer, ValidationError +from sentry import options from sentry.api.fields.avatar import AvatarField from sentry.api.serializers.rest_framework.sentry_app import URLField from sentry.api.validators.doc_integration import validate_metadata_schema @@ -59,6 +62,12 @@ def validate_name(self, value: str) -> str: def create(self, validated_data: MutableMapping[str, Any]) -> DocIntegration: slug = self._generate_slug(validated_data["name"]) + + # If option is set, add random 3 lowercase letter suffix to prevent numeric slug + # eg: 123 -> 123-abc + if options.get("api.prevent-numeric-slugs") and slug.isdecimal(): + slug = f"{slug}-{''.join(random.choice(string.ascii_lowercase) for _ in range(3))}" + features = validated_data.pop("features") if validated_data.get("features") else [] with transaction.atomic(router.db_for_write(DocIntegration)): doc_integration = DocIntegration.objects.create(slug=slug, **validated_data) diff --git a/tests/sentry/api/endpoints/test_doc_integrations.py b/tests/sentry/api/endpoints/test_doc_integrations.py index c882cafaab6f10..d7ddfb7b110598 100644 --- a/tests/sentry/api/endpoints/test_doc_integrations.py +++ b/tests/sentry/api/endpoints/test_doc_integrations.py @@ -9,6 +9,7 @@ from sentry.models import DocIntegration, IntegrationFeature from sentry.models.integrations.integration_feature import IntegrationTypes from sentry.testutils.cases import APITestCase +from sentry.testutils.helpers.options import override_options from sentry.testutils.silo import control_silo_test from sentry.utils.json import JSONData @@ -130,6 +131,19 @@ def test_create_repeated_slug(self): response = self.get_error_response(status_code=status.HTTP_400_BAD_REQUEST, **payload) assert "name" in response.data.keys() + @override_options({"api.prevent-numeric-slugs": True}) + def test_generated_slug_not_entirely_numeric(self): + """ + Tests that generated slug based on name is not entirely numeric + """ + self.login_as(user=self.superuser, superuser=True) + payload = {**self.payload, "name": "1234"} + response = self.get_success_response(status_code=status.HTTP_201_CREATED, **payload) + + slug = response.data["slug"] + assert slug.startswith("1234-") + assert not slug.isdecimal() + def test_create_invalid_metadata(self): """ Tests that incorrectly structured metadata throws an error
57b69e7ef11bf649939c0a3e96000be02e71c992
2022-08-29 12:10:51
Priscila Oliveira
ref(data-scrubbing): Convert a couple of tests to rtl (#38083)
false
Convert a couple of tests to rtl (#38083)
ref
diff --git a/static/app/views/settings/components/dataScrubbing/rules.tsx b/static/app/views/settings/components/dataScrubbing/rules.tsx index 412b9bb0cfb325..3057d99aac38e0 100644 --- a/static/app/views/settings/components/dataScrubbing/rules.tsx +++ b/static/app/views/settings/components/dataScrubbing/rules.tsx @@ -32,7 +32,7 @@ const getListItemDescription = (rule: Rule) => { ); if (rule.method === MethodType.REPLACE && rule.placeholder) { - descriptionDetails.push(` with [${rule.placeholder}]`); + descriptionDetails.push(`with [${rule.placeholder}]`); } return `${descriptionDetails.join(' ')} ${t('from')} [${source}]`; diff --git a/tests/js/spec/views/settings/components/dataScrubbing/content.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/content.spec.tsx index d5cf25f787c02c..0929a2a669a633 100644 --- a/tests/js/spec/views/settings/components/dataScrubbing/content.spec.tsx +++ b/tests/js/spec/views/settings/components/dataScrubbing/content.spec.tsx @@ -1,31 +1,26 @@ -import {mountWithTheme} from 'sentry-test/enzyme'; +import {render, screen} from 'sentry-test/reactTestingLibrary'; import Content from 'sentry/views/settings/components/dataScrubbing/content'; import convertRelayPiiConfig from 'sentry/views/settings/components/dataScrubbing/convertRelayPiiConfig'; -const relayPiiConfig = TestStubs.DataScrubbingRelayPiiConfig(); -const stringRelayPiiConfig = JSON.stringify(relayPiiConfig); -const convertedRules = convertRelayPiiConfig(stringRelayPiiConfig); +describe('Content', function () { + it('default empty', function () { + render(<Content rules={[]} onEditRule={jest.fn()} onDeleteRule={jest.fn()} />); -const handleEditRule = jest.fn(); -const handleDelete = jest.fn(); - -describe('Content', () => { - it('default render - empty', () => { - const wrapper = mountWithTheme( - <Content rules={[]} onEditRule={handleEditRule} onDeleteRule={handleDelete} /> - ); - expect(wrapper.text()).toEqual('You have no data scrubbing rules'); + expect(screen.getByText('You have no data scrubbing rules')).toBeInTheDocument(); }); - it('render rules', () => { - const wrapper = mountWithTheme( + it('render rules', function () { + render( <Content - rules={convertedRules} - onEditRule={handleEditRule} - onDeleteRule={handleDelete} + rules={convertRelayPiiConfig( + JSON.stringify(TestStubs.DataScrubbingRelayPiiConfig()) + )} + onEditRule={jest.fn()} + onDeleteRule={jest.fn()} /> ); - expect(wrapper.find('List')).toHaveLength(1); + + expect(screen.getAllByRole('button', {name: 'Edit Rule'})).toHaveLength(3); }); }); diff --git a/tests/js/spec/views/settings/components/dataScrubbing/dataScrubbing.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/dataScrubbing.spec.tsx deleted file mode 100644 index 43a673a687bebe..00000000000000 --- a/tests/js/spec/views/settings/components/dataScrubbing/dataScrubbing.spec.tsx +++ /dev/null @@ -1,244 +0,0 @@ -import {mountWithTheme} from 'sentry-test/enzyme'; -import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; - -import {openModal} from 'sentry/actionCreators/modal'; -import DataScrubbing from 'sentry/views/settings/components/dataScrubbing'; -import {ProjectId} from 'sentry/views/settings/components/dataScrubbing/types'; - -jest.mock('sentry/actionCreators/modal'); - -const relayPiiConfig = TestStubs.DataScrubbingRelayPiiConfig(); -const stringRelayPiiConfig = JSON.stringify(relayPiiConfig); -const organizationSlug = 'sentry'; -const handleUpdateOrganization = jest.fn(); -const additionalContext = 'These rules can be configured for each project.'; - -jest.mock('sentry/actionCreators/indicator'); - -function getOrganization(piiConfig?: string) { - return TestStubs.Organization( - piiConfig ? {id: '123', relayPiiConfig: piiConfig} : {id: '123'} - ); -} - -function renderComponent({ - disabled, - projectId, - endpoint, - ...props -}: Partial<Omit<DataScrubbing<ProjectId>['props'], 'endpoint'>> & - Pick<DataScrubbing<ProjectId>['props'], 'endpoint'>) { - const organization = props.organization ?? getOrganization(); - if (projectId) { - return mountWithTheme( - <DataScrubbing - additionalContext={additionalContext} - endpoint={endpoint} - projectId={projectId} - relayPiiConfig={stringRelayPiiConfig} - disabled={disabled} - organization={organization} - onSubmitSuccess={handleUpdateOrganization} - /> - ); - } - - return mountWithTheme( - <DataScrubbing - additionalContext={additionalContext} - endpoint={endpoint} - relayPiiConfig={stringRelayPiiConfig} - disabled={disabled} - organization={organization} - onSubmitSuccess={handleUpdateOrganization} - /> - ); -} - -describe('Data Scrubbing', () => { - describe('Organization level', () => { - const endpoint = `organization/${organizationSlug}/`; - - it('default render', () => { - const wrapper = renderComponent({disabled: false, endpoint}); - - // PanelHeader - expect(wrapper.find('PanelHeader').text()).toEqual('Advanced Data Scrubbing'); - - // PanelAlert - const panelAlert = wrapper.find('PanelAlert'); - expect(panelAlert.text()).toEqual( - `${additionalContext} The new rules will only apply to upcoming events. For more details, see full documentation on data scrubbing.` - ); - - const readDocsLink = panelAlert.find('a'); - expect(readDocsLink.text()).toEqual('full documentation on data scrubbing'); - expect(readDocsLink.prop('href')).toEqual( - 'https://docs.sentry.io/product/data-management-settings/scrubbing/advanced-datascrubbing/' - ); - - // PanelBody - const panelBody = wrapper.find('PanelBody'); - expect(panelBody).toHaveLength(1); - expect(panelBody.find('ListItem')).toHaveLength(3); - - // OrganizationRules - const organizationRules = panelBody.find('OrganizationRules'); - expect(organizationRules).toHaveLength(0); - - // PanelAction - const actionButtons = wrapper.find('PanelAction').find('Button'); - expect(actionButtons).toHaveLength(2); - expect(actionButtons.at(0).text()).toEqual('Read Docs'); - expect(actionButtons.at(1).text()).toEqual('Add Rule'); - expect(actionButtons.at(1).prop('disabled')).toEqual(false); - }); - - it('render disabled', () => { - const wrapper = renderComponent({disabled: true, endpoint}); - - // PanelBody - const panelBody = wrapper.find('PanelBody'); - expect(panelBody).toHaveLength(1); - expect(panelBody.find('List').prop('isDisabled')).toEqual(true); - - // PanelAction - const actionButtons = wrapper.find('PanelAction').find('StyledButton'); - expect(actionButtons).toHaveLength(2); - expect(actionButtons.at(0).prop('disabled')).toEqual(false); - expect(actionButtons.at(1).prop('disabled')).toEqual(true); - }); - }); - - describe('Project level', () => { - const projectId = 'foo'; - const endpoint = `/projects/${organizationSlug}/${projectId}/`; - - it('default render', () => { - const wrapper = renderComponent({ - disabled: false, - projectId, - endpoint, - }); - - // PanelHeader - expect(wrapper.find('PanelHeader').text()).toEqual('Advanced Data Scrubbing'); - - // PanelAlert - const panelAlert = wrapper.find('PanelAlert'); - expect(panelAlert.text()).toEqual( - `${additionalContext} The new rules will only apply to upcoming events. For more details, see full documentation on data scrubbing.` - ); - - const readDocsLink = panelAlert.find('a'); - expect(readDocsLink.text()).toEqual('full documentation on data scrubbing'); - expect(readDocsLink.prop('href')).toEqual( - 'https://docs.sentry.io/product/data-management-settings/scrubbing/advanced-datascrubbing/' - ); - - // PanelBody - const panelBody = wrapper.find('PanelBody'); - expect(panelBody).toHaveLength(1); - expect(panelBody.find('ListItem')).toHaveLength(3); - - // OrganizationRules - const organizationRules = panelBody.find('OrganizationRules'); - expect(organizationRules).toHaveLength(1); - expect(organizationRules.text()).toEqual( - 'There are no data scrubbing rules at the organization level' - ); - - // PanelAction - const actionButtons = wrapper.find('PanelAction').find('Button'); - expect(actionButtons).toHaveLength(2); - expect(actionButtons.at(0).text()).toEqual('Read Docs'); - expect(actionButtons.at(1).text()).toEqual('Add Rule'); - expect(actionButtons.at(1).prop('disabled')).toEqual(false); - }); - - it('render disabled', () => { - const wrapper = renderComponent({disabled: true, endpoint}); - - // PanelBody - const panelBody = wrapper.find('PanelBody'); - expect(panelBody).toHaveLength(1); - expect(panelBody.find('List').prop('isDisabled')).toEqual(true); - - // PanelAction - const actionButtons = wrapper.find('PanelAction').find('StyledButton'); - expect(actionButtons).toHaveLength(2); - expect(actionButtons.at(0).prop('disabled')).toEqual(false); - expect(actionButtons.at(1).prop('disabled')).toEqual(true); - }); - - it('OrganizationRules has content', () => { - const wrapper = renderComponent({ - disabled: false, - organization: getOrganization(stringRelayPiiConfig), - projectId, - endpoint, - }); - - // OrganizationRules - const organizationRules = wrapper.find('OrganizationRules'); - expect(organizationRules).toHaveLength(1); - expect(organizationRules.find('Header').text()).toEqual('Organization Rules'); - const listItems = organizationRules.find('ListItem'); - expect(listItems).toHaveLength(3); - expect(listItems.at(0).find('[role="button"]')).toHaveLength(0); - }); - - it('Delete rule successfully', () => { - // TODO(test): Improve this test by checking if the confirmation dialog is opened - render( - <DataScrubbing - additionalContext={additionalContext} - endpoint={endpoint} - projectId={projectId} - relayPiiConfig={stringRelayPiiConfig} - disabled={false} - organization={getOrganization()} - onSubmitSuccess={handleUpdateOrganization} - /> - ); - - userEvent.click(screen.getAllByLabelText('Delete Rule')[0]); - - expect(openModal).toHaveBeenCalled(); - }); - - it('Open Add Rule Modal', () => { - const wrapper = renderComponent({ - disabled: false, - projectId, - endpoint, - }); - - const addbutton = wrapper - .find('PanelAction') - .find('[aria-label="Add Rule"]') - .hostNodes(); - - addbutton.simulate('click'); - - expect(openModal).toHaveBeenCalled(); - }); - - it('Open Edit Rule Modal', () => { - const wrapper = renderComponent({ - disabled: false, - projectId, - endpoint, - }); - - const editButton = wrapper - .find('PanelBody') - .find('[aria-label="Edit Rule"]') - .hostNodes(); - - editButton.at(0).simulate('click'); - - expect(openModal).toHaveBeenCalled(); - }); - }); -}); diff --git a/tests/js/spec/views/settings/components/dataScrubbing/index.spec.tsx b/tests/js/spec/views/settings/components/dataScrubbing/index.spec.tsx new file mode 100644 index 00000000000000..9d63a76f26662a --- /dev/null +++ b/tests/js/spec/views/settings/components/dataScrubbing/index.spec.tsx @@ -0,0 +1,192 @@ +import {Fragment} from 'react'; + +import {render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; +import {textWithMarkupMatcher} from 'sentry-test/utils'; + +import GlobalModal from 'sentry/components/globalModal'; +import DataScrubbing from 'sentry/views/settings/components/dataScrubbing'; + +const relayPiiConfig = JSON.stringify(TestStubs.DataScrubbingRelayPiiConfig()); + +describe('Data Scrubbing', function () { + describe('Organization level', function () { + const organization = TestStubs.Organization(); + const additionalContext = 'These rules can be configured for each project.'; + + it('default render', function () { + render( + <DataScrubbing + additionalContext={additionalContext} + endpoint={`organization/${organization.slug}/`} + relayPiiConfig={relayPiiConfig} + organization={organization} + onSubmitSuccess={jest.fn()} + /> + ); + + // Header + expect(screen.getByText('Advanced Data Scrubbing')).toBeInTheDocument(); + + // Alert + expect( + screen.getByText( + textWithMarkupMatcher( + `${additionalContext} The new rules will only apply to upcoming events. For more details, see full documentation on data scrubbing.` + ) + ) + ).toBeInTheDocument(); + + expect( + screen.getByRole('link', {name: 'full documentation on data scrubbing'}) + ).toHaveAttribute( + 'href', + `https://docs.sentry.io/product/data-management-settings/scrubbing/advanced-datascrubbing/` + ); + + // Body + expect(screen.getAllByRole('button', {name: 'Edit Rule'})).toHaveLength(3); + + // Actions + expect(screen.getByRole('button', {name: 'Read Docs'})).toHaveAttribute( + 'href', + `https://docs.sentry.io/product/data-management-settings/scrubbing/advanced-datascrubbing/` + ); + expect(screen.getByRole('button', {name: 'Add Rule'})).toBeEnabled(); + }); + + it('render disabled actions', function () { + render( + <DataScrubbing + additionalContext={additionalContext} + endpoint={`organization/${organization.slug}/`} + relayPiiConfig={relayPiiConfig} + organization={organization} + onSubmitSuccess={jest.fn()} + disabled + /> + ); + + // Read Docs is the only enabled action + expect(screen.getByRole('button', {name: 'Read Docs'})).toBeEnabled(); + + expect(screen.getByRole('button', {name: 'Add Rule'})).toBeDisabled(); + + for (const index in JSON.parse(relayPiiConfig).rules) { + expect(screen.getAllByRole('button', {name: 'Edit Rule'})[index]).toBeDisabled(); + expect( + screen.getAllByRole('button', {name: 'Delete Rule'})[index] + ).toBeDisabled(); + } + }); + }); + + describe('Project level', function () { + it('default render', function () { + const organization = TestStubs.Organization(); + + render( + <DataScrubbing + endpoint={`/projects/${organization.slug}/foo/`} + relayPiiConfig={relayPiiConfig} + organization={organization} + onSubmitSuccess={jest.fn()} + projectId="foo" + /> + ); + + // Header + expect( + screen.getByText('There are no data scrubbing rules at the organization level') + ).toBeInTheDocument(); + }); + + it('OrganizationRules has content', function () { + const organization = TestStubs.Organization({relayPiiConfig}); + + render( + <DataScrubbing + endpoint={`/projects/${organization.slug}/foo/`} + relayPiiConfig={relayPiiConfig} + organization={organization} + onSubmitSuccess={jest.fn()} + projectId="foo" + /> + ); + + // Organization Rules + expect(screen.getByText('Organization Rules')).toBeInTheDocument(); + }); + + it('Delete rule successfully', async function () { + const organization = TestStubs.Organization(); + + render( + <Fragment> + <GlobalModal /> + <DataScrubbing + endpoint={`/projects/${organization.slug}/foo/`} + projectId="foo" + relayPiiConfig={relayPiiConfig} + disabled={false} + organization={organization} + onSubmitSuccess={jest.fn()} + /> + </Fragment> + ); + + userEvent.click(screen.getAllByLabelText('Delete Rule')[0]); + + expect( + await screen.findByText('Are you sure you wish to delete this rule?') + ).toBeInTheDocument(); + }); + + it('Open Add Rule Modal', async function () { + const organization = TestStubs.Organization(); + + render( + <Fragment> + <GlobalModal /> + <DataScrubbing + endpoint={`/projects/${organization.slug}/foo/`} + projectId="foo" + relayPiiConfig={relayPiiConfig} + disabled={false} + organization={organization} + onSubmitSuccess={jest.fn()} + /> + </Fragment> + ); + + userEvent.click(screen.getByRole('button', {name: 'Add Rule'})); + + expect( + await screen.findByText('Add an advanced data scrubbing rule') + ).toBeInTheDocument(); + }); + + it('Open Edit Rule Modal', async function () { + const organization = TestStubs.Organization(); + + render( + <Fragment> + <GlobalModal /> + <DataScrubbing + endpoint={`/projects/${organization.slug}/foo/`} + projectId="foo" + relayPiiConfig={relayPiiConfig} + disabled={false} + organization={organization} + onSubmitSuccess={jest.fn()} + /> + </Fragment> + ); + + userEvent.click(screen.getAllByRole('button', {name: 'Edit Rule'})[0]); + + expect( + await screen.findByText('Edit an advanced data scrubbing rule') + ).toBeInTheDocument(); + }); + }); +}); 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 4116eff1bbdb1e..3260ef11874b89 100644 --- a/tests/js/spec/views/settings/components/dataScrubbing/rules.spec.tsx +++ b/tests/js/spec/views/settings/components/dataScrubbing/rules.spec.tsx @@ -1,74 +1,53 @@ -import {mountWithTheme} from 'sentry-test/enzyme'; +import {render, screen} from 'sentry-test/reactTestingLibrary'; +import {textWithMarkupMatcher} from 'sentry-test/utils'; import convertRelayPiiConfig from 'sentry/views/settings/components/dataScrubbing/convertRelayPiiConfig'; import Rules from 'sentry/views/settings/components/dataScrubbing/rules'; -const relayPiiConfig = TestStubs.DataScrubbingRelayPiiConfig(); -const stringRelayPiiConfig = JSON.stringify(relayPiiConfig); -const convertedRules = convertRelayPiiConfig(stringRelayPiiConfig); -const rules = convertedRules; -const handleShowEditRule = jest.fn(); -const handleDelete = jest.fn(); +const relayPiiConfig = convertRelayPiiConfig( + JSON.stringify(TestStubs.DataScrubbingRelayPiiConfig()) +); -describe('Rules', () => { - it('default render', () => { - const wrapper = mountWithTheme(<Rules rules={rules} />); - expect(wrapper.find('ListItem')).toHaveLength(3); - }); +describe('Rules', function () { + it('default render', function () { + render(<Rules rules={relayPiiConfig} onEditRule={jest.fn()} />); - it('render correct description', () => { - const wrapper = mountWithTheme(<Rules rules={rules} />); - const listItems = wrapper.find('ListItem'); - expect(listItems.at(1).text()).toEqual( - '[Mask] [Credit card numbers] from [$message]' - ); - expect(listItems.at(0).text()).toEqual( - '[Replace] [Password fields] with [Scrubbed] from [password]' - ); - }); + expect(screen.getAllByRole('button', {name: 'Edit Rule'})).toHaveLength(3); - it('render disabled list', () => { - const wrapper = mountWithTheme(<Rules rules={rules} disabled />); - expect(wrapper.find('List').prop('isDisabled')).toEqual(true); - }); - - it('render edit and delete buttons', () => { - const wrapper = mountWithTheme( - <Rules rules={rules} onEditRule={handleShowEditRule} onDeleteRule={handleDelete} /> - ); - expect(wrapper.find('[aria-label="Edit Rule"]').hostNodes()).toHaveLength(3); - expect(wrapper.find('[aria-label="Delete Rule"]').hostNodes()).toHaveLength(3); - }); + expect( + screen.getByText( + textWithMarkupMatcher( + '[Replace] [[a-zA-Z0-9]+] with [Placeholder] from [$message]' + ) + ) + ).toBeInTheDocument(); - it('render disabled edit and delete buttons', () => { - const wrapper = mountWithTheme( - <Rules - rules={rules} - onEditRule={handleShowEditRule} - onDeleteRule={handleDelete} - disabled - /> - ); expect( - wrapper.find('[aria-label="Edit Rule"]').hostNodes().at(0).prop('aria-disabled') - ).toEqual(true); + screen.getByText('[Mask] [Credit card numbers] from [$message]') + ).toBeInTheDocument(); expect( - wrapper.find('[aria-label="Delete Rule"]').hostNodes().at(0).prop('aria-disabled') - ).toEqual(true); + screen.getByText( + textWithMarkupMatcher( + '[Replace] [Password fields] with [Scrubbed] from [password]' + ) + ) + ).toBeInTheDocument(); }); - it('render edit button only', () => { - const wrapper = mountWithTheme( - <Rules rules={rules} onEditRule={handleShowEditRule} /> - ); - expect(wrapper.find('[aria-label="Edit Rule"]').hostNodes()).toHaveLength(3); - expect(wrapper.find('[aria-label="Delete Rule"]')).toHaveLength(0); + it('render edit button only', function () { + render(<Rules rules={relayPiiConfig} onEditRule={jest.fn()} />); + + expect(screen.getAllByRole('button', {name: 'Edit Rule'})).toHaveLength(3); + + expect(screen.queryByRole('button', {name: 'Delete Rule'})).not.toBeInTheDocument(); }); - it('render delete button only', () => { - const wrapper = mountWithTheme(<Rules rules={rules} onDeleteRule={handleDelete} />); - expect(wrapper.find('[aria-label="Edit Rule"]')).toHaveLength(0); - expect(wrapper.find('[aria-label="Delete Rule"]').hostNodes()).toHaveLength(3); + it('render delete button only', function () { + render(<Rules rules={relayPiiConfig} onDeleteRule={jest.fn()} />); + + expect(screen.getAllByRole('button', {name: 'Delete Rule'})).toHaveLength(3); + + expect(screen.queryByRole('button', {name: 'Edit Rule'})).not.toBeInTheDocument(); }); });
55c5f0cb685f62b19f0184b61115da0a324eafa7
2022-05-06 00:47:24
Evan Purkhiser
ref(js): Avoid import * as React in Fragment only files (#34296)
false
Avoid import * as React in Fragment only files (#34296)
ref
diff --git a/static/app/components/actions/confirmableAction.tsx b/static/app/components/actions/confirmableAction.tsx index 8c274fbbf5ce59..1262c98b971608 100644 --- a/static/app/components/actions/confirmableAction.tsx +++ b/static/app/components/actions/confirmableAction.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import Confirm from 'sentry/components/confirm'; @@ -16,5 +16,5 @@ export default function ConfirmableAction({shouldConfirm, children, ...props}: P return <Confirm {...props}>{children as ConfirmProps['children']}</Confirm>; } - return <React.Fragment>{children}</React.Fragment>; + return <Fragment>{children}</Fragment>; } diff --git a/static/app/components/breadcrumbs.tsx b/static/app/components/breadcrumbs.tsx index 35a39ecfbdc08a..36865174043c9d 100644 --- a/static/app/components/breadcrumbs.tsx +++ b/static/app/components/breadcrumbs.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import {LocationDescriptor} from 'history'; @@ -114,7 +114,7 @@ const Breadcrumbs = ({crumbs, linkLastItem = false, ...props}: Props) => { key ?? typeof to === 'string' ? `${labelKey}${to}` : `${labelKey}${index}`; return ( - <React.Fragment key={mapKey}> + <Fragment key={mapKey}> {to ? ( <BreadcrumbLink to={to} @@ -130,7 +130,7 @@ const Breadcrumbs = ({crumbs, linkLastItem = false, ...props}: Props) => { {index < crumbs.length - 1 && ( <BreadcrumbDividerIcon size="xs" direction="right" /> )} - </React.Fragment> + </Fragment> ); })} </BreadcrumbList> diff --git a/static/app/components/bulkController/bulkNotice.tsx b/static/app/components/bulkController/bulkNotice.tsx index f2d4f3cb0d9d9a..f74dff3167d42c 100644 --- a/static/app/components/bulkController/bulkNotice.tsx +++ b/static/app/components/bulkController/bulkNotice.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import {t, tct, tn} from 'sentry/locale'; @@ -92,14 +92,14 @@ function BulkNotice({ return ( <Wrapper columnsCount={columnsCount} className={className}> {isAllSelected ? ( - <React.Fragment> + <Fragment> {noticeText}{' '} <AlertButton priority="link" onClick={onUnselectAllRows}> {t('Cancel selection.')} </AlertButton> - </React.Fragment> + </Fragment> ) : ( - <React.Fragment> + <Fragment> {tn( '%s item on this page selected.', '%s items on this page selected.', @@ -108,7 +108,7 @@ function BulkNotice({ <AlertButton priority="link" onClick={onSelectAllRows}> {actionText} </AlertButton> - </React.Fragment> + </Fragment> )} </Wrapper> ); diff --git a/static/app/components/confirmDelete.tsx b/static/app/components/confirmDelete.tsx index 70a729df30e090..f7ba760f14f2cb 100644 --- a/static/app/components/confirmDelete.tsx +++ b/static/app/components/confirmDelete.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import Alert from 'sentry/components/alert'; import Confirm from 'sentry/components/confirm'; @@ -19,7 +19,7 @@ const ConfirmDelete = ({message, confirmInput, ...props}: Props) => ( bypass={false} disableConfirmButton renderMessage={({disableConfirmButton}) => ( - <React.Fragment> + <Fragment> <Alert type="error">{message}</Alert> <Field flexibleControlStateSize @@ -35,7 +35,7 @@ const ConfirmDelete = ({message, confirmInput, ...props}: Props) => ( onChange={e => disableConfirmButton(e.target.value !== confirmInput)} /> </Field> - </React.Fragment> + </Fragment> )} /> ); diff --git a/static/app/components/createAlertButton.tsx b/static/app/components/createAlertButton.tsx index ddf7428e23883c..deb7cd808a4503 100644 --- a/static/app/components/createAlertButton.tsx +++ b/static/app/components/createAlertButton.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {withRouter, WithRouterProps} from 'react-router'; import styled from '@emotion/styled'; @@ -139,7 +139,7 @@ function IncompatibleQueryAlert({ } > {totalErrors === 1 && ( - <React.Fragment> + <Fragment> {hasProjectError && t('An alert can use data from only one Project. Select one and try again.')} {hasEnvironmentError && @@ -158,10 +158,10 @@ function IncompatibleQueryAlert({ yAxis: <StyledCode>{eventView.getYAxis()}</StyledCode>, } )} - </React.Fragment> + </Fragment> )} {totalErrors > 1 && ( - <React.Fragment> + <Fragment> {t('Yikes! That button didn’t work. Please fix the following problems:')} <StyledUnorderedList> {hasProjectError && <li>{t('Select one Project.')}</li>} @@ -187,7 +187,7 @@ function IncompatibleQueryAlert({ </li> )} </StyledUnorderedList> - </React.Fragment> + </Fragment> )} </StyledAlert> ); diff --git a/static/app/components/dashboards/widgetQueryFields.tsx b/static/app/components/dashboards/widgetQueryFields.tsx index f177ae1939af72..604f174bb8eceb 100644 --- a/static/app/components/dashboards/widgetQueryFields.tsx +++ b/static/app/components/dashboards/widgetQueryFields.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import Button from 'sentry/components/button'; @@ -216,7 +216,7 @@ function WidgetQueryFields({ const columns = fields.slice(0, fields.length - 1); return ( - <React.Fragment> + <Fragment> <Field data-test-id="columns" label={t('Columns')} @@ -260,7 +260,7 @@ function WidgetQueryFields({ /> </QueryFieldWrapper> </Field> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/events/interfaces/debugMeta-v2/debugImageDetails/candidate/information/index.tsx b/static/app/components/events/interfaces/debugMeta-v2/debugImageDetails/candidate/information/index.tsx index 6a4d5782897aad..5ee40a055b39af 100644 --- a/static/app/components/events/interfaces/debugMeta-v2/debugImageDetails/candidate/information/index.tsx +++ b/static/app/components/events/interfaces/debugMeta-v2/debugImageDetails/candidate/information/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import capitalize from 'lodash/capitalize'; import moment from 'moment-timezone'; @@ -79,7 +79,7 @@ function Information({ if (hasReprocessWarning) { return { tooltipDesc: ( - <React.Fragment> + <Fragment> {tct( 'This debug file was uploaded [when] before this event. It takes up to 1 hour for new files to propagate. To apply new debug information, reprocess this issue.', { @@ -87,7 +87,7 @@ function Information({ } )} <DateTimeWrapper>{dateTime}</DateTimeWrapper> - </React.Fragment> + </Fragment> ), displayIcon: true, }; @@ -104,7 +104,7 @@ function Information({ return { tooltipDesc: ( - <React.Fragment> + <Fragment> {tct( 'This debug file was uploaded [when] before this event. It takes up to 1 hour for new files to propagate.', { @@ -112,7 +112,7 @@ function Information({ } )} <DateTimeWrapper>{dateTime}</DateTimeWrapper> - </React.Fragment> + </Fragment> ), displayIcon: true, }; @@ -121,7 +121,7 @@ function Information({ if (hasReprocessWarning) { return { tooltipDesc: ( - <React.Fragment> + <Fragment> {tct( 'This debug file was uploaded [when] after this event. To apply new debug information, reprocess this issue.', { @@ -129,7 +129,7 @@ function Information({ } )} <DateTimeWrapper>{dateTime}</DateTimeWrapper> - </React.Fragment> + </Fragment> ), displayIcon: true, }; @@ -137,12 +137,12 @@ function Information({ return { tooltipDesc: ( - <React.Fragment> + <Fragment> {tct('This debug file was uploaded [when] after this event.', { when: moment(eventDateReceived).from(dateCreated, true), })} <DateTimeWrapper>{dateTime}</DateTimeWrapper> - </React.Fragment> + </Fragment> ), displayIcon: true, }; @@ -185,10 +185,10 @@ function Information({ } return ( - <React.Fragment> + <Fragment> <StyledProcessingList items={items} /> <Divider /> - </React.Fragment> + </Fragment> ); } @@ -208,7 +208,7 @@ function Information({ const {tooltipDesc, displayIcon} = getTimeSinceData(dateCreated); return ( - <React.Fragment> + <Fragment> <Tooltip title={tooltipDesc}> <TimeSinceWrapper> {displayIcon && <IconWarning color="red300" size="xs" />} @@ -226,7 +226,7 @@ function Information({ : `${symbolType}${fileType ? ` ${fileType}` : ''}`} </span> <Divider /> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/events/interfaces/frame/contextLine.tsx b/static/app/components/events/interfaces/frame/contextLine.tsx index 02653f053b17c8..28d93d4b47c80c 100644 --- a/static/app/components/events/interfaces/frame/contextLine.tsx +++ b/static/app/components/events/interfaces/frame/contextLine.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import classNames from 'classnames'; @@ -12,7 +12,7 @@ type Props = { isActive: boolean; line: [number, string]; className?: string; -} & React.ComponentProps<typeof React.Fragment>; +} & React.ComponentProps<typeof Fragment>; const ContextLine = function (props: Props) { const {line, isActive, className} = props; @@ -21,7 +21,7 @@ const ContextLine = function (props: Props) { if (defined(line[1]) && line[1].match) { [, lineWs, lineCode] = line[1].match(/^(\s*)(.*?)$/m)!; } - const Component = !props.children ? React.Fragment : Context; + const Component = !props.children ? Fragment : Context; return ( <li className={classNames(className, 'expandable', {active: isActive})} key={line[0]}> <Component> diff --git a/static/app/components/events/interfaces/frame/defaultTitle/index.tsx b/static/app/components/events/interfaces/frame/defaultTitle/index.tsx index 5b846d11173b54..e59fe70d832bb4 100644 --- a/static/app/components/events/interfaces/frame/defaultTitle/index.tsx +++ b/static/app/components/events/interfaces/frame/defaultTitle/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import AnnotatedText from 'sentry/components/events/meta/annotatedText'; @@ -201,7 +201,7 @@ const DefaultTitle = ({frame, platform, isHoverPreviewed, isUsedForGrouping}: Pr title.push(<StyledGroupingIndicator key="info-tooltip" />); } - return <React.Fragment>{title}</React.Fragment>; + return <Fragment>{title}</Fragment>; }; export default DefaultTitle; diff --git a/static/app/components/events/interfaces/frame/stacktraceLink.tsx b/static/app/components/events/interfaces/frame/stacktraceLink.tsx index 445caacdef4cbf..159d1044e7cd27 100644 --- a/static/app/components/events/interfaces/frame/stacktraceLink.tsx +++ b/static/app/components/events/interfaces/frame/stacktraceLink.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import {openModal} from 'sentry/actionCreators/modal'; @@ -264,7 +264,7 @@ class StacktraceLink extends AsyncComponent<Props, State> { const {frame} = this.props; const {config} = this.match; return ( - <React.Fragment> + <Fragment> <StyledHovercard header={ error === 'stack_root_mismatch' ? ( @@ -292,7 +292,7 @@ class StacktraceLink extends AsyncComponent<Props, State> { > <StyledIconInfo size="xs" /> </StyledHovercard> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/events/interfaces/spans/spanGroupBar.tsx b/static/app/components/events/interfaces/spans/spanGroupBar.tsx index bfd339304233cf..54b78552edbd72 100644 --- a/static/app/components/events/interfaces/spans/spanGroupBar.tsx +++ b/static/app/components/events/interfaces/spans/spanGroupBar.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import Count from 'sentry/components/count'; import { @@ -115,7 +115,7 @@ function renderMeasurements( const measurements = getMeasurements(event); return ( - <React.Fragment> + <Fragment> {Array.from(measurements).map(([timestamp, verticalMark]) => { const bounds = getMeasurementBounds(timestamp, generateBounds); @@ -135,7 +135,7 @@ function renderMeasurements( /> ); })} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/events/interfaces/spans/spanSiblingGroupBar.tsx b/static/app/components/events/interfaces/spans/spanSiblingGroupBar.tsx index 21406cebbe91ef..7be8e6027ac432 100644 --- a/static/app/components/events/interfaces/spans/spanSiblingGroupBar.tsx +++ b/static/app/components/events/interfaces/spans/spanSiblingGroupBar.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import { ConnectorBar, @@ -68,10 +68,10 @@ export default function SpanSiblingGroupBar(props: Props) { } return ( - <React.Fragment> + <Fragment> <strong>{`${t('Autogrouped')} \u2014 ${operation} \u2014 `}</strong> {description} - </React.Fragment> + </Fragment> ); } @@ -107,7 +107,7 @@ export default function SpanSiblingGroupBar(props: Props) { function renderSpanRectangles() { return ( - <React.Fragment> + <Fragment> {spanGrouping.map((_, index) => ( <SpanRectangle key={index} @@ -119,7 +119,7 @@ export default function SpanSiblingGroupBar(props: Props) { spanGrouping={spanGrouping} bounds={getSpanGroupBounds(spanGrouping, generateBounds)} /> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/externalIssues/abstractExternalIssueForm.tsx b/static/app/components/externalIssues/abstractExternalIssueForm.tsx index eaf52aa37b449f..20a63b530c93e1 100644 --- a/static/app/components/externalIssues/abstractExternalIssueForm.tsx +++ b/static/app/components/externalIssues/abstractExternalIssueForm.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import debounce from 'lodash/debounce'; import * as qs from 'query-string'; @@ -175,7 +175,7 @@ export default class AbstractExternalIssueForm< } if (typeof currentOption.label === 'string') { currentOption.label = ( - <React.Fragment> + <Fragment> <QuestionTooltip title={tct('This is your current [label].', { label: field.label, @@ -183,7 +183,7 @@ export default class AbstractExternalIssueForm< size="xs" />{' '} {currentOption.label} - </React.Fragment> + </Fragment> ); } const currentOptionResultIndex = result.findIndex( @@ -332,14 +332,14 @@ export default class AbstractExternalIssueForm< const {Header, Body} = this.props as ModalRenderProps; return ( - <React.Fragment> + <Fragment> <Header closeButton>{this.getTitle()}</Header> {this.renderNavTabs()} <Body> {this.shouldRenderLoading ? ( this.renderLoading() ) : ( - <React.Fragment> + <Fragment> {this.renderBodyText()} <Form initialData={initialData} {...this.getFormProps()}> {(formFields || []) @@ -360,10 +360,10 @@ export default class AbstractExternalIssueForm< /> ))} </Form> - </React.Fragment> + </Fragment> )} </Body> - </React.Fragment> + </Fragment> ); }; } diff --git a/static/app/components/forms/controls/radioGroup.tsx b/static/app/components/forms/controls/radioGroup.tsx index 879e473f833eea..9046f7323fc69d 100644 --- a/static/app/components/forms/controls/radioGroup.tsx +++ b/static/app/components/forms/controls/radioGroup.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import isPropValid from '@emotion/is-prop-valid'; import styled from '@emotion/styled'; @@ -63,7 +63,7 @@ const RadioGroup = <C extends string>({ const disabledChoiceReason = disabledChoice?.[1]; const disabled = !!disabledChoice || groupDisabled; const content = ( - <React.Fragment> + <Fragment> <RadioLineItem role="radio" index={index} @@ -80,14 +80,14 @@ const RadioGroup = <C extends string>({ /> <RadioLineText disabled={disabled}>{name}</RadioLineText> {description && ( - <React.Fragment> + <Fragment> {/* If there is a description then we want to have a 2x2 grid so the first column width aligns with Radio Button */} <div /> <Description>{description}</Description> - </React.Fragment> + </Fragment> )} </RadioLineItem> - </React.Fragment> + </Fragment> ); if (!!disabledChoiceReason) { @@ -98,7 +98,7 @@ const RadioGroup = <C extends string>({ ); } - return <React.Fragment key={index}>{content}</React.Fragment>; + return <Fragment key={index}>{content}</Fragment>; })} </Container> ); diff --git a/static/app/components/group/inboxBadges/inboxReason.tsx b/static/app/components/group/inboxBadges/inboxReason.tsx index cb2a1aec65a6db..eac0fbe6b49578 100644 --- a/static/app/components/group/inboxBadges/inboxReason.tsx +++ b/static/app/components/group/inboxBadges/inboxReason.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import DateTime from 'sentry/components/dateTime'; @@ -169,10 +169,10 @@ function InboxReason({inbox, fontSize = 'sm', showDateAdded}: Props) { <StyledTag type={tagType} tooltipText={tooltip} fontSize={fontSize}> {reasonBadgeText} {showDateAdded && dateAdded && ( - <React.Fragment> + <Fragment> <Separator type={tagType ?? 'default'}>{' | '}</Separator> <TimeSince date={dateAdded} suffix="" extraShort disabledAbsoluteTooltip /> - </React.Fragment> + </Fragment> )} </StyledTag> ); diff --git a/static/app/components/group/sidebarSection.tsx b/static/app/components/group/sidebarSection.tsx index 42316a7ec0560b..1e94d0cd096ef3 100644 --- a/static/app/components/group/sidebarSection.tsx +++ b/static/app/components/group/sidebarSection.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import space from 'sentry/styles/space'; @@ -43,10 +43,10 @@ function SidebarSection({title, children, secondary, ...props}: SidebarSectionPr const HeaderComponent = secondary ? Subheading : Heading; return ( - <React.Fragment> + <Fragment> <HeaderComponent {...props}>{title}</HeaderComponent> <SectionContent secondary={secondary}>{children}</SectionContent> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/group/suggestedOwners/suggestedOwners.tsx b/static/app/components/group/suggestedOwners/suggestedOwners.tsx index 7148018186d5a2..91e4dd5c1cf61b 100644 --- a/static/app/components/group/suggestedOwners/suggestedOwners.tsx +++ b/static/app/components/group/suggestedOwners/suggestedOwners.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {assignToActor, assignToUser} from 'sentry/actionCreators/group'; import {promptsCheck, promptsUpdate} from 'sentry/actionCreators/prompts'; @@ -226,7 +226,7 @@ class SuggestedOwners extends AsyncComponent<Props, State> { const {codeowners, isDismissed} = this.state; const owners = this.getOwnerList(); return ( - <React.Fragment> + <Fragment> {owners.length > 0 && ( <SuggestedAssignees owners={owners} onAssign={this.handleAssign} /> )} @@ -238,7 +238,7 @@ class SuggestedOwners extends AsyncComponent<Props, State> { isDismissed={isDismissed} handleCTAClose={this.handleCTAClose} /> - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/components/highlight.tsx b/static/app/components/highlight.tsx index d2125c1dae1039..a32a5296396c2d 100644 --- a/static/app/components/highlight.tsx +++ b/static/app/components/highlight.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; type HighlightProps = { @@ -22,22 +22,22 @@ type Props = Omit<React.HTMLAttributes<HTMLDivElement>, keyof HighlightProps> & const HighlightComponent = ({className, children, disabled, text}: Props) => { // There are instances when children is not string in breadcrumbs but not caught by TS if (!text || disabled || typeof children !== 'string') { - return <React.Fragment>{children}</React.Fragment>; + return <Fragment>{children}</Fragment>; } const highlightText = text.toLowerCase(); const idx = children.toLowerCase().indexOf(highlightText); if (idx === -1) { - return <React.Fragment>{children}</React.Fragment>; + return <Fragment>{children}</Fragment>; } return ( - <React.Fragment> + <Fragment> {children.substr(0, idx)} <span className={className}>{children.substr(idx, highlightText.length)}</span> {children.substr(idx + highlightText.length)} - </React.Fragment> + </Fragment> ); }; diff --git a/static/app/components/issueLink.tsx b/static/app/components/issueLink.tsx index 11a067661b6d3c..5718b4b2ac187b 100644 --- a/static/app/components/issueLink.tsx +++ b/static/app/components/issueLink.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import classNames from 'classnames'; @@ -50,7 +50,7 @@ const IssueLink = ({children, orgId, issue, to, card = true}: Props) => { levelIndicatorSize="9px" message={message} annotations={ - <React.Fragment> + <Fragment> {issue.logger && ( <EventAnnotation> <Link @@ -66,7 +66,7 @@ const IssueLink = ({children, orgId, issue, to, card = true}: Props) => { {issue.annotations.map((annotation, i) => ( <EventAnnotation key={i} dangerouslySetInnerHTML={{__html: annotation}} /> ))} - </React.Fragment> + </Fragment> } /> </Section> diff --git a/static/app/components/keyValueTable.tsx b/static/app/components/keyValueTable.tsx index 071be165ddec04..b030cbc94f349e 100644 --- a/static/app/components/keyValueTable.tsx +++ b/static/app/components/keyValueTable.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import overflowEllipsis from 'sentry/styles/overflowEllipsis'; @@ -17,10 +17,10 @@ export const KeyValueTable = styled('dl')` export const KeyValueTableRow = ({keyName, value}: Props) => { return ( - <React.Fragment> + <Fragment> <Key>{keyName}</Key> <Value>{value}</Value> - </React.Fragment> + </Fragment> ); }; diff --git a/static/app/components/modals/dashboardWidgetLibraryModal/libraryTab.tsx b/static/app/components/modals/dashboardWidgetLibraryModal/libraryTab.tsx index 63e928ca20cef1..ea8c71477c1ad6 100644 --- a/static/app/components/modals/dashboardWidgetLibraryModal/libraryTab.tsx +++ b/static/app/components/modals/dashboardWidgetLibraryModal/libraryTab.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import Alert from 'sentry/components/alert'; @@ -24,7 +24,7 @@ function DashboardWidgetLibraryTab({ setErrored, }: Props) { return ( - <React.Fragment> + <Fragment> {errored && !!!selectedWidgets.length ? ( <Alert type="error"> {t( @@ -46,7 +46,7 @@ function DashboardWidgetLibraryTab({ ); })} </WidgetLibraryGrid> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/modals/emailVerificationModal.tsx b/static/app/components/modals/emailVerificationModal.tsx index 32ca5515cd1a75..8d2f3ccabcd5d0 100644 --- a/static/app/components/modals/emailVerificationModal.tsx +++ b/static/app/components/modals/emailVerificationModal.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {withRouter, WithRouterProps} from 'react-router'; import {ModalRenderProps} from 'sentry/actionCreators/modal'; @@ -21,7 +21,7 @@ function EmailVerificationModal({ actionMessage = 'taking this action', }: Props) { return ( - <React.Fragment> + <Fragment> <Header closeButton>{t('Action Required')}</Header> <Body> <TextBlock> @@ -36,7 +36,7 @@ function EmailVerificationModal({ </TextBlock> <EmailAddresses /> </Body> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/components/modals/inviteMembersModal/index.tsx b/static/app/components/modals/inviteMembersModal/index.tsx index bb80fd4ac17634..fed1249117f406 100644 --- a/static/app/components/modals/inviteMembersModal/index.tsx +++ b/static/app/components/modals/inviteMembersModal/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {css} from '@emotion/react'; import styled from '@emotion/styled'; @@ -322,7 +322,7 @@ class InviteMembersModal extends AsyncComponent<Props, State> { // eslint-disable-next-line react/prop-types const hookRenderer: InviteModalRenderFunc = ({sendInvites, canSend, headerInfo}) => ( - <React.Fragment> + <Fragment> <Heading> {t('Invite New Members')} {!this.willInvite && ( @@ -386,7 +386,7 @@ class InviteMembersModal extends AsyncComponent<Props, State> { <div>{this.statusMessage}</div> {complete ? ( - <React.Fragment> + <Fragment> <Button data-test-id="send-more" size="small" onClick={this.reset}> {t('Send more invites')} </Button> @@ -404,9 +404,9 @@ class InviteMembersModal extends AsyncComponent<Props, State> { > {t('Close')} </Button> - </React.Fragment> + </Fragment> ) : ( - <React.Fragment> + <Fragment> <Button data-test-id="cancel" size="small" @@ -424,11 +424,11 @@ class InviteMembersModal extends AsyncComponent<Props, State> { > {this.inviteButtonLabel} </Button> - </React.Fragment> + </Fragment> )} </FooterContent> </Footer> - </React.Fragment> + </Fragment> ); return ( diff --git a/static/app/components/modals/sentryAppDetailsModal.tsx b/static/app/components/modals/sentryAppDetailsModal.tsx index fb7182c90bec8a..9516ba85776236 100644 --- a/static/app/components/modals/sentryAppDetailsModal.tsx +++ b/static/app/components/modals/sentryAppDetailsModal.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import Access from 'sentry/components/acl/access'; @@ -98,7 +98,7 @@ export default class SentryAppDetailsModal extends AsyncComponent<Props, State> } return ( - <React.Fragment> + <Fragment> <Title>Permissions</Title> {permissions.read.length > 0 && ( <Permission> @@ -134,7 +134,7 @@ export default class SentryAppDetailsModal extends AsyncComponent<Props, State> </Text> </Permission> )} - </React.Fragment> + </Fragment> ); } @@ -155,7 +155,7 @@ export default class SentryAppDetailsModal extends AsyncComponent<Props, State> const featureProps = {organization, features}; return ( - <React.Fragment> + <Fragment> <Heading> <SentryAppIcon sentryApp={sentryApp} size={50} /> <HeadingInfo> @@ -167,7 +167,7 @@ export default class SentryAppDetailsModal extends AsyncComponent<Props, State> <FeatureList {...featureProps} provider={{...sentryApp, key: sentryApp.slug}} /> <IntegrationFeatures {...featureProps}> {({disabled, disabledReason}) => ( - <React.Fragment> + <Fragment> {!disabled && this.renderPermissions()} <Footer> <Author>{t('Authored By %s', sentryApp.author)}</Author> @@ -195,10 +195,10 @@ export default class SentryAppDetailsModal extends AsyncComponent<Props, State> </Access> </div> </Footer> - </React.Fragment> + </Fragment> )} </IntegrationFeatures> - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/components/modals/widgetViewerModal/widgetViewerTableCell.tsx b/static/app/components/modals/widgetViewerModal/widgetViewerTableCell.tsx index 945904f9527959..c959626c0dedc8 100644 --- a/static/app/components/modals/widgetViewerModal/widgetViewerTableCell.tsx +++ b/static/app/components/modals/widgetViewerModal/widgetViewerTableCell.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import {Location, LocationDescriptorObject} from 'history'; @@ -191,7 +191,7 @@ export const renderGridBodyCell = } return ( - <React.Fragment> + <Fragment> {isTopEvents && isFirstPage && rowIndex < DEFAULT_NUM_TOP_EVENTS && @@ -199,7 +199,7 @@ export const renderGridBodyCell = <TopResultsIndicator count={DEFAULT_NUM_TOP_EVENTS} index={rowIndex} /> ) : null} {cell} - </React.Fragment> + </Fragment> ); }; diff --git a/static/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx b/static/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx index d06ccd000704ca..d5d114e3bc7e58 100644 --- a/static/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx +++ b/static/app/components/organizations/timeRangeSelector/dateRange/relativeSelector.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {DEFAULT_RELATIVE_PERIODS} from 'sentry/constants'; @@ -11,7 +11,7 @@ type Props = { }; const RelativeSelector = ({onClick, selected, relativePeriods}: Props) => ( - <React.Fragment> + <Fragment> {Object.entries(relativePeriods || DEFAULT_RELATIVE_PERIODS).map(([value, label]) => ( <SelectorItem key={value} @@ -21,7 +21,7 @@ const RelativeSelector = ({onClick, selected, relativePeriods}: Props) => ( selected={selected === value} /> ))} - </React.Fragment> + </Fragment> ); export default RelativeSelector; diff --git a/static/app/components/replays/keyMetrics.tsx b/static/app/components/replays/keyMetrics.tsx index da2e8544e5f669..b7f7aaa48cba13 100644 --- a/static/app/components/replays/keyMetrics.tsx +++ b/static/app/components/replays/keyMetrics.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import space from 'sentry/styles/space'; @@ -27,10 +27,10 @@ export const KeyMetrics = styled('dl')` export const KeyMetricData = ({keyName, value}: Props) => { return ( - <React.Fragment> + <Fragment> <Key>{keyName}</Key> <Value>{value}</Value> - </React.Fragment> + </Fragment> ); }; diff --git a/static/app/components/stream/processingIssueHint.tsx b/static/app/components/stream/processingIssueHint.tsx index 87899190f83f87..5a98df4676649a 100644 --- a/static/app/components/stream/processingIssueHint.tsx +++ b/static/app/components/stream/processingIssueHint.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import Alert from 'sentry/components/alert'; @@ -25,9 +25,9 @@ function ProcessingIssueHint({orgId, projectId, issue, showProject}: Props) { let project: React.ReactNode = null; if (showProject) { project = ( - <React.Fragment> + <Fragment> <strong>{projectId}</strong> &mdash;{' '} - </React.Fragment> + </Fragment> ); } @@ -38,13 +38,13 @@ function ProcessingIssueHint({orgId, projectId, issue, showProject}: Props) { issue.numIssues ); lastEvent = ( - <React.Fragment> + <Fragment> ( {tct('last event from [ago]', { ago: <TimeSince date={issue.lastSeen} />, })} ) - </React.Fragment> + </Fragment> ); alertType = 'error'; showButton = true; diff --git a/static/app/utils/dashboards/issueFieldRenderers.tsx b/static/app/utils/dashboards/issueFieldRenderers.tsx index 838b2b33c81d21..288c55dd295dfa 100644 --- a/static/app/utils/dashboards/issueFieldRenderers.tsx +++ b/static/app/utils/dashboards/issueFieldRenderers.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {css} from '@emotion/react'; import styled from '@emotion/styled'; import {Location} from 'history'; @@ -170,13 +170,13 @@ const issuesCountRenderer = ( title={ <div> {filteredCount ? ( - <React.Fragment> + <Fragment> <StyledLink to={filteredDiscoverLink}> {t('Matching search filters')} <WrappedCount value={filteredCount} /> </StyledLink> <Divider /> - </React.Fragment> + </Fragment> ) : null} <StyledLink to={discoverLink}> {t(`Total in ${selectionDateString}`)} @@ -192,10 +192,10 @@ const issuesCountRenderer = ( > <span> {['events', 'users'].includes(field) && filteredCount ? ( - <React.Fragment> + <Fragment> <Count value={filteredCount} /> <SecondaryCount value={primaryCount} /> - </React.Fragment> + </Fragment> ) : ( <Count value={primaryCount} /> )} diff --git a/static/app/utils/measurements/measurements.tsx b/static/app/utils/measurements/measurements.tsx index 75633fc3017f82..c79080702b19ee 100644 --- a/static/app/utils/measurements/measurements.tsx +++ b/static/app/utils/measurements/measurements.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {MobileVital, WebVital} from 'sentry/utils/discover/fields'; import { @@ -43,7 +43,7 @@ type Props = { function Measurements({children}: Props) { const measurements = {...WEB_MEASUREMENTS, ...MOBILE_MEASUREMENTS}; - return <React.Fragment>{children({measurements})}</React.Fragment>; + return <Fragment>{children({measurements})}</Fragment>; } export default Measurements; diff --git a/static/app/utils/performance/histogram/histogramQuery.tsx b/static/app/utils/performance/histogram/histogramQuery.tsx index 110f0970bd9d6d..288014db44e032 100644 --- a/static/app/utils/performance/histogram/histogramQuery.tsx +++ b/static/app/utils/performance/histogram/histogramQuery.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import omit from 'lodash/omit'; import GenericDiscoverQuery, { @@ -71,14 +71,14 @@ function HistogramQuery(props: Props) { if (fields.length === 0) { return ( - <React.Fragment> + <Fragment> {children({ isLoading: false, error: null, pageLinks: null, histograms: {}, })} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/utils/performance/quickTrace/quickTraceQuery.tsx b/static/app/utils/performance/quickTrace/quickTraceQuery.tsx index 0efdf88a6e7d77..0eb453e2529438 100644 --- a/static/app/utils/performance/quickTrace/quickTraceQuery.tsx +++ b/static/app/utils/performance/quickTrace/quickTraceQuery.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {Event} from 'sentry/types/event'; import {DiscoverQueryProps} from 'sentry/utils/discover/genericDiscoverQuery'; @@ -21,7 +21,7 @@ export default function QuickTraceQuery({children, event, ...props}: QueryProps) if (!traceId) { return ( - <React.Fragment> + <Fragment> {children({ isLoading: false, error: null, @@ -29,7 +29,7 @@ export default function QuickTraceQuery({children, event, ...props}: QueryProps) type: 'empty', currentEvent: null, })} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/utils/performance/quickTrace/traceFullQuery.tsx b/static/app/utils/performance/quickTrace/traceFullQuery.tsx index 44a89d551c0900..ba04972ce700b4 100644 --- a/static/app/utils/performance/quickTrace/traceFullQuery.tsx +++ b/static/app/utils/performance/quickTrace/traceFullQuery.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import GenericDiscoverQuery, { DiscoverQueryProps, @@ -50,14 +50,14 @@ function getTraceFullRequestPayload({ function EmptyTrace<T>({children}: Pick<QueryProps<T>, 'children'>) { return ( - <React.Fragment> + <Fragment> {children({ isLoading: false, error: null, traces: null, type: 'full', })} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/utils/performance/quickTrace/traceLiteQuery.tsx b/static/app/utils/performance/quickTrace/traceLiteQuery.tsx index ec9443a5569140..c5cc3327d8fa12 100644 --- a/static/app/utils/performance/quickTrace/traceLiteQuery.tsx +++ b/static/app/utils/performance/quickTrace/traceLiteQuery.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import GenericDiscoverQuery, { DiscoverQueryProps, @@ -39,14 +39,14 @@ function getTraceLiteRequestPayload({ function EmptyTrace({children}: Pick<QueryProps, 'children'>) { return ( - <React.Fragment> + <Fragment> {children({ isLoading: false, error: null, trace: null, type: 'partial', })} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/utils/performance/quickTrace/traceMetaQuery.tsx b/static/app/utils/performance/quickTrace/traceMetaQuery.tsx index 45c12154a32bee..1a86f10406f5b3 100644 --- a/static/app/utils/performance/quickTrace/traceMetaQuery.tsx +++ b/static/app/utils/performance/quickTrace/traceMetaQuery.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import GenericDiscoverQuery from 'sentry/utils/discover/genericDiscoverQuery'; import { @@ -30,13 +30,13 @@ function TraceMetaQuery({ }: QueryProps) { if (!traceId) { return ( - <React.Fragment> + <Fragment> {children({ isLoading: false, error: null, meta: null, })} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/alerts/incidentRules/ruleConditionsForm.tsx b/static/app/views/alerts/incidentRules/ruleConditionsForm.tsx index eebc9d4de1739a..a6b56e9de2c75d 100644 --- a/static/app/views/alerts/incidentRules/ruleConditionsForm.tsx +++ b/static/app/views/alerts/incidentRules/ruleConditionsForm.tsx @@ -1,5 +1,4 @@ -import * as React from 'react'; -import {Fragment} from 'react'; +import {Fragment, PureComponent} from 'react'; import {InjectedRouter} from 'react-router'; import {components} from 'react-select'; import {css} from '@emotion/react'; @@ -78,7 +77,7 @@ type State = { environments: Environment[] | null; }; -class RuleConditionsForm extends React.PureComponent<Props, State> { +class RuleConditionsForm extends PureComponent<Props, State> { state: State = { environments: null, }; @@ -480,7 +479,7 @@ class RuleConditionsForm extends React.PureComponent<Props, State> { dataset === 'events' ? [...measurementTags, ...transactionTags] : []; return ( - <React.Fragment> + <Fragment> <ChartPanel> <StyledPanelBody>{this.props.thresholdChart}</StyledPanelBody> </ChartPanel> @@ -575,7 +574,7 @@ class RuleConditionsForm extends React.PureComponent<Props, State> { </FormField> </FormRow> {!hasAlertWizardV3 && this.renderInterval()} - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/dashboardsV2/controls.tsx b/static/app/views/dashboardsV2/controls.tsx index d2835f5d026fa1..38892fb87bc605 100644 --- a/static/app/views/dashboardsV2/controls.tsx +++ b/static/app/views/dashboardsV2/controls.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import Feature from 'sentry/components/acl/feature'; @@ -121,7 +121,7 @@ function Controls({ <StyledButtonBar gap={1} key="controls"> <DashboardEditFeature> {hasFeature => ( - <React.Fragment> + <Fragment> <Button data-test-id="dashboard-edit" onClick={e => { @@ -160,7 +160,7 @@ function Controls({ </Button> </Tooltip> ) : null} - </React.Fragment> + </Fragment> )} </DashboardEditFeature> </StyledButtonBar> diff --git a/static/app/views/dashboardsV2/widgetBuilder/buildSteps/groupByStep/queryField.tsx b/static/app/views/dashboardsV2/widgetBuilder/buildSteps/groupByStep/queryField.tsx index 4a2a414f373d3a..da1aff6b3b99db 100644 --- a/static/app/views/dashboardsV2/widgetBuilder/buildSteps/groupByStep/queryField.tsx +++ b/static/app/views/dashboardsV2/widgetBuilder/buildSteps/groupByStep/queryField.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {DraggableSyntheticListeners, UseDraggableArguments} from '@dnd-kit/core'; import styled from '@emotion/styled'; @@ -40,7 +40,7 @@ export function QueryField({ return ( <QueryFieldWrapper ref={forwardRef} style={style}> {isDragging ? null : ( - <React.Fragment> + <Fragment> {canDrag && ( <DragAndReorderButton {...listeners} @@ -68,7 +68,7 @@ export function QueryField({ aria-label={t('Remove group')} /> )} - </React.Fragment> + </Fragment> )} </QueryFieldWrapper> ); diff --git a/static/app/views/dataExport/dataDownload.tsx b/static/app/views/dataExport/dataDownload.tsx index 1d5a818c7040d3..15950b32e9687e 100644 --- a/static/app/views/dataExport/dataDownload.tsx +++ b/static/app/views/dataExport/dataDownload.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {browserHistory, RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; @@ -93,7 +93,7 @@ class DataDownload extends AsyncView<Props, State> { renderEarly(): React.ReactNode { return ( - <React.Fragment> + <Fragment> <Header> <h3> {t('What are')} @@ -109,7 +109,7 @@ class DataDownload extends AsyncView<Props, State> { </p> <p>{t("Close this window and we'll email you when your download is ready.")}</p> </Body> - </React.Fragment> + </Fragment> ); } @@ -117,7 +117,7 @@ class DataDownload extends AsyncView<Props, State> { const {query} = this.state.download; const actionLink = this.getActionLink(query.type); return ( - <React.Fragment> + <Fragment> <Header> <h3>{t('This is awkward.')}</h3> </Header> @@ -136,7 +136,7 @@ class DataDownload extends AsyncView<Props, State> { {t('Start a New Download')} </DownloadButton> </Body> - </React.Fragment> + </Fragment> ); } @@ -171,13 +171,13 @@ class DataDownload extends AsyncView<Props, State> { const {type = ExportQueryType.IssuesByTag} = query; return type === 'Discover' ? ( - <React.Fragment> + <Fragment> <p>{t('Need to make changes?')}</p> <Button priority="primary" onClick={() => this.openInDiscover()}> {t('Open in Discover')} </Button> <br /> - </React.Fragment> + </Fragment> ) : null; } @@ -188,7 +188,7 @@ class DataDownload extends AsyncView<Props, State> { const {orgId, dataExportId} = this.props.params; return ( - <React.Fragment> + <Fragment> <Header> <h3>{t('All done.')}</h3> </Header> @@ -225,7 +225,7 @@ class DataDownload extends AsyncView<Props, State> { })} </p> </Body> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/eventsV2/table/tableActions.tsx b/static/app/views/eventsV2/table/tableActions.tsx index 443d0f9d2fe789..10fb8d021c2182 100644 --- a/static/app/views/eventsV2/table/tableActions.tsx +++ b/static/app/views/eventsV2/table/tableActions.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {Location} from 'history'; import Feature from 'sentry/components/acl/feature'; @@ -151,7 +151,7 @@ function FeatureWrapper(props: FeatureWrapperProps) { function HeaderActions(props: Props) { return ( - <React.Fragment> + <Fragment> <FeatureWrapper {...props} key="edit"> {renderEditButton} </FeatureWrapper> @@ -159,7 +159,7 @@ function HeaderActions(props: Props) { {renderDownloadButton} </FeatureWrapper> {renderSummaryButton(props)} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/onboarding/components/fullIntroduction.tsx b/static/app/views/onboarding/components/fullIntroduction.tsx index 1713bc7e245d25..567da7f4231d2c 100644 --- a/static/app/views/onboarding/components/fullIntroduction.tsx +++ b/static/app/views/onboarding/components/fullIntroduction.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {motion} from 'framer-motion'; import {openInviteMembersModal} from 'sentry/actionCreators/modal'; @@ -15,7 +15,7 @@ type Props = { export default function FullIntroduction({currentPlatform}: Props) { return ( - <React.Fragment> + <Fragment> <SetupIntroduction stepHeaderText={t( 'Prepare the %s SDK', @@ -46,6 +46,6 @@ export default function FullIntroduction({currentPlatform}: Props) { } )} </motion.p> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/onboarding/otherSetup.tsx b/static/app/views/onboarding/otherSetup.tsx index 42c451c1462711..c2d49832e7f3c0 100644 --- a/static/app/views/onboarding/otherSetup.tsx +++ b/static/app/views/onboarding/otherSetup.tsx @@ -1,6 +1,6 @@ import 'prism-sentry/index.css'; -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import {motion} from 'framer-motion'; @@ -54,7 +54,7 @@ class OtherSetup extends AsyncComponent<Props, State> { const currentPlatform = 'other'; const blurb = ( - <React.Fragment> + <Fragment> <p> {tct(`Prepare the SDK for your language following this [docsLink:guide].`, { docsLink: <ExternalLink href="https://develop.sentry.dev/sdk/overview/" />, @@ -66,7 +66,7 @@ class OtherSetup extends AsyncComponent<Props, State> { </p> <p>{tct('Here is the DSN: [DSN]', {DSN: <b> {keyList?.[0].dsn.public}</b>})}</p> - </React.Fragment> + </Fragment> ); const docs = ( @@ -90,13 +90,13 @@ class OtherSetup extends AsyncComponent<Props, State> { ); return ( - <React.Fragment> + <Fragment> <FullIntroduction currentPlatform={currentPlatform} /> {getDynamicText({ value: docs, fixed: testOnlyAlert, })} - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/onboarding/targetedOnboarding/components/fullIntroduction.tsx b/static/app/views/onboarding/targetedOnboarding/components/fullIntroduction.tsx index 5a1db146dfe89d..f12e4fd6f82d85 100644 --- a/static/app/views/onboarding/targetedOnboarding/components/fullIntroduction.tsx +++ b/static/app/views/onboarding/targetedOnboarding/components/fullIntroduction.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {motion} from 'framer-motion'; import {PlatformKey} from 'sentry/data/platformCategories'; @@ -19,7 +19,7 @@ export default function FullIntroduction({currentPlatform, organization}: Props) isMobile() && organization.experiments.TargetedOnboardingMobileRedirectExperiment === 'email-cta'; return ( - <React.Fragment> + <Fragment> <SetupIntroduction stepHeaderText={t( 'Prepare the %s SDK', @@ -40,6 +40,6 @@ export default function FullIntroduction({currentPlatform, organization}: Props) )} </motion.p> )} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/organizationGroupDetails/groupActivityItem.tsx b/static/app/views/organizationGroupDetails/groupActivityItem.tsx index e2f9a8fbd1e399..1fa61cbc54c2d9 100644 --- a/static/app/views/organizationGroupDetails/groupActivityItem.tsx +++ b/static/app/views/organizationGroupDetails/groupActivityItem.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import CommitLink from 'sentry/components/commitLink'; import Duration from 'sentry/components/duration'; @@ -266,7 +266,7 @@ function GroupActivityItem({activity, orgSlug, projectId, author}: Props) { } } - return <React.Fragment>{renderContent()}</React.Fragment>; + return <Fragment>{renderContent()}</Fragment>; } export default GroupActivityItem; diff --git a/static/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx b/static/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx index 0d539ce804d2bc..f460ed7ba79987 100644 --- a/static/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx +++ b/static/app/views/organizationIntegrations/abstractIntegrationDetailedView.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import startCase from 'lodash/startCase'; @@ -337,7 +337,7 @@ class AbstractIntegrationDetailedView< const {FeatureList} = getIntegrationFeatureGate(); return ( - <React.Fragment> + <Fragment> <Flex> <FlexContainer> <Description dangerouslySetInnerHTML={{__html: marked(this.description)}} /> @@ -369,20 +369,20 @@ class AbstractIntegrationDetailedView< ))} </Metadata> </Flex> - </React.Fragment> + </Fragment> ); } renderBody() { return ( - <React.Fragment> + <Fragment> {this.renderAlert()} {this.renderTopSection()} {this.renderTabs()} {this.state.tab === 'overview' ? this.renderInformationCard() : this.renderConfigurations()} - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/organizationIntegrations/integrationRepos.tsx b/static/app/views/organizationIntegrations/integrationRepos.tsx index 72ed47bb97e78a..8a23aa03e73503 100644 --- a/static/app/views/organizationIntegrations/integrationRepos.tsx +++ b/static/app/views/organizationIntegrations/integrationRepos.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import debounce from 'lodash/debounce'; @@ -219,7 +219,7 @@ class IntegrationRepos extends AsyncComponent<Props, State> { ); return ( - <React.Fragment> + <Fragment> <Panel> {header} <PanelBody> @@ -251,7 +251,7 @@ class IntegrationRepos extends AsyncComponent<Props, State> { {itemListPageLinks && ( <Pagination pageLinks={itemListPageLinks} {...this.props} /> )} - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/performance/landing/vitalsCards.tsx b/static/app/views/performance/landing/vitalsCards.tsx index a720d896e3db45..07e2eed870ef56 100644 --- a/static/app/views/performance/landing/vitalsCards.tsx +++ b/static/app/views/performance/landing/vitalsCards.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; import {Location} from 'history'; @@ -408,7 +408,7 @@ export function VitalBar(props: VitalBarProps) { const colorStops = getColorStopsFromPercents(percents); return ( - <React.Fragment> + <Fragment> {showBar && ( <StyledTooltip title={ @@ -443,7 +443,7 @@ export function VitalBar(props: VitalBarProps) { /> </BarDetail> )} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/performance/transactionSummary/filter.tsx b/static/app/views/performance/transactionSummary/filter.tsx index 24a190ffb69ba4..5f7148ac52a0c5 100644 --- a/static/app/views/performance/transactionSummary/filter.tsx +++ b/static/app/views/performance/transactionSummary/filter.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import {Location} from 'history'; @@ -62,7 +62,7 @@ function Filter(props: Props) { hasDarkBorderBottomColor: boolean; } = { children: ( - <React.Fragment> + <Fragment> <IconFilter /> <FilterLabel> {currentFilter === SpanOperationBreakdownFilter.None @@ -71,7 +71,7 @@ function Filter(props: Props) { operationName: currentFilter, })} </FilterLabel> - </React.Fragment> + </Fragment> ), priority: 'default', hasDarkBorderBottomColor: false, diff --git a/static/app/views/performance/transactionSummary/transactionOverview/content.tsx b/static/app/views/performance/transactionSummary/transactionOverview/content.tsx index 1a80b021fbd7a8..1fc20fa5bc6218 100644 --- a/static/app/views/performance/transactionSummary/transactionOverview/content.tsx +++ b/static/app/views/performance/transactionSummary/transactionOverview/content.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; import {Location} from 'history'; @@ -264,7 +264,7 @@ function SummaryContent({ }; return ( - <React.Fragment> + <Fragment> <Layout.Main> <FilterActions> <Filter @@ -386,7 +386,7 @@ function SummaryContent({ location={location} /> </Layout.Side> - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/projectDetail/projectScoreCards/projectApdexScoreCard.tsx b/static/app/views/projectDetail/projectScoreCards/projectApdexScoreCard.tsx index b9d13dbc58d8d2..c27588779a6276 100644 --- a/static/app/views/projectDetail/projectScoreCards/projectApdexScoreCard.tsx +++ b/static/app/views/projectDetail/projectScoreCards/projectApdexScoreCard.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import round from 'lodash/round'; import AsyncComponent from 'sentry/components/asyncComponent'; @@ -179,14 +179,14 @@ class ProjectApdexScoreCard extends AsyncComponent<Props, State> { renderTrend() { // we want to show trend only after currentApdex has loaded to prevent jumping return defined(this.currentApdex) && defined(this.trend) ? ( - <React.Fragment> + <Fragment> {this.trend >= 0 ? ( <IconArrow direction="up" size="xs" /> ) : ( <IconArrow direction="down" size="xs" /> )} <Count value={Math.abs(this.trend)} /> - </React.Fragment> + </Fragment> ) : null; } diff --git a/static/app/views/projectDetail/projectScoreCards/projectVelocityScoreCard.tsx b/static/app/views/projectDetail/projectScoreCards/projectVelocityScoreCard.tsx index 87d2090167a5b0..2178193ebf9b21 100644 --- a/static/app/views/projectDetail/projectScoreCards/projectVelocityScoreCard.tsx +++ b/static/app/views/projectDetail/projectScoreCards/projectVelocityScoreCard.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {fetchAnyReleaseExistence} from 'sentry/actionCreators/projects'; import AsyncComponent from 'sentry/components/asyncComponent'; @@ -209,14 +209,14 @@ class ProjectVelocityScoreCard extends AsyncComponent<Props, State> { } return ( - <React.Fragment> + <Fragment> {this.trend >= 0 ? ( <IconArrow direction="up" size="xs" /> ) : ( <IconArrow direction="down" size="xs" /> )} {Math.abs(this.trend)} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/projectInstall/issueAlertOptions.tsx b/static/app/views/projectInstall/issueAlertOptions.tsx index c9b65133b90b94..0ae04de155ee4b 100644 --- a/static/app/views/projectInstall/issueAlertOptions.tsx +++ b/static/app/views/projectInstall/issueAlertOptions.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import * as Sentry from '@sentry/react'; import isEqual from 'lodash/isEqual'; @@ -287,7 +287,7 @@ class IssueAlertOptions extends AsyncComponent<Props, State> { this.state.conditions?.length > 0 ); return ( - <React.Fragment> + <Fragment> <PageHeadingWithTopMargins withMargins> {t('Set your default alert settings')} </PageHeadingWithTopMargins> @@ -297,7 +297,7 @@ class IssueAlertOptions extends AsyncComponent<Props, State> { onChange={alertSetting => this.setStateAndUpdateParents({alertSetting})} value={this.state.alertSetting} /> - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/projectsDashboard/chart.tsx b/static/app/views/projectsDashboard/chart.tsx index d7e4ec68c8f2e2..494e5e990987af 100644 --- a/static/app/views/projectsDashboard/chart.tsx +++ b/static/app/views/projectsDashboard/chart.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {useTheme} from '@emotion/react'; import BaseChart from 'sentry/components/charts/baseChart'; @@ -161,10 +161,10 @@ const Chart = ({firstEvent, stats, transactionStats}: Props) => { }; return ( - <React.Fragment> + <Fragment> <BaseChart {...chartOptions} /> {!firstEvent && <NoEvents seriesCount={series.length} />} - </React.Fragment> + </Fragment> ); }; diff --git a/static/app/views/releases/detail/header/releaseActions.tsx b/static/app/views/releases/detail/header/releaseActions.tsx index 124d7493db255e..7044afd8b38eb8 100644 --- a/static/app/views/releases/detail/header/releaseActions.tsx +++ b/static/app/views/releases/detail/header/releaseActions.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {browserHistory} from 'react-router'; import styled from '@emotion/styled'; import {Location} from 'history'; @@ -73,7 +73,7 @@ function ReleaseActions({ releaseMeta.projects.length - visibleProjects.length; return ( - <React.Fragment> + <Fragment> {visibleProjects.map(project => ( <ProjectBadge key={project.slug} project={project} avatarSize={18} /> ))} @@ -89,7 +89,7 @@ function ReleaseActions({ </Tooltip> </span> )} - </React.Fragment> + </Fragment> ); } @@ -103,13 +103,13 @@ function ReleaseActions({ function getModalMessage(message: React.ReactNode) { return ( - <React.Fragment> + <Fragment> {message} <ProjectsWrapper>{getProjectList()}</ProjectsWrapper> {t('Are you sure you want to do this?')} - </React.Fragment> + </Fragment> ); } diff --git a/static/app/views/settings/account/accountEmails.tsx b/static/app/views/settings/account/accountEmails.tsx index 56875304d6539a..efc523827a47d9 100644 --- a/static/app/views/settings/account/accountEmails.tsx +++ b/static/app/views/settings/account/accountEmails.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import {addErrorMessage} from 'sentry/actionCreators/indicator'; @@ -47,7 +47,7 @@ class AccountEmails extends AsyncView<Props, State> { renderBody() { return ( - <React.Fragment> + <Fragment> <SettingsPageHeader title={t('Email Addresses')} /> <EmailAddresses /> <Form @@ -63,7 +63,7 @@ class AccountEmails extends AsyncView<Props, State> { <AlertLink to="/settings/account/notifications" icon={<IconStack />}> {t('Want to change how many emails you get? Use the notifications panel.')} </AlertLink> - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/settings/account/accountSecurity/components/removeConfirm.tsx b/static/app/views/settings/account/accountSecurity/components/removeConfirm.tsx index ce57907aecffd9..1bdb1be5e9cf3b 100644 --- a/static/app/views/settings/account/accountSecurity/components/removeConfirm.tsx +++ b/static/app/views/settings/account/accountSecurity/components/removeConfirm.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import Confirm from 'sentry/components/confirm'; import {t} from 'sentry/locale'; @@ -8,14 +8,14 @@ import TextBlock from 'sentry/views/settings/components/text/textBlock'; type Props = React.ComponentProps<typeof Confirm>; const message = ( - <React.Fragment> + <Fragment> <ConfirmHeader>{t('Do you want to remove this method?')}</ConfirmHeader> <TextBlock> {t( 'Removing the last authentication method will disable two-factor authentication completely.' )} </TextBlock> - </React.Fragment> + </Fragment> ); const RemoveConfirm = (props: Props) => <Confirm {...props} message={message} />; diff --git a/static/app/views/settings/account/accountSubscriptions.tsx b/static/app/views/settings/account/accountSubscriptions.tsx index 28775f24a1c76b..7d7cd076142a31 100644 --- a/static/app/views/settings/account/accountSubscriptions.tsx +++ b/static/app/views/settings/account/accountSubscriptions.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import groupBy from 'lodash/groupBy'; import moment from 'moment'; @@ -102,7 +102,7 @@ class AccountSubscriptions extends AsyncView<AsyncView['props'], State> { <PanelHeader>{t('Subscription')}</PanelHeader> <PanelBody> {subGroups.map(([email, subscriptions]) => ( - <React.Fragment key={email}> + <Fragment key={email}> {subGroups.length > 1 && ( <Heading> <IconToggle /> {t('Subscriptions for %s', email)} @@ -145,7 +145,7 @@ class AccountSubscriptions extends AsyncView<AsyncView['props'], State> { </div> </PanelItem> ))} - </React.Fragment> + </Fragment> ))} </PanelBody> </div> diff --git a/static/app/views/settings/components/dataScrubbing/modals/modal.tsx b/static/app/views/settings/components/dataScrubbing/modals/modal.tsx index f6791cb197021c..f4d063beb6d99f 100644 --- a/static/app/views/settings/components/dataScrubbing/modals/modal.tsx +++ b/static/app/views/settings/components/dataScrubbing/modals/modal.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {ModalRenderProps} from 'sentry/actionCreators/modal'; import Button from 'sentry/components/button'; @@ -22,7 +22,7 @@ const Modal = ({ Footer, closeModal, }: Props) => ( - <React.Fragment> + <Fragment> <Header closeButton>{title}</Header> <Body>{content}</Body> <Footer> @@ -33,7 +33,7 @@ const Modal = ({ </Button> </ButtonBar> </Footer> - </React.Fragment> + </Fragment> ); export default Modal; diff --git a/static/app/views/settings/components/settingsNavItem.tsx b/static/app/views/settings/components/settingsNavItem.tsx index 98cafcc95936c5..9761b75959720d 100644 --- a/static/app/views/settings/components/settingsNavItem.tsx +++ b/static/app/views/settings/components/settingsNavItem.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {Link as RouterLink} from 'react-router'; import styled from '@emotion/styled'; @@ -21,7 +21,7 @@ type Props = { const SettingsNavItem = ({badge, label, index, id, ...props}: Props) => { const LabelHook = HookOrDefault({ hookName: 'sidebar:item-label', - defaultComponent: ({children}) => <React.Fragment>{children}</React.Fragment>, + defaultComponent: ({children}) => <Fragment>{children}</Fragment>, }); let renderedBadge: React.ReactNode; diff --git a/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx b/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx index 81ddafa4d3a717..b490bc04793aed 100644 --- a/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx +++ b/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDashboard/requestLog.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import memoize from 'lodash/memoize'; import moment from 'moment-timezone'; @@ -197,7 +197,7 @@ export default class RequestLog extends AsyncComponent<Props, State> { ); return ( - <React.Fragment> + <Fragment> <h5>{t('Request Log')}</h5> <div> @@ -292,7 +292,7 @@ export default class RequestLog extends AsyncComponent<Props, State> { aria-label={t('Next page')} /> </PaginationButtons> - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx b/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx index f97a456f499ae1..6898481e126225 100644 --- a/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx +++ b/static/app/views/settings/organizationDeveloperSettings/sentryApplicationDetails.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {browserHistory, RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import omit from 'lodash/omit'; @@ -421,7 +421,7 @@ export default class SentryApplicationDetails extends AsyncView<Props, State> { const webhookDisabled = this.isInternal && !this.form.getValue('webhookUrl'); return ( - <React.Fragment> + <Fragment> <JsonForm additionalFieldProps={{webhookDisabled}} forms={forms} /> {this.getAvatarChooser(true)} {this.getAvatarChooser(false)} @@ -431,7 +431,7 @@ export default class SentryApplicationDetails extends AsyncView<Props, State> { scopes={scopes} events={events} /> - </React.Fragment> + </Fragment> ); }} </Observer> diff --git a/static/app/views/settings/organizationMembers/inviteRequestRow.tsx b/static/app/views/settings/organizationMembers/inviteRequestRow.tsx index 9b95c08f033132..c48dee14206ff0 100644 --- a/static/app/views/settings/organizationMembers/inviteRequestRow.tsx +++ b/static/app/views/settings/organizationMembers/inviteRequestRow.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import styled from '@emotion/styled'; import Button from 'sentry/components/button'; @@ -124,12 +124,12 @@ const InviteRequestRow = ({ disableConfirmButton={!canSend} disabled={!canApprove || roleDisallowed} message={ - <React.Fragment> + <Fragment> {tct('Are you sure you want to invite [email] to your organization?', { email: inviteRequest.email, })} {headerInfo} - </React.Fragment> + </Fragment> } > <Button diff --git a/static/app/views/settings/organizationMembers/organizationMembersList.tsx b/static/app/views/settings/organizationMembers/organizationMembersList.tsx index a273476f95f20c..8b85b02f5c0bbf 100644 --- a/static/app/views/settings/organizationMembers/organizationMembersList.tsx +++ b/static/app/views/settings/organizationMembers/organizationMembersList.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {RouteComponentProps} from 'react-router'; import {ClassNames} from '@emotion/react'; import styled from '@emotion/styled'; @@ -282,7 +282,7 @@ class OrganizationMembersList extends AsyncView<Props, State> { ); return ( - <React.Fragment> + <Fragment> <ClassNames> {({css}) => this.renderSearchInput({ @@ -348,7 +348,7 @@ class OrganizationMembersList extends AsyncView<Props, State> { </Panel> <Pagination pageLinks={membersPageLinks} /> - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/settings/organizationProjects/index.tsx b/static/app/views/settings/organizationProjects/index.tsx index 175acb1bdc67d1..8c3560171925f0 100644 --- a/static/app/views/settings/organizationProjects/index.tsx +++ b/static/app/views/settings/organizationProjects/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {RouteComponentProps} from 'react-router'; import styled from '@emotion/styled'; import {Location} from 'history'; @@ -101,7 +101,7 @@ class OrganizationProjects extends AsyncView<Props, State> { ); return ( - <React.Fragment> + <Fragment> <SettingsPageHeader title="Projects" action={action} /> <SearchWrapper> {this.renderSearchInput({ @@ -143,7 +143,7 @@ class OrganizationProjects extends AsyncView<Props, State> { {projectListPageLinks && ( <Pagination pageLinks={projectListPageLinks} {...this.props} /> )} - </React.Fragment> + </Fragment> ); } } diff --git a/static/app/views/settings/organizationRelay/modals/modal.tsx b/static/app/views/settings/organizationRelay/modals/modal.tsx index 3752d7ce99cb5b..f8374695fe7392 100644 --- a/static/app/views/settings/organizationRelay/modals/modal.tsx +++ b/static/app/views/settings/organizationRelay/modals/modal.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {ModalRenderProps} from 'sentry/actionCreators/modal'; import Button from 'sentry/components/button'; @@ -24,7 +24,7 @@ const Modal = ({ closeModal, btnSaveLabel = t('Save'), }: Props) => ( - <React.Fragment> + <Fragment> <Header closeButton>{title}</Header> <Body>{content}</Body> <Footer> @@ -44,7 +44,7 @@ const Modal = ({ </Button> </ButtonBar> </Footer> - </React.Fragment> + </Fragment> ); export default Modal; diff --git a/static/app/views/settings/project/filtersAndSampling/filtersAndSampling.tsx b/static/app/views/settings/project/filtersAndSampling/filtersAndSampling.tsx index 6b49d07908fe07..3c29af818ef2c9 100644 --- a/static/app/views/settings/project/filtersAndSampling/filtersAndSampling.tsx +++ b/static/app/views/settings/project/filtersAndSampling/filtersAndSampling.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import partition from 'lodash/partition'; import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator'; @@ -210,7 +210,7 @@ class FiltersAndSampling extends AsyncView<Props, State> { } return ( - <React.Fragment> + <Fragment> <SettingsPageHeader title={this.getTitle()} /> <PermissionAlert /> <TextBlock> @@ -243,7 +243,7 @@ class FiltersAndSampling extends AsyncView<Props, State> { onDeleteRule={this.handleDeleteRule} onUpdateRules={this.handleUpdateRules} /> - </React.Fragment> + </Fragment> ); } } diff --git a/tests/js/spec/components/hovercard.spec.tsx b/tests/js/spec/components/hovercard.spec.tsx index f5909742505079..56bd070b7cddd0 100644 --- a/tests/js/spec/components/hovercard.spec.tsx +++ b/tests/js/spec/components/hovercard.spec.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import {Fragment} from 'react'; import {act, render, screen, userEvent} from 'sentry-test/reactTestingLibrary'; @@ -15,7 +15,7 @@ describe('Hovercard', () => { it('reuses portal', () => { render( - <React.Fragment> + <Fragment> <Hovercard position="top" body="Hovercard Body" @@ -32,7 +32,7 @@ describe('Hovercard', () => { > Hovercard Trigger </Hovercard> - </React.Fragment> + </Fragment> ); // eslint-disable-next-line
81388224ed173f2605ef069616c9e540801a7bef
2022-07-26 20:57:20
Priscila Oliveira
ref(sampling): Attempt to fix e2e flaky test (#36790)
false
Attempt to fix e2e flaky test (#36790)
ref
diff --git a/static/app/actionCreators/serverSideSampling.tsx b/static/app/actionCreators/serverSideSampling.tsx index 7b0e73c5bca385..13ea912db3a3be 100644 --- a/static/app/actionCreators/serverSideSampling.tsx +++ b/static/app/actionCreators/serverSideSampling.tsx @@ -28,10 +28,17 @@ export function fetchSamplingSdkVersions({ } ); - promise.then(ServerSideSamplingStore.loadSamplingSdkVersionsSuccess).catch(response => { - const errorMessage = t('Unable to fetch sampling sdk versions'); - handleXhrErrorResponse(errorMessage)(response); - }); + ServerSideSamplingStore.setFetching(true); + + promise + .then(ServerSideSamplingStore.loadSamplingSdkVersionsSuccess) + .catch(response => { + const errorMessage = t('Unable to fetch sampling sdk versions'); + handleXhrErrorResponse(errorMessage)(response); + }) + .finally(() => { + ServerSideSamplingStore.setFetching(false); + }); return promise; } @@ -47,6 +54,8 @@ export function fetchSamplingDistribution({ }): Promise<SamplingDistribution> { ServerSideSamplingStore.reset(); + ServerSideSamplingStore.setFetching(true); + const promise = api.requestPromise( `/projects/${orgSlug}/${projSlug}/dynamic-sampling/distribution/`, { @@ -61,6 +70,9 @@ export function fetchSamplingDistribution({ .catch(response => { const errorMessage = t('Unable to fetch sampling distribution'); handleXhrErrorResponse(errorMessage)(response); + }) + .finally(() => { + ServerSideSamplingStore.setFetching(false); }); return promise; diff --git a/static/app/stores/serverSideSamplingStore.tsx b/static/app/stores/serverSideSamplingStore.tsx index 50fac59107b8b7..d14e64c0a3c45a 100644 --- a/static/app/stores/serverSideSamplingStore.tsx +++ b/static/app/stores/serverSideSamplingStore.tsx @@ -6,6 +6,7 @@ import {makeSafeRefluxStore} from 'sentry/utils/makeSafeRefluxStore'; import {CommonStoreDefinition} from './types'; type State = { + fetching: boolean; samplingDistribution: SamplingDistribution; samplingSdkVersions: SamplingSdkVersion[]; }; @@ -14,12 +15,14 @@ interface ServerSideSamplingStoreDefinition extends CommonStoreDefinition<State> loadSamplingDistributionSuccess(data: SamplingDistribution): void; loadSamplingSdkVersionsSuccess(data: SamplingSdkVersion[]): void; reset(): void; + setFetching(fetching: boolean): void; } const storeConfig: ServerSideSamplingStoreDefinition = { state: { samplingDistribution: {}, samplingSdkVersions: [], + fetching: false, }, reset() { @@ -34,6 +37,11 @@ const storeConfig: ServerSideSamplingStoreDefinition = { return this.state; }, + setFetching(fetching: boolean) { + this.state.fetching = fetching; + this.trigger(this.state); + }, + loadSamplingSdkVersionsSuccess(data: SamplingSdkVersion[]) { this.state = { ...this.state, diff --git a/static/app/views/settings/project/server-side-sampling/modals/uniformRateModal.tsx b/static/app/views/settings/project/server-side-sampling/modals/uniformRateModal.tsx index d17706a40fcf72..c89663818e8d1b 100644 --- a/static/app/views/settings/project/server-side-sampling/modals/uniformRateModal.tsx +++ b/static/app/views/settings/project/server-side-sampling/modals/uniformRateModal.tsx @@ -86,11 +86,12 @@ function UniformRateModal({ statsPeriod: '30d', }); - const {recommendedSdkUpgrades} = useRecommendedSdkUpgrades({ - orgSlug: organization.slug, - }); + const {recommendedSdkUpgrades, fetching: fetchingRecommendedSdkUpgrades} = + useRecommendedSdkUpgrades({ + orgSlug: organization.slug, + }); - const loading = loading30d || !projectStats; + const loading = loading30d || !projectStats || fetchingRecommendedSdkUpgrades; const [activeStep, setActiveStep] = useState<Step>(Step.SET_UNIFORM_SAMPLE_RATE); diff --git a/static/app/views/settings/project/server-side-sampling/serverSideSampling.tsx b/static/app/views/settings/project/server-side-sampling/serverSideSampling.tsx index 18570268dac6d1..d6178380cb82d2 100644 --- a/static/app/views/settings/project/server-side-sampling/serverSideSampling.tsx +++ b/static/app/views/settings/project/server-side-sampling/serverSideSampling.tsx @@ -113,9 +113,10 @@ export function ServerSideSampling({project}: Props) { statsPeriod: '48h', }); - const {recommendedSdkUpgrades} = useRecommendedSdkUpgrades({ - orgSlug: organization.slug, - }); + const {recommendedSdkUpgrades, fetching: fetchingRecommendedSdkUpgrades} = + useRecommendedSdkUpgrades({ + orgSlug: organization.slug, + }); async function handleActivateToggle(rule: SamplingRule) { const newRules = rules.map(r => { @@ -410,7 +411,7 @@ export function ServerSideSampling({project}: Props) { 'These settings can only be edited by users with the organization owner, manager, or admin role.' )} /> - {!!rules.length && ( + {!!rules.length && !fetchingRecommendedSdkUpgrades && ( <SamplingSDKAlert organization={organization} projectId={project.id} diff --git a/static/app/views/settings/project/server-side-sampling/utils/useRecommendedSdkUpgrades.tsx b/static/app/views/settings/project/server-side-sampling/utils/useRecommendedSdkUpgrades.tsx index 1640bec4b6e245..33a090dee3bb49 100644 --- a/static/app/views/settings/project/server-side-sampling/utils/useRecommendedSdkUpgrades.tsx +++ b/static/app/views/settings/project/server-side-sampling/utils/useRecommendedSdkUpgrades.tsx @@ -9,7 +9,7 @@ type Props = { }; export function useRecommendedSdkUpgrades({orgSlug}: Props) { - const {samplingSdkVersions} = useLegacyStore(ServerSideSamplingStore); + const {samplingSdkVersions, fetching} = useLegacyStore(ServerSideSamplingStore); const notSendingSampleRateSdkUpgrades = samplingSdkVersions.filter( samplingSdkVersion => !samplingSdkVersion.isSendingSampleRate @@ -39,5 +39,5 @@ export function useRecommendedSdkUpgrades({orgSlug}: Props) { }) .filter(defined); - return {recommendedSdkUpgrades}; + return {recommendedSdkUpgrades, fetching}; } diff --git a/tests/js/spec/views/settings/project/server-side-sampling/utils.tsx b/tests/js/spec/views/settings/project/server-side-sampling/utils.tsx index aa020ae20e4e06..e8b858af6a1003 100644 --- a/tests/js/spec/views/settings/project/server-side-sampling/utils.tsx +++ b/tests/js/spec/views/settings/project/server-side-sampling/utils.tsx @@ -153,6 +153,7 @@ useRecommendedSdkUpgrades.mockImplementation(() => ({ latestSDKVersion: mockedSamplingSdkVersions[1].latestSDKVersion, }, ], + fetching: false, })); export function getMockData({
54e1b0ed820ef8b4bdea0c61d42330557e758590
2022-08-18 05:15:31
Evan Purkhiser
ref(js): Remove CommitterActions (#37964)
false
Remove CommitterActions (#37964)
ref
diff --git a/static/app/actionCreators/committers.tsx b/static/app/actionCreators/committers.tsx index 2728355e102053..d7692ec52bf1e8 100644 --- a/static/app/actionCreators/committers.tsx +++ b/static/app/actionCreators/committers.tsx @@ -1,4 +1,3 @@ -import CommitterActions from 'sentry/actions/committerActions'; import {Client} from 'sentry/api'; import CommitterStore, {getCommitterStoreKey} from 'sentry/stores/committerStore'; import {Committer} from 'sentry/types'; @@ -22,18 +21,18 @@ export function getCommitters(api: Client, params: ParamsGet) { ...CommitterStore.state[storeKey], committersLoading: true, }; - CommitterActions.load(orgSlug, projectSlug, eventId); + CommitterStore.load(orgSlug, projectSlug, eventId); return api .requestPromise(path, { method: 'GET', }) .then((res: {committers: Committer[]}) => { - CommitterActions.loadSuccess(orgSlug, projectSlug, eventId, res.committers); + CommitterStore.loadSuccess(orgSlug, projectSlug, eventId, res.committers); }) .catch(err => { // NOTE: Do not captureException here as EventFileCommittersEndpoint returns // 404 Not Found if the project did not setup Releases or Commits - CommitterActions.loadError(orgSlug, projectSlug, eventId, err); + CommitterStore.loadError(orgSlug, projectSlug, eventId, err); }); } diff --git a/static/app/actions/committerActions.tsx b/static/app/actions/committerActions.tsx deleted file mode 100644 index 85ca467829de99..00000000000000 --- a/static/app/actions/committerActions.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import {createActions} from 'reflux'; - -const ComitterActions = createActions(['reset', 'load', 'loadError', 'loadSuccess']); - -export default ComitterActions; diff --git a/static/app/stores/committerStore.tsx b/static/app/stores/committerStore.tsx index 90d7c5b0cb0020..d17b5ea60c2ed3 100644 --- a/static/app/stores/committerStore.tsx +++ b/static/app/stores/committerStore.tsx @@ -1,6 +1,5 @@ import {createStore} from 'reflux'; -import CommitterActions from 'sentry/actions/committerActions'; import {Committer} from 'sentry/types'; import {makeSafeRefluxStore} from 'sentry/utils/makeSafeRefluxStore'; @@ -40,7 +39,6 @@ interface CommitterStoreDefinition extends Reflux.StoreDefinition { } export const storeConfig: CommitterStoreDefinition = { - listenables: CommitterActions, state: {}, init() { diff --git a/tests/js/spec/actionCreators/committers.spec.jsx b/tests/js/spec/actionCreators/committers.spec.jsx index 67c6735ced4608..799123f1bf7df3 100644 --- a/tests/js/spec/actionCreators/committers.spec.jsx +++ b/tests/js/spec/actionCreators/committers.spec.jsx @@ -1,5 +1,4 @@ import {getCommitters} from 'sentry/actionCreators/committers'; -import CommitterActions from 'sentry/actions/committerActions'; import CommitterStore, {getCommitterStoreKey} from 'sentry/stores/committerStore'; describe('CommitterActionCreator', function () { @@ -31,8 +30,8 @@ describe('CommitterActionCreator', function () { CommitterStore.init(); jest.restoreAllMocks(); - jest.spyOn(CommitterActions, 'load'); - jest.spyOn(CommitterActions, 'loadSuccess'); + jest.spyOn(CommitterStore, 'load'); + jest.spyOn(CommitterStore, 'loadSuccess'); /** * XXX(leedongwei): We would want to ensure that Store methods are not @@ -55,18 +54,18 @@ describe('CommitterActionCreator', function () { projectSlug: project.slug, eventId: event.id, }); // Fire Action.load - expect(CommitterActions.load).toHaveBeenCalledWith( + expect(CommitterStore.load).toHaveBeenCalledWith( organization.slug, project.slug, event.id ); - expect(CommitterActions.loadSuccess).not.toHaveBeenCalled(); + expect(CommitterStore.loadSuccess).not.toHaveBeenCalled(); await tick(); // Run Store.load and fire Action.loadSuccess await tick(); // Run Store.loadSuccess expect(mockResponse).toHaveBeenCalledWith(endpoint, expect.anything()); - expect(CommitterActions.loadSuccess).toHaveBeenCalledWith( + expect(CommitterStore.loadSuccess).toHaveBeenCalledWith( organization.slug, project.slug, event.id, @@ -91,7 +90,7 @@ describe('CommitterActionCreator', function () { eventId: event.id, }); // Fire Action.load - expect(CommitterActions.load).toHaveBeenCalled(); + expect(CommitterStore.load).toHaveBeenCalled(); // expect(CommitterStore.load).not.toHaveBeenCalled(); expect(CommitterStore.state[storeKey].committersLoading).toEqual(true); // Short-circuit });
6e60859e6f9123387f86f9dfe358ed6f3c10c66b
2024-12-10 00:27:36
Harshitha Durai
fix(dashboards): fix teams API request condition for Edit Access feature (#81867)
false
fix teams API request condition for Edit Access feature (#81867)
fix
diff --git a/static/app/views/dashboards/editAccessSelector.tsx b/static/app/views/dashboards/editAccessSelector.tsx index a0af8e8a8c799a..2ac341d5a877df 100644 --- a/static/app/views/dashboards/editAccessSelector.tsx +++ b/static/app/views/dashboards/editAccessSelector.tsx @@ -65,7 +65,9 @@ function EditAccessSelector({ const [isMenuOpen, setMenuOpen] = useState<boolean>(false); const {teams: selectedTeam} = useTeamsById({ ids: - selectedOptions[1] && selectedOptions[1] !== 'allUsers' ? [selectedOptions[1]] : [], + selectedOptions[1] && selectedOptions[1] !== '_allUsers' + ? [selectedOptions[1]] + : [], }); // Gets selected options for the dropdown from dashboard object
7823ff0887f040c3a921240c7c0c3b7c65bc8fee
2020-10-31 02:04:20
aishchenko
fix(accounts): Prevent Referer leak on password reset page (#14913)
false
Prevent Referer leak on password reset page (#14913)
fix
diff --git a/src/sentry/web/decorators.py b/src/sentry/web/decorators.py index 04a79c17f64171..b1be87de8f58a1 100644 --- a/src/sentry/web/decorators.py +++ b/src/sentry/web/decorators.py @@ -40,6 +40,19 @@ def wrapped(request, *args, **kwargs): return wrapped +def set_referrer_policy(policy): + def real_decorator(func): + @wraps(func) + def wrapped(request, *args, **kwargs): + response = func(request, *args, **kwargs) + response["Referrer-Policy"] = policy + return response + + return wrapped + + return real_decorator + + def transaction_start(endpoint): def decorator(func): @wraps(func) diff --git a/src/sentry/web/frontend/accounts.py b/src/sentry/web/frontend/accounts.py index 6f54f46a5fc12a..759b9468de42c0 100644 --- a/src/sentry/web/frontend/accounts.py +++ b/src/sentry/web/frontend/accounts.py @@ -17,7 +17,7 @@ from sentry.models import UserEmail, LostPasswordHash, Project, UserOption, Authenticator from sentry.security import capture_security_activity from sentry.signals import email_verified -from sentry.web.decorators import login_required, signed_auth_required +from sentry.web.decorators import login_required, signed_auth_required, set_referrer_policy from sentry.web.forms.accounts import RecoverPasswordForm, ChangePasswordRecoverForm from sentry.web.helpers import render_to_response from sentry.utils import auth @@ -25,6 +25,10 @@ logger = logging.getLogger("sentry.accounts") +def get_template(mode, name): + return u"sentry/account/{}/{}.html".format(mode, name) + + @login_required def login_redirect(request): login_url = auth.get_login_redirect(request) @@ -36,7 +40,7 @@ def expired(request, user): password_hash.send_email(request) context = {"email": password_hash.user.email} - return render_to_response("sentry/account/recover/expired.html", context, request) + return render_to_response(get_template("recover", "expired"), context, request) def recover(request): @@ -76,20 +80,19 @@ def recover(request): logger.info("recover.sent", extra=extra) - tpl = "sentry/account/recover/sent.html" context = {"email": email} - return render_to_response(tpl, context, request) + return render_to_response(get_template("recover", "sent"), context, request) if form._errors: logger.warning("recover.error", extra=extra) - tpl = "sentry/account/recover/index.html" context = {"form": form} - return render_to_response(tpl, context, request) + return render_to_response(get_template("recover", "index"), context, request) +@set_referrer_policy("strict-origin-when-cross-origin") def recover_confirm(request, user_id, hash, mode="recover"): try: password_hash = LostPasswordHash.objects.get(user=user_id, hash=hash) @@ -99,7 +102,7 @@ def recover_confirm(request, user_id, hash, mode="recover"): user = password_hash.user except LostPasswordHash.DoesNotExist: - return render_to_response(u"sentry/account/{}/{}.html".format(mode, "failure"), {}, request) + return render_to_response(get_template(mode, "failure"), {}, request) if request.method == "POST": form = ChangePasswordRecoverForm(request.POST) @@ -131,9 +134,7 @@ def recover_confirm(request, user_id, hash, mode="recover"): else: form = ChangePasswordRecoverForm() - return render_to_response( - u"sentry/account/{}/{}.html".format(mode, "confirm"), {"form": form}, request - ) + return render_to_response(get_template(mode, "confirm"), {"form": form}, request) # Set password variation of password recovery @@ -189,6 +190,7 @@ def start_confirm_email(request): return HttpResponseRedirect(reverse("sentry-account-settings-emails")) +@set_referrer_policy("strict-origin-when-cross-origin") def confirm_email(request, user_id, hash): msg = _("Thanks for confirming your email") level = messages.SUCCESS diff --git a/tests/sentry/web/frontend/test_accounts.py b/tests/sentry/web/frontend/test_accounts.py index 73b053e01394a1..2d7e4e07ad4ed7 100644 --- a/tests/sentry/web/frontend/test_accounts.py +++ b/tests/sentry/web/frontend/test_accounts.py @@ -12,6 +12,9 @@ class TestAccounts(TestCase): def path(self): return reverse("sentry-account-recover") + def password_recover_path(self, user_id, hash_): + return reverse("sentry-account-recover-confirm", kwargs={"user_id": user_id, "hash": hash_}) + def test_get_renders_form(self): resp = self.client.get(self.path) assert resp.status_code == 200 @@ -55,3 +58,21 @@ def test_post_multiple_users(self): assert resp.status_code == 200 self.assertTemplateUsed("sentry/account/recover/index.html") assert 0 == len(LostPasswordHash.objects.all()) + + def test_leaking_recovery_hash(self): + user = self.create_user() + + resp = self.client.post(self.path, {"user": user.email}) + assert resp.status_code == 200 + + lost_password = LostPasswordHash.objects.get(user=user) + + resp = self.client.post( + self.password_recover_path(lost_password.user_id, lost_password.hash), + {"password": "test_password"}, + ) + + header_name = "Referrer-Policy" + + assert resp.has_header(header_name) + assert resp[header_name] == "strict-origin-when-cross-origin"
e7884fa9c5c79e02e52ab2b62770eece3c77b37f
2024-09-30 23:32:55
Evan Purkhiser
feat(uptime): Add environmnet column (#78332)
false
Add environmnet column (#78332)
feat
diff --git a/fixtures/backup/model_dependencies/detailed.json b/fixtures/backup/model_dependencies/detailed.json index 89a693a0004245..ef6c4f4b6af0e9 100644 --- a/fixtures/backup/model_dependencies/detailed.json +++ b/fixtures/backup/model_dependencies/detailed.json @@ -6171,6 +6171,11 @@ "uptime.projectuptimesubscription": { "dangling": false, "foreign_keys": { + "environment": { + "kind": "FlexibleForeignKey", + "model": "sentry.environment", + "nullable": true + }, "owner_team": { "kind": "FlexibleForeignKey", "model": "sentry.team", diff --git a/fixtures/backup/model_dependencies/flat.json b/fixtures/backup/model_dependencies/flat.json index d54304bb0797ca..79f148f8dfe22c 100644 --- a/fixtures/backup/model_dependencies/flat.json +++ b/fixtures/backup/model_dependencies/flat.json @@ -850,6 +850,7 @@ "sentry.user" ], "uptime.projectuptimesubscription": [ + "sentry.environment", "sentry.project", "sentry.team", "sentry.user", diff --git a/migrations_lockfile.txt b/migrations_lockfile.txt index eae9894cf5a441..77523d6ec01735 100644 --- a/migrations_lockfile.txt +++ b/migrations_lockfile.txt @@ -12,5 +12,5 @@ remote_subscriptions: 0003_drop_remote_subscription replays: 0004_index_together sentry: 0769_add_seer_fields_to_grouphash_metadata social_auth: 0002_default_auto_field -uptime: 0013_uptime_subscription_new_unique +uptime: 0014_add_uptime_enviromnet workflow_engine: 0007_loosen_workflow_action_relationship diff --git a/src/sentry/uptime/migrations/0014_add_uptime_enviromnet.py b/src/sentry/uptime/migrations/0014_add_uptime_enviromnet.py new file mode 100644 index 00000000000000..a4d8ba9f26f786 --- /dev/null +++ b/src/sentry/uptime/migrations/0014_add_uptime_enviromnet.py @@ -0,0 +1,41 @@ +# Generated by Django 5.1.1 on 2024-09-30 16:23 + +import django.db.models.deletion +from django.db import migrations + +import sentry.db.models.fields.foreignkey +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. + # 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", "0768_fix_old_group_first_seen_dates"), + ("uptime", "0013_uptime_subscription_new_unique"), + ] + + operations = [ + migrations.AddField( + model_name="projectuptimesubscription", + name="environment", + field=sentry.db.models.fields.foreignkey.FlexibleForeignKey( + db_constraint=False, + null=True, + on_delete=django.db.models.deletion.CASCADE, + to="sentry.environment", + ), + ), + ] diff --git a/src/sentry/uptime/models.py b/src/sentry/uptime/models.py index 20a34e666c3709..42b0a6a9c12d5c 100644 --- a/src/sentry/uptime/models.py +++ b/src/sentry/uptime/models.py @@ -100,6 +100,9 @@ class ProjectUptimeSubscription(DefaultFieldsModelExisting): __relocation_scope__ = RelocationScope.Excluded project = FlexibleForeignKey("sentry.Project") + environment = FlexibleForeignKey( + "sentry.Environment", db_index=True, db_constraint=False, null=True + ) uptime_subscription = FlexibleForeignKey("uptime.UptimeSubscription", on_delete=models.PROTECT) mode = models.SmallIntegerField(default=ProjectUptimeSubscriptionMode.MANUAL.value) uptime_status = models.PositiveSmallIntegerField(default=UptimeStatus.OK.value) diff --git a/tests/sentry/backup/snapshots/test_comparators/test_default_comparators.pysnap b/tests/sentry/backup/snapshots/test_comparators/test_default_comparators.pysnap index 31b2d169a6b0eb..4f7e804c47dd48 100644 --- a/tests/sentry/backup/snapshots/test_comparators/test_default_comparators.pysnap +++ b/tests/sentry/backup/snapshots/test_comparators/test_default_comparators.pysnap @@ -1,5 +1,5 @@ --- -created: '2024-09-27T21:32:53.399200+00:00' +created: '2024-09-30T17:27:03.064802+00:00' creator: sentry source: tests/sentry/backup/test_comparators.py --- @@ -1603,6 +1603,7 @@ source: tests/sentry/backup/test_comparators.py - comparators: - class: ForeignKeyComparator fields: + - environment - owner_team - owner_user_id - project
5b462a80a9f06563a77bd4b86c6cf080d090b615
2020-01-22 23:50:46
Chris Fuller
feat(workflow): Quick and dirty alert rule trigger action descriptions (#16461)
false
Quick and dirty alert rule trigger action descriptions (#16461)
feat
diff --git a/src/sentry/api/serializers/models/alert_rule_trigger_action.py b/src/sentry/api/serializers/models/alert_rule_trigger_action.py index 5c3e6178bd4399..6c69324e6f80e7 100644 --- a/src/sentry/api/serializers/models/alert_rule_trigger_action.py +++ b/src/sentry/api/serializers/models/alert_rule_trigger_action.py @@ -8,6 +8,19 @@ @register(AlertRuleTriggerAction) class AlertRuleTriggerActionSerializer(Serializer): + def human_desc(self, action): + # Returns a human readable description to display in the UI + if action.type == action.Type.EMAIL.value: + if action.target: + if action.target_type == action.TargetType.USER.value: + return "Send an email to " + action.target.email + elif action.target_type == action.TargetType.TEAM.value: + return "Send an email to members of #" + action.target.slug + elif action.type == action.Type.PAGERDUTY.value: + return "Send a PagerDuty notification to " + action.target_display + elif action.type == action.Type.SLACK.value: + return "Send a Slack notificaiton to " + action.target_display + def serialize(self, obj, attrs, user): from sentry.incidents.endpoints.serializers import action_target_type_to_string @@ -25,4 +38,5 @@ def serialize(self, obj, attrs, user): else obj.target_identifier, "integrationId": obj.integration_id, "dateCreated": obj.date_added, + "desc": self.human_desc(obj), } 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 bd18faf90a3dff..39767603076c34 100644 --- a/src/sentry/static/sentry/app/views/settings/incidentRules/types.tsx +++ b/src/sentry/static/sentry/app/views/settings/incidentRules/types.tsx @@ -96,4 +96,7 @@ export type Action = { // How to identify the target. Can be email, slack channel, pagerduty service, user_id, team_id, etc targetIdentifier: string | null; + + // Human readable string describing what the action does. + desc: string | null; }; diff --git a/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx b/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx index cd1958e10b2b94..c7912b46afa037 100644 --- a/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx +++ b/src/sentry/static/sentry/app/views/settings/projectAlerts/ruleRowNew.tsx @@ -120,7 +120,7 @@ class RuleRow extends React.Component<Props, State> { <div> {trigger.actions && trigger.actions.map((action, j) => ( - <div key={j}>{action.type}</div> + <div key={j}>{action.desc}</div> ))} </div> </TriggerAndActions>
e1d1b23ef4a856062d7ae424c7ff9c4303a9fa04
2023-06-08 01:21:34
anthony sottile
ref: fix linting errors after moving cloudbuild files (#50511)
false
fix linting errors after moving cloudbuild files (#50511)
ref
diff --git a/src/sentry/runner/commands/devservices.py b/src/sentry/runner/commands/devservices.py index 94be37c192bf75..b29209858402aa 100644 --- a/src/sentry/runner/commands/devservices.py +++ b/src/sentry/runner/commands/devservices.py @@ -491,6 +491,7 @@ def rm(project: str, services: list[str]) -> None: an explicit list of services to remove. """ from docker.errors import NotFound + from sentry.runner import configure configure()
294de6ffee463c212f2388ec63bd7b542e14a95a
2023-06-12 22:17:50
Shruthi
feat(starfish): Add the delta columns to WSV (#50739)
false
Add the delta columns to WSV (#50739)
feat
diff --git a/static/app/views/starfish/utils/generatePerformanceEventView.tsx b/static/app/views/starfish/utils/generatePerformanceEventView.tsx index 4b096598672ad8..3970852fceb641 100644 --- a/static/app/views/starfish/utils/generatePerformanceEventView.tsx +++ b/static/app/views/starfish/utils/generatePerformanceEventView.tsx @@ -125,8 +125,11 @@ export function generateWebServiceEventView( 'transaction', 'http.method', 'tps()', + 'tps_percent_change()', 'p95(transaction.duration)', + 'percentile_percent_change(transaction.duration,0.95)', 'http_error_count()', + 'http_error_count_percent_change()', 'time_spent_percentage()', 'sum(transaction.duration)', ]; diff --git a/static/app/views/starfish/views/webServiceView/endpointList.tsx b/static/app/views/starfish/views/webServiceView/endpointList.tsx index 71854f22962442..ffb9e0cd1e97e6 100644 --- a/static/app/views/starfish/views/webServiceView/endpointList.tsx +++ b/static/app/views/starfish/views/webServiceView/endpointList.tsx @@ -33,10 +33,13 @@ import {DataTitles} from 'sentry/views/starfish/views/spans/types'; import {EndpointDataRow} from 'sentry/views/starfish/views/webServiceView/endpointDetails'; const COLUMN_TITLES = [ - 'Endpoint', + t('Endpoint'), DataTitles.throughput, + t('Change'), DataTitles.p95, + t('Change'), DataTitles.errorCount, + t('Change'), DataTitles.timeSpent, ]; @@ -131,21 +134,38 @@ function EndpointList({eventView, location, organization, setError}: Props) { } if ( - field.startsWith( - 'equation|(percentile_range(transaction.duration,0.95,lessOrEquals,' - ) + [ + 'percentile_percent_change(transaction.duration,0.95)', + 'http_error_count_percent_change()', + ].includes(field) ) { const deltaValue = dataRow[field] as number; const trendDirection = deltaValue < 0 ? 'good' : deltaValue > 0 ? 'bad' : 'neutral'; return ( <NumberContainer> - <TrendingDuration trendDirection={trendDirection}> + <PercentChangeCell trendDirection={trendDirection}> + {tct('[sign][delta]', { + sign: deltaValue >= 0 ? '+' : '-', + delta: formatPercentage(Math.abs(deltaValue), 2), + })} + </PercentChangeCell> + </NumberContainer> + ); + } + + if (field === 'tps_percent_change()') { + const deltaValue = dataRow[field] as number; + const trendDirection = deltaValue > 0 ? 'good' : deltaValue < 0 ? 'bad' : 'neutral'; + + return ( + <NumberContainer> + <PercentChangeCell trendDirection={trendDirection}> {tct('[sign][delta]', { sign: deltaValue >= 0 ? '+' : '-', delta: formatPercentage(Math.abs(deltaValue), 2), })} - </TrendingDuration> + </PercentChangeCell> </NumberContainer> ); } @@ -319,7 +339,9 @@ function EndpointList({eventView, location, organization, setError}: Props) { export default EndpointList; -const TrendingDuration = styled('div')<{trendDirection: 'good' | 'bad' | 'neutral'}>` +export const PercentChangeCell = styled('div')<{ + trendDirection: 'good' | 'bad' | 'neutral'; +}>` color: ${p => p.trendDirection === 'good' ? p.theme.successText diff --git a/static/app/views/starfish/views/webServiceView/failureDetailPanel/failureDetailTable.tsx b/static/app/views/starfish/views/webServiceView/failureDetailPanel/failureDetailTable.tsx index 58cdca9558c3c6..401f83b37eaa8a 100644 --- a/static/app/views/starfish/views/webServiceView/failureDetailPanel/failureDetailTable.tsx +++ b/static/app/views/starfish/views/webServiceView/failureDetailPanel/failureDetailTable.tsx @@ -7,13 +7,16 @@ import GridEditable, {GridColumnHeader} from 'sentry/components/gridEditable'; import {Alignments} from 'sentry/components/gridEditable/sortLink'; import Link from 'sentry/components/links/link'; import Pagination from 'sentry/components/pagination'; -import {t} from 'sentry/locale'; +import {t, tct} from 'sentry/locale'; import {Organization} from 'sentry/types'; import {TableData, TableDataRow} from 'sentry/utils/discover/discoverQuery'; import EventView from 'sentry/utils/discover/eventView'; import {getFieldRenderer} from 'sentry/utils/discover/fieldRenderers'; +import {NumberContainer} from 'sentry/utils/discover/styles'; +import {formatPercentage} from 'sentry/utils/formatters'; import {TableColumn} from 'sentry/views/discover/table/types'; import {EndpointDataRow} from 'sentry/views/starfish/views/endpointDetails'; +import {PercentChangeCell} from 'sentry/views/starfish/views/webServiceView/endpointList'; import {FailureSpike} from 'sentry/views/starfish/views/webServiceView/types'; type Props = { @@ -30,12 +33,17 @@ const COLUMN_ORDER = [ { key: 'transaction', name: t('Endpoint'), - width: 400, + width: 450, }, { key: 'http_error_count()', name: t('5xx Responses'), - width: 100, + width: 150, + }, + { + key: 'http_error_count_percent_change()', + name: t('Change'), + width: 80, }, ]; @@ -67,7 +75,7 @@ export default function FailureDetailTable({ const fieldRenderer = getFieldRenderer(field, tableData.meta, false); const rendered = fieldRenderer(dataRow, {organization, location}); - if (column.key === 'transaction') { + if (field === 'transaction') { const prefix = dataRow['http.method'] ? `${dataRow['http.method']} ` : ''; const queryParams = { start: spike ? new Date(spike.startTimestamp) : undefined, @@ -82,6 +90,22 @@ export default function FailureDetailTable({ ); } + if (field === 'http_error_count_percent_change()') { + const deltaValue = dataRow[field] as number; + const trendDirection = deltaValue < 0 ? 'good' : deltaValue > 0 ? 'bad' : 'neutral'; + + return ( + <NumberContainer> + <PercentChangeCell trendDirection={trendDirection}> + {tct('[sign][delta]', { + sign: deltaValue >= 0 ? '+' : '-', + delta: formatPercentage(Math.abs(deltaValue), 2), + })} + </PercentChangeCell> + </NumberContainer> + ); + } + return rendered; }
1c4c2afcc5347b8277b692a33aa0b55314b518ea
2023-05-18 03:24:54
David Wang
ref(crons): Change Recent Check-Ins to Check-Ins (#49365)
false
Change Recent Check-Ins to Check-Ins (#49365)
ref
diff --git a/static/app/views/monitors/components/monitorStats.tsx b/static/app/views/monitors/components/monitorStats.tsx index 6c56585a4fd453..a18bc3d2af9739 100644 --- a/static/app/views/monitors/components/monitorStats.tsx +++ b/static/app/views/monitors/components/monitorStats.tsx @@ -120,7 +120,7 @@ function MonitorStats({monitor, monitorEnvs, orgId}: Props) { <React.Fragment> <Panel> <PanelBody withPadding> - <StyledHeaderTitle>{t('Recent Check-Ins')}</StyledHeaderTitle> + <StyledHeaderTitle>{t('Check-Ins')}</StyledHeaderTitle> <BarChart isGroupedByDate showTimeInTooltip
3b167a556ffc0064753eb5982aaac395be37bd5d
2022-12-09 08:56:37
Richard Gibert
fix(createuser): Fix email prompt return (#42200)
false
Fix email prompt return (#42200)
fix
diff --git a/src/sentry/runner/commands/createuser.py b/src/sentry/runner/commands/createuser.py index aef6e9aa1eff40..862590e594fc79 100644 --- a/src/sentry/runner/commands/createuser.py +++ b/src/sentry/runner/commands/createuser.py @@ -15,7 +15,7 @@ def _get_email(): rv = click.prompt("Email") field = _get_field("email") try: - return field.clean(rv, None) + return [field.clean(rv, None)] except ValidationError as e: raise click.ClickException("; ".join(e.messages))
732d636d7306dc567c7e251fdba98331c0017ba0
2025-01-10 19:42:23
Armen Zambrano G.
chore(ci): Upgrade to supported actions/cache version (#83226)
false
Upgrade to supported actions/cache version (#83226)
chore
diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index f72739d777cf4e..7e0347f75fa854 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -78,13 +78,13 @@ jobs: echo "WEBPACK_CACHE_PATH=.webpack_cache" >> "$GITHUB_ENV" - name: webpack cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] with: path: ${{ steps.config.outputs.webpack-path }} key: ${{ runner.os }}-v2-webpack-cache-${{ hashFiles('webpack.config.ts') }} - name: node_modules cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] id: nodemodulescache with: path: node_modules diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index fc1a79c0a975f3..4cd7fdd64217d9 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -53,7 +53,7 @@ jobs: node-version-file: '.volta.json' - name: node_modules cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] id: nodemodulescache with: path: node_modules @@ -102,7 +102,7 @@ jobs: node-version-file: '.volta.json' - name: node_modules cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] id: nodemodulescache with: path: node_modules diff --git a/.github/workflows/jest-balance.yml b/.github/workflows/jest-balance.yml index 99547f016bb96a..6b6f5ad40fbee4 100644 --- a/.github/workflows/jest-balance.yml +++ b/.github/workflows/jest-balance.yml @@ -19,7 +19,7 @@ jobs: node-version-file: '.volta.json' - name: node_modules cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] id: nodemodulescache with: path: node_modules diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 8e90f1dc51ca76..bb04fbc502ce4c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -59,7 +59,7 @@ jobs: node-version-file: '.volta.json' - name: node_modules cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] id: nodemodulescache with: path: node_modules @@ -76,7 +76,7 @@ jobs: requirements-dev.txt requirements-dev-frozen.txt install-cmd: pip install -r requirements-dev.txt -c requirements-dev-frozen.txt - - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + - uses: actions/[email protected] with: path: ~/.cache/pre-commit key: cache-epoch-1|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} diff --git a/.github/workflows/self-hosted.yml b/.github/workflows/self-hosted.yml index 730796960b05a2..d218104b912e1c 100644 --- a/.github/workflows/self-hosted.yml +++ b/.github/workflows/self-hosted.yml @@ -42,13 +42,13 @@ jobs: echo "WEBPACK_CACHE_PATH=.webpack_cache" >> "$GITHUB_ENV" - name: webpack cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] with: path: ${{ steps.config.outputs.webpack-path }} key: ${{ runner.os }}-self-hosted-webpack-cache-${{ hashFiles('webpack.config.ts') }} - name: node_modules cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] id: nodemodulescache with: path: node_modules diff --git a/.github/workflows/test_devservices_acceptance.yml b/.github/workflows/test_devservices_acceptance.yml index 279c41114d277c..03e6f8a9b4c922 100644 --- a/.github/workflows/test_devservices_acceptance.yml +++ b/.github/workflows/test_devservices_acceptance.yml @@ -57,13 +57,13 @@ jobs: echo "WEBPACK_CACHE_PATH=.webpack_cache" >> "$GITHUB_ENV" - name: webpack cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] with: path: ${{ steps.config.outputs.webpack-path }} key: ${{ runner.os }}-v2-webpack-cache-${{ hashFiles('webpack.config.ts') }} - name: node_modules cache - uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 + uses: actions/[email protected] id: nodemodulescache with: path: node_modules
d9ff941b2e8639f5fa1b690068b266d676314fd0
2022-10-06 23:44:34
Dameli Ushbayeva
fix(discover): Handle undefined case for column text (#39764)
false
Handle undefined case for column text (#39764)
fix
diff --git a/static/app/utils/discover/fields.tsx b/static/app/utils/discover/fields.tsx index 4a3a9a237debae..87ba687c868096 100644 --- a/static/app/utils/discover/fields.tsx +++ b/static/app/utils/discover/fields.tsx @@ -688,7 +688,7 @@ export function parseArguments(functionText: string, columnText: string): string (functionText !== 'to_other' && functionText !== 'count_if' && functionText !== 'spans_histogram') || - columnText.length === 0 + columnText?.length === 0 ) { return columnText ? columnText.split(',').map(result => result.trim()) : []; }
461ca768ffdc995843ccd2b593fe4017b6af85ae
2020-07-02 00:10:50
Stephen Cefali
feat(vercel): update Vercel description (#19645)
false
update Vercel description (#19645)
feat
diff --git a/src/sentry/integrations/vercel/integration.py b/src/sentry/integrations/vercel/integration.py index e982b57a0d1af1..f1a20bbf465e0f 100644 --- a/src/sentry/integrations/vercel/integration.py +++ b/src/sentry/integrations/vercel/integration.py @@ -34,13 +34,13 @@ logger = logging.getLogger("sentry.integrations.vercel") DESCRIPTION = """ -VERCEL DESC +Vercel is an all-in-one platform with Global CDN supporting static & JAMstack deployment and Serverless Functions. """ FEATURES = [ FeatureDescription( """ - DEPLOYMENT DESCRIPTION + Connect your Sentry and Vercel projects to automatically upload source maps and notify Sentry of new releases being deployed. """, IntegrationFeatures.DEPLOYMENT, ),
6da68d18604b26c65ead5573237f7095bac1981d
2024-01-24 16:39:49
Iker Barriocanal
ref(tx-clusterer): Increase soft limit timeout to 0.3s/project (#63738)
false
Increase soft limit timeout to 0.3s/project (#63738)
ref
diff --git a/src/sentry/ingest/transaction_clusterer/tasks.py b/src/sentry/ingest/transaction_clusterer/tasks.py index cc973499a98f8e..deac6be19d0536 100644 --- a/src/sentry/ingest/transaction_clusterer/tasks.py +++ b/src/sentry/ingest/transaction_clusterer/tasks.py @@ -36,7 +36,7 @@ #: Estimated limit for a clusterer run per project, in seconds. #: NOTE: using this in a per-project basis may not be enough. Consider using #: this estimation for project batches instead. -CLUSTERING_TIMEOUT_PER_PROJECT = 0.15 +CLUSTERING_TIMEOUT_PER_PROJECT = 0.3 @instrumented_task(
End of preview. Expand in Data Studio

No dataset card yet

Downloads last month
15