Merged
Conversation
added 3 commits
April 8, 2026 21:23
…blic models New response models to support returning file metadata inline with samples: - SampleFilePublic: compact file with uri and flat-dict tags - SampleWithFilesPublic(SamplePublic): extends SamplePublic with files list - SamplesWithFilesPublic: paginated wrapper for the files-enriched response Needed by backend workers to construct samplesheets from sample file data.
- Add include query parameter (list of strings) to get_project_samples route - When include contains 'files', use selectinload to eagerly load Sample -> FileSample -> File -> FileTag in a single query - Build SampleFilePublic objects with flattened tags dict per sample - Return SamplesWithFilesPublic when files requested, SamplesPublic otherwise - Avoids N+1 API calls for backend workers that need file URIs and tags
- Assert existing test_get_samples_for_a_project_with_samples verifies no 'files' key present without ?include=files - test_get_samples_include_files_with_tagged_files: R1/R2 FASTQs, flat tags - test_get_samples_include_files_sample_with_no_files: files is null - test_get_samples_include_files_with_untagged_files: tags is null - test_get_samples_include_files_pagination_works: pagination correctness - test_get_samples_include_files_mixed_samples: with and without files
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.
the backend worker needs files for each sample to construct samplesheets. however, the GET samples endpoint only returned attributes, not associated files.
this PR modifies the route to include an optional ?includes=files querystring param which keeps the existing return format by default, but optionally returns a new public model with the full files + tags included to enable samplesheet generation.