feat: test suite run unified Query DSL entity #197 - #201
Merged
Merged
Conversation
buhaiovos
marked this pull request as ready for review
September 15, 2026 07:49
buhaiovos
requested review from
siarhei-fedziukovich and
vladyslavchuhai-spec
as code owners
September 15, 2026 07:49
This comment has been minimized.
This comment has been minimized.
buhaiovos
force-pushed
the
feat/197-unified-query-dsl
branch
from
September 15, 2026 07:54
5f63de3 to
dd8abe8
Compare
buhaiovos
added this pull request to stack #203
September 16, 2026 09:53
buhaiovos
force-pushed
the
feat/197-unified-query-dsl
branch
from
September 16, 2026 09:54
95a0a62 to
e21a856
Compare
vladyslavchuhai-spec
approved these changes
Sep 16, 2026
This comment has been minimized.
This comment has been minimized.
buhaiovos
disabled the stack merge
September 16, 2026 10:08
Base automatically changed from
feat/197-prepare-metrics-snapshots
to
development
September 16, 2026 10:09
buhaiovos
force-pushed
the
feat/197-unified-query-dsl
branch
from
September 16, 2026 10:09
e21a856 to
577b3ea
Compare
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
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.
Applicable issues
Description of changes
Important
MUST go after #199
Problem
The UI's run list needs, per run, the deployment (or MCP deployment) the run executed against and the names of the metrics it produced. Neither fact was reachable from the run listing: the deployment ref lives only inside
test_suite_runs.suite_snapshot(excluded from the list projection to avoid TOAST decompression), and metric names live inrun_metric_snapshots. So the UI had to fan out per row —GET /test-suite-runs/{id}plusGET /run-metric-snapshots— instead of getting a page in one request. Enriching the bespoke REST listing would have added yet another one-off shape; the run list belongs in the structured query DSL alongsidetest_casesandeval_summaries.Solution
Second step of GH #197:
test_suite_runsbecomes a queryable entity of the structured query DSL, so run listing, filtering, sorting, grouping and aggregation all go throughPOST /api/v1/queries/execute.Entity and field set. A new simple entity
test_suite_runs(meta datasource) is exposed at/queries/executeand in both schema-discovery endpoints (GET /queries/entities,GET /queries/entities/schema/test_suite_runs). Fields are everytest_suite_runscolumn exceptsuite_snapshot,run_configanderror_details, plus virtual fields extracted from the run's own snapshot —suite_type,deployment_ref::id|name|version|type,mcp_deployment_ref::id|name|type|transport— andmetric_names. Refs are snapshot-only with no fallback totest_suites(run-time truth; a later suite edit must not rewrite history) and are null for pre-snapshot runs. Row mode with an emptyselectreturns exactly that field set; the excluded JSONB columns are rejected as unknown fields (400).metric_names. The distinct, sortedtsmd_names of the run's latest computation,[]when a run has no snapshots. Bound as anARRAY-typed JSONB field, soco/ncbehave as whole-element containment (e.g. "runs that producedAccuracy"), consistent withtest_casesarray fields.Prerequisite (previous stacked change, details omitted here).
run_metric_snapshotswas moved from the analytics DB to meta with anON DELETE CASCADEFK totest_suite_runs, which is what makes both facts joinable in a single Postgres statement; its endpoint moved to/api/v1/run-metric-snapshotswith the old analytics path kept as a deprecated delegating controller.All API changes are additive: the existing
GET /api/v1/test-suite-runsis untouched and the migration carries no data movement, so this ships safely with the UI still on the old listing. Out of scope:overall_scoreand cost enrichment,latest_computation_id/metric_countfields, any ClickHouse/analytics variant.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.