Skip to content

Commit e1f7b19

Browse files
authored
Merge pull request #7121 from getsentry/prepare-release/7.37.0
2 parents f7d1ee5 + c0a227f commit e1f7b19

File tree

13 files changed

+213
-123
lines changed

13 files changed

+213
-123
lines changed

.github/workflows/auto-release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Gitflow - Auto prepare release
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
branches:
7+
- master
8+
9+
# This workflow tirggers a release when merging a branch with the pattern `prepare-release/VERSION` into master.
10+
jobs:
11+
release:
12+
runs-on: ubuntu-20.04
13+
name: 'Prepare a new version'
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
token: ${{ secrets.GH_RELEASE_PAT }}
19+
fetch-depth: 0
20+
21+
# https://github.com/actions-ecosystem/action-regex-match
22+
- uses: actions-ecosystem/action-regex-match@v2
23+
id: version
24+
with:
25+
# Parse version from head branch
26+
text: ${{ github.head_ref }}
27+
# match: refs/heads/preprare-release/xx.xx.xx
28+
regex: '^refs\/heads\/preprare-release\/(\d+\.\d+\.\d+)$'
29+
30+
- name: Prepare release
31+
uses: getsentry/action-prepare-release@v1
32+
if: github.event.pull_request.merged == true && steps.version.outputs.match != ''
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
35+
with:
36+
version: ${{ steps.version.outputs.match != '' }}
37+
force: false
38+
merge_target: master

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ jobs:
137137
# Note: These next three have to be checked as strings ('true'/'false')!
138138
is_develop: ${{ github.ref == 'refs/heads/develop' }}
139139
is_release: ${{ startsWith(github.ref, 'refs/heads/release/') }}
140-
is_gitflow_sync: ${{ github.head_ref == 'refs/heads/develop' || github.head_ref == 'refs/heads/master' }}
140+
# When merging into master, or from master
141+
is_gitflow_sync: ${{ github.head_ref == 'refs/heads/master' || github.ref == 'refs/heads/master' }}
141142
has_gitflow_label:
142143
${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' Gitflow ') }}
143144
force_skip_cache:
@@ -468,7 +469,7 @@ jobs:
468469
strategy:
469470
fail-fast: false
470471
matrix:
471-
node: [10, 12, 14, 16, 18]
472+
node: [10, 12, 14, 16, '18.13.0']
472473
steps:
473474
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
474475
uses: actions/checkout@v3

