Skip to content

Commit 69c45a4

Browse files
authored
Merge branch 'develop' into fix/tracemetrics/buffer-1000
2 parents c455ac2 + fe97d67 commit 69c45a4

File tree

18 files changed

+477
-225
lines changed

18 files changed

+477
-225
lines changed

.cursor/rules/publishing_release.mdc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ Use these guidelines when publishing a new Sentry JavaScript SDK release.
1212

1313
The release process is outlined in [publishing-a-release.md](mdc:docs/publishing-a-release.md).
1414

15-
1. Make sure you are on the latest version of the `develop` branch. To confirm this, run `git pull origin develop` to get the latest changes from the repo.
15+
1. Ensure you're on the `develop` branch with the latest changes:
16+
- If you have unsaved changes, stash them with `git stash -u`.
17+
- If you're on a different branch than `develop`, check out the develop branch using `git checkout develop`.
18+
- Pull the latest updates from the remote repository by running `git pull origin develop`.
19+
1620
2. Run `yarn changelog` on the `develop` branch and copy the output. You can use `yarn changelog | pbcopy` to copy the output of `yarn changelog` into your clipboard.
1721
3. Decide on a version for the release based on [semver](mdc:https://semver.org). The version should be decided based on what is in included in the release. For example, if the release includes a new feature, we should increment the minor version. If it includes only bug fixes, we should increment the patch version. You can find the latest version in [CHANGELOG.md](mdc:CHANGELOG.md) at the very top.
1822
4. Create a branch `prepare-release/VERSION`, eg. `prepare-release/8.1.0`, off `develop`.
19-
5. Update [CHANGELOG.md](mdc:CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release from the output of `yarn changelog`. See the `Updating the Changelog` section in [publishing-a-release.md](mdc:docs/publishing-a-release.md) for more details. If you remove changelog entries because they are not applicable, please let the user know.
23+
5. Update [CHANGELOG.md](mdc:CHANGELOG.md) to add an entry for the next release number and a list of changes since the last release from the output of `yarn changelog`. See the `Updating the Changelog` section in [publishing-a-release.md](mdc:docs/publishing-a-release.md) for more details. Do not remove any changelog entries.
2024
6. Commit the changes to [CHANGELOG.md](mdc:CHANGELOG.md) with `meta(changelog): Update changelog for VERSION` where `VERSION` is the version of the release, e.g. `meta(changelog): Update changelog for 8.1.0`
2125
7. Push the `prepare-release/VERSION` branch to origin and remind the user that the release PR needs to be opened from the `master` branch.
26+
8. In case you were working on a different branch, you can checkout back to the branch you were working on and continue your work by unstashing the changes you stashed earlier with the command `git stash pop` (only if you stashed changes).
2227

2328
## Key Commands
2429

CHANGELOG.md

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

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

7+
Work in this release was contributed by @hanseo0507. Thank you for your contribution!
8+
79
## 10.22.0
810

911
### Important Changes

packages/aws-serverless/src/sdk.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function enhanceScopeWithEnvironmentData(scope: Scope, context: Context, startTi
108108
});
109109
}
110110

