Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

ci(ui-performance): run in the Playwright image and bring the perf scenarios up to date (MUL-10057) (#11405)

Bohan Jiang17f9ef55f467
diff --git a/.github/workflows/ui-performance.yml b/.github/workflows/ui-performance.yml
index a0c4c2faca..fbdb60a9bf 100644
--- a/.github/workflows/ui-performance.yml
+++ b/.github/workflows/ui-performance.yml
@@ -36,8 +36,36 @@ concurrency:
cancel-in-progress: true
jobs:
+ # The comparison runs in Playwright's image, which ships Chromium and its
+ # system packages. `playwright install --with-deps` fetched those through the
+ # runner's Ubuntu apt mirror, which mostly took 5 to 9 minutes (MUL-10057).
+ # A job's image is fixed before its steps run, so this one reads the tag off
+ # the @playwright/test the lockfile pins, and the two never drift.
+ playwright-image:
+ runs-on: ubuntu-latest
+ outputs:
+ image: ${{ steps.image.outputs.image }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ sparse-checkout: pnpm-lock.yaml
+ sparse-checkout-cone-mode: false
+
+ - id: image
+ run: |
+ version=$(grep -m1 -oP "^ '@playwright/test@\K[^']+" pnpm-lock.yaml)
+ echo "image=mcr.microsoft.com/playwright:v$version-noble" >> "$GITHUB_OUTPUT"
+
compare:
+ needs: playwright-image
runs-on: ubuntu-latest
+ container:
+ image: ${{ needs.playwright-image.outputs.image }}
+ # The runner's user, who owns the checkout: as root, git refuses it as
+ # dubious ownership. An init reaps the stopped web servers' processes,
+ # which perf-compare waits on before measuring the other side. Host IPC
+ # gives Chromium the runner's shared memory.
+ options: --user 1001 --init --ipc=host
# Measured on CI: ~340s for the comparison itself, of which ~292s is the
# two builds and ~26s the two measurements, plus setup. Fifteen minutes
# leaves room for build variance and still stops a run that has hung.
@@ -56,12 +84,9 @@ jobs:
node-version: 22
cache: pnpm
- - name: Install (runner tree — supplies the spec and the browser)
+ - name: Install (runner tree — supplies the spec and Playwright)
run: pnpm install --frozen-lockfile
- - name: Install Chromium
- run: pnpm exec playwright install --with-deps chromium
-
- name: Compare
run: node scripts/perf-compare.mjs --base "${{ inputs.base }}" --head "${{ inputs.head }}" --out perf-report --scenario "${{ inputs.scenario }}"
diff --git a/e2e/perf/fixtures/typing-under-live-runs.ts b/e2e/perf/fixtures/typing-under-live-runs.ts
index 7167914034..a549515261 100644
--- a/e2e/perf/fixtures/typing-under-live-runs.ts
+++ b/e2e/perf/fixtures/typing-under-live-runs.ts
@@ -75,8 +75,8 @@ export function buildTimelineEntries() {
created_at: at(index),
updated_at: at(index),
issue_id: ISSUE_ID,
- // Replies nest inside the root's card, which is the thread shape that
- // mounts every body at once.
+ // Replies nest inside the root's card: one long thread, which the page
+ // mounts on demand (MUL-9409).
parent_id: index === 0 ? null : rootCommentId,
content: commentBody(index),
resolved_at: null,
diff --git a/e2e/perf/image-heavy-thread.spec.ts b/e2e/perf/image-heavy-thread.spec.ts
index 1df69a2031..72ec19d8eb 100644
--- a/e2e/perf/image-heavy-thread.spec.ts
+++ b/e2e/perf/image-heavy-thread.spec.ts
@@ -68,7 +68,11 @@ function responseFor(pathname: string): unknown | undefined {
case "/api/workspaces": return [workspace];
case "/api/client-usage": return {};
case "/api/issue-view-preferences": return { prefs: { hidden: [], order: [] } };
- case "/api/issue-views": case "/api/agent-run-counts": case "/api/agent-activity-30d": return [];
+ case "/api/issue-views": case "/api/agent-run-counts": case "/api/agent-activity-30d":
+ case "/api/working-agents": case "/api/inbox/snoozed":
+ return [];
+ case "/api/project-folders": return { folders: [], filed: [] };
+ case "/api/notification-preferences": return { workspace_id: fx.WORKSPACE_ID, preferences: {} };
case "/api/skills": return { skills: [], total: 0 };
case "/api/autopilots": return { autopilots: [], total: 0 };
case "/api/issues/unread": return { items: [], next_cursor: null };
@@ -90,6 +94,10 @@ function responseFor(pathname: string): unknown | undefined {
case "/api/issue-workflows": return { workflows: [], total: 0 };
case `/api/issues/${fx.ISSUE_ID}/system-wakeups`: return [];
case `/api/issues/${fx.ISSUE_ID}/duplicates`: return { duplicate_of: null, duplicates: [] };
+ case `/api/issues/${fx.ISSUE_ID}/environments`:
+ return { environments: [], configs: [], pending_starts: [], failed_starts: [] };
+ // No live session: the description edits locally, as with no collab server.
+ case `/api/issues/${fx.ISSUE_ID}/collab-ticket`: return { enabled: false };
case `/api/issues/${fx.ISSUE_ID}/comments/trigger-preview`:
return { agents: [], blocked: [] };
case "/api/issues/child-progress": return { progress: [] };
diff --git a/e2e/perf/typing-under-live-runs.spec.ts b/e2e/perf/typing-under-live-runs.spec.ts
index c47407dedf..177b206ff8 100644
--- a/e2e/perf/typing-under-live-runs.spec.ts
+++ b/e2e/perf/typing-under-live-runs.spec.ts
@@ -88,6 +88,16 @@ function responseFor(pathname: string): unknown | undefined {
case "/api/me": return me;
case "/api/workspaces": return [workspace];
case "/api/client-usage": return {};
+ case "/api/issue-view-preferences": return { prefs: { hidden: [], order: [] } };
+ case "/api/issue-views": case "/api/agent-run-counts": case "/api/agent-activity-30d":
+ case "/api/working-agents": case "/api/inbox/snoozed": case "/api/skills":
+ return [];
+ case "/api/autopilots": return { autopilots: [], total: 0 };
+ case "/api/project-folders": return { folders: [], filed: [] };
+ case "/api/notification-preferences": return { workspace_id: fx.WORKSPACE_ID, preferences: {} };
+ case "/api/issues/unread": return { items: [], next_cursor: null };
+ case "/api/inbox/archived/page": return { items: [], next_cursor: null, has_more: false };
+ case `/api/inbox/issues/${fx.ISSUE_ID}/read`: return { count: 0 };
case "/api/agents": case "/api/runtimes": case "/api/squads":
case "/api/agent-task-snapshot": case "/api/invitations": case "/api/inbox":
case "/api/inbox/unread-summary": case "/api/pins": case "/api/chat/sessions":
@@ -100,6 +110,13 @@ function responseFor(pathname: string): unknown | undefined {
case "/api/properties": return { properties: [], total: 0 };
case "/api/quick-actions": return { quick_actions: [] };
case "/api/assignee-frequency": return [];
+ case "/api/labels": return { labels: [], total: 0 };
+ case "/api/issue-workflows": return { workflows: [], total: 0 };
+ case `/api/issues/${fx.ISSUE_ID}/duplicates`: return { duplicate_of: null, duplicates: [] };
+ case `/api/issues/${fx.ISSUE_ID}/environments`:
+ return { environments: [], configs: [], pending_starts: [], failed_starts: [] };
+ // No live session: the description edits locally, as with no collab server.
+ case `/api/issues/${fx.ISSUE_ID}/collab-ticket`: return { enabled: false };
// Typing debounces a trigger preview. It is part of the cost being
// measured, so it is answered rather than blocked.
case `/api/issues/${fx.ISSUE_ID}/comments/trigger-preview`:
@@ -119,6 +136,12 @@ function responseFor(pathname: string): unknown | undefined {
}
}
+/**
+ * The local search copy syncs in the background on every page and is not part
+ * of this one's cost, so it is declined rather than seeded.
+ */
+const DECLINED = new Set(["/api/search-index/manifest"]);
+
const nextFrame = (page: Page) =>
page.evaluate(() => new Promise<void>((done) => {
requestAnimationFrame(() => requestAnimationFrame(() => done()));
@@ -177,6 +200,9 @@ test("comment typing stays responsive while runs stream", async ({ page, context
return route.abort();
}
if (!url.pathname.startsWith("/api/")) return route.continue();
+ if (DECLINED.has(url.pathname)) {
+ return route.fulfill({ status: 404, contentType: "application/json", body: "{}" });
+ }
const body = responseFor(url.pathname);
if (body === undefined) {
unknownRequests.push(`${route.request().method()} ${url.pathname}${url.search}`);
@@ -234,16 +260,17 @@ test("comment typing stays responsive while runs stream", async ({ page, context
throw error;
});
+ const bodies = page.locator("[data-comment-block]");
+ try {
+ await expect(bodies.first()).toBeVisible({ timeout: setupLeft() });
+ } catch (error) { failSetup("comment bodies never rendered"); throw error; }
+ // The thread mounts its replies on demand (MUL-9409), and the unanchored
+ // runs sit at its live end, above the composer: where the user types.
+ await page.getByRole("button", { name: "Jump to latest" }).click({ timeout: setupLeft() });
const summaries = page.locator("[data-run-summary]");
try {
await expect(summaries).toHaveCount(fx.RUN_COUNT, { timeout: setupLeft() });
} catch (error) { failSetup("run summaries never rendered"); throw error; }
- const bodies = page.locator("[data-comment-block]");
- try {
- await expect
- .poll(() => bodies.count(), { timeout: setupLeft() })
- .toBeGreaterThanOrEqual(fx.ROOT_COMMENT_COUNT + fx.REPLY_COMMENT_COUNT);
- } catch (error) { failSetup("comment bodies never rendered"); throw error; }
// Activity detail stays collapsed: the row shows a summary, not a step list.
await expect(page.locator("[data-run-summary] >> nth=0")).toBeVisible();
await page.evaluate(() => document.fonts?.ready);