Skip to content

Commit

Permalink
Merge pull request #7758 from getsentry/prepare-release/7.47.0
Browse files Browse the repository at this point in the history
meta: Update changelog for 7.47.0
  • Loading branch information
Lms24 authored Apr 5, 2023
2 parents beefbeb + 56268f9 commit f4861f8
Show file tree
Hide file tree
Showing 142 changed files with 2,746 additions and 451 deletions.
2 changes: 2 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@ targets:
onlyIfPresent: /^sentry-remix-\d.*\.tgz$/
'npm:@sentry/svelte':
onlyIfPresent: /^sentry-svelte-\d.*\.tgz$/
'npm:@sentry/sveltekit':
onlyIfPresent: /^sentry-sveltekit-\d.*\.tgz$/
'npm:@sentry/opentelemetry-node':
onlyIfPresent: /^sentry-opentelemetry-node-\d.*\.tgz$/
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ body:
- '@sentry/remix'
- '@sentry/serverless'
- '@sentry/svelte'
- '@sentry/sveltekit'
- '@sentry/vue'
- '@sentry/wasm'
- Sentry Browser CDN bundle
Expand Down
72 changes: 71 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
is_develop: ${{ github.ref == 'refs/heads/develop' }}
is_release: ${{ startsWith(github.ref, 'refs/heads/release/') }}
# When merging into master, or from master
is_gitflow_sync: ${{ github.head_ref == 'refs/heads/master' || github.ref == 'refs/heads/master' }}
is_gitflow_sync: ${{ github.head_ref == 'master' || github.ref == 'refs/heads/master' }}
has_gitflow_label:
${{ github.event_name == 'pull_request' && contains(steps.pr-labels.outputs.labels, ' Gitflow ') }}
force_skip_cache:
Expand Down Expand Up @@ -181,6 +181,21 @@ jobs:
outputs:
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}

