Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3684722
CI: reuse tested merge trees and run browser engines separately
dustywusty Dec 2, 2026
3baeceb
CI: preserve required coverage when reusing passing checks
dustywusty Dec 2, 2026
2c1127e
CI: keep browser obligations and complete reuse evidence
dustywusty Dec 2, 2026
3989214
CI: retain partial browser failures through full-check transitions
dustywusty Dec 2, 2026
499ac14
CI: fail on dependency-search errors and isolate browser engines
dustywusty Dec 2, 2026
d8ff4b6
CI: keep manual runs from erasing changed browser obligations
dustywusty Dec 2, 2026
f5207aa
CI: limit push browser baselines to main
dustywusty Dec 2, 2026
7ca893f
CI: keep current unlisted browser files owed across reused trees
dustywusty Dec 2, 2026
ec549ae
Tests: disable commit signing in CI decision fixtures
dustywusty Dec 2, 2026
d3dd79a
Tests: override inherited signing for fixture Git commands
dustywusty Dec 2, 2026
766dc48
CI: bound and interleave historical proof lookups
dustywusty Dec 2, 2026
d3b887c
CI: reuse current main history and classify browser tests by root
dustywusty Dec 2, 2026
e0af6ee
Merge main and compose browser engine and shard matrices
dustywusty Dec 2, 2026
029bc76
CI: build app assets for partial print browser tests
dustywusty Dec 2, 2026
82028b6
CI: bound the entire queued pull request lookup
dustywusty Dec 2, 2026
8e320be
CI: require readable queue labels before skipping docs checks
dustywusty Dec 2, 2026
8b7f93f
Tests: await company sign-in socket before holding out the page
dustywusty Dec 2, 2026
e5d6d36
CI: no browser test runs twice, and only full-ci replaces a run
dustywusty Dec 2, 2026
5a031c7
Merge #2784 (reuse tested merge trees, split browser engines) onto main
davidmckayv Dec 5, 2026
ab23337
Tests: deal the artifact screens' layout cases over four files
davidmckayv Dec 5, 2026
4703546
Tests: the desktop setup window's browser tests in three files, run s…
davidmckayv Dec 5, 2026
22c6b70
CI: cut the cross-browser shards by each engine's recorded durations
davidmckayv Dec 5, 2026
ee34942
CI: browser timing records measured by each engine's own shards
davidmckayv Dec 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ci-budgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"API spec": 3,
"native types": 3,
"app (real browser)": 8,
"app (real browser, Chromium) (shard N of N)": 15,
"app (real browser, WebKit) (shard N of N)": 15,
"app (real browser, desktop setup window)": 12,
"tests (shard N of N)": 7,
Expand Down
104 changes: 83 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: CI

on:
pull_request:
# Adding full-ci must start the full replacement run on the same commit.
types: [opened, synchronize, reopened, labeled]
push:
branches: [main]
# The merge queue: main's merge queue builds each pull request on top of main and the pull
Expand All @@ -18,7 +20,7 @@ on:
permissions:
contents: read

# The newest push on a pull request wins. Every commit on main keeps its own run, for the badge and
# The newest run on a pull request wins. Every commit on main keeps its own run, for the badge and
# for the release: publishing a release relies on main's CI having passed on a commit whose tree
# differs from the release's only in what it runs again (scripts/release-ci-gate.ts). In one group,
# a push landing while another commit's run was in progress replaced the pending run of the commit
Expand All @@ -34,12 +36,15 @@ permissions:
# GitHub drops from the group's one pending slot is re-run later by Contributor CI
# (scripts/contributor-ci.ts), which also pauses fork runs while CopilotKit's are waiting.
#
# Only a pull request's own push cancels. The release's call of these checks runs with the release
# push's context, a push to main or to a release branch, and is never cancelled by the next one
# (scripts/workflow-concurrency.test.ts).
# A pull request's newer push, or the `full-ci` label, starts a replacement run. Any other label waits
# for the run in progress instead of cancelling it: once that run is done, the waiting run finds every
# check it passed on the same commit, skips them, and takes a minute. A label run cannot simply skip
# everything up front: a skipped `verify` counts as passing, and could turn a failing pull request
# green. The release's call runs with the release push's context, a push to main or to a release
# branch, and is never cancelled by the next one (scripts/workflow-concurrency.test.ts).
concurrency:
group: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && format('ci-{0}-forks', github.workflow) || format('ci-{0}-{1}', github.workflow, github.ref == 'refs/heads/main' && github.sha || github.ref) }}
cancel-in-progress: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
cancel-in-progress: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && (github.event.action != 'labeled' || github.event.label.name == 'full-ci') }}

