Skip to content

Commit 706ebd3

Browse files
authored
Merge pull request #13474 from getsentry/prepare-release/8.27.0
meta: Update CHANGELOG for 8.27.0
2 parents d7e934e + b0180be commit 706ebd3

File tree

11 files changed

+113
-48
lines changed

11 files changed

+113
-48
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ outputs:
99
runs:
1010
using: "composite"
1111
steps:
12-
# we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed,
13-
# so no need to reinstall them
1412
- name: Compute dependency cache key
1513
id: compute_lockfile_hash
16-
run: echo "hash=dependencies-${{ hashFiles('yarn.lock', 'packages/*/package.json', 'dev-packages/*/package.json') }}" >> "$GITHUB_OUTPUT"
14+
run: node ./scripts/dependency-hash-key.js >> "$GITHUB_OUTPUT"
1715
shell: bash
1816

1917
- name: Check dependency cache

.github/workflows/build.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ jobs:
127127
runs-on: ubuntu-20.04
128128
timeout-minutes: 15
129129
if: |
130-
needs.job_get_metadata.outputs.changed_any_code == 'true' &&
130+
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
131+
needs.job_get_metadata.outputs.is_develop == 'true' ||
132+
needs.job_get_metadata.outputs.is_release == 'true' ||
131133
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false')
132134
steps:
133135
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
@@ -344,7 +346,7 @@ jobs:
344346
name: ${{ github.sha }}
345347
path: |
346348
${{ github.workspace }}/packages/browser/build/bundles/**
347-
${{ github.workspace }}/packages/replay/build/bundles/**
349+
${{ github.workspace }}/packages/replay-internal/build/bundles/**
348350
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
349351
${{ github.workspace }}/packages/feedback/build/bundles/**
350352
${{ github.workspace }}/packages/**/*.tgz
@@ -1417,31 +1419,29 @@ jobs:
14171419
with:
14181420
ref: ${{ env.HEAD_COMMIT }}
14191421

1422+
- name: Setup Node
1423+
uses: actions/setup-node@v4
1424+
with:
1425+
node-version: ${{ matrix.node }}
1426+
14201427
- name: Restore dependency cache
14211428
uses: actions/cache/restore@v4
14221429
id: restore-dependencies
14231430
with:
14241431
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
14251432
key: ${{ needs.job_build.outputs.dependency_cache_key }}
14261433
enableCrossOsArchive: true
1427-
fail-on-cache-miss: true
14281434

1429-
- name: Restore build cache
1430-
uses: actions/cache/restore@v4
1431-
id: restore-build
1432-
with:
1433-
path: ${{ env.CACHED_BUILD_PATHS }}
1434-
key: ${{ needs.job_build.outputs.dependency_cache_key }}
1435-
enableCrossOsArchive: true
1436-
fail-on-cache-miss: true
1435+
- name: Install dependencies
1436+
env:
1437+
SKIP_PLAYWRIGHT_BROWSER_INSTALL: "1"
1438+
if: steps.restore-dependencies.outputs.cache-hit != 'true'
1439+
run: yarn install --ignore-engines --frozen-lockfile
14371440

14381441
- name: Configure safe directory
14391442
run: |
14401443
git config --global --add safe.directory "*"
14411444
1442-
- name: Install yarn
1443-
run: npm i -g [email protected] --force
1444-
14451445
- name: Increase yarn network timeout on Windows
14461446
if: contains(matrix.os, 'windows')
14471447
run: yarn config set network-timeout 600000 -g
@@ -1453,15 +1453,6 @@ jobs:
14531453
with:
14541454
python-version: '3.8.10'
14551455

