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

0 commit comments

Comments
 (0)