Skip to content

Commit 2cf3ef7

Browse files
authored
Merge branch 'develop' into sig/nuxt-reexport-firebase
2 parents 511f7f2 + ff8e780 commit 2cf3ef7

File tree

129 files changed

+2381
-1292
lines changed

Some content is hidden

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

129 files changed

+2381
-1292
lines changed

.github/dependency-review-config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
fail-on-severity: 'high'
2+
allow-ghsas:
3+
# dependency review does not allow specific file exclusions
4+
# we use an older version of NextJS in our tests and thus need to
5+
# exclude this
6+
# once our minimum supported version is over 14.1.1 this can be removed
7+
- GHSA-fr5h-rqp8-mj6g

.github/workflows/build.yml

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ jobs:
904904
'nextjs-13',
905905
'nextjs-14',
906906
'nextjs-15',
907+
'nextjs-turbo',
907908
'nextjs-t3',
908909
'react-17',
909910
'react-19',
@@ -1018,12 +1019,12 @@ jobs:
10181019

10191020
- name: Build E2E app
10201021
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1021-
timeout-minutes: 5
1022+
timeout-minutes: 7
10221023
run: pnpm ${{ matrix.build-command || 'test:build' }}
10231024

10241025
- name: Run E2E test
10251026
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1026-
timeout-minutes: 5
1027+
timeout-minutes: 10
10271028
run: pnpm test:assert
10281029

10291030
- name: Upload Playwright Traces
@@ -1035,14 +1036,20 @@ jobs:
10351036
overwrite: true
10361037
retention-days: 7
10371038

1039+
- name: Pre-process E2E Test Dumps
1040+
if: always()
1041+
run: |
1042+
node ./scripts/normalize-e2e-test-dump-transaction-events.js
1043+
10381044
- name: Upload E2E Test Event Dumps
10391045
uses: actions/upload-artifact@v4
10401046
if: always()
10411047
with:
1042-
name: playwright-event-dumps-job_e2e_playwright_tests-${{ matrix.test-application }}
1048+
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
10431049
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/event-dumps
10441050
overwrite: true
10451051
retention-days: 7
1052+
if-no-files-found: ignore
10461053

10471054
- name: Upload test results to Codecov
10481055
if: cancelled() == false
@@ -1083,10 +1090,6 @@ jobs:
10831090
'react-send-to-sentry',
10841091
'node-express-send-to-sentry',
10851092
'debug-id-sourcemaps',
1086-
'nextjs-app-dir',
1087-
'nextjs-13',
1088-
'nextjs-14',
1089-
'nextjs-15',
10901093
]
10911094
build-command:
10921095
- false
@@ -1125,6 +1128,12 @@ jobs:
11251128
- test-application: 'nextjs-15'
11261129
build-command: 'test:build-latest'
11271130
label: 'nextjs-15 (latest)'
1131+
- test-application: 'nextjs-turbo'
1132+
build-command: 'test:build-canary'
1133+
label: 'nextjs-turbo (canary)'
1134+
- test-application: 'nextjs-turbo'
1135+
build-command: 'test:build-latest'
1136+
label: 'nextjs-turbo (latest)'
11281137

11291138
steps:
11301139
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
@@ -1176,14 +1185,29 @@ jobs:
11761185

11771186
- name: Build E2E app
11781187
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1179-
timeout-minutes: 5
1188+
timeout-minutes: 7
11801189
run: pnpm ${{ matrix.build-command || 'test:build' }}
11811190

11821191
- name: Run E2E test
11831192
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1184-
timeout-minutes: 5
1193+
timeout-minutes: 10
11851194
run: pnpm ${{ matrix.assert-command || 'test:assert' }}
11861195

1196+
- name: Pre-process E2E Test Dumps
1197+
if: always()
1198+
run: |
1199+
node ./scripts/normalize-e2e-test-dump-transaction-events.js
1200+
1201+
- name: Upload E2E Test Event Dumps
1202+
uses: actions/upload-artifact@v4
1203+
if: always()
1204+
with:
1205+
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
1206+
path: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/event-dumps
1207+
overwrite: true
1208+
retention-days: 7
1209+
if-no-files-found: ignore
1210+
11871211
- name: Deploy Astro to Cloudflare
11881212
uses: cloudflare/pages-action@v1
11891213
if: matrix.test-application == 'cloudflare-astro'
@@ -1282,12 +1306,12 @@ jobs:
12821306

12831307
- name: Build E2E app
12841308
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1285-
timeout-minutes: 5
1309+
timeout-minutes: 7
12861310
run: yarn ${{ matrix.build-command || 'test:build' }}
12871311

12881312
- name: Run E2E test
12891313
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1290-
timeout-minutes: 5
1314+
timeout-minutes: 10
12911315
run: yarn test:assert
12921316

