Skip to content

ci: check Linux and Windows installs on push to main - #80

Merged
bhavsarpratik merged 6 commits into
mainfrom
ci/install-checks
Oct 16, 2026
Merged

bhavsarpratik merged 6 commits into
mainfrom
ci/install-checks

Conversation

@bhavsarpratik

@bhavsarpratik bhavsarpratik commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds .github/workflows/install-checks.yml, which runs on every push to main, on every pull request to main, and on manual dispatch.
  • Linux (ubuntu-latest): starts a systemd user manager (loginctl enable-linger, CI environment setup only), installs with ./scripts/install --backend-only, checks token-meter-server.service, INSTALL_MODE, /health and /menubar, then runs the installed uninstall-systemd-user and confirms the service and port are gone.
  • Windows (windows-latest): installs with scripts\install-windows.ps1 -BackendOnly, checks /health, /menubar, INSTALL_MODE and the login Run entry, then runs the installed uninstall-windows.ps1 and confirms the Run entry and port are gone.
  • Both jobs first write one synthetic, content-free Codex session (.github/scripts/write_sample_trace.py), so /health must report at least one indexed session and no runtime-adapter failures. Server logs print on failure.

Installer bugs found by the first run

  • Linux uninstall left the server running. uninstall-systemd-user passed both units to one systemctl --user disable --now. systemd rejects the whole command when any unit file is missing, which every backend-only install hits (no tray unit), and || true hid that. The server unit file was then deleted while the server kept running. Each unit is now stopped on its own.
  • The Windows installer aborted on a detached HEAD (PR checkouts, tags, git checkout <sha>) and on branches without an upstream. Windows PowerShell 5.1 turns a native command's stderr into a terminating error under ErrorActionPreference=Stop, even when redirected with 2>$null. Git probes now go through Get-GitText, which tolerates that and returns an empty string, which is what the script already expected. update-windows.ps1 had the same probes; they now use the same helper, so the updater records upstream_unavailable or inspect_failed for the dashboard instead of aborting.

Not covered

  • Tray companions (Linux GTK/AppIndicator, Windows NotifyIcon) need a desktop session that hosted runners don't reliably provide.
  • macOS is not included.

Test plan

  • Sample trace is discovered and parsed locally (1 session, 1 turn, 1,280 tokens)
  • Regression tests for both bugs (each fails against main's scripts)
  • Full unit suite on this branch: 1,453 tests OK (update-windows contract added)
  • Linux and Windows jobs pass on this PR

🤖 Generated with Claude Code

bhavsarpratik and others added 6 commits October 16, 2026 14:37
Neither installer had automated evidence on its target host. Each job
writes one synthetic content-free session, installs the backend, checks
the service, /health (ready, at least one indexed session, no adapter
failures) and /menubar, then uninstalls and confirms nothing is left
serving. Tray companions need a desktop session hosted runners do not
reliably provide, so they are out of scope.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…ndows checkouts

The first CI run on real hosts found two installer bugs:
- Linux uninstall passed both units to one `systemctl disable --now`;
  systemd refuses the whole command when a unit file is missing, which
  every backend-only install hits, so the server kept running after its
  unit was deleted. Each unit is now stopped on its own.
- The Windows installer aborted on a detached HEAD or a branch without an
  upstream: Windows PowerShell 5.1 turns git's stderr into a terminating
  error under ErrorActionPreference=Stop even when redirected. Git probes
  now go through Get-GitText, which tolerates that and returns "".

Install checks now also run on every pull request to main.

Co-Authored-By: Claude Code <noreply@anthropic.com>
update-windows.ps1 had the same bare git probes as the installer. On a
detached HEAD or a branch without an upstream, Windows PowerShell 5.1
turned git's redirected stderr into a terminating error, so the helper
aborted instead of recording upstream_unavailable or inspect_failed for
the dashboard. Its probes now use the same Get-GitText helper.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Review found two more Windows PowerShell 5.1 abort paths: the dirty-tree
`git status` probe and the Git delivery bootstrap's Python call, both of
which redirected stderr outside the helper. Get-GitText now wraps a general
Invoke-NativeText, and both calls use it. The contract test rejects any git
or Python call with discarded stderr outside the helper.

CI: wait for inventory_ready before counting indexed sessions, finish every
run on main (cancel only superseded pull-request runs), and pin actions to
the commits of the tested v4/v5 tags.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The contract only caught single-line git or Python probes, so a multi-line
`& $PythonExe ... 2>$null` slipped through. It now removes the helper and
the two try/catch-guarded Python discovery probes, then rejects any other
`2>$null`. CI concurrency keys push runs by commit so every main commit is
checked to completion, as the comment promises.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@bhavsarpratik
bhavsarpratik merged commit b49f27d into main Oct 16, 2026
2 checks passed
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