Skip to content

Commit 13fe88a

Browse files
author
Luca Forstner
authored
Merge pull request #9397 from getsentry/prepare-release/7.76.0
meta(changelog): Update changelog for 7.76.0
2 parents 241e3b6 + 8b76c18 commit 13fe88a

Some content is hidden

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

62 files changed

+682
-282
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -817,13 +817,20 @@ jobs:
817817
uses: ./.github/actions/restore-cache
818818
env:
819819
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
820-
- name: Check tarball cache
821-
uses: actions/cache@v3
820+
- name: NX cache
821+
uses: actions/cache/restore@v3
822822
with:
823-
path: ${{ github.workspace }}/packages/*/*.tgz
824-
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
823+
path: .nxcache
824+
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
825+
# On develop branch, we want to _store_ the cache (so it can be used by other branches), but never _restore_ from it
826+
restore-keys: ${{ env.NX_CACHE_RESTORE_KEYS }}
825827
- name: Build tarballs
826828
run: yarn build:tarball
829+
- name: Stores tarballs in cache
830+
uses: actions/cache/save@v3
831+
with:
832+
path: ${{ github.workspace }}/packages/*/*.tgz
833+
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
827834

828835
job_e2e_tests:
829836
name: E2E ${{ matrix.label || matrix.test-application }} Test
@@ -877,6 +884,12 @@ jobs:
877884
- test-application: 'standard-frontend-react'
878885
build-command: 'test:build-ts3.8'
879886
label: 'standard-frontend-react (TS 3.8)'
887+
- test-application: 'create-next-app'
888+
build-command: 'test:build-13'
889+
label: 'create-next-app (next@13)'
890+
- test-application: 'nextjs-app-dir'
891+
build-command: 'test:build-13'
892+
label: 'nextjs-app-dir (next@13)'
880893

881894
steps:
882895
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jest/transformers/*.js
2121
# node tarballs
2222
packages/*/sentry-*.tgz
2323
.nxcache
24-
# The Deno types are downloaded before building
25-
packages/deno/lib.deno.d.ts
2624

2725
# logs
2826
yarn-error.log

CHANGELOG.md

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

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

