Skip to content

Commit f4861f8

Browse files
authored
Merge pull request #7758 from getsentry/prepare-release/7.47.0
meta: Update changelog for 7.47.0
2 parents beefbeb + 56268f9 commit f4861f8

File tree

142 files changed

+2746
-451
lines changed

Some content is hidden

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

142 files changed

+2746
-451
lines changed

.craft.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@ targets:
5252
onlyIfPresent: /^sentry-remix-\d.*\.tgz$/
5353
'npm:@sentry/svelte':
5454
onlyIfPresent: /^sentry-svelte-\d.*\.tgz$/
55+
'npm:@sentry/sveltekit':
56+
onlyIfPresent: /^sentry-sveltekit-\d.*\.tgz$/
5557
'npm:@sentry/opentelemetry-node':
5658
onlyIfPresent: /^sentry-opentelemetry-node-\d.*\.tgz$/

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ body:
4040
- '@sentry/remix'
4141
- '@sentry/serverless'
4242
- '@sentry/svelte'
43+
- '@sentry/sveltekit'
4344
- '@sentry/vue'
4445
- '@sentry/wasm'
4546
- Sentry Browser CDN bundle

.github/workflows/build.yml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
is_develop: ${{ github.ref == 'refs/heads/develop' }}
141141
is_release: ${{ startsWith(github.ref, 'refs/heads/release/') }}
142142
# When merging into master, or from master
143-
is_gitflow_sync: ${{ github.head_ref == 'refs/heads/master' || github.ref == 'refs/heads/master' }}
143+
is_gitflow_sync: ${{ github.head_ref == 'master' || github.ref == 'refs/heads/master' }}
144144
has_gitflow_label:
145145
${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' Gitflow ') }}
146146
force_skip_cache:
@@ -181,6 +181,21 @@ jobs:
181181
outputs:
182182
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
183183

184+
job_check_branches:
185+
name: Check PR branches
186+
needs: job_get_metadata
187+
runs-on: ubuntu-20.04
188+
if: github.event_name == 'pull_request'
189+
permissions:
190+
pull-requests: write
191+
steps:
192+
- name: PR is opened against master
193+
uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1
194+
if: ${{ github.base_ref == 'master' && !startsWith(github.ref, 'refs/heads/prepare-release/') }}
195+
with:
196+
message: |
197+
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
198+
184199
job_build:
185200
name: Build
186201
needs: [job_get_metadata, job_install_deps]
@@ -543,6 +558,60 @@ jobs:
543558
cd packages/browser-integration-tests
544559
yarn test:ci
545560
561+
job_browser_loader_tests:
562+
name: Playwright Loader (${{ matrix.bundle }}) Tests
563+
needs: [job_get_metadata, job_build]
564+
if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
565+
runs-on: ubuntu-20.04
566+
timeout-minutes: 15
567+
strategy:
568+
fail-fast: false
569+
matrix:
570+
bundle:
571+
- loader_base
572+
- loader_eager
573+
- loader_tracing
574+
- loader_replay
575+
- loader_tracing_replay
576+
577+
steps:
578+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
579+
uses: actions/checkout@v3
580+
with:
581+
ref: ${{ env.HEAD_COMMIT }}
582+
- name: Set up Node
583+
uses: volta-cli/action@v4
584+
- name: Restore caches
585+
uses: ./.github/actions/restore-cache
586+
env:
587+
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
588+
- name: Get npm cache directory
589+
id: npm-cache-dir
590+
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
591+
- name: Get Playwright version
592+
id: playwright-version
593+
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
594+
- uses: actions/cache@v3
595+
name: Check if Playwright browser is cached
596+
id: playwright-cache
597+
with:
598+
path: ${{ steps.npm-cache-dir.outputs.dir }}
599+
key: ${{ runner.os }}-Playwright-${{steps.playwright-version.outputs.version}}
600+
- name: Install Playwright browser if not cached
601+
if: steps.playwright-cache.outputs.cache-hit != 'true'
602+
run: npx playwright install --with-deps
603+
env:
604+
PLAYWRIGHT_BROWSERS_PATH: ${{steps.npm-cache-dir.outputs.dir}}
605+
- name: Install OS dependencies of Playwright if cache hit
606+
if: steps.playwright-cache.outputs.cache-hit == 'true'
607+
run: npx playwright install-deps
608+
- name: Run Playwright Loader tests
609+
env:
610+
PW_BUNDLE: ${{ matrix.bundle }}
611+
run: |
612+
cd packages/browser-integration-tests
613+
yarn test:loader
614+
546615
job_browser_integration_tests:
547616
name: Browser (${{ matrix.browser }}) Tests
548617
needs: [job_get_metadata, job_build]
@@ -709,6 +778,7 @@ jobs:
709778
job_browser_playwright_tests,
710779
job_browser_integration_tests,
711780
job_remix_integration_tests,
781+
job_e2e_tests,
712782
]
713783
# Always run this, even if a dependent job failed
714784
if: always()

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request:
55
paths:
66
- 'packages/browser-integration-tests/suites/**'
7+
branches-ignore:
8+
- master
79