111-
function setupTimeoutWatning(context: Context, options: WrapperOptions): NodeJS.Timeout | undefined {
111+
function setupTimeoutWarning(context: Context, options: WrapperOptions): NodeJS.Timeout | undefined {
112112
// In seconds. You cannot go any more granular than this in AWS Lambda.
113113
const configuredTimeout = Math.ceil(tryGetRemainingTimeInMillis(context) / 1000);
114114
const configuredTimeoutMinutes = Math.floor(configuredTimeout / 60);
@@ -220,7 +220,7 @@ export function wrapHandler<TEvent, TResult>(
220220
return async (event: TEvent, context: Context) => {
221221
context.callbackWaitsForEmptyEventLoop = options.callbackWaitsForEmptyEventLoop;
222222

223-
timeoutWarningTimer = setupTimeoutWatning(context, options);
223+
timeoutWarningTimer = setupTimeoutWarning(context, options);
224224

225225
async function processResult(): Promise<TResult> {
226226
const scope = getCurrentScope();
@@ -272,7 +272,7 @@ function wrapStreamingHandler<TEvent, TResult>(
272272
): Promise<TResult> => {
273273
context.callbackWaitsForEmptyEventLoop = options.callbackWaitsForEmptyEventLoop;
274274

275-
timeoutWarningTimer = setupTimeoutWatning(context, options);
275+
timeoutWarningTimer = setupTimeoutWarning(context, options);
276276

277277
async function processStreamingResult(): Promise<TResult> {
278278
const scope = getCurrentScope();

packages/core/src/build-time-plugins/buildTimeOptionsBase.ts

Lines changed: 91 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,37 @@ interface SourceMapsOptions {
243243
filesToDeleteAfterUpload?: string | Array<string>;
244244
}
245245

246+
type AutoSetCommitsOptions = {
247+
/**
248+
* Automatically sets `commit` and `previousCommit`. Sets `commit` to `HEAD`
249+
* and `previousCommit` as described in the option's documentation.
250+
*
251+
* If you set this to `true`, manually specified `commit` and `previousCommit`
252+
* options will be overridden. It is best to not specify them at all if you
253+
* set this option to `true`.
254+
*/
255+
auto: true;
256+
repo?: undefined;
257+
commit?: undefined;
258+
};
259+
260+
type ManualSetCommitsOptions = {
261+
auto?: false | undefined;
262+
/**
263+
* The full repo name as defined in Sentry.
264+
*
265+
* Required if the `auto` option is not set to `true`.
266+
*/
267+
repo: string;
268+
269+
/**
270+
* The current (last) commit in the release.
271+
*
272+
* Required if the `auto` option is not set to `true`.
273+
*/
274+
commit: string;
275+
};
276+
246277
interface ReleaseOptions {
247278
/**
248279
* Unique identifier for the release you want to create.
@@ -299,101 +330,81 @@ interface ReleaseOptions {
299330

300331
/**
301332
* Configuration for associating the release with its commits in Sentry.
333+
*
334+
* Set to `false` to disable commit association.
335+
*
336+
* @default { auto: true }
302337
*/
303-
setCommits?: (
304-
| {
338+
setCommits?:
339+
| false
340+
| ((AutoSetCommitsOptions | ManualSetCommitsOptions) & {
305341
/**
306-
* Automatically sets `commit` and `previousCommit`. Sets `commit` to `HEAD`
307-
* and `previousCommit` as described in the option's documentation.
342+
* The commit before the beginning of this release (in other words,
343+
* the last commit of the previous release).
344+
*
345+
* Defaults to the last commit of the previous release in Sentry.
308346
*
309-
* If you set this to `true`, manually specified `commit` and `previousCommit`
310-
* options will be overridden. It is best to not specify them at all if you
311-
* set this option to `true`.
347+
* If there was no previous release, the last 10 commits will be used.
312348
*/
313-
auto: true;
314-
repo?: undefined;
315-
commit?: undefined;
316-
}
317-
| {
318-
auto?: false | undefined;
349+
previousCommit?: string;
350+
319351
/**
320-
* The full repo name as defined in Sentry.
352+
* If the flag is to `true` and the previous release commit was not found
353+
* in the repository, the plugin creates a release with the default commits
354+
* count instead of failing the command.
321355
*
322-
* Required if the `auto` option is not set to `true`.
356+
* @default false
323357
*/
324-
repo: string;
358+
ignoreMissing?: boolean;
325359

326360
/**
327-
* The current (last) commit in the release.
361+
* If this flag is set, the setCommits step will not fail and just exit
362+
* silently if no new commits for a given release have been found.
328363
*
329-
* Required if the `auto` option is not set to `true`.
364+
* @default false
330365
*/
331-
commit: string;
332-
}
333-
) & {
334-
/**
335-
* The commit before the beginning of this release (in other words,
336-
* the last commit of the previous release).
337-
*
338-
* Defaults to the last commit of the previous release in Sentry.
339-
*
340-
* If there was no previous release, the last 10 commits will be used.
341-
*/
342-
previousCommit?: string;
343-
344-
/**
345-
* If the flag is to `true` and the previous release commit was not found
346-
* in the repository, the plugin creates a release with the default commits
347-
* count instead of failing the command.
348-
*
349-
* @default false
350-
*/
351-
ignoreMissing?: boolean;
352-
353-
/**
354-
* If this flag is set, the setCommits step will not fail and just exit
355-
* silently if no new commits for a given release have been found.
356-
*
357-
* @default false
358-
*/
359-
ignoreEmpty?: boolean;
360-
};
366+
ignoreEmpty?: boolean;
367+
});
361368

362369
/**
363370
* Configuration for adding deployment information to the release in Sentry.
371+
*
372+
* Set to `false` to disable automatic deployment detection and creation.
364373
*/
365-
deploy?: {
366-
/**
367-
* Environment for this release. Values that make sense here would
368-
* be `production` or `staging`.
369-
*/
370-
env: string;
371-
372-
/**
373-
* Deployment start time in Unix timestamp (in seconds) or ISO 8601 format.
374-
*/
375-
started?: number | string;
376-
377-
/**
378-
* Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format.
379-
*/
380-
finished?: number | string;
381-
382-
/**
383-
* Deployment duration (in seconds). Can be used instead of started and finished.
384-
*/
385-
time?: number;
386-
387-
/**
388-
* Human-readable name for the deployment.
389-
*/
390-
name?: string;
391-
392-
/**
393-
* URL that points to the deployment.
394-
*/
395-
url?: string;
396-
};
374+
deploy?:
375+
| false
376+
| {
377+
/**
378+
* Environment for this release. Values that make sense here would
379+
* be `production` or `staging`.
380+
*/
381+
env: string;
382+
383+
/**
384+
* Deployment start time in Unix timestamp (in seconds) or ISO 8601 format.
385+
*/
386+
started?: number | string;
387+
388+
/**
389+
* Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format.
390+
*/
391+
finished?: number | string;
392+
393+
/**
394+
* Deployment duration (in seconds). Can be used instead of started and finished.
395+
*/
396+
time?: number;
397+
398+
/**
399+
* Human-readable name for the deployment.
400+
*/
401+
name?: string;
402+
403+
/**
404+
* URL that points to the deployment.
405+
*/
406+
url?: string;
407+
};
397408
}
398409

399410
interface BundleSizeOptimizationsOptions {

packages/nuxt/src/runtime/hooks/captureErrorHook.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ export async function sentryCaptureErrorHook(error: Error, errorContext: Capture
2525
if (error.statusCode >= 300 && error.statusCode < 500) {
2626
return;
2727
}
28+
29+
// Check if the cause (original error) was already captured by middleware instrumentation
30+
// H3 wraps errors, so we need to check the cause property
31+
if (
32+
'cause' in error &&
33+
typeof error.cause === 'object' &&
34+
error.cause !== null &&
35+
'__sentry_captured__' in error.cause
36+
) {
37+
return;
38+
}
2839
}
2940

3041
const { method, path } = {

0 commit comments

Comments
 (0)