Skip to content

Commit 8231651

Browse files
committed
Merge branch 'develop' into nh/langgraph-no-invoke-agent
2 parents 957b6ed + 0e597c2 commit 8231651

582 files changed

Lines changed: 18850 additions & 5304 deletions

File tree

Some content is hidden

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

.claude/skills/e2e/SKILL.md

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
---
2+
name: e2e
3+
description: Run E2E tests for Sentry JavaScript SDK test applications
4+
argument-hint: <test-app-name> [--variant <variant-name>]
5+
---
6+
7+
# E2E Test Runner Skill
8+
9+
This skill runs end-to-end tests for Sentry JavaScript SDK test applications. It ensures SDK packages are built before running tests.
10+
11+
## Input
12+
13+
The user provides a test application name and optionally a variant:
14+
15+
- `e2e-tests/test-applications/nextjs-app-dir` (full path)
16+
- `nextjs-app-dir` (just the app name)
17+
- `nextjs-app-dir --variant nextjs-15` (with variant)
18+
19+
## Workflow
20+
21+
### Step 1: Parse the Test Application Name
22+
23+
Extract the test app name from user input:
24+
25+
- Strip `e2e-tests/test-applications/` prefix if present
26+
- Extract variant flag if provided (e.g., `--variant nextjs-15`)
27+
- Store the clean app name (e.g., `nextjs-app-dir`)
28+
29+
### Step 2: Determine Which Packages Need Rebuilding
30+
31+
If the user recently edited files in `packages/*`, identify which packages were modified:
32+
33+
```bash
34+
# Check which packages have uncommitted changes (including untracked files)
35+
git status --porcelain | grep "^[ MARC?][ MD?] packages/" | cut -d'/' -f2 | sort -u
36+
```
37+
38+
For each modified package, rebuild its tarball:
39+
40+
```bash
41+
cd packages/<package-name>
42+
yarn build && yarn build:tarball
43+
cd ../..
44+
```
45+
46+
**Option C: User Specifies Packages**
47+
48+
If the user says "I changed @sentry/node" or similar, rebuild just that package:
49+
50+
```bash
51+
cd packages/node
52+
yarn build && yarn build:tarball
53+
cd ../..
54+
```
55+
56+
### Step 3: Verify Test Application Exists
57+
58+
Check that the test app exists:
59+
60+
```bash
61+
ls -d dev-packages/e2e-tests/test-applications/<app-name>
62+
```
63+
64+
If it doesn't exist, list available test apps:
65+
66+
```bash
67+
ls dev-packages/e2e-tests/test-applications/
68+
```
69+
70+
Ask the user which one they meant.
71+
72+
### Step 4: Run the E2E Test
73+
74+
Navigate to the e2e-tests directory and run the test:
75+
76+
```bash
77+
cd dev-packages/e2e-tests
78+
yarn test:run <app-name>
79+
```
80+
81+
If a variant was specified:
82+
83+
```bash
84+
cd dev-packages/e2e-tests
85+
yarn test:run <app-name> --variant <variant-name>
86+
```
87+
88+
### Step 5: Report Results
89+
90+
After the test completes, provide a summary:
91+
92+
**If tests passed:**
93+
94+
```
95+
✅ E2E tests passed for <app-name>
96+
97+
All tests completed successfully. Your SDK changes work correctly with this test application.
98+
```
99+
100+
**If tests failed:**
101+
102+
```
103+
❌ E2E tests failed for <app-name>
104+
105+
[Include relevant error output]
106+
```
107+
108+
**If package rebuild was needed:**
109+
110+
```
111+
📦 Rebuilt SDK packages: <list of packages>
112+
🧪 Running E2E tests for <app-name>...
113+
```
114+
115+
## Error Handling
116+
117+
- **No tarballs found**: Run `yarn build && yarn build:tarball` at repository root
118+
- **Test app not found**: List available apps and ask user to clarify
119+
- **Verdaccio not running**: Tests should start Verdaccio automatically, but if issues occur, check Docker
120+
- **Build failures**: Fix build errors before running tests
121+
122+
## Common Test Applications
123+
124+
Here are frequently tested applications:
125+
126+
- `nextjs-app-dir` - Next.js App Router
127+
- `nextjs-15` - Next.js 15.x
128+
- `react-create-hash-router` - React with React Router
129+
- `node-express-esm-loader` - Node.js Express with ESM
130+
- `sveltekit-2` - SvelteKit 2.x
131+
- `remix-2` - Remix 2.x
132+
- `nuxt-3` - Nuxt 3.x
133+
134+
To see all available test apps:
135+
136+
```bash
137+
ls dev-packages/e2e-tests/test-applications/
138+
```
139+
140+
## Example Workflows
141+
142+
### Example 1: After modifying @sentry/node
143+
144+
```bash
145+
# User: "Run e2e tests for node-express-esm-loader"
146+
147+
# Step 1: Detect recent changes to packages/node
148+
# Step 2: Rebuild the modified package
149+
cd packages/node
150+
yarn build && yarn build:tarball
151+
cd ../..
152+
153+
# Step 3: Run the test
154+
cd dev-packages/e2e-tests
155+
yarn test:run node-express-esm-loader
156+
```
157+
158+
### Example 2: First-time test run
159+
160+
```bash
161+
# User: "Run e2e tests for nextjs-app-dir"
162+
163+
# Step 1: Check for existing tarballs
164+
# Step 2: None found, build all packages
165+
yarn build && yarn build:tarball
166+
167+
# Step 3: Run the test
168+
cd dev-packages/e2e-tests
169+
yarn test:run nextjs-app-dir
170+
```
171+
172+
### Example 3: With variant
173+
174+
```bash
175+
# User: "Run e2e tests for nextjs-app-dir with nextjs-15 variant"
176+
177+
# Step 1: Rebuild if needed
178+
# Step 2: Run with variant
179+
cd dev-packages/e2e-tests
180+
yarn test:run nextjs-app-dir --variant nextjs-15
181+
```
182+
183+
## Tips
184+
185+
- **Always rebuild after SDK changes**: Tarballs contain the compiled SDK code
186+
- **Watch build output**: Build errors must be fixed before testing
187+
188+
## Integration with Development Workflow
189+
190+
This skill integrates with the standard SDK development workflow:
191+
192+
1. Make changes to SDK code in `packages/*`
193+
2. Run `/e2e <app-name>` to test your changes
194+
3. Fix any test failures
195+
196+
The skill automates the tedious parts of:
197+
198+
- Remembering to rebuild tarballs
199+
- Navigating to the correct directory
200+
- Running tests with the right flags

