Skip to content

Commit 10a4a49

Browse files
authored
Merge branch 'master' into feat/tracemetrics/allow-adding-alerts-from-explore
2 parents d683541 + 5ed3084 commit 10a4a49

File tree

502 files changed

+9263
-7605
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

502 files changed

+9263
-7605
lines changed

.agents/skills/sentry-security/references/serializer-patterns.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class IssueAlertRuleSerializer(serializers.Serializer):
4040
1. If org has `allow_joinleave` flag → any team is allowed (user could join anyway)
4141
2. If user has `team:admin` scope → any team is allowed
4242
3. If user is a member of the target team → allowed
43-
4. If user is a member of the current owner's team → allowed (can reassign from their team)
44-
5. Otherwise → `ValidationError("You can only assign teams you are a member of")`
43+
4. Otherwise → `ValidationError("You can only assign teams you are a member of")`
4544

4645
### What to look for
4746

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ pyproject.toml @getsentry/owners-pytho
172172
vercel.json @getsentry/owners-js-build
173173
/.github/workflows/frontend.yml @getsentry/owners-js-build
174174
/.github/file-filters.yml @getsentry/owners-js-build
175-
babel.config.* @getsentry/owners-js-build
176175
build-utils/ @getsentry/owners-js-build
177176
eslint.config.ts @getsentry/owners-js-build
178177
jest-balance.json @getsentry/owners-js-build
@@ -356,6 +355,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
356355
/static/app/components/arithmeticBuilder/ @getsentry/data-browsing
357356

358357
/static/app/components/charts/ @getsentry/data-browsing
358+
/static/app/chartcuterie/timeseries.tsx @getsentry/data-browsing
359359

360360
/static/app/views/insights/ @getsentry/dashboards
361361

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ updates:
1515
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups
1616
groups:
1717
# The name of the group, it will be used in PR titles and branch
18-
babel-dependencies:
18+
swc-dependencies:
1919
patterns:
20-
- '@babel/*'
20+
- '@swc/*'
2121
sentry-dependencies:
2222
patterns:
2323
- '@sentry/core'

.github/file-filters.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
sentry_frontend_workflow_file: &sentry_frontend_workflow_file
44
- added|modified: '.github/workflows/frontend.yml'
55

6+
sentry_frontend_snapshots_workflow_file: &sentry_frontend_snapshots_workflow_file
7+
- added|modified: '.github/workflows/frontend-snapshots.yml'
8+
69
# Provides list of changed files to test (jest)
710
# getsentry/sentry does not use the list directly, instead we shard tests inside jest.config.js
811
testable_modified: &testable_modified
@@ -30,6 +33,7 @@ typecheckable_rules_changed: &typecheckable_rules_changed
3033
# Trigger to apply the 'Scope: Frontend' label to PRs
3134
frontend_all: &frontend_all
3235
- *sentry_frontend_workflow_file
36+
- *sentry_frontend_snapshots_workflow_file
3337
- added|modified: '**/*.{ts,tsx,js,jsx,mjs}'
3438
- added|modified: 'static/**/*.{less,json,yml,md,mdx}'
3539
- added|modified: '{vercel,tsconfig,biome,package}.json'

.github/workflows/frontend-snapshots.yml

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,37 +69,19 @@ jobs:
6969

7070
- name: Install sentry-cli
7171
if: ${{ !cancelled() }}
72-
run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.3.4 sh
72+
run: curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.3.5 sh
7373

