Skip to content

Commit 57ef36c

Browse files
committed
Merge branch 'cl/screenshot-integration' into ryan953/feedback-async
2 parents 2ff3795 + b03f61a commit 57ef36c

File tree

790 files changed

+19350
-14052
lines changed

Some content is hidden

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

790 files changed

+19350
-14052
lines changed

.craft.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ targets:
136136
includeNames: /^sentry-internal-eslint-config-sdk-\d.*\.tgz$/
137137

138138
## 8. Deprecated packages we still release (but no packages depend on them anymore)
139+
- name: npm
140+
id: '@sentry/hub'
141+
includeNames: /^sentry-hub-\d.*\.tgz$/
139142
- name: npm
140143
id: '@sentry/tracing'
141144
includeNames: /^sentry-tracing-\d.*\.tgz$/

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module.exports = {
2222
'test/manual/**',
2323
'types/**',
2424
],
25+
reportUnusedDisableDirectives: true,
2526
overrides: [
2627
{
2728
files: ['*.ts', '*.tsx', '*.d.ts'],

.github/CANARY_FAILURE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
title: '{{ env.TITLE }}'
3-
labels: 'Type: Tests'
3+
labels: 'Type: Tests, Waiting for: Product Owner'
44
---
55
Canary tests failed: {{ env.RUN_LINK }}

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ jobs:
517517
518518
job_node_unit_tests:
519519
name: Node (${{ matrix.node }}) Unit Tests
520-
if: needs.job_get_metadata.outputs.changed_node == 'true' || github.event_name != 'pull_request'
521520
needs: [job_get_metadata, job_build]
522521
timeout-minutes: 10
523522
runs-on: ubuntu-20.04
@@ -901,6 +900,7 @@ jobs:
901900
- name: Run integration tests
902901
env:
903902
NODE_VERSION: ${{ matrix.node }}
903+
TS_VERSION: ${{ matrix.typescript }}
904904
run: |
905905
cd dev-packages/node-integration-tests
906906
yarn test
@@ -1044,9 +1044,8 @@ jobs:
10441044
'node-express-app',
10451045
'create-react-app',
10461046
'create-next-app',
1047-
# disabling remix e2e tests because of flakes
1048-
# 'create-remix-app',
1049-
# 'create-remix-app-v2',
1047+
'create-remix-app',
1048+
'create-remix-app-v2',
10501049
'debug-id-sourcemaps',
10511050
'nextjs-app-dir',
10521051
'nextjs-14',
@@ -1058,7 +1057,8 @@ jobs:
10581057
'sveltekit-2',
10591058
'generic-ts3.8',
10601059
'node-experimental-fastify-app',
1061-
'node-hapi-app',
1060+
# TODO(v8): Re-enable hapi tests
1061+
# 'node-hapi-app',
10621062
'node-exports-test-app',
10631063
'vue-3'
10641064
]

.github/workflows/flaky-test-detector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
list-files: json
7878
filters: |
79-
browser_integration: dev-packages/browser-integration-tests/suites/**
79+
browser_integration: dev-packages/browser-integration-tests/suites/**/test.ts
8080
8181
- name: Detect flaky tests
8282
run: yarn test:detect-flaky

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@
44

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

7+
## 7.101.0
8+
9+
- feat: Export semantic attribute keys from SDK packages (#10637)
10+
- feat(core): Add metric summaries to spans (#10554)
11+
- feat(core): Deprecate the `Hub` constructor (#10584)
12+
- feat(core): Make custom tracing methods return spans & set default op (#10633)
13+
- feat(replay): Add `getReplay` utility function (#10510)
14+
- fix(angular-ivy): Add `exports` field to `package.json` (#10569)
15+
- fix(sveltekit): Avoid capturing Http 4xx errors on the client (#10571)
16+
- fix(sveltekit): Properly await sourcemaps flattening (#10602)
17+
18+
## 7.100.1
19+
20+
This release contains build fixes for profiling-node.
21+
22+
- build(profiling-node): make sure debug build plugin is used #10534
23+
- build: Only run profiling e2e test if bindings have changed #10542
24+
- fix(feedback): Replay breadcrumb for feedback events was incorrect #10536
25+
726
## 7.100.0
827

928
### Important Changes

CODEOWNERS

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
packages/replay @getsentry/replay-sdk
2-
packages/replay-worker @getsentry/replay-sdk
3-
dev-packages/browser-integration-tests/suites/replay @getsentry/replay-sdk
1+
packages/replay @getsentry/replay-sdk-web
2+
packages/replay-worker @getsentry/replay-sdk-web
3+
packages/replay-canvas @getsentry/replay-sdk-web
4+
packages/feedback @getsentry/replay-sdk-web
5+
dev-packages/browser-integration-tests/suites/replay @getsentry/replay-sdk-web

MIGRATION.md

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# Upgrading from 7.x to 8.x
22

3+
## Removal of the `MetricsAggregator` integration class and `metricsAggregatorIntegration`
4+
5+
The SDKs now support metrics features without any additional configuration.
6+
7+
## Updated behaviour of `tracePropagationTargets` in the browser (HTTP tracing headers & CORS)
8+
9+
We updated the behaviour of the SDKs when no `tracePropagationTargets` option was defined. As a reminder, you can
10+
provide a list of strings or RegExes that will be matched against URLs to tell the SDK, to which outgoing requests
11+
tracing HTTP headers should be attached to. These tracing headers are used for distributed tracing.
12+
13+
Previously, on the browser, when `tracePropagationTargets` were not defined, they defaulted to the following:
14+
`['localhost', /^\/(?!\/)/]`. This meant that all request targets to that had "localhost" in the URL, or started with a
15+
`/` were equipped with tracing headers. This default was chosen to prevent CORS errors in your browser applications.
16+
However, this default had a few flaws.
17+
18+
Going forward, when the `tracePropagationTargets` option is not set, tracing headers will be attached to all outgoing
19+
requests on the same origin. For example, if you're on `https://example.com/` and you send a request to
20+
`https://example.com/api`, the request will be traced (ie. will have trace headers attached). Requests to
21+
`https://api.example.com/` will not, because it is on a different origin. The same goes for all applications running on
22+
`localhost`.
23+
24+
When you provide a `tracePropagationTargets` option, all of the entries you defined will now be matched be matched
25+
against the full URL of the outgoing request. Previously, it was only matched against what you called request APIs with.
26+
For example, if you made a request like `fetch("/api/posts")`, the provided `tracePropagationTargets` were only compared
27+
against `"/api/posts"`. Going forward they will be matched against the entire URL, for example, if you were on the page
28+
`https://example.com/` and you made the same request, it would be matched against `"https://example.com/api/posts"`.
29+
30+
But that is not all. Because it would be annoying having to create matchers for the entire URL, if the request is a
31+
same-origin request, we also match the `tracePropagationTargets` against the resolved `pathname` of the request.
32+
Meaning, a matcher like `/^\/api/` would match a request call like `fetch('/api/posts')`, or
33+
`fetch('https://same-origin.com/api/posts')` but not `fetch('https://different-origin.com/api/posts')`.
34+
35+
## Removal of the `tracingOrigins` option
36+
37+
After its deprecation in v7 the `tracingOrigins` option is now removed in favor of the `tracePropagationTargets` option.
38+
The `tracePropagationTargets` option should be set in the `Sentry.init()` options, or in your custom `Client`s option if
39+
you create them. The `tracePropagationTargets` option can no longer be set in the `browserTracingIntegration()` options.
40+
41+
## Dropping Support for React 15
42+
43+
Sentry will no longer officially support React 15 in version 8. This means that React 15.x will be removed
44+
from`@sentry/react`'s peer dependencies.
45+
346
## Removal of deprecated API in `@sentry/nextjs`
447

548
The following previously deprecated API has been removed from the `@sentry/nextjs` package:
@@ -16,6 +59,11 @@ The following previously deprecated API has been removed from the `@sentry/nextj
1659
- `IS_BUILD`
1760
- `isBuild`
1861

62+
## Removal of `Span` class export from SDK packages
63+
64+
In v8, we are no longer exporting the `Span` class from SDK packages (e.g. `@sentry/browser` or `@sentry/node`).
65+
Internally, this class is now called `SentrySpan`, and it is no longer meant to be used by users directly.
66+
1967
## Removal of Severity Enum
2068

2169
In v7 we deprecated the `Severity` enum in favor of using the `SeverityLevel` type. In v8 we removed the `Severity`
@@ -27,9 +75,36 @@ enum. If you were using the `Severity` enum, you should replace it with the `Sev
2775
The `Offline` integration has been removed in favor of the offline transport wrapper:
2876
http://docs.sentry.io/platforms/javascript/configuration/transports/#offline-caching
2977

30-
## Other changes
78+
## Removal of `enableAnrDetection` and `Anr` class (##10562)
79+
80+
The `enableAnrDetection` and `Anr` class have been removed. See the
81+
[docs](https://docs.sentry.io/platforms/node/configuration/application-not-responding/) for more details how to migrate
82+
to `anrIntegration`, the new integration for ANR detection.
83+
84+
## Removal of `Sentry.configureScope` (#10565)
85+
86+
The top level `Sentry.configureScope` function has been removed. Instead, you should use the `Sentry.getCurrentScope()`
87+
to access and mutate the current scope.
88+
89+
## Deletion of `@sentry/hub` package (#10530)
90+
91+
`@sentry/hub` has been removed. All exports from `@sentry.hub` should be available in `@sentry/core`.
92+
93+
## Removal of `makeXHRTransport` transport (#10703)
94+
95+
The `makeXHRTransport` transport has been removed. Only `makeFetchTransport` is available now. This means that the
96+
Sentry SDK requires the fetch API to be available in the environment.
97+
98+
## General API Changes
3199

100+
- The minumum supported Node version for all the SDK packages is Node 14 (#10527)
32101
- Remove `spanStatusfromHttpCode` in favour of `getSpanStatusFromHttpCode` (#10361)
102+
- Remove deprecated `deepReadDirSync` export from `@sentry/node` (#10564)
103+
- Remove `_eventFromIncompleteOnError` usage (#10553)
104+
- The `Transaction` integration in `@sentry/integrations` has been removed. There is no replacement API. (#10556)
105+
- `extraErrorDataIntegration` now looks at
106+
[`error.cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) by
107+
default.
33108

34109
# Deprecations in 7.x
35110

dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customBrowserTracing/init.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ Sentry.onLoad(function () {
44
Sentry.init({
55
integrations: [
66
// Without this syntax, this will be re-written by the test framework
7-
new window['Sentry'].BrowserTracing({
8-
tracePropagationTargets: ['http://localhost:1234'],
9-
}),
7+
window['Sentry'].browserTracingIntegration(),
108
],
9+
tracePropagationTargets: ['http://localhost:1234'],
1110
});
1211
});

dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customBrowserTracing/test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,4 @@ sentryTest('should handle custom added BrowserTracing integration', async ({ get
2525
expect(eventData.contexts?.trace?.op).toBe('pageload');
2626
expect(eventData.spans?.length).toBeGreaterThan(0);
2727
expect(eventData.transaction_info?.source).toEqual('url');
28-
29-
const tracePropagationTargets = await page.evaluate(() => {
30-
const browserTracing = (window as any).Sentry.getClient().getIntegrationByName('BrowserTracing');
31-
return browserTracing.options.tracePropagationTargets;
32-
});
33-
34-
expect(tracePropagationTargets).toEqual(['http://localhost:1234']);
3528
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@sentry-internal/rrweb": "2.11.0",
5050
"@sentry/browser": "7.100.0",
5151
"@sentry/tracing": "7.100.0",
52-
"axios": "1.6.0",
52+
"axios": "1.6.7",
5353
"babel-loader": "^8.2.2",
5454
"html-webpack-plugin": "^5.5.0",
5555
"pako": "^2.1.0",

dev-packages/browser-integration-tests/suites/feedback/captureFeedback/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ sentryTest('should capture feedback (@sentry-internal/feedback import)', async (
4444
const feedbackEvent = envelopeRequestParser((await feedbackRequestPromise).request());
4545
expect(feedbackEvent).toEqual({
4646
type: 'feedback',
47+
breadcrumbs: expect.any(Array),
4748
contexts: {
4849
feedback: {
4950
contact_email: '[email protected]',

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackAndReplay/test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ sentryTest('should capture feedback (@sentry-internal/feedback import)', async (
5050

5151
expect(breadcrumbs).toEqual(
5252
expect.arrayContaining([
53-
{
53+
expect.objectContaining({
5454
category: 'sentry.feedback',
5555
data: { feedbackId: expect.any(String) },
56-
},
56+
}),
5757
]),
5858
);
5959

6060
expect(feedbackEvent).toEqual({
6161
type: 'feedback',
62+
breadcrumbs: expect.any(Array),
6263
contexts: {
6364
feedback: {
6465
contact_email: '[email protected]',

dev-packages/browser-integration-tests/suites/integrations/Breadcrumbs/dom/click/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ sentryTest(
7878

7979
await page.goto(url);
8080
await page.locator('#annotated-button').click();
81-
await page.evaluate('Sentry.captureException("test exception")');
8281

83-
const eventData = await promise;
82+
const [eventData] = await Promise.all([promise, page.evaluate('Sentry.captureException("test exception")')]);
8483

8584
expect(eventData.breadcrumbs).toEqual([
8685
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as Sentry from '@sentry/browser';
2-
import { ContextLines } from '@sentry/integrations';
2+
import { contextLinesIntegration } from '@sentry/integrations';
33

44
window.Sentry = Sentry;
55

66
Sentry.init({
77
dsn: 'https://[email protected]/1337',
8-
integrations: [new ContextLines()],
8+
integrations: [contextLinesIntegration()],
99
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as Sentry from '@sentry/browser';
2-
import { HttpClient } from '@sentry/integrations';
2+
import { httpClientIntegration } from '@sentry/integrations';
33

44
window.Sentry = Sentry;
55

66
Sentry.init({
77
dsn: 'https://[email protected]/1337',
8-
integrations: [new HttpClient()],
8+
integrations: [httpClientIntegration()],
99
tracesSampleRate: 1,
1010
sendDefaultPii: true,
1111
});

dev-packages/browser-integration-tests/suites/integrations/httpclient/fetch/simple/test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import type { Event } from '@sentry/types';
44
import { sentryTest } from '../../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest } from '../../../../../utils/helpers';
66

7+
// This test rarely flakes with timeouts. The reason might be:
8+
// https://github.com/microsoft/playwright/issues/10376
79
sentryTest(
810
'should assign request and response context from a failed 500 fetch request',
911
async ({ getLocalTestPath, page }) => {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as Sentry from '@sentry/browser';
2-
import { HttpClient } from '@sentry/integrations';
2+
import { httpClientIntegration } from '@sentry/integrations';
33

44
window.Sentry = Sentry;
55

66
Sentry.init({
77
dsn: 'https://[email protected]/1337',
8-
integrations: [new HttpClient()],
8+
integrations: [httpClientIntegration()],
99
tracesSampleRate: 1,
1010
sendDefaultPii: true,
1111
});
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import * as Sentry from '@sentry/browser';
2+
3+
window.Sentry = Sentry;
4+
5+
Sentry.init({
6+
dsn: 'https://[email protected]/1337',
7+
});
8+
9+
Sentry.metrics.increment('increment');
10+
Sentry.metrics.increment('increment');
11+
Sentry.metrics.distribution('distribution', 42);
12+
Sentry.metrics.distribution('distribution', 45);
13+
Sentry.metrics.gauge('gauge', 5);
14+
Sentry.metrics.gauge('gauge', 15);
15+
Sentry.metrics.set('set', 'nope');
16+
Sentry.metrics.set('set', 'another');
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../utils/fixtures';
4+
import { getFirstSentryEnvelopeRequest, properEnvelopeRequestParser } from '../../utils/helpers';
5+
6+
sentryTest('collects metrics', async ({ getLocalTestUrl, page }) => {
7+
const url = await getLocalTestUrl({ testDir: __dirname });
8+
9+
const statsdBuffer = await getFirstSentryEnvelopeRequest<Uint8Array>(page, url, properEnvelopeRequestParser);
10+
const statsdString = new TextDecoder().decode(statsdBuffer);
11+
// Replace all the Txxxxxx to remove the timestamps
12+
const normalisedStatsdString = statsdString.replace(/T\d+\n?/g, 'T000000');
13+
14+
expect(normalisedStatsdString).toEqual(
15+
'increment@none:2|c|T000000distribution@none:42:45|d|T000000gauge@none:15:5:15:20:2|g|T000000set@none:3387254:3443787523|s|T000000',
16+
);
17+
});

dev-packages/browser-integration-tests/suites/public-api/configureScope/clear_scope/subject.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/public-api/configureScope/clear_scope/test.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

dev-packages/browser-integration-tests/suites/public-api/configureScope/init.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)