Skip to content

Commit 72baf50

Browse files
authored
Merge 77fa886 into 72d77d8
2 parents 72d77d8 + 77fa886 commit 72baf50

File tree

627 files changed

+16459
-6417
lines changed

Some content is hidden

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

627 files changed

+16459
-6417
lines changed

.github/workflows/build.yml

Lines changed: 113 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ env:
4040
4141
BUILD_CACHE_KEY: ${{ github.event.inputs.commit || github.sha }}
4242

43+
# GH will use the first restore-key it finds that matches
44+
# So it will start by looking for one from the same branch, else take the newest one it can find elsewhere
45+
# We want to prefer the cache from the current master branch, if we don't find any on the current branch
46+
NX_CACHE_RESTORE_KEYS: |
47+
nx-Linux-${{ github.ref }}-${{ github.event.inputs.commit || github.sha }}
48+
nx-Linux-${{ github.ref }}
49+
nx-Linux-refs/heads/master
50+
nx-Linux
51+
4352
jobs:
4453
job_get_metadata:
4554
name: Get Metadata
@@ -120,6 +129,11 @@ jobs:
120129
changed_browser: ${{ steps.changed.outputs.browser }}
121130
changed_browser_integration: ${{ steps.changed.outputs.browser_integration }}
122131
changed_any_code: ${{ steps.changed.outputs.any_code }}
132+
# Note: These next three have to be checked as strings ('true'/'false')!
133+
is_master: ${{ github.ref == 'refs/heads/master' }}
134+
is_release: ${{ startsWith(github.ref, 'refs/heads/release/') }}
135+
force_skip_cache:
136+
${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ci-skip-cache') }}
123137

124138
job_install_deps:
125139
name: Install Dependencies
@@ -139,14 +153,19 @@ jobs:
139153
- name: Compute dependency cache key
140154
id: compute_lockfile_hash
141155
run: echo "hash=${{ hashFiles('yarn.lock') }}" >> "$GITHUB_OUTPUT"
156+
157+
# When the `ci-skip-cache` label is added to a PR, we always want to skip dependency cache
142158
- name: Check dependency cache
143159
uses: actions/cache@v3
144160
id: cache_dependencies
161+
if: needs.job_get_metadata.outputs.force_skip_cache == 'false'
145162
with:
146163
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
147164
key: ${{ steps.compute_lockfile_hash.outputs.hash }}
165+
148166
- name: Install dependencies
149-
if: steps.cache_dependencies.outputs.cache-hit == ''
167+
if:
168+
steps.cache_dependencies.outputs.cache-hit == '' || needs.job_get_metadata.outputs.force_skip_cache == 'true'
150169
run: yarn install --ignore-engines --frozen-lockfile
151170
outputs:
152171
dependency_cache_key: ${{ steps.compute_lockfile_hash.outputs.hash }}
@@ -168,12 +187,31 @@ jobs:
168187
with:
169188
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
170189
key: ${{ needs.job_install_deps.outputs.dependency_cache_key }}
190+
171191
- name: Check build cache
172192
uses: actions/cache@v3
173193
id: cache_built_packages
194+
if: needs.job_get_metadata.outputs.force_skip_cache == 'false'
174195
with:
175196
path: ${{ env.CACHED_BUILD_PATHS }}
176197
key: ${{ env.BUILD_CACHE_KEY }}
198+
199+
- name: NX cache
200+
uses: actions/cache@v3
201+
# Disable cache when:
202+
# - on master
203+
# - on release branches
204+
# - when PR has `ci-skip-cache` label
205+
if: |
206+
needs.job_get_metadata.outputs.is_release == 'false' &&
207+
needs.job_get_metadata.outputs.force_skip_cache == 'false'
208+
with:
209+
path: node_modules/.cache/nx
210+
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
211+
# On master branch, we want to _store_ the cache (so it can be used by other branches), but never _restore_ from it
212+
restore-keys:
213+
${{needs.job_get_metadata.outputs.is_master == 'false' && env.NX_CACHE_RESTORE_KEYS || 'nx-never-restore'}}
214+
177215
- name: Build packages
178216
# Under normal circumstances, using the git SHA as a cache key, there shouldn't ever be a cache hit on the built
179217
# packages, and so `yarn build` should always run. This `if` check is therefore only there for testing CI issues
@@ -232,7 +270,7 @@ jobs:
232270
timeout-minutes: 15
233271
runs-on: ubuntu-20.04
234272
# Size Check will error out outside of the context of a PR
235-
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/master'
273+
if: github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_master == 'true'
236274
steps:
237275
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
238276
uses: actions/checkout@v3
@@ -258,7 +296,7 @@ jobs:
258296
- name: Check bundle sizes
259297
uses: getsentry/size-limit-action@v5
260298
# Don't run size check on release branches - at that point, we're already committed
261-
if: ${{ !startsWith(github.ref, 'refs/heads/release/') }}
299+
if: needs.job_get_metadata.outputs.is_release == 'false'
262300
with:
263301
github_token: ${{ secrets.GITHUB_TOKEN }}
264302
skip_step: build
@@ -320,7 +358,7 @@ jobs:
320358
needs: [job_get_metadata, job_build]
321359
runs-on: ubuntu-20.04
322360
# Build artifacts are only needed for releasing workflow.
323-
if: startsWith(github.ref, 'refs/heads/release/')
361+
if: needs.job_get_metadata.outputs.is_release == 'true'
324362
steps:
325363
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
326364
uses: actions/checkout@v3
@@ -339,7 +377,7 @@ jobs:
339377
path: ${{ env.CACHED_BUILD_PATHS }}
340378
key: ${{ env.BUILD_CACHE_KEY }}
341379
- name: Pack
342-
run: yarn build:npm
380+
run: yarn build:tarball
343381
- name: Archive artifacts
344382
uses: actions/upload-artifact@v3.1.1
345383
with:
@@ -505,6 +543,7 @@ jobs:
505543
if: needs.job_get_metadata.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
506544
runs-on: ubuntu-20.04
507545
strategy:
546+
fail-fast: false
508547
matrix:
509548
bundle:
510549
- esm
@@ -540,13 +579,34 @@ jobs:
540579
with:
541580
path: ${{ env.CACHED_BUILD_PATHS }}
542581
key: ${{ env.BUILD_CACHE_KEY }}
582+
- name: Get npm cache directory
583+
id: npm-cache-dir
584+
run: |
585+
echo "::set-output name=dir::$(npm config get cache)"
586+
- name: Get Playwright version
587+
id: playwright-version
588+
run: |
589+
echo "::set-output name=version::$(node -p "require('@playwright/test/package.json').version")"
590+
- uses: actions/cache@v3
591+
name: Check if Playwright browser is cached
592+
id: playwright-cache
593+
with:
594+
path: ${{ steps.npm-cache-dir.outputs.dir }}
595+
key: ${{ runner.os }}-Playwright-${{steps.playwright-version.outputs.version}}
596+
- name: Install Playwright browser if not cached
597+
if: steps.playwright-cache.outputs.cache-hit != 'true'
598+
run: npx playwright install --with-deps
599+
env:
600+
PLAYWRIGHT_BROWSERS_PATH: ${{steps.npm-cache-dir.outputs.dir}}
601+
- name: Install OS dependencies of Playwright if cache hit
602+
if: steps.playwright-cache.outputs.cache-hit == 'true'
603+
run: npx playwright install-deps
543604
- name: Run Playwright tests
544605
env:
545606
PW_BUNDLE: ${{ matrix.bundle }}
546607
PW_TRACING_ONLY: ${{ matrix.tracing_only }}
547608
run: |
548609
cd packages/integration-tests
549-
yarn run playwright install-deps webkit
550610
yarn test:ci
551611
552612
job_browser_integration_tests:
@@ -755,3 +815,50 @@ jobs:
755815
if: contains(needs.*.result, 'failure')
756816
run: |
757817
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
818+
819+
replay_metrics:
820+
name: Replay Metrics
821+
needs: [job_get_metadata, job_build]
822+
runs-on: ubuntu-20.04
823+
timeout-minutes: 30
824+
steps:
825+
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
826+
uses: actions/checkout@v3
827+
with:
828+
ref: ${{ env.HEAD_COMMIT }}
829+
- name: Set up Node
830+
uses: volta-cli/action@v4
831+
- name: Check dependency cache
832+
uses: actions/cache@v3
833+
with:
834+
path: ${{ env.CACHED_DEPENDENCY_PATHS }}
835+
key: ${{ needs.job_build.outputs.dependency_cache_key }}
836+
- name: Check build cache
837+
uses: actions/cache@v3
838+
with:
839+
path: ${{ env.CACHED_BUILD_PATHS }}
840+
key: ${{ env.BUILD_CACHE_KEY }}
841+
842+
- name: Setup
843+
run: yarn install
844+
working-directory: packages/replay/metrics
845+
846+
- name: Collect
847+
run: yarn ci:collect
848+
working-directory: packages/replay/metrics
849+
850+
- name: Process
851+
id: process
852+
run: yarn ci:process
853+
working-directory: packages/replay/metrics
854+
# Don't run on forks - the PR comment cannot be added.
855+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
856+
env:
857+
GITHUB_TOKEN: ${{ github.token }}
858+
859+
- name: Upload results
860+
uses: actions/upload-artifact@v3
861+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
862+
with:
863+
name: ${{ steps.process.outputs.artifactName }}
864+
path: ${{ steps.process.outputs.artifactPath }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ tmp.js
4747

4848
# eslint
4949
.eslintcache
50-
eslintcache/*
50+
**/eslintcache/*

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = [
4646
},
4747
{
4848
name: '@sentry/nextjs Client - Webpack (gzipped + minified)',
49-
path: 'packages/nextjs/build/esm/index.client.js',
49+
path: 'packages/nextjs/build/esm/client/index.js',
5050
import: '{ init }',
5151
gzip: true,
5252
limit: '57 KB',

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@
3737
"internalConsoleOptions": "openOnSessionStart",
3838
"outputCapture": "std"
3939
},
40+
{
41+
"type": "node",
42+
"name": "Debug replay metrics collection script",
43+
"request": "launch",
44+
"cwd": "${workspaceFolder}/packages/replay/metrics/",
45+
"program": "${workspaceFolder}/packages/replay/metrics/configs/dev/collect.ts",
46+
"preLaunchTask": "Build Replay metrics script",
47+
},
48+
{
49+
"type": "node",
50+
"name": "Debug replay metrics processing script",
51+
"request": "launch",
52+
"cwd": "${workspaceFolder}/packages/replay/metrics/",
53+
"program": "${workspaceFolder}/packages/replay/metrics/configs/dev/process.ts",
54+
"preLaunchTask": "Build Replay metrics script",
55+
},
4056
// Run rollup using the config file which is in the currently active tab.
4157
{
4258
"name": "Debug rollup (config from open file)",

.vscode/tasks.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
"type": "npm",
88
"script": "predebug",
99
"path": "packages/nextjs/test/integration/",
10-
"detail": "Link the SDK (if not already linked) and build test app"
10+
"detail": "Link the SDK (if not already linked) and build test app",
11+
},
12+
{
13+
"label": "Build Replay metrics script",
14+
"type": "npm",
15+
"script": "build",
16+
"path": "packages/replay/metrics",
1117
}
1218
]
1319
}

CHANGELOG.md

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

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

7+
## 7.30.0
8+
9+
- feat(core): Add `addIntegration` method to client (#6651)
10+
- feat(core): Add `replay_event` type for events (#6481)
11+
- feat(gatsby): Support Gatsby v5 (#6635)
12+
- feat(integrations): Add HTTPClient integration (#6500)
13+
- feat(node): Add `LocalVariables` integration to capture local variables to stack frames (#6478)
14+
- feat(node): Check for invalid url in node transport (#6623)
15+
- feat(replay): Remove `replayType` from tags and into `replay_event` (#6658)
16+
- feat(transport): Return result through Transport send (#6626)
17+
- fix(nextjs): Don't wrap `res.json` and `res.send` (#6674)
18+
- fix(nextjs): Don't write to `res.end` to fix `next export` (#6682)
19+
- fix(nextjs): Exclude SDK from Edge runtime bundles (#6683)
20+
- fix(replay): Allow Replay to be used in Electron renderers with nodeIntegration enabled (#6644)
21+
- fix(utils): Ignore stack frames over 1kb (#6627)
22+
- ref(angular) Add error-like objects handling (#6446)
23+
- ref(nextjs): Remove `instrumentSever` (#6592)
24+
25+
Work in this release contributed by @rjoonas, @Naddiseo, and @theofidry. Thank you for your contributions!
26+
727
## 7.29.0
828

929
This update includes a change to the `@sentry/nextjs` SDK that may increase response times of requests in applications

docs/event-sending.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ This document gives an outline for how event sending works, and which which plac
7777
## Replay (WIP)
7878

7979
* `replay.sendReplayRequest()`
80-
* `createPayload()`
81-
* `getReplayEvent()`
80+
* `createRecordingData()`
81+
* `prepareReplayEvent()`
8282
* `client._prepareEvent()` (see baseclient)
8383
* `baseclient._applyClientOptions()`
8484
* `baseclient._applyIntegrationsMetadata()`

docs/new-sdk-release-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This page serves as a checklist of what to do when releasing a new SDK for the f
2121
- [ ] Make sure that the `LICENSE` file exists and has the correct license (We default to the `MIT` license)
2222
- [ ] Also check, that the same license is mentioned in `package.json`
2323

24-
- [ ] Make sure that the tarball (`yarn build:npm`) has all the necessary contents
24+
- [ ] Make sure that the tarball (`yarn build:tarball`) has all the necessary contents
2525

2626
For basic SDKs, this means that the tarball has at least these files:
2727

lerna.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"lerna": "3.4.0",
3-
"version": "7.29.0",
4-
"packages": "packages/*",
2+
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3+
"version": "7.30.0",
4+
"packages": ["packages/*"],
55
"npmClient": "yarn",
66
"useWorkspaces": true
77
}

0 commit comments

Comments
 (0)