fix(ui): per-assertion pass/fail breakdown on API monitor detail#86
Merged
Conversation
The processor already stores assertion_results (jsonb) per api_executions row — every assertion's pass/fail + actual + expected + message. The UI was throwing it away and rendering a generic "One or more assertions failed" in the Detail column. Operators had to drop to psql to find which assertion actually failed. Now: each API monitor run renders its assertion_results inline as a small ul.assertion-results with one li per result — pass/fail dot + the message from evaluator (which already includes the actual vs expected delta, e.g. "Expected status code to equal 200, but got 500" or "Header 'Content-Type' contains 'application/json' but got 'text/html'"). Non-assertion failures (fetch errors, timeouts) where the row has no assertion_results keep the existing errorMessage truncated view. Also widens RunLite.assertionResults so detail.ts isn't reaching through an unsafe cast. Test: tests/ui/api-assertion-detail.e2e.spec.ts creates an API monitor with one passing and one failing assertion against example.com, waits for the run, and asserts the breakdown renders with one .dot.up and one .dot.down. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merged
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.
Summary
Friction #21 from the 2026-05-26 walkthrough. The API check processor already stores
assertion_resultsjsonb per execution row (every assertion's pass/fail + actual vs expected + message). The detail UI was rendering a generic "One or more assertions failed" — operators had to drop to psql to know which assertion failed.Now: each API monitor run renders its
assertion_resultsinline as a small list with one line per result — pass/fail dot + the evaluator's message (which includes "Expected status code to equal 200, but got 500" / "Header 'Content-Type' contains 'application/json' but got 'text/html'" / etc).Test plan
bun run tsc --noEmit,format:checkcleantests/ui/api-assertion-detail.e2e.spec.tscreates an API monitor with one passing and one failing assertion, waits for the run, asserts the breakdown renders with one.dot.upand one.dot.down🤖 Generated with Claude Code