7474
- name: Upload snapshots
7575
id: upload
7676
if: ${{ !cancelled() }}
7777
env:
7878
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_SNAPSHOTS_AUTH_TOKEN }}
79-
run: |
80-
ARGS=(
81-
--log-level=debug
82-
--auth-token "${{ secrets.SENTRY_SNAPSHOTS_AUTH_TOKEN }}"
83-
build snapshots "${{ env.SNAPSHOT_OUTPUT_DIR }}"
84-
--app-id sentry-frontend
85-
--project sentry-frontend
86-
--head-sha "${{ github.event.pull_request.head.sha || github.sha }}"
87-
--vcs-provider github
88-
--head-repo-name "${{ github.repository }}"
89-
)
90-
91-
# PR-only flags: base-sha, base-ref, base-repo-name, head-ref, pr-number
92-
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
93-
ARGS+=(
94-
--base-sha "${{ github.event.pull_request.base.sha }}"
95-
--base-repo-name "${{ github.repository }}"
96-
--head-ref "${{ github.head_ref }}"
97-
--base-ref "${{ github.base_ref }}"
98-
--pr-number "${{ github.event.number }}"
99-
)
100-
fi
101-
102-
sentry-cli "${ARGS[@]}"
79+
run: >
80+
sentry-cli
81+
--log-level=debug
82+
build snapshots "${{ env.SNAPSHOT_OUTPUT_DIR }}"
83+
--app-id sentry-frontend
84+
--project sentry-frontend
10385
10486
- name: Report upload failure to Sentry
10587
if: ${{ failure() && steps.upload.outcome == 'failure' }}

.github/workflows/frontend.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ jobs:
131131

132132
- uses: ./.github/actions/setup-node-pnpm
133133

134+
- name: jest transform cache
135+
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
136+
with:
137+
path: |
138+
.cache/jest
139+
~/.cache/swc
140+
key: jest-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'jest.config.ts') }}-${{ matrix.instance }}
141+
restore-keys: |
142+
jest-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'jest.config.ts') }}-
143+
jest-cache-${{ runner.os }}-
144+
134145
- name: Download jest-balance.json
135146
id: download-artifact
136147
uses: dawidd6/action-download-artifact@ac66b43f0e6a346234dd65d4d0c8fbb31cb316e5 # v11

.vercelignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
!src/sentry/locale/**
99
!build-utils
1010
!build-utils/**
11-
!babel.config.js
1211
!jest.config.js
1312
!now.json
1413
!package.json

eslint.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ export default typescript.config([
462462
'@sentry/no-flag-comments': 'error',
463463
'@sentry/no-static-translations': 'error',
464464
'@sentry/no-styled-shortcut': 'error',
465+
'@sentry/no-unnecessary-use-callback': 'error',
465466
},
466467
},
467468
{
@@ -757,7 +758,7 @@ export default typescript.config([
757758
plugins: {'@emotion': emotion},
758759
rules: {
759760
'@emotion/import-from-emotion': 'off', // Not needed, in v11 we import from @emotion/react
760-
'@emotion/jsx-import': 'off', // Not needed, handled by babel
761+
'@emotion/jsx-import': 'off', // Not needed, handled by swc
761762
'@emotion/no-vanilla': 'error',
762763
'@emotion/pkg-renaming': 'off', // Not needed, we have migrated to v11 and the old package names cannot be used anymore
763764
'@emotion/styled-import': 'error',

jest.config.snapshots.ts

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
1-
import type {TransformOptions} from '@babel/core';
21
import type {Config} from '@jest/types';
2+
import type {Options as SwcOptions} from '@swc/core';
33

4-
const babelConfig: TransformOptions = {
5-
presets: [
6-
[
7-
'@babel/preset-react',
8-
{
4+
const swcConfig: SwcOptions = {
5+
isModule: true,
6+
module: {
7+
type: 'commonjs',
8+
},
9+
sourceMaps: 'inline',
10+
jsc: {
11+
target: 'esnext',
12+
parser: {
13+
syntax: 'typescript',
14+
tsx: true,
15+
dynamicImport: true,
16+
},
17+
transform: {
18+
react: {
919
runtime: 'automatic',
1020
importSource: '@emotion/react',
1121
},
12-
],
13-
[
14-
'@babel/preset-env',
15-
{
16-
useBuiltIns: 'usage',
17-
corejs: '3.41',
18-
targets: {
19-
node: 'current',
20-
},
21-
},
22-
],
23-
['@babel/preset-typescript', {allowDeclareFields: true, onlyRemoveTypeImports: true}],
24-
],
25-
plugins: [
26-
[
27-
'@emotion/babel-plugin',
28-
{
29-
sourceMap: false,
30-
},
31-
],
32-
],
22+
},
23+
experimental: {
24+
plugins: [
25+
['@swc-contrib/mut-cjs-exports', {}],
26+
[
27+
'@swc/plugin-emotion',
28+
{
29+
sourceMap: false,
30+
autoLabel: 'never',
31+
},
32+
],
33+
],
34+
},
35+
},
3336
};
3437

3538
/**
36-
* ESM packages that need to be transformed by babel-jest.
39+
* ESM packages that need to be transformed.
3740
*/
3841
const ESM_NODE_MODULES = ['screenfull', 'cbor2', 'nuqs', 'color'];
3942