.github/workflows/gitflow-sync-master.yml

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

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
- feat: Add source map debug ids (#7068)
1010
- feat(browser): Add IndexedDb offline transport store (#6983)
1111
- feat(nextjs): Add auto-wrapping for server components (#6953)
12+
- feat(nextjs): Improve client stack traces (#7097)
1213
- feat(replay): Improve rrweb error ignoring (#7087 & #7094)
1314
- feat(replay): Send client_report when replay sending fails (#7093)
1415
- fix(node): `LocalVariables`, Improve frame matching for ESM (#7049)
1516
- fix(node): Add lru cache to http integration span map (#7064)
17+
- fix(replay): Export Replay from Sentry namespace in full CDN bundle (#7119)
1618

1719
Work in this release contributed by @JamesHenry. Thank you for your contribution!
1820

docs/publishing-a-release.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ _These steps are only relevant to Sentry employees when preparing and publishing
66
**If you want to release a new SDK for the first time, be sure to follow the [New SDK Release Checklist](./new-sdk-release-checklist.md)**
77

88
1. Determine what version will be released (we use [semver](https://semver.org)).
9-
2. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release. (See details below.)
10-
a. Merging the Changelog PR will automatically trigger a sync from `develop` -> `master`
11-
3. Run the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) workflow.
12-
a. Wait for this until the sync to `master` is completed.
13-
4. A new issue should appear in https://github.com/getsentry/publish/issues.
14-
5. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release.
9+
2. Create a branch `prepare-release/VERSION`, eg. `prepare-release/7.37.0`, off develop
10+
3. Update [`CHANGELOG.md`](https://github.com/getsentry/sentry-javascript/edit/master/CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release. (See details below.)
11+
4. Create a PR towards `master` branch
12+
5. When the PR is merged, it will automatically trigger the [Prepare Release](https://github.com/getsentry/sentry-javascript/actions/workflows/release.yml) on master.
13+
6. A new issue should appear in https://github.com/getsentry/publish/issues.
14+
7. Ask a member of the [@getsentry/releases team](https://github.com/orgs/getsentry/teams/releases/members) to approve the release.
1515
a. Once the release is completed, a sync from `master` ->` develop` will be automatically triggered
1616

1717
## Updating the Changelog
1818

19-
1. Create a new branch.
19+
1. Create a new branch `prepare-release/VERSION` off of `develop`, e.g. `prepare-release/7.37.1`.
2020
2. Run `yarn changelog` and copy everything
2121
3. Create a new section in the changelog, deciding based on the changes whether it should be a minor bump or a patch release.
2222
4. Paste in the logs you copied earlier.
2323
5. Delete any which aren't user-facing changes.
2424
7. If any of the PRs are from external contributors, include underneath the commits `Work in this release contributed by <list of external contributors' GitHub usernames>. Thank you for your contributions!`. If there's only one external PR, don't forget to remove the final `s`. If there are three or more, use an Oxford comma. (It's in the Sentry styleguide!)
25-
8. Commit, push, and open a PR with the title `meta: Update changelog for <fill in relevant version here>` against `develop` branch.
25+
8. Commit, push, and open a PR with the title `meta(changelog): Update changelog for VERSION` against `master` branch.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@
109109
"typescript": "3.8.3"
110110
},
111111
"resolutions": {
112-
"**/agent-base": "5",
113-
"@types/express-serve-static-core": "4.17.30"
112+
"**/agent-base": "5"
114113
},
115114
"version": "0.0.0",
116115
"name": "sentry-javascript"

packages/nextjs/src/client/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,22 @@ function addClientIntegrations(options: BrowserOptions): void {
6969
// Filename wasn't a properly formed URL, so there's nothing we can do
7070
}
7171

72+
if (frame.filename && frame.filename.startsWith('app:///_next')) {
73+
// We need to URI-decode the filename because Next.js has wildcard routes like "/users/[id].js" which show up as "/users/%5id%5.js" in Error stacktraces.
74+
// The corresponding sources that Next.js generates have proper brackets so we also need proper brackets in the frame so that source map resolving works.
75+
frame.filename = decodeURI(frame.filename);
76+
}
77+
78+
if (
79+
frame.filename &&
80+
frame.filename.match(
81+
/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/,
82+
)
83+
) {
84+
// We don't care about these frames. It's Next.js internal code.
85+
frame.in_app = false;
86+
}
87+
7288
return frame;
7389
},
7490
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const ButtonPage = (): JSX.Element => (
2+
<button
3+
onClick={() => {
4+
throw new Error('Sentry Frontend Error');
5+
}}
6+
>
7+
Throw Error
8+
</button>
9+
);
10+
11+
export default ButtonPage;

packages/nextjs/test/integration/test/client/errorClick.test.ts

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Event } from '@sentry/types';
55
test('should capture error triggered on click', async ({ page }) => {
66
await page.goto('/errorClick');
77

8-
const [_, events] = await Promise.all([
8+
const [, events] = await Promise.all([
99
page.click('button'),
1010
getMultipleSentryEnvelopeRequests<Event>(page, 1, { envelopeType: 'event' }),
1111
]);
@@ -15,3 +15,45 @@ test('should capture error triggered on click', async ({ page }) => {
1515
value: 'Sentry Frontend Error',
1616
});
1717
});
18+
19+
test('should have a non-url-encoded top frame in route with parameter', async ({ page }) => {
20+
await page.goto('/some-param/errorClick');
21+
22+
const [, events] = await Promise.all([
23+
page.click('button'),
24+
getMultipleSentryEnvelopeRequests<Event>(page, 1, { envelopeType: 'event' }),
25+
]);
26+
27+
const frames = events[0]?.exception?.values?.[0].stacktrace?.frames;
28+
29+
expect(frames?.[frames.length - 1].filename).toMatch(/\/\[id\]\/errorClick-[a-f0-9]+\.js$/);
30+
});
31+
32+
test('should mark nextjs internal frames as `in_app`: false', async ({ page }) => {
33+
await page.goto('/some-param/errorClick');
34+
35+
const [, events] = await Promise.all([
36+
page.click('button'),
37+
getMultipleSentryEnvelopeRequests<Event>(page, 1, { envelopeType: 'event' }),
38+
]);
39+
40+
const frames = events[0]?.exception?.values?.[0].stacktrace?.frames;
41+
42+
expect(frames).toContainEqual(
43+
expect.objectContaining({
44+
filename: expect.stringMatching(
45+
/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/,
46+
),
47+
in_app: false,
48+
}),
49+
);
50+
51+
expect(frames).not.toContainEqual(
52+
expect.objectContaining({
53+
filename: expect.stringMatching(
54+
/^app:\/\/\/_next\/static\/chunks\/(main-|main-app-|polyfills-|webpack-|framework-|framework\.)[0-9a-f]+\.js$/,
55+
),
56+
in_app: true,
57+
}),
58+
);
59+
});

packages/node-integration-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@types/mongodb": "^3.6.20",
2626
"@types/mysql": "^2.15.21",
2727
"@types/pg": "^8.6.5",
28-
"apollo-server": "^3.6.7",
28+
"apollo-server": "^3.11.1",
2929
"axios": "^0.27.2",
3030
"cors": "^2.8.5",
3131
"express": "^4.17.3",

packages/tracing/src/index.bundle.replay.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { Replay } from '@sentry/browser';
22

33
import * as Sentry from './index.bundle';
44

5+
// TODO (v8): Remove this as it was only needed for backwards compatibility
6+
// We want replay to be available under Sentry.Replay, to be consistent
7+
// with the NPM package version.
58
Sentry.Integrations.Replay = Replay;
69

7-
export default Sentry;
10+
export { Replay };
11+
12+
export * from './index.bundle';

packages/tracing/test/index.bundle.replay.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Sentry from '../src/index.bundle.replay';
1+
import * as Sentry from '../src/index.bundle.replay';
22

33
// Because of the way how we re-export stuff for the replay bundle, we only have a single default export
44
const { Integrations } = Sentry;
@@ -15,5 +15,6 @@ describe('Integrations export', () => {
1515
});
1616

1717
expect(Integrations.Replay).toBeDefined();
18+
expect(Sentry.Replay).toBeDefined();
1819
});
1920
});

0 commit comments

Comments
 (0)