.craft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ targets:
146146
# AWS Lambda Layer target
147147
- name: aws-lambda-layer
148148
includeNames: /^sentry-node-serverless-\d+.\d+.\d+(-(beta|alpha|rc)\.\d+)?\.zip$/
149-
layerName: SentryNodeServerlessSDKv10
149+
layerName: SentryNodeServerlessSDKv{{{major}}}
150150
compatibleRuntimes:
151151
- name: node
152152
versions:

.cursor/rules/sdk_development.mdc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,54 @@ Each package typically contains:
121121
- Integration tests use Playwright extensively
122122
- Never change the volta, yarn, or package manager setup in general unless explicitly asked for
123123

124+
### E2E Testing
125+
126+
E2E tests are located in `dev-packages/e2e-tests/` and verify SDK behavior in real-world framework scenarios.
127+
128+
#### How Verdaccio Registry Works
129+
130+
E2E tests use [Verdaccio](https://verdaccio.org/), a lightweight npm registry running in Docker. Before tests run:
131+
132+
1. SDK packages are built and packed into tarballs (`yarn build && yarn build:tarball`)
133+
2. Tarballs are published to Verdaccio at `http://127.0.0.1:4873`
134+
3. Test applications install packages from Verdaccio instead of public npm
135+
136+
#### The `.npmrc` Requirement
137+
138+
Every E2E test application needs an `.npmrc` file with:
139+
140+
```
141+
@sentry:registry=http://127.0.0.1:4873
142+
@sentry-internal:registry=http://127.0.0.1:4873
143+
```
144+
145+
Without this file, pnpm installs from the public npm registry instead of Verdaccio, so your local changes won't be tested. This is a common cause of "tests pass in CI but fail locally" or vice versa.
146+
147+
#### Running a Single E2E Test
148+
149+
```bash
150+
# Build packages first
151+
yarn build && yarn build:tarball
152+
153+
# Run a specific test app
154+
cd dev-packages/e2e-tests
155+
yarn test:run <app-name>
156+
157+
# Run with a specific variant (e.g., Next.js 15)
158+
yarn test:run <app-name> --variant <variant-name>
159+
```
160+
161+
#### Common Pitfalls and Debugging
162+
163+
1. **Missing `.npmrc`**: Most common issue. Always verify the test app has the correct `.npmrc` file.
164+
165+
2. **Stale tarballs**: After SDK changes, must re-run `yarn build:tarball`.
166+
167+
3. **Debugging tips**:
168+
- Check browser console logs for SDK initialization errors
169+
- Use `debug: true` in Sentry config
170+
- Verify installed package version: check `node_modules/@sentry/*/package.json`
171+
124172
### Notes for Background Tasks
125173

126174
- Make sure to use [volta](https://volta.sh/) for development. Volta is used to manage the node, yarn and pnpm version used.

.github/workflows/auto-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- name: Get auth token
1717
id: token
18-
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
18+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
1919
with:
2020
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
2121
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}

.github/workflows/build.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
head: ${{ env.HEAD_COMMIT }}
160160

161161
- name: NX cache
162-
uses: actions/cache@v4
162+
uses: actions/cache@v5
163163
# Disable cache when:
164164
# - on release branches
165165
# - when PR has `ci-skip-cache` label or on nightly builds
@@ -181,7 +181,7 @@ jobs:
181181
run: yarn build
182182

183183
- name: Upload build artifacts
184-
uses: actions/upload-artifact@v5
184+
uses: actions/upload-artifact@v6
185185
with:
186186
name: build-output
187187
path: ${{ env.CACHED_BUILD_PATHS }}
@@ -386,7 +386,7 @@ jobs:
386386
run: yarn build:tarball
387387

388388
- name: Archive artifacts
389-
uses: actions/upload-artifact@v5
389+
uses: actions/upload-artifact@v6
390390
with:
391391
name: ${{ github.sha }}
392392
retention-days: 90
@@ -568,9 +568,11 @@ jobs:
568568
- bundle_min
569569
- bundle_replay
570570
- bundle_tracing
571+
- bundle_tracing_logs_metrics
571572
- bundle_tracing_replay
572573
- bundle_tracing_replay_feedback
573574
- bundle_tracing_replay_feedback_min
575+
- bundle_tracing_replay_feedback_logs_metrics
574576
project:
575577
- chromium
576578
include:
@@ -629,7 +631,7 @@ jobs:
629631
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
630632

631633
- name: Upload Playwright Traces
632-
uses: actions/upload-artifact@v5
634+
uses: actions/upload-artifact@v6
633635
if: failure()
634636
with:
635637
name:
@@ -692,7 +694,7 @@ jobs:
692694
yarn test:loader
693695
694696
- name: Upload Playwright Traces
695-
uses: actions/upload-artifact@v5
697+
uses: actions/upload-artifact@v6
696698
if: failure()
697699
with:
698700
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
@@ -881,7 +883,7 @@ jobs:
881883
with:
882884
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
883885
- name: NX cache
884-
uses: actions/cache/restore@v4
886+
uses: actions/cache/restore@v5
885887
with:
886888
path: .nxcache
887889
key: nx-Linux-${{ github.ref }}-${{ env.HEAD_COMMIT }}
@@ -892,7 +894,7 @@ jobs:
892894
run: yarn build:tarball
893895

894896
- name: Stores tarballs in cache
895-
uses: actions/cache/save@v4
897+
uses: actions/cache/save@v5
896898
with:
897899
path: ${{ github.workspace }}/packages/*/*.tgz
898900
key: ${{ env.BUILD_CACHE_TARBALL_KEY }}
@@ -959,7 +961,7 @@ jobs:
959961
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
960962

961963
- name: Restore tarball cache
962-
uses: actions/cache/restore@v4
964+
uses: actions/cache/restore@v5
963965
id: restore-tarball-cache
964966
with:
965967
path: ${{ github.workspace }}/packages/*/*.tgz
@@ -1009,7 +1011,7 @@ jobs:
10091011
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
10101012

10111013
- name: Upload Playwright Traces
1012-
uses: actions/upload-artifact@v5
1014+
uses: actions/upload-artifact@v6
10131015
if: failure()
10141016
with:
10151017
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
@@ -1023,7 +1025,7 @@ jobs:
10231025
node ./scripts/normalize-e2e-test-dump-transaction-events.js
10241026
10251027
- name: Upload E2E Test Event Dumps
1026-
uses: actions/upload-artifact@v5
1028+
uses: actions/upload-artifact@v6
10271029
if: failure()
10281030
with:
10291031
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
@@ -1084,7 +1086,7 @@ jobs:
10841086
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
10851087

10861088
- name: Restore tarball cache
1087-
uses: actions/cache/restore@v4
1089+
uses: actions/cache/restore@v5
10881090
id: restore-tarball-cache
10891091
with:
10901092
path: ${{ github.workspace }}/packages/*/*.tgz
@@ -1135,7 +1137,7 @@ jobs:
11351137
node ./scripts/normalize-e2e-test-dump-transaction-events.js
11361138
11371139
- name: Upload E2E Test Event Dumps
1138-
uses: actions/upload-artifact@v5
1140+
uses: actions/upload-artifact@v6
11391141
if: failure()
11401142
with:
11411143
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})

0 commit comments

Comments
 (0)