Skip to content

Commit 806ccdf

Browse files
committed
Merge remote-tracking branch 'origin/develop' into kunal/feat/support-suppressed-error
2 parents 91c0b88 + ea7efab commit 806ccdf

39 files changed

Lines changed: 382 additions & 211 deletions

File tree

‎.agents/skills/e2e/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ All tests completed successfully. Your SDK changes work correctly with this test
118118
- **Test app not found**: List available apps and ask user to clarify
119119
- **Packed tarballs missing**: Run `yarn build:tarball` at the repo root, then `yarn test:prepare` in `dev-packages/e2e-tests`
120120
- **Build failures**: Fix build errors before running tests
121+
- **pnpm errors such as `packages field missing or empty`**: The app needs the pnpm version in its `volta.pnpm`. Run with Volta, which installs that version
121122

122123
## Common Test Applications
123124

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Install pnpm'
2+
description: 'Installs the pnpm version that Volta pins for a package.'
3+
inputs:
4+
package-json:
5+
description: 'The package.json to read `volta.pnpm` from. `volta.extends` is followed until a version is found.'
6+
default: 'package.json'
7+
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- name: Resolve pnpm version
12+
id: pnpm-version
13+
shell: bash
14+
env:
15+
PACKAGE_JSON: ${{ inputs.package-json }}
16+
# Keep in sync with `getPnpmMajor` in `dev-packages/e2e-tests/lib/pnpmOverrides.ts`. It writes the overrides in
17+
# the format of the version it finds, so a different lookup breaks the install.
18+
run: |
19+
package_json="$PACKAGE_JSON"
20+
until version=$(jq -er '.volta.pnpm' "$package_json"); do
21+
extends=$(jq -er '.volta.extends' "$package_json") || {
22+
echo "::error::No volta.pnpm in $PACKAGE_JSON or the files it extends"
23+
exit 1
24+
}
25+
package_json="$(dirname "$package_json")/$extends"
26+
done
27+
echo "version=$version" >> "$GITHUB_OUTPUT"
28+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
29+
with:
30+
version: ${{ steps.pnpm-version.outputs.version }}

‎.github/workflows/build.yml‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -892,9 +892,8 @@ jobs:
892892
with:
893893
ref: ${{ env.HEAD_COMMIT }}
894894
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
895-
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
896-
with:
897-
version: 9.15.9
895+
- name: Install pnpm
896+
uses: ./.github/actions/install-pnpm
898897
- name: Set up Node
899898
uses: actions/setup-node@v7
900899
with:
@@ -1056,9 +1055,10 @@ jobs:
10561055
uses: actions/checkout@v7
10571056
with:
10581057
ref: ${{ env.HEAD_COMMIT }}
1059-
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
1058+
- name: Install pnpm
1059+
uses: ./.github/actions/install-pnpm
10601060
with:
1061-
version: ${{ matrix.test-application == 'nuxt-5' && '11.10.0' || '9.15.9' }}
1061+
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
10621062
- name: Set up Node
10631063
uses: actions/setup-node@v7
10641064
with:
@@ -1211,9 +1211,10 @@ jobs:
12111211
uses: actions/checkout@v7
12121212
with:
12131213
ref: ${{ env.HEAD_COMMIT }}
1214-
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
1214+
- name: Install pnpm
1215+
uses: ./.github/actions/install-pnpm
12151216
with:
1216-
version: ${{ matrix.test-application == 'nuxt-5' && '11.10.0' || '9.15.9' }}
1217+
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
12171218
- name: Set up Node
12181219
uses: actions/setup-node@v7
12191220
with:

‎.github/workflows/canary.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ jobs:
117117
uses: actions/checkout@v7
118118
with:
119119
ref: ${{ env.HEAD_COMMIT }}
120-
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
120+
- name: Install pnpm
121+
uses: ./.github/actions/install-pnpm
121122
with:
122-
version: 9.15.9
123+
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
123124
- name: Set up Node
124125
uses: actions/setup-node@v7
125126
with:

‎.github/workflows/lighthouse.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ jobs:
1919
VITE_E2E_TEST_DSN: 'https://username@domain/123'
2020
steps:
2121
- uses: actions/checkout@v7
22-
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
23-
with:
24-
version: 9.15.9
22+
- name: Install pnpm
23+
uses: ./.github/actions/install-pnpm
2524
- uses: actions/setup-node@v7
2625
with:
2726
node-version-file: 'package.json'

‎dev-packages/e2e-tests/README.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ Make sure to add a `test:build` and `test:assert` command to the new app's `pack
118118
Sentry packages are automatically resolved to the local build via pnpm overrides injected at test time, so no manual
119119
registry configuration is needed.
120120

121+
Apps use the root pnpm version. To use another one, set `volta.pnpm` in the app's `package.json`. Volta (locally) and
122+
CI (`.github/actions/install-pnpm`) both install that version.
123+
121124
### Test apps that deploy a real Cloudflare Worker
122125

123126
Apps like `cloudflare-workers-send-to-sentry` deploy the built app as a real Worker and check what arrives in Sentry:

‎dev-packages/e2e-tests/lib/pnpmOverrides.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export async function addPnpmOverrides(tmpDirPath: string, packedDirPath: string
5757
console.log(`Added ${packageNames.length} internal Sentry package overrides`);
5858
}
5959

60+
// Keep in sync with `.github/actions/install-pnpm`, which installs the version this finds in CI.
6061
async function getPnpmMajor(
6162
packageJsonPath: string,
6263
packageJson: { volta?: { extends?: string; pnpm?: string } },

‎dev-packages/e2e-tests/test-applications/cloudflare-pi-durable/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"test:assert": "playwright test"
1313
},
1414
"dependencies": {
15-
"@earendil-works/pi-ai": "1.0.0",
16-
"@earendil-works/pi-durable": "1.0.0",
15+
"@earendil-works/pi-ai": "1.2.0",
16+
"@earendil-works/pi-durable": "1.2.0",
1717
"@sentry/cloudflare": "file:../../packed/sentry-cloudflare-packed.tgz",
1818
"agents": "0.26.0"
1919
},

‎dev-packages/e2e-tests/test-applications/cloudflare-pi-durable/src/assistant.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class Assistant extends Agent<Env> {
4747
// The manual span should nest under the SDK's `execute_tool` span.
4848
execute: async args =>
4949
Sentry.startSpan({ name: 'resolve-weather', attributes: { 'weather.city': args.city } }, () => ({
50-
content: [{ type: 'text', text: `It is 21 degrees and sunny in ${args.city}.` }],
50+
output: [{ type: 'text', text: `It is 21 degrees and sunny in ${args.city}.` }],
5151
})),
5252
}),
5353
defineTool({
@@ -67,7 +67,7 @@ export class Assistant extends Agent<Env> {
6767
execute: async args => {
6868
const marker = `crashed:${args.job}`;
6969
if (await this.ctx.storage.get(marker)) {
70-
return { content: [{ type: 'text', text: `Step of job ${args.job} completed.` }] };
70+
return { output: [{ type: 'text', text: `Step of job ${args.job} completed.` }] };
7171
}
7272
await this.ctx.storage.put(marker, true);
7373
await this.ctx.storage.sync();

‎dev-packages/e2e-tests/test-applications/node-pi-durable/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"test:assert": "OPENROUTER_API_KEY=$E2E_OPENROUTER_API_KEY playwright test"
1212
},
1313
"dependencies": {
14-
"@earendil-works/chord": "1.0.0",
15-
"@earendil-works/pi-ai": "1.0.0",
16-
"@earendil-works/pi-durable": "1.0.0",
14+
"@earendil-works/chord": "1.2.0",
15+
"@earendil-works/pi-ai": "1.2.0",
16+
"@earendil-works/pi-durable": "1.2.0",
1717
"@sentry/node": "file:../../packed/sentry-node-packed.tgz"
1818
},
1919
"devDependencies": {

0 commit comments

Comments
 (0)