Skip to content

Commit dd08e37

Browse files
authored
Merge branch 'develop' into rolaabuhasna/js-1071-support-langchain-v1
2 parents 0433989 + ebb8eed commit dd08e37

File tree

136 files changed

+4107
-727
lines changed

Some content is hidden

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

136 files changed

+4107
-727
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: 'Gitflow: Merge Conflict Issue'
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
branches:
7+
- develop
8+
9+
jobs:
10+
check-merge-conflicts:
11+
name: Detect merge conflicts in gitflow PRs
12+
runs-on: ubuntu-24.04
13+
if: |
14+
${{ contains(github.event.pull_request.labels.*.name, 'Dev: Gitflow') }}
15+
permissions:
16+
issues: write
17+
steps:
18+
- name: Check for merge conflicts with retry
19+
uses: actions/github-script@v8
20+
with:
21+
script: |
22+
const retryInterval = 30_000;
23+
const maxRetries = 10; // (30 seconds * 10 retries) = 5 minutes
24+
25+
async function isMergeable() {
26+
const { data: pr } = await github.rest.pulls.get({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
pull_number: context.payload.pull_request.number
30+
});
31+
32+
return pr.mergeable;
33+
}
34+
35+
async function sleep(ms) {
36+
return new Promise(resolve => setTimeout(resolve, ms));
37+
}
38+
39+
let attempt = 0;
40+
let mergeable = null;
41+
42+
while (attempt < maxRetries) {
43+
attempt++;
44+
console.log(`Attempt ${attempt}/${maxRetries}: Checking if PR is mergeable...`);
45+
46+
mergeable = await isMergeable();
47+
console.log(`Mergeable: ${mergeable}`);
48+
49+
// If mergeable is not null, GitHub has finished computing merge state
50+
if (mergeable !== null) {
51+
break;
52+
}
53+
54+
if (attempt < maxRetries) {
55+
console.log(`Waiting ${retryInterval/1000} seconds before retry...`);
56+
await sleep(retryInterval);
57+
}
58+
}
59+
60+
// Check if we have merge conflicts
61+
if (mergeable === false) {
62+
const issueTitle = '[Gitflow] Merge Conflict';
63+
64+
// Check for existing open issues with the same title
65+
const { data: existingIssues } = await github.rest.issues.listForRepo({
66+
owner: context.repo.owner,
67+
repo: context.repo.repo,
68+
state: 'open',
69+
labels: 'Dev: Gitflow'
70+
});
71+
72+
const existingOpenIssue = existingIssues.find(issue =>
73+
issue.title === issueTitle && !issue.pull_request
74+
);
75+
76+
if (!existingOpenIssue) {
77+
const issueBody = [
78+
'## Gitflow Merge Conflict Detected',
79+
'',
80+
`The automated gitflow PR #${context.payload.pull_request.number} has merge conflicts and cannot be merged automatically.`,
81+
'',
82+
'### How to resolve',
83+
'',
84+
`Follow the steps documented in [docs/gitflow.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/develop/docs/gitflow.md#what-to-do-if-there-is-a-merge-conflict):`,
85+
'',
86+
`1. Close the automated PR #${context.payload.pull_request.number}`,
87+
'2. Create a new branch on top of `master` (e.g., `manual-develop-sync`)',
88+
'3. Merge `develop` into this branch with a **merge commit** (fix any merge conflicts)',
89+
'4. Create a PR against `develop` from your branch',
90+
'5. Merge that PR with a **merge commit**'
91+
].join('\n');
92+
93+
await github.rest.issues.create({
94+
owner: context.repo.owner,
95+
repo: context.repo.repo,
96+
title: issueTitle,
97+
body: issueBody,
98+
labels: ['Dev: Gitflow']
99+
});
100+
101+
console.log('Created new issue for merge conflict');
102+
}
103+
} else if (mergeable === null) {
104+
console.log('Could not determine mergeable state after maximum retries');
105+
} else {
106+
console.log('No merge conflicts detected - PR can be merged');
107+
}

CHANGELOG.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

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

