Skip to content

feat(omnigraph): send the Omnigraph-Http-Api header from the council probe - #6291

Merged
blarghmatey merged 1 commit into
mainfrom
omnigraph-013-probe-http-api-header
Oct 8, 2026
Merged

blarghmatey merged 1 commit into
mainfrom
omnigraph-013-probe-http-api-header

Conversation

@blarghmatey

Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A (witan task tk-send-omnigraph-http-api-0-12-from-ol-infrastruct-55e376, part of the omnigraph 0.13 upgrade; spec in mitodl/agent-kit#461, D7)

Description (What does it do?)

omnigraph-server 0.13 answers 400 api_contract_mismatch to any protected request without exactly one Omnigraph-Http-Api: 0.13 header. The council probe POSTs /graphs/<id>/query with only a bearer token, so every run would fail after the cutover.

This sends the header from check_council_health.py. A 0.11 server ignores it, so this can deploy ahead of the cutover.

Two related checks:

  • An api_contract_mismatch refusal gets its own message, because the remedy is to bump HTTP_API_CONTRACT in the script and has nothing to do with the probe's credentials or the graph.
  • A 2xx stamped with a different contract fails the run. A 2xx with no stamp is still accepted, because 0.11 sends none and this script runs on both sides of the cutover.

503 graph_unavailable (what 0.13 returns for a blocked graph, where 0.11 returned 404) already fails the run as a non-2xx. There is a test for it now.

The probe is the only caller of a protected omnigraph route in this repo. The kubelet probes use /healthz and /readyz, which need no header, and the other urlopen calls under applications/omnigraph go to the Kubernetes API, STS and S3.

How can this be tested?

  • uv run pytest tests/ol_infrastructure/applications/omnigraph/test_check_council_health.py: 20 passed.
  • Checked on scratch servers with curl. 0.11.0 answers a query carrying Omnigraph-Http-Api: 0.13 with 200 and sends no such response header. 0.13.0 answers 200 with the header, 400 {"code":"api_contract_mismatch"} without it or with 0.12, and stamps omnigraph-http-api: 0.13 on 200, 400, 403 and 404 responses. /healthz answers 200 without the header on both.
  • Not yet run in a cluster. After this deploys to CI, the next council-health CronJob run should still succeed against the 0.11 data tier.

https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A

…probe

omnigraph-server 0.13 answers 400 api_contract_mismatch to any protected
request without exactly one `Omnigraph-Http-Api: 0.13`. The council probe
POSTs /graphs/<id>/query with only a bearer token, so it would fail every
run after the cutover. A 0.11 server ignores the header, so this is safe to
deploy first.

A contract mismatch is reported apart from other refusals, because the
remedy is a version bump in this script and not a credential or the graph.
A success stamped with another contract also fails the run. An unstamped
success is still accepted, since 0.11 sends no stamp and this script runs
on both sides of the cutover.

Claude-Session: https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A
Copilot AI balanced review requested due to automatic review settings October 8, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused implementation preserves legacy compatibility and has targeted regression coverage, with no identified blocking issues.

0 open findings

What changed in this PR

Prepares the council health probe for Omnigraph 0.13 while preserving compatibility with 0.11.

Changes:

  • Sends the required API contract header and reports contract mismatches distinctly.
  • Validates response headers and adds regression coverage for compatibility and blocked graphs.
File Description
tests/​ol_infrastructure/​applications/​omnigraph/​test_check_council_health.py Tests contract headers, mismatches, legacy compatibility, and blocked graphs.
src/​ol_infrastructure/​applications/​omnigraph/​scripts/​check_council_health.py Adds contract headers, response validation, and mismatch diagnostics.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@blarghmatey
blarghmatey merged commit 0ca0610 into main Oct 8, 2026
13 checks passed
@blarghmatey
blarghmatey deleted the omnigraph-013-probe-http-api-header branch October 8, 2026 19:20
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.

2 participants