Skip to content

Add full run and full sample API endpoints#68

Merged
kylebittinger merged 2 commits intomasterfrom
codex/add-endpoints-for-full-runs-and-samples
Mar 23, 2026
Merged

Add full run and full sample API endpoints#68
kylebittinger merged 2 commits intomasterfrom
codex/add-endpoints-for-full-runs-and-samples

Conversation

@Ulthran
Copy link
Copy Markdown
Contributor

@Ulthran Ulthran commented Feb 6, 2026

Motivation

  • Provide endpoints that return a complete run (with all samples and their annotations) and a complete sample (with all annotations) to simplify client-side aggregation and reduce multiple requests.
  • Expose higher-level helper methods on the registry layer so callers can fetch aggregate objects in a single call.

Description

  • Added SampleRegistry.get_full_run(run_accession) which returns the Run model, the list of Sample models for that run, and annotations grouped by sample accession.
  • Added SampleRegistry.get_full_sample(sample_accession) which returns the Sample model and all its Annotation records.
  • Added two new API endpoints: GET /api/get_full_run?run_accession=... and GET /api/get_full_sample?sample_accession=... that perform the same input validation style used elsewhere and serialize results using api_model_to_dict.
  • Updated tests in tests/test_api.py to cover both endpoints and assert payload structure and annotation contents.

Testing

  • Ran pytest -q tests/test_api.py and all tests passed: 14 passed.

Codex Task

Copilot AI review requested due to automatic review settings February 6, 2026 20:38
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 6, 2026

Codecov Report

❌ Patch coverage is 85.93750% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.41%. Comparing base (e8d60e5) to head (ce00740).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
sample_registry/registrar.py 89.10% 11 Missing ⚠️
sample_registry/app.py 74.07% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #68      +/-   ##
==========================================
+ Coverage   71.03%   71.41%   +0.38%     
==========================================
  Files           9        9              
  Lines         932      976      +44     
==========================================
+ Hits          662      697      +35     
- Misses        270      279       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds higher-level registry helpers and Flask API endpoints that return fully aggregated run/sample payloads (including annotations), reducing the number of client-side round trips and aggregation logic.

Changes:

  • Added SampleRegistry.get_full_run() to fetch a run, its samples, and annotations grouped per sample.
  • Added SampleRegistry.get_full_sample() to fetch a sample and all annotations.
  • Added GET /api/get_full_run and GET /api/get_full_sample plus API tests validating payload structure/content.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
sample_registry/registrar.py Adds registry-layer aggregation helpers for “full run” and “full sample” retrieval.
sample_registry/app.py Adds two new GET endpoints that validate inputs and serialize aggregated results.
tests/test_api.py Adds tests covering both new endpoints and expected annotation payloads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sample_registry/registrar.py Outdated
@kylebittinger kylebittinger merged commit ba7d01e into master Mar 23, 2026
9 checks passed
@kylebittinger kylebittinger deleted the codex/add-endpoints-for-full-runs-and-samples branch March 23, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants