Skip to content

Commit

Permalink
Merge pull request #13459 from getsentry/prepare-release/8.27.0
Browse files Browse the repository at this point in the history
meta: Update Changelog for 8.27.0
  • Loading branch information
nicohrubec authored Aug 26, 2024
2 parents 7ef6da3 + bb2d34f commit d7e934e
Show file tree
Hide file tree
Showing 181 changed files with 3,295 additions and 920 deletions.
29 changes: 29 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Install yarn dependencies"
description: "Installs yarn dependencies and caches them."

outputs:
cache_key:
description: "The dependency cache key"
value: ${{ steps.compute_lockfile_hash.outputs.hash }}

runs:
using: "composite"
steps:
# we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed,
# so no need to reinstall them
- name: Compute dependency cache key
id: compute_lockfile_hash
run: echo "hash=dependencies-${{ hashFiles('yarn.lock', 'packages/*/package.json', 'dev-packages/*/package.json') }}" >> "$GITHUB_OUTPUT"
shell: bash

- name: Check dependency cache
uses: actions/cache@v4
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ steps.compute_lockfile_hash.outputs.hash }}

- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: yarn install --ignore-engines --frozen-lockfile
shell: bash
13 changes: 11 additions & 2 deletions .github/actions/install-playwright/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,23 @@ runs:
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
shell: bash

- name: Cache playwright binaries
uses: actions/cache@v4
- name: Restore cached playwright binaries
uses: actions/cache/restore@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}

# Only store cache on develop branch
- name: Store cached playwright binaries
uses: actions/cache/save@v4
if: github.event_name == 'push' && github.ref == 'refs/heads/develop'
with:
path: |
~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}

# We always install all browsers, if uncached
- name: Install Playwright dependencies (uncached)
run: npx playwright install chromium webkit firefox --with-deps
Expand Down
48 changes: 14 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,9 @@ jobs:
with:
node-version-file: 'package.json'

# we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed,
# so no need to reinstall them
- name: Compute dependency cache key
id: compute_lockfile_hash
run: echo "hash=${{ hashFiles('yarn.lock', '**/package.json') }}" >> "$GITHUB_OUTPUT"

- name: Check dependency cache
uses: actions/cache@v4
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ steps.compute_lockfile_hash.outputs.hash }}

- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: yarn install --ignore-engines --frozen-lockfile
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies

- name: Check for Affected Nx Projects
uses: dkhunt27/[email protected]
Expand Down Expand Up @@ -200,7 +187,7 @@ jobs:
run: yarn build

outputs:
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry-internal/node-integration-tests') }}
changed_remix: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry/remix') }}
changed_node: ${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected, '@sentry/node') }}
Expand Down Expand Up @@ -293,22 +280,9 @@ jobs:
with:
node-version-file: 'package.json'

# we use a hash of yarn.lock as our cache key, because if it hasn't changed, our dependencies haven't changed,
# so no need to reinstall them
- name: Compute dependency cache key
id: compute_lockfile_hash
run: echo "hash=${{ hashFiles('yarn.lock', '**/package.json') }}" >> "$GITHUB_OUTPUT"

- name: Check dependency cache
uses: actions/cache@v4
id: cache_dependencies
with:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ steps.compute_lockfile_hash.outputs.hash }}

- name: Install dependencies
if: steps.cache_dependencies.outputs.cache-hit != 'true'
run: yarn install --ignore-engines --frozen-lockfile
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies

