fix(health): restore message field in public health view (SDK contract)#206
Merged
Conversation
The S-3 sanitizer dropped `message` from each /v1/health component, but the SDK
`HealthComponent` model requires a string `message` — so `client.health()`'s
`HealthStatus.model_validate` raised 7 missing-field errors. This only surfaced
in the push-only E2E and Staging lanes (not PR CI): both failed
`test_ops_agent_journey` identically.
The leak was the message *content* (`f"Kafka unavailable: {exc}"`, counts,
backend identity), not the field. Blank the message to "" instead of dropping
it — shape preserved, content gone. The unit suite now validates the view
against the SDK `HealthStatus` model so this class of break fails here, not only
in the push-only lanes; my earlier test wrongly asserted the message-less shape.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DORA Metrics
|
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.
Follow-up to #205. The S-3 health sanitizer dropped
messagefrom each/v1/healthcomponent, but the SDK'sHealthComponentmodel requires a stringmessage, soclient.health()→HealthStatus.model_validateraised 7 missing-field errors. This surfaced only in the push-only E2E and Staging lanes (not PR CI), wheretest_ops_agent_journeyfailed identically on both.The leak was the message content (
f"Kafka unavailable: {exc}", broker/topic counts, backend identity), not the field itself. This blanksmessageto""instead of dropping it — field shape preserved (SDK happy), sensitive content still gone.Also adds a unit regression test (
test_view_still_validates_against_sdk_health_model) that runs the sanitized view through the SDKHealthStatusmodel, so this class of break fails in unit tests rather than only in the post-merge lanes. (My earlier test wrongly asserted the message-less shape — corrected.)Note: E2E/Staging are push-only and do not run on PRs; verified locally via the SDK-model unit test that reproduces the exact
model_validatefailure.🤖 Generated with Claude Code