ci: per-arch image build + boot smoke on every PR - #385
Conversation
Builds the local target and boots it on native amd64 and arm64 runners on every PR, with an authenticated MCP initialize probe; the arm64 leg also compile-checks the remote target. Prevents the v0.33.0-v0.33.4 class of arch-specific startup breakage from reaching a release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR Code Suggestions ✨Explore these optional code suggestions:
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This reverts commit ca63500.
… run Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@CodeRabbit review |
✅ Action performedReview finished.
|
📝 WalkthroughWalkthroughThe PR adds a native amd64/arm64 GitHub Actions workflow that builds Docker targets, boots images with fixture vaults, validates health and authenticated MCP initialization, collects failure diagnostics, and documents the checks as merge-blocking. ChangesArchitecture smoke validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/arch_smoke.yml:
- Around line 82-85: Update the cache-from and cache-to scope expressions in the
workflow’s architecture smoke build to include the build target, using distinct
local and remote scopes derived from matrix.arch so each target reads from and
writes to its own GHA cache.
In `@CONTRIBUTING.md`:
- Around line 122-125: Update the Arch Smoke required-check description in
CONTRIBUTING.md to explicitly state that the arm64 workflow compile-checks the
Dockerfile’s remote target and that failures can block merges, covering this
path alongside the existing arm64 boot smoke behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7a538342-43c4-414e-b9b9-e84e33fc4fbd
📒 Files selected for processing (2)
.github/workflows/arch_smoke.ymlCONTRIBUTING.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Motivation
Every arm64 image from v0.33.0 through v0.33.4 crash-looped at startup (better-sqlite3 v13's linux-arm64 prebuild requires glibc >= 2.38; the bookworm base had 2.36) and stayed invisible for five days across four releases: prod is amd64, and trivy-pr — the only PR-time image build — builds amd64 only, so nothing ever executed an arm64 artifact before release. PR #384 fixed the image and added the deps-stage assertion that executes both native bindings per-arch at build time. This PR makes executed-per-arch a PR gate.
What the job does
New
Arch Smokeworkflow, matrix over native runners (ubuntu-latestamd64,ubuntu-24.04-armarm64 — no QEMU). Each leg:docker build --target local— natively executes the Dockerfile deps-stage native-binding assertion for its arch (new Database(':memory:')+require('onnxruntime-node')).EMBEDDING_ENABLED=false/MEMORY_ENABLED=falseand a per-run generated token./healthz200 is a true proof of the incident class:server.tsopens the search DB, awaits the blocking FTS rebuild, and opens the OAuth DB beforeapp.listen, exiting 1 on any failure. Then an authenticated MCPinitializeround-trip is asserted (HTTP 2xx +mcp-session-idheader +serverInfoin the body — a JSON-RPC error still returns 200, hence the body assertion).docker build --target remoteas a compile check — the first-ever arm64 build of the remote target at PR time. Build-only: booting remote needs Obsidian Sync credentials, and amd64 remote coverage is already trivy-pr's job.Design notes
arch-smoke (amd64)/arch-smoke (arm64)— explicit jobnamewith a friendly arch key, so the ruleset contexts stay stable if runner labels ever change. Adding them to the branch ruleset is a follow-up settings change after this merges.scope=arch-smoke-<arch>, a deliberate divergence from the repo's baretype=gha: trivy-pr (two targets) plus both smoke legs writingmode=maxinto the one default scope would evict each other — worst for arm64, which shares no blobs with the amd64 writers.cache-fromalso lists the bare default scope so the amd64 leg piggybacks trivy-pr's layers (no-op on arm64). TheAPT_UPGRADE_DATEcache-bust step is reused verbatim from trivy.yml — a differing build-arg would change the apt-upgrade layer hash and break that sharing.paths:leaves docs-only PRs stuck on "Expected" forever; trivy-pr also runs unconditionally.push: maintrigger seeds the per-arch cache into the default-branch scope (readable by all PRs; PR-branch caches are not shared across PRs) and acts as a post-merge canary.docker inspect '{{.State.Running}}'each iteration, so the incident's exact failure mode (startupprocess.exit(1)) fails in ~2s instead of burning the 60s poll window. Diagnostics step (if: failure()) dumpsdocker ps -a, container state JSON, and logs.timeout-minutes: 20is a kill-switch cap (default is 360), not the expected runtime — expected ~3-5 min warm-cache, ~8-12 min cold, legs parallel.fail-fast: false— arch failures are independent signals; one leg must not cancel the other.Verification
actionlint: zero findings on the new workflow;npm run prettier:checkgreen.bash -ein 2.2s — healthz ready on attempt 2, MCP initialize round-trip clean, and the initialize curl exits naturally when the SSE response stream closes (no--max-timetimeout).MCP_AUTH_TOKEN(startup exit 1) trips the crash-detection branch on poll attempt 1 with the startup error visible indocker logs.pull_requestworkflows run from the PR branch). A deliberate red push (probe pointed at a wrong port) will verify the gate bites and the diagnostics render, then be reverted.Also updates CONTRIBUTING.md's required-checks item to name the new checks.
🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
Documentation