1456-
- name: Setup Node
1457-
uses: actions/setup-node@v4
1458-
with:
1459-
node-version: ${{ matrix.node }}
1460-
1461-
- name: Install Dependencies
1462-
if: steps.restore-dependencies.outputs.cache-hit != 'true'
1463-
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts
1464-
14651456
- name: Setup (arm64| ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }})
14661457
if: matrix.arch == 'arm64' && !contains(matrix.container, 'alpine') && matrix.target_platform != 'darwin'
14671458
run: |

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
- feat: Add options for passing nonces to feedback integration (#13347)
2828
- feat: Add support for SENTRY_SPOTLIGHT env var in Node (#13325)
2929
- feat(deps): bump @prisma/instrumentation from 5.17.0 to 5.18.0 (#13327)
30+
- feat(feedback): Improve error message for 403 errors (#13441)
3031
- fix(deno): Don't rely on `Deno.permissions.querySync` (#13378)
32+
- fix(replay): Ensure we publish replay CDN bundles (#13437)
3133

3234
Work in this release was contributed by @charpeni. Thank you for your contribution!
3335

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"private": true,
1010
"scripts": {
1111
"clean": "rimraf -g suites/**/dist loader-suites/**/dist tmp",
12-
"install-browsers": "npx playwright install --with-deps",
12+
"install-browsers": "[[ -z \"$SKIP_PLAYWRIGHT_BROWSER_INSTALL\" ]] && yarn install-browsers || echo 'Skipping browser installation'",
1313
"lint": "eslint . --format stylish",
1414
"fix": "eslint . --format stylish --fix",
1515
"type-check": "tsc",

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/init.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,3 @@ Sentry.init({
1010
feedbackIntegration({ tags: { from: 'integration init' }, styleNonce: 'foo1234', scriptNonce: 'foo1234' }),
1111
],
1212
});
13-
14-
document.addEventListener('securitypolicyviolation', () => {
15-
const container = document.querySelector('#csp-violation');
16-
if (container) {
17-
container.innerText = 'CSP Violation';
18-
}
19-
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
window.__CSPVIOLATION__ = false;
2+
document.addEventListener('securitypolicyviolation', () => {
3+
window.__CSPVIOLATION__ = true;
4+
});

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/template.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@
77
content="style-src 'nonce-foo1234'; script-src sentry-test.io 'nonce-foo1234';"
88
/>
99
</head>
10-
<body>
11-
<div id="csp-violation" />
12-
</body>
10+
<body></body>
1311
</html>

dev-packages/browser-integration-tests/suites/feedback/captureFeedbackCsp/test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ sentryTest('should capture feedback', async ({ getLocalTestUrl, page }) => {
7979
},
8080
platform: 'javascript',
8181
});
82-
const cspContainer = await page.locator('#csp-violation');
83-
expect(cspContainer).not.toContainText('CSP Violation');
82+
const cspViolation = await page.evaluate<boolean>('window.__CSPVIOLATION__');
83+
expect(cspViolation).toBe(false);
8484
});

packages/cloudflare/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,16 @@ Currently only ESM handlers are supported.
114114
import * as Sentry from '@sentry/cloudflare';
115115

116116
export default withSentry(
117-
(env) => ({
118-
dsn: env.SENTRY_DSN,
117+
env => ({
118+
dsn: env.SENTRY_DSN,
119119
// Set tracesSampleRate to 1.0 to capture 100% of spans for tracing.
120-
tracesSampleRate: 1.0,
121-
}),
122-
{
123-
async fetch(request, env, ctx) {
124-
return new Response('Hello World!');
125-
},
126-
} satisfies ExportedHandler<Env>
120+
tracesSampleRate: 1.0,
121+
}),
122+
{
123+
async fetch(request, env, ctx) {
124+
return new Response('Hello World!');
125+
},
126+
} satisfies ExportedHandler<Env>,
127127
);
128128
```
129129

packages/feedback/src/core/sendFeedback.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ export const sendFeedback: SendFeedback = (
6464
);
6565
}
6666

67+
if (response && typeof response.statusCode === 'number' && response.statusCode === 403) {
68+
return reject(
69+
'Unable to send Feedback. This could be because this domain is not in your list of allowed domains.',
70+
);
71+
}
72+
6773
return reject(
6874
'Unable to send Feedback. This could be because of network issues, or because you are using an ad-blocker',
6975
);

scripts/dependency-hash-key.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
const crypto = require('crypto');
2+
const fs = require('fs');
3+
const path = require('path');
4+
5+
/**
6+
* Build a cache key for the dependencies of the monorepo.
7+
* In addition to the content of the yarn.lock file, we also include
8+
* dependencies of all workspace packages in the cache key.
9+
* This ensures that we get a consistent cache key even if a dependency change does not affect
10+
* the yarn.lock file.
11+
*/
12+
function outputDependencyCacheKey() {
13+
const lockfileContent = fs.readFileSync(path.join(process.cwd(), 'yarn.lock'), 'utf8');
14+
15+
const hashParts = [lockfileContent];
16+
17+
const packageJson = require(path.join(process.cwd(), 'package.json'));
18+
19+
const workspacePackages = packageJson.workspaces || [];
20+
21+
// Get the package name (e.g. @sentry/browser) of all workspace packages
22+
// we want to ignore their version numbers later
23+
const workspacePackageNames = getWorkspacePackageNames(workspacePackages);
24+
25+
// Add the dependencies of the workspace itself
26+
hashParts.push(getNormalizedDependencies(packageJson, workspacePackageNames));
27+
28+
// Now for each workspace package, add the dependencies
29+
workspacePackages.forEach(workspace => {
30+
const packageJsonPath = path.join(process.cwd(), workspace, 'package.json');
31+
const packageJson = require(packageJsonPath);
32+
hashParts.push(getNormalizedDependencies(packageJson, workspacePackageNames));
33+
});
34+
35+
const hash = crypto.createHash('md5').update(hashParts.join('\n')).digest('hex');
36+
// We log the output in a way that the GitHub Actions can append it to the output
37+
// We prefix it with `dependencies-` so it is easier to identify in the logs
38+
// eslint-disable-next-line no-console
39+
console.log(`hash=dependencies-${hash}`);
40+
}
41+
42+
function getNormalizedDependencies(packageJson, workspacePackageNames) {
43+
const { dependencies, devDependencies } = packageJson;
44+
45+
const mergedDependencies = {
46+
...devDependencies,
47+
...dependencies,
48+
};
49+
50+
const normalizedDependencies = {};
51+
52+
// Sort the keys to ensure a consistent order
53+
Object.keys(mergedDependencies)
54+
.sort()
55+
.forEach(key => {
56+
// If the dependency is a workspace package, ignore the version
57+
// No need to invalidate a cache after every release
58+
const version = workspacePackageNames.includes(key) ? '**workspace**' : mergedDependencies[key];
59+
normalizedDependencies[key] = version;
60+
});
61+
62+
return JSON.stringify(normalizedDependencies);
63+
}
64+
65+
function getWorkspacePackageNames(workspacePackages) {
66+
return workspacePackages.map(workspace => {
67+
const packageJsonPath = path.join(process.cwd(), workspace, 'package.json');
68+
const packageJson = require(packageJsonPath);
69+
return packageJson.name;
70+
});
71+
}
72+
73+
outputDependencyCacheKey();

0 commit comments

Comments
 (0)