@201 Add RO-Crate entity filters for targeted lookups#273
Open
@201 Add RO-Crate entity filters for targeted lookups#273
Conversation
daniel-thom
reviewed
Apr 24, 2026
| @@ -0,0 +1,112 @@ | |||
| # RO-Crate Filter Staged Review | |||
| configuration, | ||
| workflow_id, | ||
| Some(0), | ||
| Some(2), |
| { | ||
| Ok(result) => result, | ||
| Err(e) => { | ||
| let error_string = e.to_string(); |
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.
Summary
This MR fixes the RO-Crate existence-check path by extending the existing
GET /workflows/{id}/ro_crate_entitiesAPI with optional filters for:file_identity_idInstead of repeatedly fetching the full RO-Crate entity list and scanning it
client-side, callers can now perform targeted lookups against the server.
Problem
The previous implementation relied on listing all RO-Crate entities for a
workflow and then filtering in client code to determine whether a matching
record already existed.
That has two problems:
What Changed
Server / API
file_idandentity_idquery parameters toGET /workflows/{id}/ro_crate_entitiesand RO-Crate transport
consistent
Client
list_ro_crate_entities_with_filtersfind_ro_crate_entity_by_file_idfind_ro_crate_entity_by_entity_idfind_entity_for_file()to use a targeted filtered lookup instead offull-list fetch + scan
find_*helpers observe multiple matchesand return the first result
Data Integrity
(workflow_id, file_id)wherefile_id IS NOT NULL(workflow_id, file_id)rowsbefore creating the unique index
Error Handling
structured
422response instead of falling through as a generic server errorTests
Added and strengthened RO-Crate coverage for:
file_identity_id422assertionValidation
Ran successfully:
cargo fmt --all --checkcargo check --testscargo clippy --all --all-targets --all-features -- -D warningsdprint checkNote: full integration test execution is still limited in this environment
because sandboxed test server port binding is restricted.
Notes / Risk
(workflow_id, file_id)rows already exist, it keeps the newest row beforeadding the unique index.
any out-of-tree implementors will need to update accordingly.