Skip to content

ci(checks): skip the server-side jobs for a pull request that changes only the client - #4747

Merged
devswha merged 5 commits into
mainfrom
ci/skip-native-jobs-client-only
Nov 25, 2026
Merged

devswha merged 5 commits into
mainfrom
ci/skip-native-jobs-client-only

Conversation

@devswha

@devswha devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Skips three non-required, server-side CI jobs on a pull request that changes only the client. Every other event keeps the full suite.

What is skipped, and when

Job (none is a required check) pull_request, only client paths changed any other pull_request push to main workflow_call (Release, Pages) workflow_dispatch
herdr-core live contract skipped runs runs runs runs
Rust PTY host skipped runs runs runs runs
Native macOS session identity skipped runs runs runs runs
Fast checks, Integration and browser, Native Windows install, Hook kill tests (container) unchanged unchanged unchanged unchanged unchanged

"Only client paths" (scripts/ci-server-reach.sh): every changed path is under src/, public/ or changelog.d/, or is index.html, except the client code the ovis command shares (src/lib/account/, src/lib/relay/, src/lib/nativeApp.ts, src/lib/shellMode.ts). Any other path, a path the script cannot read, or no path at all prints server=true. Every event but a pull request exits Detect changes before the script and leaves server unset, and the jobs run on server != 'false'.

