Skip to content

feat: test suite run unified Query DSL entity #197 - #201

Merged
buhaiovos merged 4 commits into
developmentfrom
feat/197-unified-query-dsl
Sep 16, 2026
Merged

buhaiovos merged 4 commits into
developmentfrom
feat/197-unified-query-dsl

Conversation

@buhaiovos

@buhaiovos buhaiovos commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

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 in run_metric_snapshots. So the UI had to fan out per row — GET /test-suite-runs/{id} plus GET /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 alongside test_cases and eval_summaries.

Solution

Second step of GH #197: test_suite_runs becomes a queryable entity of the structured query DSL, so run listing, filtering, sorting, grouping and aggregation all go through POST /api/v1/queries/execute.

Entity and field set. A new simple entity test_suite_runs (meta datasource) is exposed at /queries/execute and in both schema-discovery endpoints (GET /queries/entities, GET /queries/entities/schema/test_suite_runs). Fields are every test_suite_runs column except suite_snapshot, run_config and error_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 — and metric_names. Refs are snapshot-only with no fallback to test_suites (run-time truth; a later suite edit must not rewrite history) and are null for pre-snapshot runs. Row mode with an empty select returns exactly that field set; the excluded JSONB columns are rejected as unknown fields (400).

metric_names. The distinct, sorted tsmd_names of the run's latest computation, [] when a run has no snapshots. Bound as an ARRAY-typed JSONB field, so co/nc behave as whole-element containment (e.g. "runs that produced Accuracy"), consistent with test_cases array fields.

Prerequisite (previous stacked change, details omitted here). run_metric_snapshots was moved from the analytics DB to meta with an ON DELETE CASCADE FK to test_suite_runs, which is what makes both facts joinable in a single Postgres statement; its endpoint moved to /api/v1/run-metric-snapshots with the old analytics path kept as a deprecated delegating controller.

All API changes are additive: the existing GET /api/v1/test-suite-runs is untouched and the migration carries no data movement, so this ships safely with the UI still on the old listing. Out of scope: overall_score and cost enrichment, latest_computation_id/metric_count fields, any ClickHouse/analytics variant.

Checklist

  • corresponding issue(s) linked in the "Development" section of sidebar and referenced in "Applicable issues" section above
  • I have read the "Description of changes" and understood it


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@buhaiovos buhaiovos changed the title Feat/197 unified query dsl feat: test suite run unified query dsl entity #197 Sep 15, 2026
@buhaiovos
buhaiovos marked this pull request as ready for review September 15, 2026 07:49
@ai-dial-actions

This comment has been minimized.

@buhaiovos
buhaiovos force-pushed the feat/197-unified-query-dsl branch from 5f63de3 to dd8abe8 Compare September 15, 2026 07:54
@buhaiovos
buhaiovos added this pull request to stack #203 September 16, 2026 09:53
@buhaiovos
buhaiovos force-pushed the feat/197-unified-query-dsl branch from 95a0a62 to e21a856 Compare September 16, 2026 09:54
@buhaiovos buhaiovos changed the title feat: test suite run unified query dsl entity #197 feat: test suite run unified query DSL entity #197 Sep 16, 2026
@ai-dial-actions

This comment has been minimized.

@buhaiovos
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
buhaiovos force-pushed the feat/197-unified-query-dsl branch from e21a856 to 577b3ea Compare September 16, 2026 10:09
@buhaiovos buhaiovos changed the title feat: test suite run unified query DSL entity #197 feat: test suite run unified Query DSL entity #197 Sep 16, 2026
@ai-dial-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@buhaiovos
buhaiovos merged commit fb13d87 into development Sep 16, 2026
12 checks passed
@buhaiovos
buhaiovos deleted the feat/197-unified-query-dsl branch September 16, 2026 10:29
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.

3 participants