Skip to content

feat: NMv3: add read-only results API to orchestrator#6689

Merged
jstuczyn merged 8 commits intofeat/mix-stress-testingfrom
feat/nmv3-results-api
Apr 24, 2026
Merged

feat: NMv3: add read-only results API to orchestrator#6689
jstuczyn merged 8 commits intofeat/mix-stress-testingfrom
feat/nmv3-results-api

Conversation

@jstuczyn
Copy link
Copy Markdown
Contributor

@jstuczyn jstuczyn commented Apr 20, 2026

NYM-752

Summary

  • Add six read-only endpoints under /v1/results/* that expose the orchestrator's local SQLite database to external consumers (grafana, harbourmaster, etc.)
  • All routes are protected by the shared metrics_and_results bearer token
  • Endpoints: paginated node list, node by id (with latest test run), paginated test run list, per-node test run history, single test run by id, and paginated in-progress test run list
  • Storage layer extended with snapshot-consistent paginated queries (page + total in a single transaction) for all four relevant tables
  • Replaced the previous silent 200-row cap on in-progress runs with standard Pagination / PagedResult<T> contract, matching the other endpoints
  • Added idx_testrun_test_timestamp migration index to support efficient global test-run pagination without a full-table scan
  • OpenAPI responses blocks on all agent and results handlers now document 4xx/5xx error shapes alongside the happy-path 200

This change is Reviewable

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nym-explorer-v2 Ready Ready Preview, Comment Apr 24, 2026 9:36am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs-nextra Ignored Ignored Preview Apr 24, 2026 9:36am
nym-node-status Ignored Ignored Preview Apr 24, 2026 9:36am

Request Review

@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from 76e7f2a to cd9f5c7 Compare April 20, 2026 09:55
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-api branch from f884718 to 8fe23c4 Compare April 20, 2026 09:55
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-api branch from 8fe23c4 to a882e15 Compare April 23, 2026 10:59
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from cd9f5c7 to 66e6a6b Compare April 23, 2026 10:59
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-api branch from a882e15 to d4f290c Compare April 23, 2026 11:46
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from 66e6a6b to 830b33e Compare April 23, 2026 11:46
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from 830b33e to 1030c3f Compare April 23, 2026 12:55
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-api branch from d4f290c to 2bdd601 Compare April 23, 2026 12:55
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from 1030c3f to 4084616 Compare April 23, 2026 13:04
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-api branch from 2bdd601 to 0f82710 Compare April 23, 2026 13:04
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from 4084616 to c18dbf8 Compare April 23, 2026 13:13
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-api branch from 0f82710 to 302c8bf Compare April 23, 2026 13:14
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from c18dbf8 to 6f73cab Compare April 23, 2026 17:46
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-api branch from 302c8bf to 267c5f0 Compare April 23, 2026 17:47
@jstuczyn jstuczyn force-pushed the feat/nmv3-results-eviction branch from 9f6388f to 2d32e37 Compare April 24, 2026 09:23
Base automatically changed from feat/nmv3-results-eviction to feat/mix-stress-testing April 24, 2026 09:24

/// Selects the most stale idle node and atomically marks it as having a test
/// in progress. Returns `None` if no node is currently eligible.
pub(crate) async fn assign_next_testrun(&self) -> Result<Option<TestRunAssignment>, ApiError> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We seem to have a mix of functions being defined here and some directly in the endpoint function.
Am I missing something? Any reason for that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a stylistic choice to not have to deal with storage on the endpoint level, especially if calls interact with multiple things on the state

@jstuczyn jstuczyn merged commit 1b645d8 into feat/mix-stress-testing Apr 24, 2026
12 of 13 checks passed
@jstuczyn jstuczyn deleted the feat/nmv3-results-api branch April 24, 2026 09:55
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.

2 participants