job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-20.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@a65df5f64fc741e91c59b8359a4bc56e57aaf5b1
if: ${{ github.base_ref == 'master' && !startsWith(github.ref, 'refs/heads/prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_build:
name: Build
needs: [job_get_metadata, job_install_deps]
Expand Down Expand Up @@ -543,6 +558,60 @@ jobs:
cd packages/browser-integration-tests
yarn test:ci
job_browser_loader_tests:
name: Playwright Loader (${{ matrix.bundle }}) Tests
needs: [job_get_metadata, job_build]
if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-20.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_tracing
- loader_replay
- loader_tracing_replay

steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v3
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: volta-cli/action@v4
- name: Restore caches
uses: ./.github/actions/restore-cache
env:
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Get npm cache directory
id: npm-cache-dir
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Get Playwright version
id: playwright-version
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Check if Playwright browser is cached
id: playwright-cache
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-Playwright-${{steps.playwright-version.outputs.version}}
- name: Install Playwright browser if not cached
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
env:
PLAYWRIGHT_BROWSERS_PATH: ${{steps.npm-cache-dir.outputs.dir}}
- name: Install OS dependencies of Playwright if cache hit
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd packages/browser-integration-tests
yarn test:loader
job_browser_integration_tests:
name: Browser (${{ matrix.browser }}) Tests
needs: [job_get_metadata, job_build]
Expand Down Expand Up @@ -709,6 +778,7 @@ jobs:
job_browser_playwright_tests,
job_browser_integration_tests,
job_remix_integration_tests,
job_e2e_tests,
]
# Always run this, even if a dependent job failed
if: always()
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/flaky-test-detector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
paths:
- 'packages/browser-integration-tests/suites/**'
branches-ignore:
- master

env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
Expand All @@ -24,6 +26,8 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 60
name: 'Check tests for flakiness'
# Also skip if PR is from master -> develop
if: ${{ github.base_ref != 'master' && github.ref != 'refs/heads/master' }}
steps:
- name: Check out current branch
uses: actions/checkout@v3
Expand Down Expand Up @@ -77,5 +81,4 @@ jobs:
working-directory: packages/browser-integration-tests
env:
CHANGED_TEST_PATHS: ${{ steps.changed.outputs.browser_integration_files }}
# Run 50 times when detecting changed test(s), else run all tests 5x
TEST_RUN_COUNT: ${{ steps.changed.outputs.browser_integration == 'true' && 50 || 5 }}
TEST_RUN_COUNT: 'AUTO'
7 changes: 1 addition & 6 deletions .github/workflows/gitflow-sync-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,8 @@ jobs:
# This token is scoped to Daniel Griesser
github_token: ${{ secrets.REPO_SCOPED_TOKEN }}

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

# https://github.com/marketplace/actions/auto-approve
- name: Auto approve PR
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-20.04
steps:
- uses: actions/stale@6f05e4244c9a0b2ed3401882b05d701dd0a7289b
- uses: actions/stale@1160a2240286f5da8ec72b1c0816ce2481aabf84
with:
repo-token: ${{ github.token }}
days-before-stale: 21
Expand Down
68 changes: 68 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,74 @@

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

## 7.47.0

### Important Changes

- **feat(browser)**: Add captureUserFeedback (#7729)

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.

For instance, you can collect feedback, whenever convenient as shown in this example:

```js
const eventId = Sentry.captureMessage('User Feedback');
const user = Sentry.getCurrentHub().getScope().getUser();
const userFeedback = {
event_id: eventId;
email: user.email
name: user.username
comments: 'I really like your App, thanks!'
}
Sentry.captureUserFeedback(userFeedback);
```

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.

You could also collect feedback in a custom way if an error happens and use the SDK to send it along:
```js
Sentry.init({
dsn: '__DSN__',
beforeSend: event => {
const userFeedback = collectYourUserFeedback();
const feedback = {
...userFeedback,
event_id: event.event_id.
}
Sentry.captureUserFeedback(feedback);
return event;
}
})
```

- **feat(tracing)**: Deprecate `@sentry/tracing` exports (#7611)

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.

Please take a look at the [Migration docs](./MIGRATION.md/#remove-requirement-for-sentrytracing-package-since-7460) for more details.

### Additional Features and Fixes

- feat(sveltekit): Add partial instrumentation for client-side `fetch` (#7626)
- fix(angular): Handle routes with empty path (#7686)
- fix(angular): Only open report dialog if error was sent (#7750)
- fix(core): Determine debug ID paths from the top of the stack (#7722)
- fix(ember): Ensure only one client is created & Replay works (#7712)
- fix(integrations): Ensure HttpClient integration works with Axios (#7714)
- fix(loader): Ensure JS loader works with tracing & add tests (#7662)
- fix(nextjs): Restore tree shaking capabilities (#7710)
- fix(node): Disable `LocalVariables` integration on Node < v18 (#7748)
- fix(node): Redact URL authority only in breadcrumbs and spans (#7740)
- fix(react): Only show report dialog if event was sent to Sentry (#7754)
- fix(remix): Remove unnecessary dependencies (#7708)
- fix(replay): Ensure circular references are handled (#7752)
- fix(sveltekit): Don't capture thrown `Redirect`s as exceptions (#7731)
- fix(sveltekit): Log error to console by default in `handleErrorWithSentry` (#7674)
- fix(tracing): Make sure idle transaction does not override other transactions (#7725)

Work in this release contributed by @de-don and @TrySound. Thank you for your contributions!


## 7.46.0

### Important Changes
Expand Down
2 changes: 2 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Sentry.init({
});
```

**Note:** If you imported `stripUrlQueryAndFragment` from `@sentry/tracing`, you'll need to import it from `@sentry/utils`, once you remove `@sentry/tracing`.

## Replay options changed (since 7.35.0) - #6645

Some options for replay have been depracted in favor of new APIs.
Expand Down
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,14 @@ package. Please refer to the README and instructions of those SDKs for more deta
- [`@sentry/browser`](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser): SDK for Browsers
- [`@sentry/node`](https://github.com/getsentry/sentry-javascript/tree/master/packages/node): SDK for Node including
integrations for Express
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): Browser SDK with
Angular integration enabled
- [`@sentry/angular-ivy`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy): Browser SDK with
Angular integration enabled including native support for Angular's Ivy rendering engine.
- [`@sentry/ember`](https://github.com/getsentry/sentry-javascript/tree/master/packages/ember): Browser SDK with Ember
integration enabled
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): Browser SDK with React
integration enabled
- [`@sentry/svelte`](https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte): Browser SDK with
Svelte integration enabled
- [`@sentry/vue`](https://github.com/getsentry/sentry-javascript/tree/master/packages/vue): Browser SDK with Vue
integration enabled
- [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular): Browser SDK for Angular
- [`@sentry/angular-ivy`](https://github.com/getsentry/sentry-javascript/tree/master/packages/angular-ivy): Browser SDK for
Angular with native support for Angular's Ivy rendering engine.
- [`@sentry/ember`](https://github.com/getsentry/sentry-javascript/tree/master/packages/ember): Browser SDK for Ember
- [`@sentry/react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/react): Browser SDK for React
- [`@sentry/svelte`](https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte): Browser SDK for Svelte
- [`@sentry/sveltekit`](https://github.com/getsentry/sentry-javascript/tree/master/packages/sveltekit): SDK for SvelteKit
- [`@sentry/vue`](https://github.com/getsentry/sentry-javascript/tree/master/packages/vue): Browser SDK for Vue
- [`@sentry/gatsby`](https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby): SDK for Gatsby
- [`@sentry/nextjs`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs): SDK for Next.js
- [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-ivy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --format stylish",
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
"yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push"
"yalc:publish": "yalc publish build --push"
},
"volta": {
"extends": "../../package.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"test": "yarn test:unit",
"test:unit": "jest",
"test:unit:watch": "jest --watch",
"yalc:publish": "ts-node ../../scripts/prepack.ts && yalc publish build --push"
"yalc:publish": "yalc publish build --push"
},
"volta": {
"extends": "../../package.json"
Expand Down
18 changes: 17 additions & 1 deletion packages/angular/src/errorhandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ function isErrorOrErrorLikeObject(value: unknown): value is Error {
class SentryErrorHandler implements AngularErrorHandler {
protected readonly _options: ErrorHandlerOptions;

/* indicates if we already registered our the afterSendEvent handler */
private _registeredAfterSendEventHandler = false;

public constructor(@Inject('errorHandlerOptions') options?: ErrorHandlerOptions) {
this._options = {
logErrors: true,
Expand Down Expand Up @@ -120,7 +123,20 @@ class SentryErrorHandler implements AngularErrorHandler {

// Optionally show user dialog to provide details on what happened.
if (this._options.showDialog) {
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });
const client = Sentry.getCurrentHub().getClient();

if (client && client.on && !this._registeredAfterSendEventHandler) {
client.on('afterSendEvent', event => {
if (!event.type) {
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });
}
});

// We only want to register this hook once in the lifetime of the error handler
this._registeredAfterSendEventHandler = true;
} else if (!client || !client.on) {
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });
}
}
}

Expand Down
22 changes: 16 additions & 6 deletions packages/angular/src/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,24 @@ export function TraceMethodDecorator(): MethodDecorator {
* child route with its parent to produce the complete parameterized URL of the activated route.
* This happens recursively until the last child (i.e. the end of the URL) is reached.
*
* @param route the ActivatedRouteSnapshot of which its path and its child's path is concantenated
* @param route the ActivatedRouteSnapshot of which its path and its child's path is concatenated
*
* @returns the concatenated parameterzited route string
* @returns the concatenated parameterized route string
*/
export function getParameterizedRouteFromSnapshot(route?: ActivatedRouteSnapshot | null): string {
const path = route && route.firstChild && route.firstChild.routeConfig && route.firstChild.routeConfig.path;
if (!path) {
return '/';
const parts: string[] = [];

let currentRoute = route && route.firstChild;
while (currentRoute) {
const path = currentRoute && currentRoute.routeConfig && currentRoute.routeConfig.path;
if (path === null || path === undefined) {
break;
}

parts.push(path);
currentRoute = currentRoute.firstChild;
}
return `/${path}${getParameterizedRouteFromSnapshot(route && route.firstChild)}`;

const fullPath = parts.filter(part => part).join('/');
return fullPath ? `/${fullPath}/` : '/';
}
Loading

0 comments on commit f4861f8

Please sign in to comment.