810
env:
911
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
@@ -24,6 +26,8 @@ jobs:
2426
runs-on: ubuntu-20.04
2527
timeout-minutes: 60
2628
name: 'Check tests for flakiness'
29+
# Also skip if PR is from master -> develop
30+
if: ${{ github.base_ref != 'master' && github.ref != 'refs/heads/master' }}
2731
steps:
2832
- name: Check out current branch
2933
uses: actions/checkout@v3
@@ -77,5 +81,4 @@ jobs:
7781
working-directory: packages/browser-integration-tests
7882
env:
7983
CHANGED_TEST_PATHS: ${{ steps.changed.outputs.browser_integration_files }}
80-
# Run 50 times when detecting changed test(s), else run all tests 5x
81-
TEST_RUN_COUNT: ${{ steps.changed.outputs.browser_integration == 'true' && 50 || 5 }}
84+
TEST_RUN_COUNT: 'AUTO'

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,8 @@ jobs:
3838
# This token is scoped to Daniel Griesser
3939
github_token: ${{ secrets.REPO_SCOPED_TOKEN }}
4040

41-
# https://github.com/marketplace/actions/enable-pull-request-automerge
4241
- name: Enable automerge for PR
43-
if: steps.open-pr.outputs.pr_number != ''
44-
uses: peter-evans/enable-pull-request-automerge@v2
45-
with:
46-
pull-request-number: ${{ steps.open-pr.outputs.pr_number }}
47-
merge-method: merge
42+
run: gh pr merge --merge --auto "1"
4843

4944
# https://github.com/marketplace/actions/auto-approve
5045
- name: Auto approve PR

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
stale:
88
runs-on: ubuntu-20.04
99
steps:
10-
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
10+
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84
1111
with:
1212
repo-token: ${{ github.token }}
1313
days-before-stale: 21

CHANGELOG.md

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

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