7-
- feat(deps): Bump OpenTelemetry ([#18239](https://github.com/getsentry/sentry-javascript/pull/18239))
7+
## 10.27.0
8+
9+
### Important Changes
10+
11+
- **feat(deps): Bump OpenTelemetry ([#18239](https://github.com/getsentry/sentry-javascript/pull/18239))**
812
- Bump @opentelemetry/context-async-hooks from ^2.1.0 to ^2.2.0
913
- Bump @opentelemetry/core from ^2.1.0 to ^2.2.0
1014
- Bump @opentelemetry/resources from ^2.1.0 to ^2.2.0
@@ -37,6 +41,49 @@
3741
- Bump @opentelemetry/instrumentation-undici from 0.15.0 to 0.19.0
3842
- Bump @prisma/instrumentation from 6.15.0 to 6.19.0
3943

44+
- **feat(browserprofiling): Add `manual` mode and deprecate old profiling ([#18189](https://github.com/getsentry/sentry-javascript/pull/18189))**
45+
46+
Adds the `manual` lifecycle mode for UI profiling (the default mode), allowing profiles to be captured manually with `Sentry.uiProfiler.startProfiler()` and `Sentry.uiProfiler.stopProfiler()`.
47+
The previous transaction-based profiling is with `profilesSampleRate` is now deprecated in favor of the new UI Profiling with `profileSessionSampleRate`.
48+
49+
### Other Changes
50+
51+
- feat(core): Add `gibibyte` and `pebibyte` to `InformationUnit` type ([#18241](https://github.com/getsentry/sentry-javascript/pull/18241))
52+
- feat(core): Add scope attribute APIs ([#18165](https://github.com/getsentry/sentry-javascript/pull/18165))
53+
- feat(core): Re-add `_experiments.enableLogs` option ([#18299](https://github.com/getsentry/sentry-javascript/pull/18299))
54+
- feat(core): Use `maxValueLength` on error messages ([#18301](https://github.com/getsentry/sentry-javascript/pull/18301))
55+
- feat(deps): bump @sentry/bundler-plugin-core from 4.3.0 to 4.6.1 ([#18273](https://github.com/getsentry/sentry-javascript/pull/18273))
56+
- feat(deps): bump @sentry/cli from 2.56.0 to 2.58.2 ([#18271](https://github.com/getsentry/sentry-javascript/pull/18271))
57+
- feat(node): Add tracing support for AzureOpenAI ([#18281](https://github.com/getsentry/sentry-javascript/pull/18281))
58+
- feat(node): Fix local variables capturing for out-of-app frames ([#18245](https://github.com/getsentry/sentry-javascript/pull/18245))
59+
- fix(core): Add a PromiseBuffer for incoming events on the client ([#18120](https://github.com/getsentry/sentry-javascript/pull/18120))
60+
- fix(core): Always redact content of sensitive headers regardless of `sendDefaultPii` ([#18311](https://github.com/getsentry/sentry-javascript/pull/18311))
61+
- fix(metrics): Update return type of `beforeSendMetric` ([#18261](https://github.com/getsentry/sentry-javascript/pull/18261))
62+
- fix(nextjs): universal random tunnel path support ([#18257](https://github.com/getsentry/sentry-javascript/pull/18257))
63+
- ref(react): Add more guarding against wildcards in lazy route transactions ([#18155](https://github.com/getsentry/sentry-javascript/pull/18155))
64+
- chore(deps): bump glob from 11.0.1 to 11.1.0 in /packages/react-router ([#18243](https://github.com/getsentry/sentry-javascript/pull/18243))
65+
66+
<details>
67+
<summary> <strong>Internal Changes</strong> </summary>
68+
- build(deps): bump hono from 4.9.7 to 4.10.3 in /dev-packages/e2e-tests/test-applications/cloudflare-hono ([#18038](https://github.com/getsentry/sentry-javascript/pull/18038))
69+
- chore: Add `bump_otel_instrumentations` cursor command ([#18253](https://github.com/getsentry/sentry-javascript/pull/18253))
70+
- chore: Add external contributor to CHANGELOG.md ([#18297](https://github.com/getsentry/sentry-javascript/pull/18297))
71+
- chore: Add external contributor to CHANGELOG.md ([#18300](https://github.com/getsentry/sentry-javascript/pull/18300))
72+
- chore: Do not update opentelemetry ([#18254](https://github.com/getsentry/sentry-javascript/pull/18254))
73+
- chore(angular): Add Angular 21 Support ([#18274](https://github.com/getsentry/sentry-javascript/pull/18274))
74+
- chore(deps): bump astro from 4.16.18 to 5.15.9 in /dev-packages/e2e-tests/test-applications/cloudflare-astro ([#18259](https://github.com/getsentry/sentry-javascript/pull/18259))
75+
- chore(dev-deps): Update some dev dependencies ([#17816](https://github.com/getsentry/sentry-javascript/pull/17816))
76+
- ci(deps): Bump actions/create-github-app-token from 2.1.1 to 2.1.4 ([#17825](https://github.com/getsentry/sentry-javascript/pull/17825))
77+
- ci(deps): bump actions/setup-node from 4 to 6 ([#18077](https://github.com/getsentry/sentry-javascript/pull/18077))
78+
- ci(deps): bump actions/upload-artifact from 4 to 5 ([#18075](https://github.com/getsentry/sentry-javascript/pull/18075))
79+
- ci(deps): bump github/codeql-action from 3 to 4 ([#18076](https://github.com/getsentry/sentry-javascript/pull/18076))
80+
- doc(sveltekit): Update documentation link for SvelteKit guide ([#18298](https://github.com/getsentry/sentry-javascript/pull/18298))
81+
- test(e2e): Fix astro config in test app ([#18282](https://github.com/getsentry/sentry-javascript/pull/18282))
82+
- test(nextjs): Remove debug logs from e2e test ([#18250](https://github.com/getsentry/sentry-javascript/pull/18250))
83+
</details>
84+
85+
Work in this release was contributed by @bignoncedric and @adam-kov. Thank you for your contributions!
86+
4087
## 10.26.0
4188

4289
### Important Changes

dev-packages/browser-integration-tests/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/browser-integration-tests",
3-
"version": "10.26.0",
3+
"version": "10.27.0",
44
"main": "index.js",
55
"license": "MIT",
66
"engines": {
@@ -43,7 +43,7 @@
4343
"@babel/preset-typescript": "^7.16.7",
4444
"@playwright/test": "~1.53.2",
4545
"@sentry-internal/rrweb": "2.34.0",
46-
"@sentry/browser": "10.26.0",
46+
"@sentry/browser": "10.27.0",
4747
"@supabase/supabase-js": "2.49.3",
4848
"axios": "^1.12.2",
4949
"babel-loader": "^8.2.2",
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import * as Sentry from '@sentry/browser';
2+
import { browserProfilingIntegration } from '@sentry/browser';
3+
4+
window.Sentry = Sentry;
5+
6+
Sentry.init({
7+
dsn: 'https://[email protected]/1337',
8+
integrations: [browserProfilingIntegration()],
9+
tracesSampleRate: 1,
10+
profileSessionSampleRate: 1,
11+
profileLifecycle: 'manual',
12+
});
13+
14+
function largeSum(amount = 1000000) {
15+
let sum = 0;
16+
for (let i = 0; i < amount; i++) {
17+
sum += Math.sqrt(i) * Math.sin(i);
18+
}
19+
}
20+
21+
function fibonacci(n) {
22+
if (n <= 1) {
23+
return n;
24+
}
25+
return fibonacci(n - 1) + fibonacci(n - 2);
26+
}
27+
28+
function fibonacci1(n) {
29+
if (n <= 1) {
30+
return n;
31+
}
32+
return fibonacci1(n - 1) + fibonacci1(n - 2);
33+
}
34+
35+
function fibonacci2(n) {
36+
if (n <= 1) {
37+
return n;
38+
}
39+
return fibonacci1(n - 1) + fibonacci1(n - 2);
40+
}
41+
42+
function notProfiledFib(n) {
43+
if (n <= 1) {
44+
return n;
45+
}
46+
return fibonacci1(n - 1) + fibonacci1(n - 2);
47+
}
48+
49+
// Adding setTimeout to ensure we cross the sampling interval to avoid flakes
50+
51+
Sentry.uiProfiler.startProfiler();
52+
53+
fibonacci(40);
54+
await new Promise(resolve => setTimeout(resolve, 25));
55+
56+
largeSum();
57+
await new Promise(resolve => setTimeout(resolve, 25));
58+
59+
Sentry.uiProfiler.stopProfiler();
60+
61+
// ---
62+
63+
notProfiledFib(40);
64+
await new Promise(resolve => setTimeout(resolve, 25));
65+
66+
// ---
67+
68+
Sentry.uiProfiler.startProfiler();
69+
70+
fibonacci2(40);
71+
await new Promise(resolve => setTimeout(resolve, 25));
72+
73+
Sentry.uiProfiler.stopProfiler();
74+
75+
const client = Sentry.getClient();
76+
await client?.flush(8000);
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { expect } from '@playwright/test';
2+
import type { ProfileChunkEnvelope } from '@sentry/core';
3+
import { sentryTest } from '../../../utils/fixtures';
4+
import {
5+
countEnvelopes,
6+
getMultipleSentryEnvelopeRequests,
7+
properFullEnvelopeRequestParser,
8+
shouldSkipTracingTest,
9+
} from '../../../utils/helpers';
10+
import { validateProfile, validateProfilePayloadMetadata } from '../test-utils';
11+
12+
sentryTest(
13+
'does not send profile envelope when document-policy is not set',
14+
async ({ page, getLocalTestUrl, browserName }) => {
15+
if (shouldSkipTracingTest() || browserName !== 'chromium') {
16+
// Profiling only works when tracing is enabled
17+
sentryTest.skip();
18+
}
19+
20+
const url = await getLocalTestUrl({ testDir: __dirname });
21+
22+
// Assert that no profile_chunk envelope is sent without policy header
23+
const chunkCount = await countEnvelopes(page, { url, envelopeType: 'profile_chunk', timeout: 1500 });
24+
expect(chunkCount).toBe(0);
25+
},
26+
);
27+
28+
sentryTest('sends profile_chunk envelopes in manual mode', async ({ page, getLocalTestUrl, browserName }) => {
29+
if (shouldSkipTracingTest() || browserName !== 'chromium') {
30+
// Profiling only works when tracing is enabled
31+
sentryTest.skip();
32+
}
33+
34+
const url = await getLocalTestUrl({ testDir: __dirname, responseHeaders: { 'Document-Policy': 'js-profiling' } });
35+
36+
// In manual mode we start and stop once -> expect exactly one chunk
37+
const profileChunkEnvelopes = await getMultipleSentryEnvelopeRequests<ProfileChunkEnvelope>(
38+
page,
39+
2,
40+
{ url, envelopeType: 'profile_chunk', timeout: 8000 },
41+
properFullEnvelopeRequestParser,
42+
);
43+
44+
expect(profileChunkEnvelopes.length).toBe(2);
45+
46+
// Validate the first chunk thoroughly
47+
const profileChunkEnvelopeItem = profileChunkEnvelopes[0][1][0];
48+
const envelopeItemHeader = profileChunkEnvelopeItem[0];
49+
const envelopeItemPayload1 = profileChunkEnvelopeItem[1];
50+
51+
expect(envelopeItemHeader).toHaveProperty('type', 'profile_chunk');
52+
expect(envelopeItemPayload1.profile).toBeDefined();
53+
54+
const profilerId1 = envelopeItemPayload1.profiler_id;
55+
56+
validateProfilePayloadMetadata(envelopeItemPayload1);
57+
58+
validateProfile(envelopeItemPayload1.profile, {
59+
expectedFunctionNames: ['startJSSelfProfile', 'fibonacci', 'largeSum'],
60+
minSampleDurationMs: 20,
61+
isChunkFormat: true,
62+
});
63+
64+
// only contains fibonacci
65+
const functionNames1 = envelopeItemPayload1.profile.frames.map(frame => frame.function).filter(name => name !== '');
66+
expect(functionNames1).toEqual(expect.not.arrayContaining(['fibonacci1', 'fibonacci2', 'fibonacci3']));
67+
68+
// === PROFILE CHUNK 2 ===
69+
70+
const profileChunkEnvelopeItem2 = profileChunkEnvelopes[1][1][0];
71+
const envelopeItemHeader2 = profileChunkEnvelopeItem2[0];
72+
const envelopeItemPayload2 = profileChunkEnvelopeItem2[1];
73+
74+
expect(envelopeItemHeader2).toHaveProperty('type', 'profile_chunk');
75+
expect(envelopeItemPayload2.profile).toBeDefined();
76+
77+
expect(envelopeItemPayload2.profiler_id).toBe(profilerId1); // same profiler id for the whole session
78+
79+
validateProfilePayloadMetadata(envelopeItemPayload2);
80+
81+
validateProfile(envelopeItemPayload2.profile, {
82+
expectedFunctionNames: [
83+
'startJSSelfProfile',
84+
'fibonacci1', // called by fibonacci2
85+
'fibonacci2',
86+
],
87+
isChunkFormat: true,
88+
});
89+
90+
// does not contain notProfiledFib (called during unprofiled part)
91+
const functionNames2 = envelopeItemPayload2.profile.frames.map(frame => frame.function).filter(name => name !== '');
92+
expect(functionNames2).toEqual(expect.not.arrayContaining(['notProfiledFib']));
93+
});

dev-packages/browser-integration-tests/suites/profiling/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function validateProfile(
9090
}
9191
}
9292

93-
// Frames
93+
// FRAMES
9494
expect(profile.frames.length).toBeGreaterThan(0);
9595
for (const frame of profile.frames) {
9696
expect(frame).toHaveProperty('function');

dev-packages/browser-integration-tests/suites/public-api/logger/init.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@ window.Sentry = Sentry;
44

55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
7-
enableLogs: true,
7+
// purposefully testing against the experimental flag here
8+
_experiments: {
9+
enableLogs: true,
10+
},
811
});

dev-packages/browser-integration-tests/suites/public-api/logger/integration/init.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@ window.Sentry = Sentry;
55
Sentry.init({
66
dsn: 'https://[email protected]/1337',
77
enableLogs: true,
8+
// Purposefully specifying the experimental flag here
9+
// to ensure the top level option is used instead.
10+
_experiments: {
11+
enableLogs: false,
12+
},
813
integrations: [Sentry.consoleLoggingIntegration()],
914
});

dev-packages/bundle-analyzer-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sentry-internal/bundle-analyzer-scenarios",
3-
"version": "10.26.0",
3+
"version": "10.27.0",
44
"description": "Scenarios to test bundle analysis with",
55
"repository": "git://github.com/getsentry/sentry-javascript.git",
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/dev-packages/bundle-analyzer-scenarios",

0 commit comments

Comments
 (0)