Why it is safe

  • The three jobs build crates/ and run bun tests of server/, shared/, tui/ and scripts/. They do not build the client; Fast checks, Integration tests and the Browser regression jobs keep testing it.
  • scripts/ci-server-reach.test.ts reads the jobs' bun test paths from ci.yml, follows every import, and also follows files read beside a file (new URL("…", import.meta.url), join/resolve(import.meta.dir, …)). The test fails if any file reached that way is in a skipped path. That is how it found the account and relay code scripts/plugin.ts loads, which tui/fidelity.live.test.ts starts. Mutation checked: making an ACP test read public/manifest.webmanifest fails it.
  • The Rust job's bun test paths now start with ./. A bare server/acp filter also selects src/lib/server/acp-view.test.ts; the test pins that every path is anchored.
  • scripts/release-ci-reuse.test.ts: the new condition is one a push run always meets (main's run still runs the jobs, so Release can take it), and the filter step's end-to-end case asserts server=false only for the client-only pull requests and no server line for push and dispatch.

Expected saving

4 of the last 100 merged PRs (#4556 to #4735) changed only these client paths; the lead's earlier count was 5%. Each such PR run skips herdr-core live (about 5 min), Rust PTY host (about 1.7 min, hosted when the Rust runners are busy) and the macOS job (self-hosted Mac or macos-15). This is a small saving; it frees the Rust/Linux pool for the PRs that need it.

Not changed (pre-existing, out of scope)

Detect changes' code=false (paths that are all docs-like: docs/, *.md, *.txt, LICENSE, issue templates) already skips these jobs, and Integration tests too, for e.g. plugins/new/fixture.txt alone. Both reviewers noted it. This PR does not change that rule; it applies to the required Integration job the same way.

Revert

Revert this commit, or drop && needs.changes.outputs.server != 'false' from the three jobs' if:.

Validation

  • bun run check fast (TMPDIR under ~/.cache/ovis-tmp): passed (unit: 28148 pass, 0 fail; typecheck, build, workflow syntax ok)
  • Guard tests: ci-server-reach, release-ci-reuse, pty-sidecar-workflow, light-runner-workflow, privileged-jobs-workflow, workflow-needs, ci-browser-reach, ci-runner-route, hook-kill-tests-workflow, workflow-expression: 437 pass, 0 fail.
  • Reviews: one gate reviewer and one Codex adversarial review (gpt-6.2-sol-fast, xhigh) on bf9775f, both BLOCK on the same two findings. Fixed: unanchored bun test paths, and the guard now follows runtime reads (which found the shared client code). Not changed: the pre-existing docs-only rule above.

Hold: this narrows checks, so it waits for the maintainer.

@devswha devswha added the hold Not merged until the owner says so label Nov 25, 2026
@devswha

devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Hold: this pull request narrows where CI checks run, so it waits for the maintainer's word (AGENTS.md). Merge order is decided by the lead once he agrees; a CI config change makes pr-merge ask every open PR for a fresh run, so these go in at a quiet time.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Chores
    • Pull requests limited to client-side changes now skip selected server-side checks. Changes to shared or server-related files, and pushes to the main branch, releases, and manual runs, continue to run those checks.
    • Updated CI validation to cover which changes trigger these checks and how test commands are run.

The CI workflow now detects client-only pull requests and skips three server-related jobs when appropriate. The change adds path-classification and workflow-integration tests, updates the ACP test path, and documents the skip conditions.

Changes: Server CI gating

Layer / File(s) Summary
Changed-path detection
scripts/ci-server-reach.sh, .github/workflows/ci.yml, scripts/ci-server-reach.test.ts, scripts/release-ci-reuse.test.ts
The script classifies changed paths and sets the server output in the changes job. Tests cover client-only, server-reaching, mixed, empty, and merge-commit cases.
Job conditions and validation
.github/workflows/ci.yml, scripts/ci-server-reach.test.ts, scripts/pty-sidecar-workflow.test.ts, scripts/release-ci-reuse.test.ts, changelog.d/ci-skip-server-jobs-client-only.md
The macOS session identity, Rust PTY host, and herdr-core live contract jobs require code changes and a server output other than false. Tests check job conditions and discovered test-file coverage. The ACP test command uses ./server/acp, and the changelog describes the skip conditions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related PRs

  • devswha/ovis#4447: Changes the diff base used to detect changed paths for merge-commit heads, which can affect the path list used by this PR’s server-reach filter.
Merge Risk: Minimal · previous review 6326a

This change skips three non-required server CI jobs when a pull request touches only client files, and the jobs still run for all other pull requests and events. The rule is conservative, so uncertain input leaves the jobs running, and a revert is straightforward. No actionable merge risk was found. Merge timing remains a maintainer decision, as the author noted.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description covers the change, the skipped jobs, the reasons the change is safe, the expected saving, the revert path, and the validation run. It follows the template's Change and Validation secti…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the main change: skipping the server-side CI jobs when a pull request changes only client files. The raw summary and objectives confirm that the CI gating script, workflow conditions, …
Full details: Description check

Explanation

The description covers the change, the skipped jobs, the reasons the change is safe, the expected saving, the revert path, and the validation run. It follows the template's Change and Validation sections, though it does not use the template's exact headings. The comment at the top of the template is a contributor instruction and is not a required section. The author also links no issue, and the template asks for one only for features, so this change is not a feature. The description is complete.

Full details: Title check

Explanation

The title names the main change: skipping the server-side CI jobs when a pull request changes only client files. The raw summary and objectives confirm that the CI gating script, workflow conditions, and tests implement this. The title is specific and accurate, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 22abe50 and 6326a1f.

Files selected for processing: 6

  • .github/workflows/ci.yml
  • changelog.d/ci-skip-server-jobs-client-only.md
  • scripts/ci-server-reach.sh
  • scripts/ci-server-reach.test.ts
  • scripts/pty-sidecar-workflow.test.ts
  • scripts/release-ci-reuse.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

…lient-only

# Conflicts:
#	.github/workflows/ci.yml
#	scripts/pty-sidecar-workflow.test.ts
@devswha devswha changed the title ci: skip the server-side jobs for a pull request that changes only the client ci(checks): skip the server-side jobs for a pull request that changes only the client Nov 25, 2026
@devswha

devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Owner approved merging the CI efficiency PRs together in the Dori session (2026-11-25).

@devswha devswha removed the hold Not merged until the owner says so label Nov 25, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Deploying ovis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5822bf7
Status: ✅  Deploy successful!
Preview URL: https://bcc8b08e.ovis.pages.dev
Branch Preview URL: https://ci-skip-native-jobs-client-o.ovis.pages.dev

View logs

@devswha
devswha merged commit 815bd29 into main Nov 25, 2026
25 of 28 checks passed
@devswha
devswha deleted the ci/skip-native-jobs-client-only branch November 25, 2026 17:12
@devswha

devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 5822bf7e7. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.

main moved but untouched: merged without update. Its new commits up to 2485443df change no file of this pull request, none imported by one, and nothing that decides which checks run.

Owner approved (2026-11-25). Reviews: gate reviewer + Codex adversarial; CodeRabbit: did not review this head (limit/skip).

devswha added a commit that referenced this pull request Nov 25, 2026
## What changed

Three browser scripts that failed once and passed on their second run in
CI (#4747, #4748 and others) now wait on the state they need instead of
racing it. Only the scripts change; no app code.

- `scripts/chat-reading-position-demo-regression.ts` ("older"): presses
Earlier messages from the keyboard where it is, and waits for the exact
number of page reads.
- `scripts/palette-machines-demo-regression.ts` (Back/Forward to a
creation link): never leaves a history entry it pushed as the current
entry.
- `scripts/pending-pane-switch-regression.ts` (lost connection): awaits
the close of a refused WebSocket before its route handler returns.

## Why

Each cause was found from a failed run's state, then forced to show it
is the one CI hit.

- **chat-reading-position.** A click scrolls the button to the top
first, and the top reads an earlier page by itself. So the click raced a
second read. Either the button re-rendered under the click (CI: `click:
Timeout 6000ms exceeded`, a row "intercepts pointer events", then
"element was detached"), or two pages arrived at once and the next
height wait was already met before the test's wheel landed.
- **palette-machines.** The app writes its own address over the history
entry it is on whenever the two differ, and a roster update reruns that
write. A failed run's history log shows the write landing on the
`name=Forward` entry the test had just pushed, 300 ms before its Back.
Forward then reached the pane's address, and no dialog opened (CI:
`waitFor: Timeout 30000ms exceeded` on `dialog /^New workspace/`).
- **pending-pane-switch.** The route handler refused a reconnect with an
unawaited `socket.close()`. Playwright opens a routed socket the handler
did not connect as soon as the handler returns. When that open landed
first, every refused attempt opened and closed on the page, each one
restarted the client's reconnect grace, and the connection chip stayed
live past the 10 s wait (CI: `waiting for locator('.conn-live') to be
hidden`, 23× visible).

## Failure rates (CI runner image `herdr-ci-runner:local`)

| Script | Condition | Before | After |
|---|---|---:|---:|
| chat-reading-position | 2 CPUs, 3 runs at once | 11/30 | 0/30 |
| palette-machines | the app's address write forced right after the
test's push | 30/30 | 0/30 |
| palette-machines | 2 CPUs, 3 runs at once | 0/30 | 0/30 |
| pending-pane-switch | Playwright's open forced before the close |
28/30 | - |
| pending-pane-switch | 2 CPUs, 3 runs at once | 0/30 | 0/30 |
| pending-pane-switch | lost connections repeated in one run (queue,
lose, Send now), no CPU limit | 1 in 617 | 1 in 3,203 |

The forced rows reproduce the exact order a failed run showed, inside
the real script. The fix for pending removes that order, so it has no
forced "after" row.

## Not fixed here

- **portal-regression** (`focus: Timeout 10000ms exceeded` on `Private
link for alice`). Both CI failures (runs 45327133346 and 45630135993)
were on the HostHatch runners, and the field was missing for the whole
10 s. The WebSocket close in those logs is the test's own teardown: Bun
prints the uncaught error only after `finally` has run. Other scripts in
the same job kept logging every 1–2 s, so the machine did not stall. Not
reproduced in about 600 runs: locally (CPU-capped and uncapped, with
herdr workspace churn in the same session), on HostHatch (portal alone),
and with CI's own shard 1/3 under `bun run check run` on both machines.
No speculative change is made.
- **pending-pane-switch, a rarer second path**: 1 failure in 3,203 lost
connections after the fix. Both failed runs had the same page: the
header chip and the sidebar said live/Connected while the terminal-view
panes showed "Reconnecting to Ovis…". In the second, a dump of the React
props shows the pane that feeds the header is the active pane, in chat
view, and it was still reporting the connection as up more than 10 s
after the drop. This is app behaviour: a chat-view pane can miss a drop
that terminal-view panes see. It needs its own fix in the app, not in
this script.

## Validation

- `bun run check fast` in the CI runner image, on this head rebased on
main: typecheck, build and generated files pass. The unit run's only
failures came from how the image was run locally, not from this branch
(which changes three browser scripts only).
`server/ssh-account-add.test.ts` fails as uid 1000 (`ubuntu`, no home
directory) and passes 3/3 as uid 1001 (`runner`, as in CI).
`scripts/plugin.test.ts` fails when the clone's owner is not the user
running the tests.
- The runs in the table above.
devswha added a commit that referenced this pull request Nov 25, 2026
…it missing (red main) (#4756)

## Why

`herdr-core live contract` went red on main (run
https://github.com/devswha/ovis/actions/runs/45655628244, 267319e) and
on #4747 after #4745 moved it to GitHub-hosted ubuntu-24.04:
`tui/testing/with-core.contract.test.ts` "a dump WASM failure stops the
started core and removes its folder" exited 127 instead of 125, without
reaching the dump.

127 is with-core's "cannot run the command on a pseudo-terminal". The
hosted job has no Rust PTY host (`Rust PTY host unavailable
(...ovis-pty-sidecar: ENOENT)` in the log), so `PtySession` falls back
to the Node sidecar, which first asks `node -p` whether it is a real
Node with a 3 s bound (`server/pty/sidecar.ts`). This test is the job's
first Node start; on a fresh runner Node's first start from a cold disk
sits right at 3 s (the passing hosted runs took 2.6 s for the whole
test, the failing one 3.09 s), and past it the probe says "no Node", so
there is no PTY host.

The same holds for a real server on a PC without the Rust host: a slow
first Node start leaves it with no PTY host until it restarts (the
answer is kept), so live terminals fall back to a mirror.

## Change

The Node lookup (`realNode`) gets one 10 s budget, the bound the app's
own hc already gets for its first answer (`BUNDLED_PROBE_TIMEOUT_MS`),
shared among its candidates (the app's own Nodes, then the one on PATH):
each candidate asked gets an equal share of what is left. A single Node,
as on the hosted runner, gets the whole 10 s; hung app Nodes can no
longer use up the time of a working one on PATH, and the whole lookup
stays within 10 s (it was up to 3 x 3 s), well inside the plugin's 20 s
start deadline. No test skip, job or retry changes.

A new unit test in `server/machines.test.ts` puts two hung app Nodes
before a working one on PATH: it times out on main's code and passes in
about 0.6 s here.

## Validation

Hosted-like repro: `ubuntu:24.04` container, `--cpus 2`, a clean tmpfs
HOME, no Rust host, Node's page cache evicted before each run and the
disk throttled (`--device-read-bps 9mb`, cold `node -p` about 3-4.5 s),
running only that test:
- before (main's `sidecar.ts` mounted over): 30/30 fail, each `"code":
127` at about 3.18 s, the hosted signature
- after (final code): 0/50 fail, twice
- (at 12 MB/s, cold Node right at 3.0 s, main passed 30/30, which
matches the flake being a near-tie)

- `bun test server/machines.test.ts` (new budget test included) and `bun
test server/machines.test.ts server/pty
tui/testing/with-core.contract.test.ts scripts/changelog-fold.test.ts`:
194 pass, 0 fail
- `bun run check fast`: all green except
`server/ssh-account-add.test.ts`, which fails only because the long lane
TMPDIR makes its ssh forward socket path too long; it passes (3/3) with
a short TMPDIR. Unrelated to this change.

## Review

Gate reviewer: HIGH (10 s per candidate could pass the plugin's 20 s
start deadline with two hung app Nodes) fixed by the shared budget
above; LOW (`server/index.ts` comment said 3 s) fixed. MEDIUM, not
changed: if the Rust host dies after start, the first Node lookup runs
synchronously while clients are connected; it was already synchronous
(up to 9 s before), now bounded at 10 s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant