Repository navigation
feat(omnigraph): send the Omnigraph-Http-Api header from the council probe - #6291
Merged
Merged
Conversation
…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
Contributor
There was a problem hiding this comment.
🟢 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_mismatchto any protected request without exactly oneOmnigraph-Http-Api: 0.13header. The council probe POSTs/graphs/<id>/querywith 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:
api_contract_mismatchrefusal gets its own message, because the remedy is to bumpHTTP_API_CONTRACTin the script and has nothing to do with the probe's credentials or the graph.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
/healthzand/readyz, which need no header, and the otherurlopencalls underapplications/omnigraphgo 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.curl. 0.11.0 answers a query carryingOmnigraph-Http-Api: 0.13with 200 and sends no such response header. 0.13.0 answers 200 with the header,400 {"code":"api_contract_mismatch"}without it or with0.12, and stampsomnigraph-http-api: 0.13on 200, 400, 403 and 404 responses./healthzanswers 200 without the header on both.council-healthCronJob run should still succeed against the 0.11 data tier.https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A