Skip to content

Commit e10e477

Browse files
authored
Merge branch 'develop' into jb/pkg/profiling-node
2 parents 8fa4055 + c981524 commit e10e477

File tree

90 files changed

+1518
-771
lines changed

Some content is hidden

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

90 files changed

+1518
-771
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145
146146
- name: Get PR labels
147147
id: pr-labels
148-
uses: mydea/pr-labels-action@update-core
148+
uses: mydea/pr-labels-action@fn/bump-node20
149149

150150
outputs:
151151
commit_label: '${{ env.COMMIT_SHA }}: ${{ env.COMMIT_MESSAGE }}'
@@ -592,14 +592,13 @@ jobs:
592592
name: Playwright (${{ matrix.bundle }}) Tests
593593
needs: [job_get_metadata, job_build]
594594
if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
595-
runs-on: ubuntu-20.04
595+
runs-on: ubuntu-20.04-large-js
596596
timeout-minutes: 25
597597
strategy:
598598
fail-fast: false
599599
matrix:
600600
bundle:
601601
- esm
602-
- cjs
603602
- bundle_es5
604603
- bundle_es5_min
605604
- bundle_es6
@@ -714,7 +713,7 @@ jobs:
714713
name: Browser (${{ matrix.browser }}) Tests
715714
needs: [job_get_metadata, job_build]
716715
if: needs.job_get_metadata.outputs.changed_browser == 'true' || github.event_name != 'pull_request'
717-
runs-on: ubuntu-20.04
716+
runs-on: ubuntu-20.04-large-js
718717
timeout-minutes: 20
719718
strategy:
720719
fail-fast: false
@@ -884,7 +883,7 @@ jobs:
884883
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
885884
github.actor != 'dependabot[bot]'
886885
needs: [job_get_metadata, job_build, job_compile_bindings_profiling_node]
887-
runs-on: ubuntu-20.04
886+
runs-on: ubuntu-20.04-large-js
888887
timeout-minutes: 15
889888
steps:
890889
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
@@ -1009,6 +1008,9 @@ jobs:
10091008
uses: actions/setup-node@v4
10101009
with:
10111010
node-version-file: 'dev-packages/e2e-tests/package.json'
1011+
- name: Set up Bun
1012+
if: matrix.test-application == 'node-exports-test-app'
1013+
uses: oven-sh/setup-bun@v1
10121014
- name: Restore caches
10131015
uses: ./.github/actions/restore-cache
10141016
env:

