Skip to content

Commit 30e5008

Browse files
authored
chore(insights): Move permissive SQL parser into utils folder (#72953)
This is used outside of Starfish now (performance, trace view, etc.) time to move it up where it's findable
1 parent 131d1d8 commit 30e5008

File tree

14 files changed

+14
-14
lines changed

14 files changed

+14
-14
lines changed

static/app/components/events/interfaces/performance/spanEvidenceKeyValueList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ import {
3232
import {formatBytesBase2} from 'sentry/utils/bytes/formatBytesBase2';
3333
import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls';
3434
import toRoundedPercent from 'sentry/utils/number/toRoundedPercent';
35+
import {SQLishFormatter} from 'sentry/utils/sqlish/SQLishFormatter';
3536
import {safeURL} from 'sentry/utils/url/safeURL';
3637
import {useLocation} from 'sentry/utils/useLocation';
3738
import useOrganization from 'sentry/utils/useOrganization';
3839
import {transactionSummaryRouteWithQuery} from 'sentry/views/performance/transactionSummary/utils';
3940
import {getPerformanceDuration} from 'sentry/views/performance/utils/getPerformanceDuration';
40-
import {SQLishFormatter} from 'sentry/views/starfish/utils/sqlish/SQLishFormatter';
4141

4242
import KeyValueList from '../keyValueList';
4343
import type {ProcessedSpanType, RawSpanType} from '../spans/types';

static/app/views/starfish/utils/sqlish/SQLishFormatter.spec.tsx renamed to static/app/utils/sqlish/SQLishFormatter.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Fragment} from 'react';
22

33
import {render} from 'sentry-test/reactTestingLibrary';
44

5-
import {SQLishFormatter} from 'sentry/views/starfish/utils/sqlish/SQLishFormatter';
5+
import {SQLishFormatter} from 'sentry/utils/sqlish/SQLishFormatter';
66

77
describe('SQLishFormatter', function () {
88
describe('SQLishFormatter.toString()', () => {

static/app/views/starfish/utils/sqlish/SQLishFormatter.tsx renamed to static/app/utils/sqlish/SQLishFormatter.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as Sentry from '@sentry/react';
22

3-
import {simpleMarkup} from 'sentry/views/starfish/utils/sqlish/formatters/simpleMarkup';
4-
import {string} from 'sentry/views/starfish/utils/sqlish/formatters/string';
5-
import {SQLishParser} from 'sentry/views/starfish/utils/sqlish/SQLishParser';
3+
import {simpleMarkup} from 'sentry/utils/sqlish/formatters/simpleMarkup';
4+
import {string} from 'sentry/utils/sqlish/formatters/string';
5+
import {SQLishParser} from 'sentry/utils/sqlish/SQLishParser';
66

77
type StringFormatterOptions = Parameters<typeof string>[1];
88

static/app/views/starfish/utils/sqlish/SQLishParser.spec.tsx renamed to static/app/utils/sqlish/SQLishParser.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {SQLishParser} from 'sentry/views/starfish/utils/sqlish/SQLishParser';
1+
import {SQLishParser} from 'sentry/utils/sqlish/SQLishParser';
22

33
describe('SQLishParser', function () {
44
describe('SQLishParser()', () => {

static/app/views/starfish/utils/sqlish/SQLishParser.ts renamed to static/app/utils/sqlish/SQLishParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Token} from 'sentry/views/starfish/utils/sqlish/types';
1+
import type {Token} from 'sentry/utils/sqlish/types';
22

33
import grammar from './sqlish.pegjs';
44

static/app/views/starfish/utils/sqlish/formatters/simpleMarkup.tsx renamed to static/app/utils/sqlish/formatters/simpleMarkup.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {Token} from 'sentry/views/starfish/utils/sqlish/types';
1+
import type {Token} from 'sentry/utils/sqlish/types';
22

33
export function simpleMarkup(tokens: Token[]): React.ReactElement[] {
44
const accumulator: React.ReactElement[] = [];

static/app/views/starfish/utils/sqlish/formatters/string.ts renamed to static/app/utils/sqlish/formatters/string.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {StringAccumulator} from 'sentry/views/starfish/utils/sqlish/formatters/stringAccumulator';
2-
import type {Token} from 'sentry/views/starfish/utils/sqlish/types';
1+
import {StringAccumulator} from 'sentry/utils/sqlish/formatters/stringAccumulator';
2+
import type {Token} from 'sentry/utils/sqlish/types';
33

44
interface Options {
55
maxLineLength?: number;

static/app/views/performance/newTraceDetails/traceDrawer/details/span/sections/description.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {t} from 'sentry/locale';
99
import {space} from 'sentry/styles/space';
1010
import type {Organization} from 'sentry/types/organization';
1111
import {trackAnalytics} from 'sentry/utils/analytics';
12+
import {SQLishFormatter} from 'sentry/utils/sqlish/SQLishFormatter';
1213
import type {
1314
TraceTree,
1415
TraceTreeNode,
@@ -20,7 +21,6 @@ import {
2021
} from 'sentry/views/starfish/components/stackTraceMiniFrame';
2122
import {ModuleName} from 'sentry/views/starfish/types';
2223
import {resolveSpanModule} from 'sentry/views/starfish/utils/resolveSpanModule';
23-
import {SQLishFormatter} from 'sentry/views/starfish/utils/sqlish/SQLishFormatter';
2424

2525
import {TraceDrawerComponents} from '../../styles';
2626

static/app/views/starfish/components/fullSpanDescription.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import styled from '@emotion/styled';
44
import {CodeSnippet} from 'sentry/components/codeSnippet';
55
import LoadingIndicator from 'sentry/components/loadingIndicator';
66
import {space} from 'sentry/styles/space';
7+
import {SQLishFormatter} from 'sentry/utils/sqlish/SQLishFormatter';
78
import {useFullSpanFromTrace} from 'sentry/views/starfish/queries/useFullSpanFromTrace';
8-
import {SQLishFormatter} from 'sentry/views/starfish/utils/sqlish/SQLishFormatter';
99

1010
const formatter = new SQLishFormatter();
1111

static/app/views/starfish/components/spanDescription.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import styled from '@emotion/styled';
44
import {CodeSnippet} from 'sentry/components/codeSnippet';
55
import LoadingIndicator from 'sentry/components/loadingIndicator';
66
import {space} from 'sentry/styles/space';
7+
import {SQLishFormatter} from 'sentry/utils/sqlish/SQLishFormatter';
78
import {MutableSearch} from 'sentry/utils/tokenizeSearch';
89
import {
910
MissingFrame,
@@ -13,7 +14,6 @@ import {useSpansIndexed} from 'sentry/views/starfish/queries/useDiscover';
1314
import {useFullSpanFromTrace} from 'sentry/views/starfish/queries/useFullSpanFromTrace';
1415
import type {SpanIndexedFieldTypes} from 'sentry/views/starfish/types';
1516
import {SpanIndexedField} from 'sentry/views/starfish/types';
16-
import {SQLishFormatter} from 'sentry/views/starfish/utils/sqlish/SQLishFormatter';
1717

1818
interface Props {
1919
groupId: SpanIndexedFieldTypes[SpanIndexedField.SPAN_GROUP];

static/app/views/starfish/components/tableCells/spanDescriptionCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import styled from '@emotion/styled';
44
import {Hovercard} from 'sentry/components/hovercard';
55
import {t} from 'sentry/locale';
66
import {space} from 'sentry/styles/space';
7+
import {SQLishFormatter} from 'sentry/utils/sqlish/SQLishFormatter';
78
import {FullSpanDescription} from 'sentry/views/starfish/components/fullSpanDescription';
89
import {SpanGroupDetailsLink} from 'sentry/views/starfish/components/spanGroupDetailsLink';
910
import {ModuleName, SpanMetricsField} from 'sentry/views/starfish/types';
10-
import {SQLishFormatter} from 'sentry/views/starfish/utils/sqlish/SQLishFormatter';
1111

1212
const formatter = new SQLishFormatter();
1313

0 commit comments

Comments
 (0)