7+
## 7.76.0
8+
9+
### Important Changes
10+
11+
- **feat(core): Add cron monitor wrapper helper (#9395)**
12+
13+
This release adds `Sentry.withMonitor()`, a wrapping function that wraps a callback with a cron monitor that will automatically report completions and failures:
14+
15+
```ts
16+
import * as Sentry from '@sentry/node';
17+
18+
// withMonitor() will send checkin when callback is started/finished
19+
// works with async and sync callbacks.
20+
const result = Sentry.withMonitor(
21+
'dailyEmail',
22+
() => {
23+
// withCheckIn return value is same return value here
24+
return sendEmail();
25+
},
26+
// Optional upsert options
27+
{
28+
schedule: {
29+
type: 'crontab',
30+
value: '0 * * * *',
31+
},
32+
// 🇨🇦🫡
33+
timezone: 'Canada/Eastern',
34+
},
35+
);
36+
```
37+
38+
### Other Changes
39+
40+
- chore(angular-ivy): Allow Angular 17 in peer dependencies (#9386)
41+
- feat(nextjs): Instrument SSR page components (#9346)
42+
- feat(nextjs): Trace errors in page component SSR (#9388)
43+
- fix(nextjs): Instrument route handlers with `jsx` and `tsx` file extensions (#9362)
44+
- fix(nextjs): Trace with performance disabled (#9389)
45+
- fix(replay): Ensure `replay_id` is not added to DSC if session expired (#9359)
46+
- fix(replay): Remove unused parts of pako from build (#9369)
47+
- fix(serverless): Don't mark all errors as unhandled (#9368)
48+
- fix(tracing-internal): Fix case when middleware contain array of routes with special chars as @ (#9375)
49+
- meta(nextjs): Bump peer deps for Next.js 14 (#9390)
50+
51+
Work in this release contributed by @LubomirIgonda1. Thank you for your contribution!
52+
753
## 7.75.1
854

955
- feat(browser): Allow collecting of pageload profiles (#9317)

packages/angular-ivy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
## Angular Version Compatibility
1818

19-
This SDK officially supports Angular 12 to 16 with Angular's new rendering engine, Ivy.
19+
This SDK officially supports Angular 12 to 17 with Angular's new rendering engine, Ivy.
2020

2121
If you're using Angular 10, 11 or a newer Angular version with View Engine instead of Ivy, please use [`@sentry/angular`](https://github.com/getsentry/sentry-javascript/blob/develop/packages/angular/README.md).
2222

packages/angular-ivy/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"access": "public"
1616
},
1717
"peerDependencies": {
18-
"@angular/common": ">= 12.x <= 16.x",
19-
"@angular/core": ">= 12.x <= 16.x",
20-
"@angular/router": ">= 12.x <= 16.x",
18+
"@angular/common": ">= 12.x <= 17.x",
19+
"@angular/core": ">= 12.x <= 17.x",
20+
"@angular/router": ">= 12.x <= 17.x",
2121
"rxjs": "^6.5.5 || ^7.x"
2222
},
2323
"dependencies": {

packages/astro/src/index.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export {
1313
captureEvent,
1414
captureMessage,
1515
captureCheckIn,
16+
withMonitor,
1617
configureScope,
1718
createTransport,
1819
extractTraceparentData,

packages/bun/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export {
5555
trace,
5656
withScope,
5757
captureCheckIn,
58+
withMonitor,
5859
setMeasurement,
5960
getActiveSpan,
6061
startSpan,

packages/core/src/exports.ts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import type {
77
EventHint,
88
Extra,
99
Extras,
10+
FinishedCheckIn,
1011
MonitorConfig,
1112
Primitive,
1213
Severity,
1314
SeverityLevel,
1415
TransactionContext,
1516
User,
1617
} from '@sentry/types';
17-
import { logger, uuid4 } from '@sentry/utils';
18+
import { isThenable, logger, timestampInSeconds, uuid4 } from '@sentry/utils';
1819

1920
import type { Hub } from './hub';
2021
import { getCurrentHub } from './hub';
@@ -210,6 +211,49 @@ export function captureCheckIn(checkIn: CheckIn, upsertMonitorConfig?: MonitorCo
210211
return uuid4();
211212
}
212213

214+
/**
215+
* Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.
216+
*
217+
* @param monitorSlug The distinct slug of the monitor.
218+
* @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want
219+
* to create a monitor automatically when sending a check in.
220+
*/
221+
export function withMonitor<T>(
222+
monitorSlug: CheckIn['monitorSlug'],
223+
callback: () => T,
224+
upsertMonitorConfig?: MonitorConfig,
225+
): T {
226+
const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);
227+
const now = timestampInSeconds();
228+
229+
function finishCheckIn(status: FinishedCheckIn['status']): void {
230+
captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });
231+
}
232+
233+
let maybePromiseResult: T;
234+
try {
235+
maybePromiseResult = callback();
236+
} catch (e) {
237+
finishCheckIn('error');
238+
throw e;
239+
}
240+
241+
if (isThenable(maybePromiseResult)) {
242+
Promise.resolve(maybePromiseResult).then(
243+
() => {
244+
finishCheckIn('ok');
245+
},
246+
() => {
247+
finishCheckIn('error');
248+
},
249+
);
250+
} else {
251+
finishCheckIn('ok');
252+
}
253+
254+
return maybePromiseResult;
255+
}
256+
213257
/**
214258
* Call `flush()` on the current client, if there is one. See {@link Client.flush}.
215259
*

packages/core/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export * from './tracing';
77
export {
88
addBreadcrumb,
99
captureCheckIn,
10+
withMonitor,
1011
captureException,
1112
captureEvent,
1213
captureMessage,

packages/deno/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
build-types
2+
build-test
3+
lib.deno.d.ts

packages/deno/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
"lint:eslint": "eslint . --format stylish",
4949
"lint:prettier": "prettier --check \"{src,test,scripts}/**/**.ts\"",
5050
"install:deno": "node ./scripts/install-deno.mjs",
51-
"test": "run-s deno-types install:deno test:types test:unit",
51+
"pretest": "run-s deno-types test:build",
52+
"test": "run-s install:deno test:types test:unit",
53+
"test:build": "tsc -p tsconfig.test.types.json && rollup -c rollup.test.config.js",
5254
"test:types": "deno check ./build/index.js",
5355
"test:unit": "deno test --allow-read --allow-run",
5456
"test:unit:update": "deno test --allow-read --allow-write --allow-run -- --update",

packages/deno/rollup.test.config.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// @ts-check
2+
import dts from 'rollup-plugin-dts';
3+
import nodeResolve from '@rollup/plugin-node-resolve';
4+
import sucrase from '@rollup/plugin-sucrase';
5+
import { defineConfig } from 'rollup';
6+
7+
export default [
8+
defineConfig({
9+
input: ['test/build.ts'],
10+
output: {
11+
file: 'build-test/index.js',
12+
sourcemap: true,
13+
preserveModules: false,
14+
strict: false,
15+
freeze: false,
16+
interop: 'auto',
17+
format: 'esm',
18+
banner: '/// <reference types="./index.d.ts" />',
19+
},
20+
plugins: [
21+
nodeResolve({
22+
extensions: ['.mjs', '.js', '.json', '.node', '.ts', '.tsx'],
23+
}),
24+
sucrase({ transforms: ['typescript'] }),
25+
],
26+
}),
27+
defineConfig({
28+
input: './build-test/build.d.ts',
29+
output: [{ file: 'build-test/index.d.ts', format: 'es' }],
30+
plugins: [
31+
dts({ respectExternal: true }),
32+
// The bundled types contain a declaration for the __DEBUG_BUILD__ global
33+
// This can result in errors about duplicate global declarations so we strip it out!
34+
{
35+
name: 'strip-global',
36+
renderChunk(code) {
37+
return { code: code.replace(/declare global \{\s*const __DEBUG_BUILD__: boolean;\s*\}/g, '') };
38+
},
39+
},
40+
],
41+
}),
42+
];

packages/deno/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export {
5353
trace,
5454
withScope,
5555
captureCheckIn,
56+
withMonitor,
5657
setMeasurement,
5758
getActiveSpan,
5859
startSpan,

packages/deno/test/__snapshots__/mod.test.ts.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ snapshot[`captureException 1`] = `
8282
filename: "app:///test/mod.test.ts",
8383
function: "<anonymous>",
8484
in_app: true,
85-
lineno: 42,
85+
lineno: 46,
8686
post_context: [
8787
"",
8888
" await delay(200);",
8989
" await assertSnapshot(t, ev);",
9090
"});",
9191
"",
9292
"Deno.test('captureMessage', async t => {",
93-
" let ev: Event | undefined;",
93+
" let ev: sentryTypes.Event | undefined;",
9494
],
9595
pre_context: [
9696
" ev = event;",
@@ -108,7 +108,7 @@ snapshot[`captureException 1`] = `
108108
filename: "app:///test/mod.test.ts",
109109
function: "something",
110110
in_app: true,
111-
lineno: 39,
111+
lineno: 43,
112112
post_context: [
113113
" }",
114114
"",
@@ -120,7 +120,7 @@ snapshot[`captureException 1`] = `
120120
],
121121
pre_context: [
122122
"Deno.test('captureException', async t => {",
123-
" let ev: Event | undefined;",
123+
" let ev: sentryTypes.Event | undefined;",
124124
" const [hub] = getTestClient(event => {",
125125
" ev = event;",
126126
" });",

packages/deno/test/build.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// We use this as the entry point to bundle Sentry dependencies that are used by the tests.
2+
export * as sentryTypes from '@sentry/types';
3+
export * as sentryUtils from '@sentry/utils';
4+
export * as sentryCore from '@sentry/core';

packages/deno/test/mod.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
import { assertEquals } from 'https://deno.land/[email protected]/assert/assert_equals.ts';
22
import { assertSnapshot } from 'https://deno.land/[email protected]/testing/snapshot.ts';
33

4-
import { createStackParser, nodeStackLineParser } from '../../utils/build/esm/index.js';
4+
import type { sentryTypes } from '../build-test/index.js';
5+
import { sentryUtils } from '../build-test/index.js';
56
import { defaultIntegrations, DenoClient, Hub, Scope } from '../build/index.js';
67
import { getNormalizedEvent } from './normalize.ts';
78
import { makeTestTransport } from './transport.ts';
89

9-
function getTestClient(callback: (event?: Event) => void, integrations: any[] = []): [Hub, DenoClient] {
10+
function getTestClient(
11+
callback: (event?: sentryTypes.Event) => void,
12+
integrations: sentryTypes.Integration[] = [],
13+
): [Hub, DenoClient] {
1014
const client = new DenoClient({
1115
dsn: 'https://[email protected]/5650507',
1216
debug: true,
1317
integrations: [...defaultIntegrations, ...integrations],
14-
stackParser: createStackParser(nodeStackLineParser()),
18+
stackParser: sentryUtils.createStackParser(sentryUtils.nodeStackLineParser()),
1519
transport: makeTestTransport(envelope => {
1620
callback(getNormalizedEvent(envelope));
17-
}) as any,
21+
}),
1822
});
1923

2024
const scope = new Scope();
@@ -30,7 +34,7 @@ function delay(time: number): Promise<void> {
3034
}
3135

3236
Deno.test('captureException', async t => {
33-
let ev: Event | undefined;
37+
let ev: sentryTypes.Event | undefined;
3438
const [hub] = getTestClient(event => {
3539
ev = event;
3640
});
@@ -46,7 +50,7 @@ Deno.test('captureException', async t => {
4650
});
4751

4852
Deno.test('captureMessage', async t => {
49-
let ev: Event | undefined;
53+
let ev: sentryTypes.Event | undefined;
5054
const [hub] = getTestClient(event => {
5155
ev = event;
5256
});

0 commit comments

Comments
 (0)