# Runners. The checks run on the 16-core larger runners (org runner group openbot-larger, billed per
# minute) for main, releases and pull requests from this repository: the standard runners are shared
Expand All @@ -51,11 +56,13 @@ concurrency:
jobs:
# What this push has to run (scripts/ci-changes.ts). On a pull request, a job whose inputs are
# unchanged since a commit where it passed is skipped, and `verify` reads the skip as a pass: test
# files alone run just those tests, docs alone run only the tests that name them, and a release PR
# files alone run just those tests (removing one reruns the suite's count floor), docs alone run
# only the tests that name them, and a release PR
# of only the release files runs the checks publishing re-runs on it. main's run of a commit the
# merge queue merged skips the checks the queue's run already passed on that same commit, and runs
# only `component dockerfile` and any job whose cache key the push changed, which write the caches
# pull requests read. A merge group is decided like a pull request, from main's history and the
# only `component dockerfile`, any job whose cache key the push changed, and startup when the queue
# ran Windows but omitted macOS. The first two write caches pull requests read. A merge group is
# decided like a pull request, from main's history and the
# queued pull request's: a job runs unless nothing it reads changed since it passed on one of them.
# A push to main the queue did not pass, the release's own call of these checks and a pull request
# labelled `full-ci` (in its own runs and in the queue) run everything. CHANGELOG.md is never a
Expand Down Expand Up @@ -100,6 +107,19 @@ jobs:
# Strings, since 0 is falsy and `&& 0 || 1` would always give 1.
fetch-depth: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && '0' || '1' }}
filter: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && 'blob:none' || '' }}
# The run API names the PR head, while these jobs test its merge with main. Keep the actual
# checkout commit so a later merge group compares against the tree the jobs really tested.
- name: Record the tested checkout
if: github.event_name == 'pull_request'
run: git rev-parse HEAD > "$RUNNER_TEMP/ci-tested-tree.txt"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: github.event_name == 'pull_request'
with:
# Re-running only a failed check retains changes' original proof artifact.
name: ci-tested-tree-${{ github.run_id }}
path: ${{ runner.temp }}/ci-tested-tree.txt
retention-days: 14
overwrite: true
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.3
Expand Down Expand Up @@ -141,6 +161,11 @@ jobs:
- run: bun run format:check
- run: bun run lint
- run: bun run typecheck
# Desktop is not a root workspace; its test files still belong to its TypeScript project.
- run: bun install --frozen-lockfile
working-directory: desktop
- run: bun run typecheck
working-directory: desktop
- name: Desktop version tracks the release version
run: bun desktop/scripts/desktop-version.ts check
# What each recorded OpenBot Desktop launch hands Compose, read with this tree's
Expand Down Expand Up @@ -635,8 +660,12 @@ jobs:
# than the error screen, the diagram drawn in its default colours. In the image, as above:
# WebKit's system packages are about 94 MB, which took nine minutes from the mirror on a slow day.
#
# Each shard runs twice, once per engine: OPENBOT_APP_ENGINES names one, and every file opens only
# the engines it names (app/tests/browser-engines.ts). A file that only ever runs in Chromium skips
# itself in the WebKit leg, so no file runs the same browser twice (scripts/ci-changes.test.ts).
#
# The files run side by side, like the Chromium list's, but eight at a time rather than a worker
# per core: each file opens Chromium and WebKit, and sixteen workers' 32 browsers on 16 cores
# per core: each file used to open Chromium and WebKit, and sixteen workers' 32 browsers on 16 cores
# starved the tests that wait on a clock (a hold's Retry-After, a menu's load). This job began
# with one file and ran its list one file after another; by 24 November it held 30 files in two
# engines each, took 35 minutes and was the whole length of a run. Add a new file to this one
Expand All @@ -653,15 +682,21 @@ jobs:
#
# In shards, one runner each, as the suite is: one job took 16 to 17 minutes before the browser tests
# no job had ever named were added, and every file is still named here once. `bun test --shard`
# deals the sorted list out in turn. A run is as long as its slowest shard, and a shard as long as
# its slowest file: artifacts-screens, about 11 minutes.
# cuts the list by each file's recorded duration in that engine (scripts/browser-timings/), so the
# shards take about as long as each other, and each worker starts its slowest file first. Each
# shard writes what its files took over the record, kept as an artifact for refreshing it
# (scripts/browser-timings.ts). A shard is still as long as its slowest file, so no file should
# take more than a few minutes in one engine: artifacts-screens took 11 and set every run's length
# until its layout cases were dealt over four files of their own.
app-browser-webkit:
name: app (real browser, WebKit) (shard ${{ matrix.shard }} of ${{ strategy.job-total }})
name: app (real browser, ${{ matrix.engine }}) (shard ${{ matrix.shard }} of 3)
needs: changes
strategy:
# Every shard runs to the end, so one red run names every failing test, as the suite's do.
# Each engine and shard has its own runner and result, so a failed leg can be re-run on its
# own. A failure still stops the whole run at once (.github/actions/stop-on-failure).
fail-fast: false
matrix:
engine: [Chromium, WebKit]
shard: [1, 2, 3]
# On a pull request, only when the app, what it imports or its tests change (scripts/ci-changes.ts,
# app_browser_webkit). A merge group and main run it every time.
Expand All @@ -677,7 +712,9 @@ jobs:
PLAYWRIGHT_IMAGE: mcr.microsoft.com/playwright:v1.62.1-noble@sha256:dcc5531e97840b9b5e794f2814476b21571c5124a3fca2267d73041f56e7580e
TEST_WORKERS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && '2' || '8' }}
TEST_TIMEOUT_MS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && '15000' || '5000' }}
TEST_SHARD: ${{ matrix.shard }}/${{ strategy.job-total }}
# Three shards per engine; strategy.job-total counts all six engine/shard jobs.
TEST_SHARD: ${{ matrix.shard }}/3
BROWSER_ENGINE: ${{ matrix.engine == 'WebKit' && 'webkit' || 'chromium' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down Expand Up @@ -714,6 +751,10 @@ jobs:
app/tests/artifact-sign-in-refusal-browser.test.tsx
app/tests/artifact-tool-cards-browser.test.tsx
app/tests/artifacts-kit.test.ts
app/tests/artifacts-screens-layout-1.test.tsx
app/tests/artifacts-screens-layout-2.test.tsx
app/tests/artifacts-screens-layout-3.test.tsx
app/tests/artifacts-screens-layout-4.test.tsx
app/tests/artifacts-screens.test.tsx
app/tests/board-row-layout.test.tsx
app/tests/boot-screen.test.ts
Expand Down Expand Up @@ -832,12 +873,21 @@ jobs:
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES=chromium,webkit \
--env OPENBOT_APP_BROWSER=1 --env OPENBOT_APP_ENGINES="$BROWSER_ENGINE" \
"$PLAYWRIGHT_IMAGE" \
bun test --parallel="$TEST_WORKERS" --timeout="$TEST_TIMEOUT_MS" --shard="$TEST_SHARD" "${files[@]}"
bun test --parallel="$TEST_WORKERS" --timeout="$TEST_TIMEOUT_MS" --shard="$TEST_SHARD" --timings="scripts/browser-timings/$BROWSER_ENGINE.json" --update-timings "${files[@]}"
# This shard's own durations, which the run wrote over the engine's record: download every
# shard's and merge them to refresh it (scripts/browser-timings.ts).
- if: ${{ !cancelled() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: browser-timings-${{ env.BROWSER_ENGINE }}-${{ matrix.shard }}
path: scripts/browser-timings/${{ env.BROWSER_ENGINE }}.json
retention-days: 14
if-no-files-found: ignore
# Connect your AI's sign-in code, copied with one press and read back from WebKit's clipboard.
# Only that test: the rest of the file runs in Chromium in the job above. Once, on the first shard.
- if: matrix.shard == 1
- if: matrix.engine == 'WebKit' && matrix.shard == 1
run: |
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE" \
Expand All @@ -851,8 +901,9 @@ jobs:

# The desktop setup window's, for the same reason as the list above: the AI step's form holding
# still while the install behind it comes and goes. It bundles the window from the desktop's own
# dependencies. One file, so it is its own job rather than one of the list's workers. In the
# image, as above.
# dependencies, so it is its own job rather than one of the list's workers. In the image, as
# above. Its describes were one file of ten minutes, the longest job of a run; they are three
# files now (setupLayout.browser.harness.ts holds what they share), run side by side.
app-browser-desktop:
name: app (real browser, desktop setup window)
needs: changes
Expand All @@ -875,13 +926,20 @@ jobs:
- run: bun install --frozen-lockfile
- run: bun install --frozen-lockfile
working-directory: desktop
# A list, as in the jobs above, so scripts/ci-changes.ts can tell this job covers the file and a
# change to it does not run it a second time in `tests (changed files)`. Paths from desktop/.
- run: |
files=(
src/setupLayout.approved.browser.test.ts
src/setupLayout.browser.test.ts
src/setupLayout.moveToCloud.browser.test.ts
)
docker run --rm --ipc=host \
--volume "$GITHUB_WORKSPACE:$GITHUB_WORKSPACE" --workdir "$GITHUB_WORKSPACE/desktop" \
--volume "$(command -v bun):/usr/local/bin/bun:ro" \
--env OPENBOT_APP_BROWSER=1 \
"$PLAYWRIGHT_IMAGE" \
bun test src/setupLayout.browser.test.ts
bun test --parallel "${files[@]}"
# Connect your AI's key field and tab row, in WebKit, the engine the Mac window draws with.
# Only those tests: the rest of the file runs in Chromium in the step above.
- run: |
Expand Down Expand Up @@ -1034,8 +1092,12 @@ jobs:
if: needs.changes.outputs.browser_tests != '[]' || needs.changes.outputs.desktop_browser_tests != '[]'
run: bunx playwright-core install --with-deps --no-shell chromium
- name: Install WebKit
if: needs.changes.outputs.webkit_tests != '[]'
if: needs.changes.outputs.webkit_tests != '[]' || contains(fromJSON(needs.changes.outputs.desktop_browser_tests), 'desktop/src/setupLayout.browser.test.ts')
run: bunx playwright-core install --with-deps webkit
# The print-page test serves the shipped HTML, styles and assets from app/dist.
- name: Build the print page and app assets
if: contains(fromJSON(needs.changes.outputs.browser_tests), 'app/tests/artifact-print-browser.test.ts')
run: bun run --cwd app build
- name: Run the changed tests
env:
TESTS: ${{ needs.changes.outputs.tests }}
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ request merges, by editing its description before the release is prepared.
- **A new push starts a new run.** If you push again while a run is waiting, the newer commit is
the one that gets checked.
- **It merges through a merge queue.** Once it is approved and CI passes, a maintainer adds it to
`main`'s merge queue, which runs CI once more on top of `main` and the pull requests queued ahead
of it, and merges it when that passes. You never need to update your branch from `main` for it
`main`'s merge queue, which checks it once more on top of `main` and the pull requests queued
ahead of it, and merges it when that passes. A check that already passed on the tree it would
test is not run again; the rest run on only what changed since. You never need to update your branch from `main` for it
to merge.

Locally, `bun install` and then `bun test` runs the suite, `bun run lint` and `bun run format:check`
Expand Down
4 changes: 3 additions & 1 deletion app/tests/artifact-bridge-browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { afterAll, describe, expect } from "bun:test";
import { readFileSync } from "node:fs";
import { join } from "node:path";
import type { Browser, Frame, Page } from "playwright-core";
import { ownBrowsersAsked } from "./browser-engines";
import { test } from "./renderer-crash";

/**
Expand All @@ -20,7 +21,8 @@ import { test } from "./renderer-crash";
* Why it is worth a browser: an opaque origin, the sandbox, CSP and MessageChannel transfer are the
* browser's, and a test without them proves nothing about them.
*/
const asked = process.env.OPENBOT_APP_BROWSER === "1";
// Opens its own browsers, so it runs where Chromium is selected (browser-engines.ts).
const asked = ownBrowsersAsked();

const APP = join(import.meta.dir, "..");

Expand Down
4 changes: 3 additions & 1 deletion app/tests/artifact-collab-browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
fakeArtifactServer,
type Person,
} from "./artifact-pages-api";
import { ownBrowsersAsked } from "./browser-engines";
import { still } from "./page-still";
import { test } from "./renderer-crash";

Expand All @@ -31,7 +32,8 @@ import { test } from "./renderer-crash";
*
* With OPENBOT_APP_SHOTS=<dir> each screen is saved in light and dark, at 400 and 1280 wide.
*/
const asked = process.env.OPENBOT_APP_BROWSER === "1";
// Opens its own browsers, so it runs where Chromium is selected (browser-engines.ts).
const asked = ownBrowsersAsked();
const shots = process.env.OPENBOT_APP_SHOTS;

const APP = join(import.meta.dir, "..");
Expand Down
4 changes: 3 additions & 1 deletion app/tests/artifact-error-notice-layout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { existsSync, mkdirSync, readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import type { Browser, Page } from "playwright-core";
import { compile } from "tailwindcss";
import { ownBrowsersAsked } from "./browser-engines";
import { still } from "./page-still";
import { test } from "./renderer-crash";

Expand All @@ -18,7 +19,8 @@ import { test } from "./renderer-crash";
*
* With OPENBOT_APP_SHOTS=<dir> it saves each as artifact-error-notice-<theme>-<width>.png.
*/
const asked = process.env.OPENBOT_APP_BROWSER === "1";
// Opens its own browsers, so it runs where Chromium is selected (browser-engines.ts).
const asked = ownBrowsersAsked();
const shots = process.env.OPENBOT_APP_SHOTS;

const APP = join(import.meta.dir, "..");
Expand Down
4 changes: 3 additions & 1 deletion app/tests/artifact-events-socket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { afterAll, beforeAll, describe, expect } from "bun:test";
import { join } from "node:path";
import type { Server, ServerWebSocket } from "bun";
import type { Browser } from "playwright-core";
import { ownBrowsersAsked } from "./browser-engines";
import { marksPlugin } from "./marks-plugin";
import { test } from "./renderer-crash";

Expand All @@ -19,7 +20,8 @@ import { test } from "./renderer-crash";
*
* OPENBOT_APP_BROWSER=1 bun test app/tests/artifact-events-socket.test.ts
*/
const asked = process.env.OPENBOT_APP_BROWSER === "1";
// Opens its own browsers, so it runs where Chromium is selected (browser-engines.ts).
const asked = ownBrowsersAsked();
const EVENTS = /\/api\/v2\/organizations\/[^/]+\/artifacts\/[^/]+\/events$/;

type Behaviour = "not-here" | "drops";
Expand Down
4 changes: 3 additions & 1 deletion app/tests/artifact-kinds-browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import { basename, dirname, join } from "node:path";
import type { Browser, Page } from "playwright-core";
import { compile } from "tailwindcss";
import { ownBrowsersAsked } from "./browser-engines";
import { marksPlugin } from "./marks-plugin";
import { test } from "./renderer-crash";

Expand All @@ -21,7 +22,8 @@ import { test } from "./renderer-crash";
* With OPENBOT_APP_SHOTS=<dir> every page is saved as kinds-<kind>-<theme>-<width>.png, beside the
* app's own gallery cards (kinds-reference-…), to look at side by side.
*/
const asked = process.env.OPENBOT_APP_BROWSER === "1";
// Opens its own browsers, so it runs where Chromium is selected (browser-engines.ts).
const asked = ownBrowsersAsked();
const shots = process.env.OPENBOT_APP_SHOTS;

const APP = join(import.meta.dir, "..");
Expand Down
Loading
Loading