4043
const config: Config.InitialOptions = {
44+
cacheDirectory: '.cache/jest-snapshots',
4145
// testEnvironment and testMatch are the core differences between this and the main config
4246
testEnvironment: 'node',
4347
testMatch: ['<rootDir>/static/**/*.snapshots.tsx'],
@@ -63,9 +67,7 @@ const config: Config.InitialOptions = {
6367
},
6468

6569
transform: {
66-
'^.+\\.jsx?$': ['babel-jest', babelConfig as any],
67-
'^.+\\.tsx?$': ['babel-jest', babelConfig as any],
68-
'^.+\\.mjs?$': ['babel-jest', babelConfig as any],
70+
'^.+\\.[mc]?[jt]sx?$': ['@swc/jest', swcConfig],
6971
},
7072
transformIgnorePatterns: [
7173
ESM_NODE_MODULES.length

jest.config.ts

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,32 @@ import {execFileSync} from 'node:child_process';
22
import path from 'node:path';
33
import process from 'node:process';
44

5-
import type {TransformOptions} from '@babel/core';
65
import type {Config} from '@jest/types';
6+
import type {Options as SwcOptions} from '@swc/core';
77

8-
const babelConfig: TransformOptions = {
9-
presets: [
10-
[
11-
'@babel/preset-react',
12-
{
8+
const swcConfig: SwcOptions = {
9+
isModule: true,
10+
module: {
11+
type: 'commonjs',
12+
},
13+
sourceMaps: 'inline',
14+
jsc: {
15+
target: 'esnext',
16+
parser: {
17+
syntax: 'typescript',
18+
tsx: true,
19+
dynamicImport: true,
20+
},
21+
transform: {
22+
react: {
1323
runtime: 'automatic',
1424
importSource: '@emotion/react',
1525
},
16-
],
17-
[
18-
'@babel/preset-env',
19-
{
20-
useBuiltIns: 'usage',
21-
corejs: '3.41',
22-
targets: {
23-
node: 'current',
24-
},
25-
},
26-
],
27-
// TODO: Remove allowDeclareFields when we upgrade to Babel 8
28-
['@babel/preset-typescript', {allowDeclareFields: true, onlyRemoveTypeImports: true}],
29-
],
30-
plugins: [
31-
[
32-
'@emotion/babel-plugin',
33-
{
34-
sourceMap: false,
35-
},
36-
],
37-
],
26+
},
27+
experimental: {
28+
plugins: [['@swc-contrib/mut-cjs-exports', {}]],
29+
},
30+
},
3831
};
3932

4033
const {
@@ -284,6 +277,7 @@ const ESM_NODE_MODULES = [
284277

285278
const config: Config.InitialOptions = {
286279
verbose: false,
280+
cacheDirectory: '.cache/jest',
287281
collectCoverageFrom: [
288282
'static/app/**/*.{js,jsx,ts,tsx}',
289283
'!static/app/**/*.spec.{js,jsx,ts,tsx}',
@@ -334,8 +328,7 @@ const config: Config.InitialOptions = {
334328
'<rootDir>/node_modules/reflux',
335329
],
336330
transform: {
337-
'^.+\\.jsx?$': ['babel-jest', babelConfig as any],
338-
'^.+\\.tsx?$': ['babel-jest', babelConfig as any],
331+
'^.+\\.[mc]?[jt]sx?$': ['@swc/jest', swcConfig],
339332
'^.+\\.pegjs?$': '<rootDir>/tests/js/jest-pegjs-transform.js',
340333
},
341334
transformIgnorePatterns: [

0 commit comments

Comments
 (0)