CHANGELOG.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,43 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 7.99.0
8+
9+
### Important Changes
10+
11+
#### Deprecations
12+
13+
This release includes some deprecations for span related methods and integrations in our Deno SDK, `@sentry/deno`. For
14+
more details please look at our
15+
[migration guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md).
16+
17+
- feat(core): Deprecate `Span.setHttpStatus` in favor of `setHttpStatus` (#10268)
18+
- feat(core): Deprecate `spanStatusfromHttpCode` in favour of `getSpanStatusFromHttpCode` (#10361)
19+
- feat(core): Deprecate `StartSpanOptions.origin` in favour of passing attribute (#10274)
20+
- feat(deno): Expose functional integrations to replace classes (#10355)
21+
22+
### Other Changes
23+
24+
- feat(bun): Add missing `@sentry/node` re-exports (#10396)
25+
- feat(core): Add `afterAllSetup` hook for integrations (#10345)
26+
- feat(core): Ensure `startSpan()` can handle spans that require parent (#10386)
27+
- feat(core): Read propagation context off scopes in `startSpan` APIs (#10300)
28+
- feat(remix): Export missing `@sentry/node` functions (#10385, #10391)
29+
- feat(serverless): Add missing `@sentry/node` re-exports (#10390)
30+
- feat(sveltekit): Add more missing `@sentry/node` re-exports (#10392)
31+
- feat(tracing): Export proper type for browser tracing (#10411)
32+
- feat(tracing): Expose new `browserTracingIntegration` (#10351)
33+
- fix: Ensure `afterAllSetup` is called when using `addIntegration()` (#10372)
34+
- fix(core): Export `spanToTraceContext` function from span utils (#10364)
35+
- fix(core): Make `FunctionToString` integration use SETUP_CLIENTS weakmap (#10358)
36+
- fix(deno): Call function if client is not setup (#10354)
37+
- fix(react): Fix attachReduxState option (#10381)
38+
- fix(spotlight): Use unpatched http.request (#10369)
39+
- fix(tracing): Only create request span if there is active span (#10375)
40+
- ref: Read propagation context off of scope and isolation scope when propagating and applying trace context (#10297)
41+
42+
Work in this release contributed by @AleshaOleg. Thank you for your contribution!
43+
744
## 7.98.0
845

946
This release primarily fixes some type declaration errors:
@@ -20,7 +57,7 @@ Note: The 7.96.0 release was incomplete. This release is partially encompassing
2057

2158
## 7.96.0
2259

23-
Note: This release was incomplete. Not all Sentry SDK packages were released for this version. Please upgrade to 7.97.0
60+
Note: This release was incomplete. Not all Sentry SDK packages were released for this version. Please upgrade to 7.98.0
2461
directly.
2562

2663
### Important Changes

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ convenient interface and improved consistency between various JavaScript environ
3232
- [Supported Platforms](#supported-platforms)
3333
- [Installation and Usage](#installation-and-usage)
3434
- [Other Packages](#other-packages)
35+
- [Bug Bounty Program](#bug-bounty-program)
3536

3637
## Supported Platforms
3738

@@ -104,3 +105,13 @@ below:
104105
utility functions useful for various SDKs.
105106
- [`@sentry/types`](https://github.com/getsentry/sentry-javascript/tree/master/packages/types): Types used in all
106107
packages.
108+
109+
## Bug Bounty Program
110+
111+
Our bug bounty program aims to improve the security of our open source projects by encouraging the community to identify
112+
and report potential security vulnerabilities. Your reward will depend on the severity of the identified vulnerability.
113+
114+
Our program is currently running on an invitation basis. If you're interested in participating, please send us an email
115+
to [email protected] and tell us, that you are interested in auditing this repository.
116+
117+
For more details, please have a look at https://sentry.io/security/#vulnerability-disclosure.

dev-packages/browser-integration-tests/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "7.98.0",
3+
"version": "7.99.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -47,8 +47,8 @@
4747
"@babel/preset-typescript": "^7.16.7",
4848
"@playwright/test": "^1.40.1",
4949
"@sentry-internal/rrweb": "2.9.0",
50-
"@sentry/browser": "7.98.0",
51-
"@sentry/tracing": "7.98.0",
50+
"@sentry/browser": "7.99.0",
51+
"@sentry/tracing": "7.99.0",
5252
"axios": "1.6.0",
5353
"babel-loader": "^8.2.2",
5454
"html-webpack-plugin": "^5.5.0",

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/interactions/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ sentryTest('should capture interaction transaction. @firefox', async ({ browserN
5151
expect(interactionSpan.timestamp).toBeDefined();
5252

5353
const interactionSpanDuration = (interactionSpan.timestamp! - interactionSpan.start_timestamp) * 1000;
54-
expect(interactionSpanDuration).toBeGreaterThan(70);
54+
expect(interactionSpanDuration).toBeGreaterThan(65);
5555
expect(interactionSpanDuration).toBeLessThan(200);
5656
});
5757

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
// disable pageload transaction
8+
integrations: [Sentry.BrowserTracing({ tracingOrigins: ['http://example.com'], startTransactionOnPageLoad: false })],
9+
tracesSampleRate: 1,
10+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fetch('http://example.com/0').then(fetch('http://example.com/1').then(fetch('http://example.com/2')));
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { envelopeUrlRegex, shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
sentryTest(
7+
'there should be no span created for fetch requests with no active span',
8+
async ({ getLocalTestPath, page }) => {
9+
if (shouldSkipTracingTest()) {
10+
sentryTest.skip();
11+
}
12+
13+
const url = await getLocalTestPath({ testDir: __dirname });
14+
15+
let requestCount = 0;
16+
page.on('request', request => {
17+
expect(envelopeUrlRegex.test(request.url())).toBe(false);
18+
requestCount++;
19+
});
20+
21+
await page.goto(url);
22+
23+
// Here are the requests that should exist:
24+
// 1. HTML page
25+
// 2. Init JS bundle
26+
// 3. Subject JS bundle
27+
// 4 [OPTIONAl] CDN JS bundle
28+
// and then 3 fetch requests
29+
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_')) {
30+
expect(requestCount).toBe(7);
31+
} else {
32+
expect(requestCount).toBe(6);
33+
}
34+
},
35+
);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
// disable pageload transaction
8+
integrations: [Sentry.BrowserTracing({ tracingOrigins: ['http://example.com'], startTransactionOnPageLoad: false })],
9+
tracesSampleRate: 1,
10+
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const xhr_1 = new XMLHttpRequest();
2+
xhr_1.open('GET', 'http://example.com/0');
3+
xhr_1.send();
4+
5+
const xhr_2 = new XMLHttpRequest();
6+
xhr_2.open('GET', 'http://example.com/1');
7+
xhr_2.send();
8+
9+
const xhr_3 = new XMLHttpRequest();
10+
xhr_3.open('GET', 'http://example.com/2');
11+
xhr_3.send();
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { envelopeUrlRegex, shouldSkipTracingTest } from '../../../../utils/helpers';
5+
6+
sentryTest(
7+
'there should be no span created for xhr requests with no active span',
8+
async ({ getLocalTestPath, page }) => {
9+
if (shouldSkipTracingTest()) {
10+
sentryTest.skip();
11+
}
12+
13+
const url = await getLocalTestPath({ testDir: __dirname });
14+
15+
let requestCount = 0;
16+
page.on('request', request => {
17+
expect(envelopeUrlRegex.test(request.url())).toBe(false);
18+
requestCount++;
19+
});
20+
21+
await page.goto(url);
22+
23+
// Here are the requests that should exist:
24+
// 1. HTML page
25+
// 2. Init JS bundle
26+
// 3. Subject JS bundle
27+
// 4 [OPTIONAl] CDN JS bundle
28+
// and then 3 fetch requests
29+
if (process.env.PW_BUNDLE && process.env.PW_BUNDLE.startsWith('bundle_')) {
30+
expect(requestCount).toBe(7);
31+
} else {
32+
expect(requestCount).toBe(6);
33+
}
34+
},
35+
);

dev-packages/browser-integration-tests/utils/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Page, Request } from '@playwright/test';
22
import type { EnvelopeItemType, Event, EventEnvelopeHeaders } from '@sentry/types';
33

4-
const envelopeUrlRegex = /\.sentry\.io\/api\/\d+\/envelope\//;
4+
export const envelopeUrlRegex = /\.sentry\.io\/api\/\d+\/envelope\//;
55

66
export const envelopeParser = (request: Request | null): unknown[] => {
77
// https://develop.sentry.dev/sdk/envelopes/

dev-packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/e2e-tests",
3-
"version": "7.98.0",
3+
"version": "7.99.0",
44
"license": "MIT",
55
"private": true,
66
"scripts": {

dev-packages/e2e-tests/test-applications/node-exports-test-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"build": "tsc",
8-
"start": "pnpm build && node dist/consistentExports.js",
9-
"test": " node dist/consistentExports.js",
8+
"start": "pnpm build && bun run ./dist/consistentExports.js",
9+
"test": " bun run ./dist/consistentExports.js",
1010
"clean": "npx rimraf node_modules,pnpm-lock.yaml,dist",
1111
"test:build": "pnpm install && pnpm build",
1212
"test:assert": "pnpm test"

dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as SentryAstro from '@sentry/astro';
2-
// import * as SentryBun from '@sentry/bun';
2+
import * as SentryBun from '@sentry/bun';
33
import * as SentryNextJs from '@sentry/nextjs';
44
import * as SentryNode from '@sentry/node';
55
import * as SentryRemix from '@sentry/remix';
@@ -11,7 +11,7 @@ const NODE_EXPORTS_IGNORE = [
1111
'default',
1212
// Probably generated by transpilation, no need to require it
1313
'__esModule',
14-
// this function was deprecates almost immediately after it was introduced
14+
// this function was deprecated almost immediately after it was introduced
1515
// due to a name change (startSpan). No need to re-export it IMHO.
1616
'startActiveSpan',
1717
// this was never meant for external use (and documented as such)
@@ -22,8 +22,6 @@ const NODE_EXPORTS_IGNORE = [
2222
'DebugSession',
2323
'AnrIntegrationOptions',
2424
'LocalVariablesIntegrationOptions',
25-
// deprecated
26-
'spanStatusfromHttpCode',
2725
];
2826

2927
type Dependent = {
@@ -38,40 +36,35 @@ const DEPENDENTS: Dependent[] = [
3836
package: '@sentry/astro',
3937
exports: Object.keys(SentryAstro),
4038
},
39+
{
40+
package: '@sentry/bun',
41+
exports: Object.keys(SentryBun),
42+
ignoreExports: [
43+
// not supported in bun:
44+
'Handlers',
45+
'NodeClient',
46+
'hapiErrorPlugin',
47+
'makeNodeTransport',
48+
],
49+
},
4150
{
4251
package: '@sentry/nextjs',
4352
// Next.js doesn't require explicit exports, so we can just merge top level and `default` exports:
4453
// @ts-expect-error: `default` is not in the type definition but it's defined
4554
exports: Object.keys({ ...SentryNextJs, ...SentryNextJs.default }),
46-
ignoreExports: ['withSentryConfig'],
4755
},
4856
{
4957
package: '@sentry/remix',
5058
exports: Object.keys(SentryRemix),
51-
// TODO: Fix exports in remix
52-
skip: true,
5359
},
5460
{
5561
package: '@sentry/serverless',
5662
exports: Object.keys(SentryServerless),
57-
ignoreExports: [
58-
// Deprecated, no need to add this now to serverless
59-
'extractTraceparentData',
60-
'getModuleFromFilename',
61-
// TODO: Should these be exported from serverless?
62-
'cron',
63-
'enableAnrDetection',
64-
'runWithAsyncContext',
65-
'hapiErrorPlugin',
66-
],
67-
// TODO: Fix exports in serverless
68-
skip: true,
63+
ignoreExports: ['cron', 'hapiErrorPlugin', 'enableAnrDetection'],
6964
},
7065
{
7166
package: '@sentry/sveltekit',
7267
exports: Object.keys(SentrySvelteKit),
73-
// TODO: Fix exports in sveltekit
74-
skip: true,
7568
},
7669
];
7770

dev-packages/node-integration-tests/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/node-integration-tests",
3-
"version": "7.98.0",
3+
"version": "7.99.0",
44
"license": "MIT",
55
"engines": {
66
"node": ">=10"
@@ -29,9 +29,9 @@
2929
"dependencies": {
3030
"@hapi/hapi": "^20.3.0",
3131
"@prisma/client": "3.15.2",
32-
"@sentry/node": "7.98.0",
33-
"@sentry/tracing": "7.98.0",
34-
"@sentry/types": "7.98.0",
32+
"@sentry/node": "7.99.0",
33+
"@sentry/tracing": "7.99.0",
34+
"@sentry/types": "7.99.0",
3535
"@types/mongodb": "^3.6.20",
3636
"@types/mysql": "^2.15.21",
3737
"@types/pg": "^8.6.5",

dev-packages/overhead-metrics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
3-
"version": "7.98.0",
3+
"version": "7.99.0",
44
"name": "@sentry-internal/overhead-metrics",
55
"main": "index.js",
66
"author": "Sentry",

0 commit comments

Comments
 (0)