Repository navigation
Add Metadata Selector API with POST /investigations endpoint - #686
Draft
joshdimanteto wants to merge 8 commits into
Draft
joshdimanteto wants to merge 8 commits into
joshdimanteto wants to merge 8 commits into
Conversation
- Add metadata_selector_api as its own sub-API - POST /investigations checks that the source Investigation exists and that every supplied related ID belongs to it - Omitted relationship lists default to every related record; supplied lists, even empty ones, are used as given - Fails fast on the first list with IDs not found in the Investigation - Update config.yaml.example, .env.example and test_config_data - Add unit and integration tests
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #686 +/- ##
===========================================
- Coverage 100.00% 99.87% -0.13%
===========================================
Files 54 59 +5
Lines 2897 3140 +243
===========================================
+ Hits 2897 3136 +239
- Misses 0 4 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Return every column of the Investigation and each selected related record, nested following the ICAT schema: owned relationships to every level (e.g. datasets > datafiles > parameters) and the shared records they refer to (users, parameter types with permissible string values, instruments, facilities etc.) - Use the models generated from the ICAT schema (build_datagateway_api_model) as the response model, replacing the hand-written response models - Never include back-references to a parent or the collections of shared records, so the nesting cannot recurse - Nest each selected Dataset's Datafiles under it and add the Samples used by the selected Datasets - Split ID lists into batches and fetch results in pages, halving a page that exceeds ICAT's maxEntities - Keep failing fast: all supplied IDs are checked before any full records are fetched - Update integration tests for the full document, paging and batching
- Add POST /metadata-selector/investigations/xml, which takes the same request as POST /investigations and returns the new Investigation in python-icat's XML dump format, loadable with icatingest - Write every record once, referring to related records by unique key, so the file is self-contained: shared records first, then the Investigation, its Samples, Datasets and Datafiles - Fetch records as the requesting user, batching ID lists and fetching in chunks to stay within ICAT's limits - Move the request checks into check_metadata_selection, shared by both endpoints - Add integration tests, including reading the file back with python-icat's dump file reader - Add docs/metadata_selector_ingest_formats.md comparing the JSON and XML formats, with the results of ingesting into a new ICAT and the fix for loading into an ICAT that already has some shared records
…OST /investigations
joshdimanteto
force-pushed
the
feature/metadata-selector
branch
from
December 2, 2026 11:29
8a3f7a1 to
16dc9f2
Compare
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.
Description
Testing Instructions
icatdb Generator Script Consistency TestCI job fails, is this because of a deliberate change made to the script to change generated data (which isn't actually a problem) or is here an underlying issue with the changes made?fix:,feat:orBREAKING CHANGE:so a release is automatically made via GitHub Actions upon merge?