Skip to content

Per-server opt-in for the legacy /status format#229

Open
passcod wants to merge 2 commits into
mainfrom
allow-legacy-status
Open

Per-server opt-in for the legacy /status format#229
passcod wants to merge 2 commits into
mainfrom
allow-legacy-status

Conversation

@passcod

@passcod passcod commented Jun 18, 2026

Copy link
Copy Markdown
Member

🤖 Follow-up to #228, which made a health array mandatory on /status. That blanket reject is too blunt for servers still running an old reporter, so this adds a per-server escape hatch.

What

  • New servers.allow_legacy_status column (boolean, off by default). A status push with no health array is still rejected with 400 unless the server has this set.
  • When it's on, a legacy push is accepted as reachability-only: it carries the server's last known health/healthy forward (defaulting to "healthy, no checks" if the server has never reported the new format) and files no health events. So a server straddling an old and a new reporter doesn't flap its per-check issues, and the health snapshot keeps showing the last real report rather than blinking to "no checks" on every legacy ping.
  • Operators toggle it from the server edit page. Drop the flag and the legacy path once every reporter speaks the new format.

Also in here

  • cargo fmt across the workspace — the tree wasn't clean under the current stable rustfmt, so a lot of unrelated files reflow. Committed deliberately so it doesn't keep re-surfacing on every PR.
  • A new CI Rustfmt job (just fmt-check) to keep it clean going forward.

Wire specs (crates/public-server/openapi.json, private-web/openapi.json, private-web/src/api-types.ts) regenerated. Coverage: public-server tests for accept/reject/carry-forward and a Playwright test for the edit-page toggle.

@passcod passcod force-pushed the allow-legacy-status branch from d298405 to ae6a5c0 Compare June 18, 2026 11:34
Making a health array mandatory is too blunt for servers still running an
old reporter, so add a per-server `allow_legacy_status` flag (off by
default). When set, a push with no `health` array is accepted as
reachability-only: it carries the server's last known healthchecks
forward instead of clearing them and files no events, so a server
straddling an old and a new reporter doesn't flap its per-check issues.
Operators toggle it from the server edit page. Drop the flag and the
legacy path once every reporter speaks the new format.

Also reformats the workspace (the tree wasn't clean under current stable
rustfmt) and adds a CI rustfmt check to keep it that way.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@passcod passcod force-pushed the allow-legacy-status branch from ae6a5c0 to f80a5a2 Compare June 18, 2026 11:40
@passcod passcod enabled auto-merge June 18, 2026 11:41
The edit-page checkbox was reworded to "Allow status from Tamanu"; the
Playwright test still looked for the old "Allow legacy status format"
label and failed to find the control. Match the current label.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@passcod passcod added this pull request to the merge queue Jun 18, 2026
@passcod passcod removed this pull request from the merge queue due to a manual request Jun 18, 2026
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