12931317
job_required_jobs_passed:

.github/workflows/canary.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ jobs:
9696
- test-application: 'nextjs-15'
9797
build-command: 'test:build-latest'
9898
label: 'nextjs-15 (latest)'
99+
- test-application: 'nextjs-turbo'
100+
build-command: 'test:build-canary'
101+
label: 'nextjs-turbo (canary)'
102+
- test-application: 'nextjs-turbo'
103+
build-command: 'test:build-latest'
104+
label: 'nextjs-turbo (latest)'
99105
- test-application: 'react-create-hash-router'
100106
build-command: 'test:build-canary'
101107
label: 'react-create-hash-router (canary)'
@@ -140,7 +146,7 @@ jobs:
140146

141147
- name: Build E2E app
142148
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
143-
timeout-minutes: 5
149+
timeout-minutes: 7
144150
run: yarn ${{ matrix.build-command }}
145151

146152
- name: Run E2E test

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ module.exports = [
224224
import: createImport('init'),
225225
ignore: ['next/router', 'next/constants'],
226226
gzip: true,
227-
limit: '39 KB',
227+
limit: '39.1 KB',
228228
},
229229
// SvelteKit SDK (ESM)
230230
{

dev-packages/e2e-tests/publish-packages.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@ const packageTarballPaths = glob.sync('packages/*/sentry-*.tgz', {
1212

1313
// Publish built packages to the fake registry
1414
packageTarballPaths.forEach(tarballPath => {
15+
// eslint-disable-next-line no-console
16+
console.log(`Publishing tarball ${tarballPath} ...`);
1517
// `--userconfig` flag needs to be before `publish`
1618
childProcess.exec(
1719
`npm --userconfig ${__dirname}/test-registry.npmrc publish ${tarballPath}`,
1820
{
1921
cwd: repositoryRoot, // Can't use __dirname here because npm would try to publish `@sentry-internal/e2e-tests`
2022
encoding: 'utf8',
2123
},
22-
(err, stdout, stderr) => {
23-
// eslint-disable-next-line no-console
24-
console.log(stdout);
25-
// eslint-disable-next-line no-console
26-
console.log(stderr);
24+
err => {
2725
if (err) {
2826
// eslint-disable-next-line no-console
29-
console.error(err);
27+
console.error(`Error publishing tarball ${tarballPath}`, err);
3028
process.exit(1);
3129
}
3230
},

dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"devDependencies": {
1616
"rollup": "^4.0.2",
1717
"vitest": "^0.34.6",
18-
"@sentry/rollup-plugin": "2.22.3"
18+
"@sentry/rollup-plugin": "2.22.6"
1919
},
2020
"volta": {
2121
"extends": "../../package.json"

dev-packages/e2e-tests/test-applications/nextjs-13/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ next-env.d.ts
3838
!*.d.ts
3939

4040
test-results
41+
event-dumps
4142

4243
.vscode

dev-packages/e2e-tests/test-applications/nextjs-13/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@types/node": "18.11.17",
1818
"@types/react": "18.0.26",
1919
"@types/react-dom": "18.0.9",
20-
"next": "13.2.0",
20+
"next": "13.5.7",
2121
"react": "18.2.0",
2222
"react-dom": "18.2.0",
2323
"typescript": "4.9.5"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
13
import { startEventProxyServer } from '@sentry-internal/test-utils';
24

5+
const packageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')));
6+
37
startEventProxyServer({
48
port: 3031,
59
proxyServerName: 'nextjs-13',
10+
envelopeDumpPath: path.join(
11+
process.cwd(),
12+
`event-dumps/next-13-v${packageJson.dependencies.next}-${process.env.TEST_ENV}.dump`,
13+
),
614
});

dev-packages/e2e-tests/test-applications/nextjs-13/tests/client/pages-dir-pageload.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,38 @@ test('should create a pageload transaction when the `pages` directory is used',
4646
type: 'transaction',
4747
});
4848
});
49+
50+
test('should create a pageload transaction with correct name when an error occurs in getServerSideProps', async ({
51+
page,
52+
}) => {
53+
const transactionPromise = waitForTransaction('nextjs-13', async transactionEvent => {
54+
return (
55+
transactionEvent.transaction === '/[param]/error-getServerSideProps' &&
56+
transactionEvent.contexts?.trace?.op === 'pageload'
57+
);
58+
});
59+
60+
await page.goto(`/something/error-getServerSideProps`, { waitUntil: 'networkidle' });
61+
62+
const transaction = await transactionPromise;
63+
64+
expect(transaction).toMatchObject({
65+
contexts: {
66+
trace: {
67+
data: {
68+
'sentry.op': 'pageload',
69+
'sentry.origin': 'auto.pageload.nextjs.pages_router_instrumentation',
70+
'sentry.source': 'route',
71+
},
72+
op: 'pageload',
73+
origin: 'auto.pageload.nextjs.pages_router_instrumentation',
74+
},
75+
},
76+
transaction: '/[param]/error-getServerSideProps',
77+
transaction_info: { source: 'route' },
78+
type: 'transaction',
79+
});
80+
81+
// Ensure the transaction name is not '/_error'
82+
expect(transaction.transaction).not.toBe('/_error');
83+
});

dev-packages/e2e-tests/test-applications/nextjs-13/tests/isomorphic/getInitialProps.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('should propagate serverside `getInitialProps` trace to client', async ({ p
1111

1212
const serverTransactionPromise = waitForTransaction('nextjs-13', async transactionEvent => {
1313
return (
14-
transactionEvent.transaction === '/[param]/withInitialProps' &&
14+
transactionEvent.transaction === 'GET /[param]/withInitialProps' &&
1515
transactionEvent.contexts?.trace?.op === 'http.server'
1616
);
1717
});
@@ -47,7 +47,7 @@ test('should propagate serverside `getInitialProps` trace to client', async ({ p
4747
status: 'ok',
4848
},
4949
},
50-
transaction: '/[param]/withInitialProps',
50+
transaction: 'GET /[param]/withInitialProps',
5151
transaction_info: {
5252
source: 'route',
5353
},

dev-packages/e2e-tests/test-applications/nextjs-13/tests/isomorphic/getServerSideProps.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('Should record performance for getServerSideProps', async ({ page }) => {
1111

1212
const serverTransactionPromise = waitForTransaction('nextjs-13', async transactionEvent => {
1313
return (
14-
transactionEvent.transaction === '/[param]/withServerSideProps' &&
14+
transactionEvent.transaction === 'GET /[param]/withServerSideProps' &&
1515
transactionEvent.contexts?.trace?.op === 'http.server'
1616
);
1717
});
@@ -47,7 +47,7 @@ test('Should record performance for getServerSideProps', async ({ page }) => {
4747
status: 'ok',
4848
},
4949
},
50-
transaction: '/[param]/withServerSideProps',
50+
transaction: 'GET /[param]/withServerSideProps',
5151
transaction_info: {
5252
source: 'route',
5353
},
Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect, test } from '@playwright/test';
22
import { waitForTransaction } from '@sentry-internal/test-utils';
33

4-
test('should not automatically create transactions for routes that were excluded from auto wrapping (string)', async ({
4+
test('should not apply build-time instrumentation for routes that were excluded from auto wrapping (string)', async ({
55
request,
66
}) => {
77
const transactionPromise = waitForTransaction('nextjs-13', async transactionEvent => {
@@ -13,17 +13,13 @@ test('should not automatically create transactions for routes that were excluded
1313

1414
expect(await (await request.get(`/api/endpoint-excluded-with-string`)).text()).toBe('{"success":true}');
1515

16-
let transactionPromiseReceived = false;
17-
transactionPromise.then(() => {
18-
transactionPromiseReceived = true;
19-
});
20-
21-
await new Promise(resolve => setTimeout(resolve, 5_000));
16+
const transaction = await transactionPromise;
2217

23-
expect(transactionPromiseReceived).toBe(false);
18+
expect(transaction.contexts?.trace?.data?.['sentry.origin']).toBeDefined();
19+
expect(transaction.contexts?.trace?.data?.['sentry.origin']).not.toBe('auto.http.nextjs'); // This is the origin set by the build time instrumentation
2420
});
2521

26-
test('should not automatically create transactions for routes that were excluded from auto wrapping (regex)', async ({
22+
test('should not apply build-time instrumentation for routes that were excluded from auto wrapping (regex)', async ({
2723
request,
2824
}) => {
2925
const transactionPromise = waitForTransaction('nextjs-13', async transactionEvent => {
@@ -35,12 +31,8 @@ test('should not automatically create transactions for routes that were excluded
3531

3632
expect(await (await request.get(`/api/endpoint-excluded-with-regex`)).text()).toBe('{"success":true}');
3733

38-
let transactionPromiseReceived = false;
39-
transactionPromise.then(() => {
40-
transactionPromiseReceived = true;
41-
});
42-
43-
await new Promise(resolve => setTimeout(resolve, 5_000));
34+
const transaction = await transactionPromise;
4435

45-
expect(transactionPromiseReceived).toBe(false);
36+
expect(transaction.contexts?.trace?.data?.['sentry.origin']).toBeDefined();
37+
expect(transaction.contexts?.trace?.data?.['sentry.origin']).not.toBe('auto.http.nextjs'); // This is the origin set by the build time instrumentation
4638
});

0 commit comments

Comments
 (0)