Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 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
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
74 changes: 58 additions & 16 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 the commit the release
# PR merged onto (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 before it, and that commit never got a
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 @@ -585,8 +610,12 @@ jobs:
# link, the page, a reload, and the bare address an older tab kept. 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 @@ -606,12 +635,14 @@ jobs:
# 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.
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 @@ -627,7 +658,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 @@ -745,12 +778,12 @@ 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[@]}"
# 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 Down Expand Up @@ -788,13 +821,18 @@ 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.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 "${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 @@ -947,8 +985,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
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";

/**
Expand All @@ -30,7 +31,8 @@ import { still } from "./page-still";
*
* 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, test } 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";

/**
Expand All @@ -18,7 +19,8 @@ import { marksPlugin } from "./marks-plugin";
*
* 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
4 changes: 3 additions & 1 deletion app/tests/artifacts-kit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { build } from "esbuild";
import type { Browser, Page } from "playwright-core";
import { compile } from "tailwindcss";
import { scheme, TOKENS } from "../../tokens/src/scheme";
import { ownBrowsersAsked } from "./browser-engines";

/**
* The artifacts kit: what a Bot's page is compiled against (app/scripts/build-artifacts-kit.ts).
Expand All @@ -34,7 +35,8 @@ const APP = join(import.meta.dir, "..");
const ROOT = join(APP, "..");
const SCRIPT = join(APP, "scripts", "build-artifacts-kit.ts");
const RUNTIME_SOURCE = join(APP, "src/lib/artifacts/bridge/page-runtime.ts");
const browserAsked = process.env.OPENBOT_APP_BROWSER === "1";
// Opens Chromium itself, so it runs where Chromium is selected (browser-engines.ts).
const browserAsked = ownBrowsersAsked();
const shots = process.env.OPENBOT_SHOTS;

let scratch: string;
Expand Down
4 changes: 3 additions & 1 deletion app/tests/artifacts-screens.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
THUMBNAIL_DARK_SHA,
THUMBNAIL_LIGHT_SHA,
} from "./artifacts-api";
import { ownBrowsersAsked } from "./browser-engines";
import { marksPlugin } from "./marks-plugin";
import { still } from "./page-still";

Expand All @@ -43,7 +44,8 @@ import { still } from "./page-still";
* <screen>-<theme>-<width>.png, in light and dark, wide (1440), narrow (700, the panel a sheet) and
* at a phone's width (390), beside one of the app's own pages (Teams) to compare them with.
*/
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/board-row-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, BrowserType, Page } from "playwright-core";
import { compile } from "tailwindcss";
import { ownBrowsersAsked } from "./browser-engines";

/**
* A Needs you board row keeps its words readable at every width the board is drawn at.
Expand All @@ -20,7 +21,8 @@ import { compile } from "tailwindcss";
* With OPENBOT_APP_SHOTS=<dir> it also saves the rows at each width, light and dark, in each
* browser, as board-row-<browser>-<width>-<theme>.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
Loading
Loading