- name: Check file formatting
run: yarn lint:prettier && yarn lint:biome
Expand Down Expand Up @@ -480,7 +454,8 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [14, 16, 18, 20, 22]
# TODO(lforst): Unpin Node.js version 22 when https://github.com/protobufjs/protobuf.js/issues/2025 is resolved which broke the nodejs tests
node: [14, 16, 18, 20, '22.6.0']
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v4
Expand Down Expand Up @@ -873,6 +848,7 @@ jobs:
[
'angular-17',
'angular-18',
'astro-4',
'aws-lambda-layer-cjs',
'aws-serverless-esm',
'node-express',
Expand Down Expand Up @@ -977,6 +953,7 @@ jobs:
with:
path: ${{ github.workspace }}/packages/*/*.tgz
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
fail-on-cache-miss: true

- name: Install Playwright
uses: ./.github/actions/install-playwright
Expand Down Expand Up @@ -1076,6 +1053,7 @@ jobs:
with:
path: ${{ github.workspace }}/packages/*/*.tgz
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
fail-on-cache-miss: true

- name: Install Playwright
uses: ./.github/actions/install-playwright
Expand Down Expand Up @@ -1446,6 +1424,7 @@ jobs:
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
key: ${{ needs.job_build.outputs.dependency_cache_key }}
enableCrossOsArchive: true
fail-on-cache-miss: true

- name: Restore build cache
uses: actions/cache/restore@v4
Expand All @@ -1454,6 +1433,7 @@ jobs:
path: ${{ env.CACHED_BUILD_PATHS }}
key: ${{ needs.job_build.outputs.dependency_cache_key }}
enableCrossOsArchive: true
fail-on-cache-miss: true

- name: Configure safe directory
run: |
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/cleanup-pr-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Automation: Cleanup PR caches"
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
# `actions:write` permission is required to delete caches
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"cSpell.words": ["arrayify"]
"cSpell.words": ["arrayify", "OTEL"]
}
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@

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

## 8.27.0

### Important Changes

- **fix(nestjs): Exception filters in main app module are not being executed (#13278)**

With this release nestjs error monitoring is no longer automatically set up after adding the `SentryModule` to your
application, which led to issues in certain scenarios. You will now have to either add the `SentryGlobalFilter` to
your main module providers or decorate the `catch()` method in your existing global exception filters with the newly
released `@WithSentry()` decorator. See the [docs](https://docs.sentry.io/platforms/javascript/guides/nestjs/) for
more details.

### Other Changes

- feat: Add options for passing nonces to feedback integration (#13347)
- feat: Add support for SENTRY_SPOTLIGHT env var in Node (#13325)
- feat(deps): bump @prisma/instrumentation from 5.17.0 to 5.18.0 (#13327)
- fix(deno): Don't rely on `Deno.permissions.querySync` (#13378)

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

## 8.26.0

### Important Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs';
import path from 'path';
import * as fs from 'fs';
import * as path from 'path';
import { expect } from '@playwright/test';

import { TEST_HOST, sentryTest } from '../../../../utils/fixtures';
Expand Down Expand Up @@ -28,19 +28,22 @@ sentryTest('it does not download the SDK if the SDK was loaded in the meanwhile'
});
});

const tmpDir = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true });

await page.route(`${TEST_HOST}/*.*`, route => {
const file = route.request().url().split('/').pop();

if (file === 'cdn.bundle.js') {
cdnLoadedCount++;
}

const filePath = path.resolve(__dirname, `./dist/${file}`);
const filePath = path.resolve(tmpDir, `./${file}`);

return fs.existsSync(filePath) ? route.fulfill({ path: filePath }) : route.continue();
});

const url = await getLocalTestUrl({ testDir: __dirname, skipRouteHandler: true });
const url = `${TEST_HOST}/index.html`;

const req = await waitForErrorRequestOnUrl(page, url);

const eventData = envelopeRequestParser(req);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const config: PlaywrightTestConfig = {
],

globalSetup: require.resolve('./playwright.setup.ts'),
globalTeardown: require.resolve('./playwright.teardown.ts'),
};

export default config;
5 changes: 5 additions & 0 deletions dev-packages/browser-integration-tests/playwright.teardown.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as childProcess from 'child_process';

export default function globalTeardown(): void {
childProcess.execSync('yarn clean', { stdio: 'inherit', cwd: process.cwd() });
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as Sentry from '@sentry/browser';
// Import this separately so that generatePlugin can handle it for CDN scenarios
import { feedbackIntegration } from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [
feedbackIntegration({ tags: { from: 'integration init' }, styleNonce: 'foo1234', scriptNonce: 'foo1234' }),
],
});

document.addEventListener('securitypolicyviolation', () => {
const container = document.querySelector('#csp-violation');
if (container) {
container.innerText = 'CSP Violation';
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta
http-equiv="Content-Security-Policy"
content="style-src 'nonce-foo1234'; script-src sentry-test.io 'nonce-foo1234';"
/>
</head>
<body>
<div id="csp-violation" />
</body>
</html>
Loading

0 comments on commit d7e934e

Please sign in to comment.