7+
## 7.47.0
8+
9+
### Important Changes
10+
11+
- **feat(browser)**: Add captureUserFeedback (#7729)
12+
13+
This release adds a new API, `Sentry.captureUserFeedback`, to browser-side SDKs that allows you to send user feedback to Sentry without loading and opening Sentry's user feedback dialog. This allows you to obtain user feedback however and whenever you want to and simply send it to Sentry using the SDK.
14+
15+
For instance, you can collect feedback, whenever convenient as shown in this example:
16+
17+
```js
18+
const eventId = Sentry.captureMessage('User Feedback');
19+
const user = Sentry.getCurrentHub().getScope().getUser();
20+
const userFeedback = {
21+
event_id: eventId;
22+
email: user.email
23+
name: user.username
24+
comments: 'I really like your App, thanks!'
25+
}
26+
Sentry.captureUserFeedback(userFeedback);
27+
```
28+
29+
Note that feedback needs to be coupled to an event but as in the example above, you can just use `Sentry.captureMessage` to generate one.
30+
31+
You could also collect feedback in a custom way if an error happens and use the SDK to send it along:
32+
```js
33+
Sentry.init({
34+
dsn: '__DSN__',
35+
beforeSend: event => {
36+
const userFeedback = collectYourUserFeedback();
37+
const feedback = {
38+
...userFeedback,
39+
event_id: event.event_id.
40+
}
41+
Sentry.captureUserFeedback(feedback);
42+
return event;
43+
}
44+
})
45+
```
46+
47+
- **feat(tracing)**: Deprecate `@sentry/tracing` exports (#7611)
48+
49+
With this release, we officially deprecate all exports from the `@sentry/tracing` package, in favour of using them directly from the main SDK package. The `@sentry/tracing` package will be removed in a future major release.
50+
51+
Please take a look at the [Migration docs](./MIGRATION.md/#remove-requirement-for-sentrytracing-package-since-7460) for more details.
52+
53+
### Additional Features and Fixes
54+
55+
- feat(sveltekit): Add partial instrumentation for client-side `fetch` (#7626)
56+
- fix(angular): Handle routes with empty path (#7686)
57+
- fix(angular): Only open report dialog if error was sent (#7750)
58+
- fix(core): Determine debug ID paths from the top of the stack (#7722)
59+
- fix(ember): Ensure only one client is created & Replay works (#7712)
60+
- fix(integrations): Ensure HttpClient integration works with Axios (#7714)
61+
- fix(loader): Ensure JS loader works with tracing & add tests (#7662)
62+
- fix(nextjs): Restore tree shaking capabilities (#7710)
63+
- fix(node): Disable `LocalVariables` integration on Node < v18 (#7748)
64+
- fix(node): Redact URL authority only in breadcrumbs and spans (#7740)
65+
- fix(react): Only show report dialog if event was sent to Sentry (#7754)
66+
- fix(remix): Remove unnecessary dependencies (#7708)
67+
- fix(replay): Ensure circular references are handled (#7752)
68+
- fix(sveltekit): Don't capture thrown `Redirect`s as exceptions (#7731)
69+
- fix(sveltekit): Log error to console by default in `handleErrorWithSentry` (#7674)
70+
- fix(tracing): Make sure idle transaction does not override other transactions (#7725)
71+
72+
Work in this release contributed by @de-don and @TrySound. Thank you for your contributions!
73+
74+
775
## 7.46.0
876

977
### Important Changes

MIGRATION.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Sentry.init({
5656
});
5757
```
5858

59+
**Note:** If you imported `stripUrlQueryAndFragment` from `@sentry/tracing`, you'll need to import it from `@sentry/utils`, once you remove `@sentry/tracing`.
60+
5961
## Replay options changed (since 7.35.0) - #6645
6062

6163
Some options for replay have been depracted in favor of new APIs.

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,14 @@ package. Please refer to the README and instructions of those SDKs for more deta
4141
- [`@sentry/browser`](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser): SDK for Browsers
4242
- [`@sentry/node`](https://github.com/getsentry/sentry-javascript/tree/master/packages/node): SDK for Node including
4343
integrations for Express
44-
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): Browser SDK with
45-
Angular integration enabled
46-
- [`@sentry/angular-ivy`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy): Browser SDK with
47-
Angular integration enabled including native support for Angular's Ivy rendering engine.
48-
- [`@sentry/ember`](https://github.com/getsentry/sentry-javascript/tree/master/packages/ember): Browser SDK with Ember
49-
integration enabled
50-
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): Browser SDK with React
51-
integration enabled
52-
- [`@sentry/svelte`](https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte): Browser SDK with
53-
Svelte integration enabled
54-
- [`@sentry/vue`](https://github.com/getsentry/sentry-javascript/tree/master/packages/vue): Browser SDK with Vue
55-
integration enabled
44+
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): Browser SDK for Angular
45+
- [`@sentry/angular-ivy`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy): Browser SDK for
46+
Angular with native support for Angular's Ivy rendering engine.
47+
- [`@sentry/ember`](https://github.com/getsentry/sentry-javascript/tree/master/packages/ember): Browser SDK for Ember
48+
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): Browser SDK for React
49+
- [`@sentry/svelte`](https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte): Browser SDK for Svelte
50+
- [`@sentry/sveltekit`](https://github.com/getsentry/sentry-javascript/tree/master/packages/sveltekit): SDK for SvelteKit
51+
- [`@sentry/vue`](https://github.com/getsentry/sentry-javascript/tree/master/packages/vue): Browser SDK for Vue
5652
- [`@sentry/gatsby`](https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby): SDK for Gatsby
5753
- [`@sentry/nextjs`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs): SDK for Next.js
5854
- [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix

packages/angular-ivy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"lint": "run-s lint:prettier lint:eslint",
5858
"lint:eslint": "eslint . --format stylish",
5959
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
60-
"yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push"
60+
"yalc:publish": "yalc publish build --push"
6161
},
6262
"volta": {
6363
"extends": "../../package.json"

packages/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"test": "yarn test:unit",
6161
"test:unit": "jest",
6262
"test:unit:watch": "jest --watch",
63-
"yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push"
63+
"yalc:publish": "yalc publish build --push"
6464
},
6565
"volta": {
6666
"extends": "../../package.json"

packages/angular/src/errorhandler.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ function isErrorOrErrorLikeObject(value: unknown): value is Error {
8383
class SentryErrorHandler implements AngularErrorHandler {
8484
protected readonly _options: ErrorHandlerOptions;
8585

86+
/* indicates if we already registered our the afterSendEvent handler */
87+
private _registeredAfterSendEventHandler = false;
88+
8689
public constructor(@Inject('errorHandlerOptions') options?: ErrorHandlerOptions) {
8790
this._options = {
8891
logErrors: true,
@@ -120,7 +123,20 @@ class SentryErrorHandler implements AngularErrorHandler {
120123

121124
// Optionally show user dialog to provide details on what happened.
122125
if (this._options.showDialog) {
123-
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });
126+
const client = Sentry.getCurrentHub().getClient();
127+
128+
if (client && client.on && !this._registeredAfterSendEventHandler) {
129+
client.on('afterSendEvent', event => {
130+
if (!event.type) {
131+
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });
132+
}
133+
});
134+
135+
// We only want to register this hook once in the lifetime of the error handler
136+
this._registeredAfterSendEventHandler = true;
137+
} else if (!client || !client.on) {
138+
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });
139+
}
124140
}
125141
}
126142

packages/angular/src/tracing.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,24 @@ export function TraceMethodDecorator(): MethodDecorator {
282282
* child route with its parent to produce the complete parameterized URL of the activated route.
283283
* This happens recursively until the last child (i.e. the end of the URL) is reached.
284284
*
285-
* @param route the ActivatedRouteSnapshot of which its path and its child's path is concantenated
285+
* @param route the ActivatedRouteSnapshot of which its path and its child's path is concatenated
286286
*
287-
* @returns the concatenated parameterzited route string
287+
* @returns the concatenated parameterized route string
288288
*/
289289
export function getParameterizedRouteFromSnapshot(route?: ActivatedRouteSnapshot | null): string {
290-
const path = route && route.firstChild && route.firstChild.routeConfig && route.firstChild.routeConfig.path;
291-
if (!path) {
292-
return '/';
290+
const parts: string[] = [];
291+
292+
let currentRoute = route && route.firstChild;
293+
while (currentRoute) {
294+
const path = currentRoute && currentRoute.routeConfig && currentRoute.routeConfig.path;
295+
if (path === null || path === undefined) {
296+
break;
297+
}
298+
299+
parts.push(path);
300+
currentRoute = currentRoute.firstChild;
293301
}
294-
return `/${path}${getParameterizedRouteFromSnapshot(route && route.firstChild)}`;
302+
303+
const fullPath = parts.filter(part => part).join('/');
304+
return fullPath ? `/${fullPath}/` : '/';
295305
}

0 commit comments

Comments
 (0)