Skip to content

Conversation

@Ulthran
Copy link
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

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).

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
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.

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.

1 participant