Skip to content

Commit b986eae

Browse files
authored
Merge pull request #8754 from getsentry/prepare-release/7.62.0
meta: Update CHANGELOG for version 7.62.0
2 parents aec068c + 9070e3e commit b986eae

File tree

115 files changed

+1688
-1189
lines changed

Some content is hidden

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

115 files changed

+1688
-1189
lines changed

.craft.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
minVersion: '0.23.1'
22
changelogPolicy: simple
33
preReleaseCommand: bash scripts/craft-pre-release.sh
4+
statusProvider:
5+
name: github
6+
config:
7+
contexts:
8+
- job_required_jobs_passed
49
targets:
510
# NPM Targets
611
## 1. Base Packages, node or browser SDKs depend on

.github/workflows/build.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ jobs:
599599
needs: [job_get_metadata, job_build]
600600
if: needs.job_get_metadata.outputs.changed_browser == 'true' || github.event_name != 'pull_request'
601601
runs-on: ubuntu-20.04
602-
timeout-minutes: 10
602+
timeout-minutes: 20
603603
strategy:
604604
fail-fast: false
605605
matrix:
@@ -855,8 +855,8 @@ jobs:
855855
timeout-minutes: 5
856856
run: yarn test:assert
857857

858-
job_required_tests:
859-
name: All required tests passed or skipped
858+
job_required_jobs_passed:
859+
name: All required jobs passed or were skipped
860860
needs:
861861
[
862862
job_build,
@@ -870,6 +870,9 @@ jobs:
870870
job_browser_loader_tests,
871871
job_remix_integration_tests,
872872
job_e2e_tests,
873+
job_artifacts,
874+
job_lint,
875+
job_circular_dep_check,
873876
]
874877
# Always run this, even if a dependent job failed
875878
if: always()

CHANGELOG.md

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

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

7+
## 7.62.0
8+
9+
### Important Changes
10+
11+
- **feat(integrations): Add `ContextLines` integration for html-embedded JS stack frames (#8699)**
12+
13+
This release adds the `ContextLines` integration as an optional integration for the Browser SDKs to `@sentry/integrations`.
14+
15+
This integration adds source code from inline JavaScript of the current page's HTML (e.g. JS in `<script>` tags) to stack traces of captured errors.
16+
It _can't_ collect source code from assets referenced by your HTML (e.g. `<script src="..." />`).
17+
18+
The `ContextLines` integration is useful when you have inline JS code in HTML pages that can't be accessed by Sentry's backend, for example, due to a login-protected page.
19+
20+
```js
21+
import { ContextLines } from "@sentry/integrations";
22+
23+
Sentry.init({
24+
// ...
25+
integrations: [
26+
new ContextLines({
27+
// The number of lines to collect before and after each stack frame's line number
28+
// Defaults to 7
29+
frameContextLines: 7,
30+
}),
31+
],
32+
});
33+
```
34+
35+
### Other Changes
36+
37+
- fix(nextjs): Make all wrappers isomorphic and available in all runtimes (#8743)
38+
- fix(replay): Cancel debounce when replay is too short/long (#8742)
39+
- fix(utils): `dirname` and `basename` should handle Windows paths (#8737)
40+
- ref: Hoist `flush`, `close`, and `lastEventId` into `@sentry/core` (#8731)
41+
- ref(node): Don't call `JSON.stringify` on prisma client when logging (#8745)
42+
743
## 7.61.1
844

945
- feat(nextjs): Add `AsyncLocalStorage` async context strategy to edge SDK (#8720)

packages/browser-integration-tests/suites/integrations/Breadcrumbs/fetch/get/test.ts

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

7-
sentryTest('captures Breadcrumb for basic GET request', async ({ getLocalTestPath, page }) => {
8-
const url = await getLocalTestPath({ testDir: __dirname });
7+
sentryTest('captures Breadcrumb for basic GET request', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
99

1010
await page.route('**/foo', route => {
1111
return route.fulfill({

packages/browser-integration-tests/suites/integrations/Breadcrumbs/fetch/post/test.ts

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

7-
sentryTest('captures Breadcrumb for POST request', async ({ getLocalTestPath, page }) => {
8-
const url = await getLocalTestPath({ testDir: __dirname });
7+
sentryTest('captures Breadcrumb for POST request', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
99

1010
await page.route('**/foo', route => {
1111
return route.fulfill({

packages/browser-integration-tests/suites/integrations/Breadcrumbs/xhr/get/test.ts

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

7-
sentryTest('captures Breadcrumb for basic GET request', async ({ getLocalTestPath, page }) => {
8-
const url = await getLocalTestPath({ testDir: __dirname });
7+
sentryTest('captures Breadcrumb for basic GET request', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
99

1010
await page.route('**/foo', route => {
1111
return route.fulfill({

packages/browser-integration-tests/suites/integrations/Breadcrumbs/xhr/post/test.ts

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

7-
sentryTest('captures Breadcrumb for POST request', async ({ getLocalTestPath, page }) => {
8-
const url = await getLocalTestPath({ testDir: __dirname });
7+
sentryTest('captures Breadcrumb for POST request', async ({ getLocalTestUrl, page }) => {
8+
const url = await getLocalTestUrl({ testDir: __dirname });
99

1010
await page.route('**/foo', route => {
1111
return route.fulfill({
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as Sentry from '@sentry/browser';
2+
import { ContextLines } from '@sentry/integrations';
3+
4+
window.Sentry = Sentry;
5+
6+
Sentry.init({
7+
dsn: 'https://[email protected]/1337',
8+
integrations: [new ContextLines()],
9+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
</head>
6+
<body>
7+
<button id="inline-error-btn" onclick="throw new Error('Error with context lines')">Click me</button>
8+
</body>
9+
<footer>
10+
Some text...
11+
</foot>
12+
</html>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { expect } from '@playwright/test';
2+
3+
import { sentryTest } from '../../../../utils/fixtures';
4+
import { envelopeRequestParser, waitForErrorRequestOnUrl } from '../../../../utils/helpers';
5+
6+
sentryTest(
7+
'should add source context lines around stack frames from errors in Html inline JS',
8+
async ({ getLocalTestPath, page, browserName }) => {
9+
if (browserName === 'webkit') {
10+
// The error we're throwing in this test is thrown as "Script error." in Webkit.
11+
// We filter "Script error." out by default in `InboundFilters`.
12+
// I don't think there's much value to disable InboundFilters defaults for this test,
13+
// given that most of our users won't do that either.
14+
// Let's skip it instead for Webkit.
15+
sentryTest.skip();
16+
}
17+
18+
const url = await getLocalTestPath({ testDir: __dirname });
19+
20+
const eventReqPromise = waitForErrorRequestOnUrl(page, url);
21+
22+
const clickPromise = page.click('#inline-error-btn');
23+
24+
const [req] = await Promise.all([eventReqPromise, clickPromise]);
25+
26+
const eventData = envelopeRequestParser(req);
27+
28+
expect(eventData.exception?.values).toHaveLength(1);
29+
30+
const exception = eventData.exception?.values?.[0];
31+
32+
expect(exception).toMatchObject({
33+
stacktrace: {
34+
frames: [
35+
{
36+
pre_context: ['<!DOCTYPE html>', '<html>', '<head>', ' <meta charset="utf-8">', ' </head>', ' <body>'],
37+
context_line:
38+
' <button id="inline-error-btn" onclick="throw new Error(\'Error with context lines\')">Click me</button>',
39+
post_context: [
40+
expect.stringContaining('<script'), // this line varies in the test based on tarball/cdn bundle (+variants)
41+
' <footer>',
42+
' Some text...',
43+
' ',
44+
'',
45+
'</footer></body>',
46+
'</html>',
47+
],
48+
},
49+
],
50+
},
51+
});
52+
},
53+
);

0 commit comments

Comments
 (0)