Skip to content

Commit 3480b98

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/sandbox-flags
2 parents 4c75c0a + 246e1ab commit 3480b98

101 files changed

Lines changed: 3973 additions & 944 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.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Update E2E Snapshots
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: "Branch to update snapshots on"
8+
required: true
9+
default: "main"
10+
issue_comment:
11+
types: [created]
12+
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
jobs:
18+
update-snapshots:
19+
# Run on workflow_dispatch OR when someone comments "/update-snapshots" on a PR
20+
if: >
21+
github.event_name == 'workflow_dispatch' ||
22+
(github.event.issue.pull_request && contains(github.event.comment.body, '/update-snapshots'))
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Get PR branch
26+
if: github.event_name == 'issue_comment'
27+
id: pr
28+
uses: actions/github-script@v7
29+
with:
30+
script: |
31+
const pr = await github.rest.pulls.get({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
pull_number: context.issue.number
35+
});
36+
core.setOutput('ref', pr.data.head.ref);
37+
core.setOutput('sha', pr.data.head.sha);
38+
39+
- name: Add reaction to comment
40+
if: github.event_name == 'issue_comment'
41+
uses: actions/github-script@v7
42+
with:
43+
script: |
44+
await github.rest.reactions.createForIssueComment({
45+
owner: context.repo.owner,
46+
repo: context.repo.repo,
47+
comment_id: context.payload.comment.id,
48+
content: 'rocket'
49+
});
50+
51+
- uses: actions/checkout@v4
52+
with:
53+
ref: ${{ github.event.inputs.branch || steps.pr.outputs.ref || github.ref }}
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- uses: oven-sh/setup-bun@v2
57+
with:
58+
bun-version: latest
59+
60+
- uses: actions/setup-node@v4
61+
with:
62+
node-version: "20"
63+
64+
- uses: astral-sh/setup-uv@v5
65+
66+
- run: npm ci
67+
68+
- name: Install Playwright browsers
69+
run: npx playwright install --with-deps chromium
70+
71+
- name: Update snapshots
72+
run: npx playwright test --update-snapshots --reporter=list
73+
74+
- name: Commit updated snapshots
75+
id: commit
76+
run: |
77+
git config user.name "github-actions[bot]"
78+
git config user.email "github-actions[bot]@users.noreply.github.com"
79+
git add tests/e2e/**/*.png
80+
if git diff --staged --quiet; then
81+
echo "changed=false" >> $GITHUB_OUTPUT
82+
echo "No snapshot changes to commit"
83+
else
84+
git commit -m "chore: update e2e snapshots [skip ci]"
85+
git push
86+
echo "changed=true" >> $GITHUB_OUTPUT
87+
fi
88+
89+
- name: Comment on PR
90+
if: github.event_name == 'issue_comment'
91+
uses: actions/github-script@v7
92+
with:
93+
script: |
94+
const changed = '${{ steps.commit.outputs.changed }}' === 'true';
95+
const body = changed
96+
? '✅ Snapshots updated and pushed to this branch.'
97+
: '✅ No snapshot changes needed - all snapshots are up to date.';
98+
await github.rest.issues.createComment({
99+
owner: context.repo.owner,
100+
repo: context.repo.repo,
101+
issue_number: context.issue.number,
102+
body
103+
});

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Key abstractions:
1010
- **Host** - Chat client embedding the iframe, uses `AppBridge` class to proxy MCP requests
1111
- **Server** - MCP server that registers tools/resources with UI metadata
1212

13-
Specification (draft): `specification/draft/apps.mdx`
13+
Specification (stable): `specification/2026-01-26/apps.mdx`
1414

1515
## Commands
1616

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ npm run test:e2e:update -- --grep "Three.js"
7979

8080
**Note**: Golden screenshots are platform-agnostic. Tests use canvas masking and tolerance thresholds to handle minor cross-platform rendering differences.
8181

82+
#### Updating Snapshots in CI
83+
84+
If E2E tests fail in CI due to screenshot mismatches, you can update snapshots directly from your PR:
85+
86+
1. Comment `/update-snapshots` on the PR
87+
2. The workflow will update snapshots and push to your branch
88+
3. A comment will confirm when complete
89+
90+
Alternatively, use the [workflow dispatch](https://github.com/modelcontextprotocol/ext-apps/actions/workflows/update-snapshots.yml) to manually trigger updates for any branch.
91+
8292
## Code of Conduct
8393

8494
This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). Please review it before contributing.

0 commit comments

Comments
 (0)