Skip to content

Ro crate validator - #2686

Open
AbbyGavin wants to merge 28 commits into
seek4science:mainfrom
AbbyGavin:ro-crate-validator
Open

Ro crate validator#2686
AbbyGavin wants to merge 28 commits into
seek4science:mainfrom
AbbyGavin:ro-crate-validator

Conversation

@AbbyGavin

Copy link
Copy Markdown
Contributor

Adding validation to uploaded RO crates. This uses a python based validator: https://github.com/crs4/rocrate-validator. Currently this doesn't have version 1.3 validation, though they have an issue for it crs4/rocrate-validator#179. It doesn't support version 1.0 crates, so we first check if the crate contains an ro-crate-metadata.json file. If it doesn't, we pass through to the existing validation since version 1.0 crates use an ro-crate-metadata.jsonld file instead.

Fixes #1191.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces RO-Crate validation during workflow RO-Crate uploads by invoking a Python-based validator before attempting to parse/extract the crate, and updates tests to reflect the new validation/error behavior.

Changes:

  • Add a Python script (script/validate-ro-crate.py) to run RO-Crate validation and print validation issues.
  • Invoke the validator from WorkflowCrateExtractor only when the crate includes ro-crate-metadata.json (i.e., not RO-Crate 1.0 .jsonld crates).
  • Update test expectations (including normalized source_link_url with a trailing slash and new validation error messaging).

Reviewed changes

Copilot reviewed 4 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
app/forms/workflow_crate_extractor.rb Adds conditional pre-parse RO-Crate validation via an external Python validator.
script/validate-ro-crate.py New validator runner script that prints validation issues for the Ruby layer to surface.
requirements.txt Adds the validator dependency and updates cwltool version.
test/functional/workflows_controller_test.rb Updates expectations for the new validation error output.
test/integration/api/git_workflow_ro_crate_api_test.rb Updates expectations for source_link_url normalization (trailing slash).

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

Comment thread app/forms/workflow_crate_extractor.rb
Comment thread script/validate-ro-crate.py
Comment thread script/validate-ro-crate.py Outdated
Comment thread app/forms/workflow_crate_extractor.rb
Comment thread app/forms/workflow_crate_extractor.rb

@fbacall fbacall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On hold for now - Investigating some performance issues of the validator library on crates with large numbers of entities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More helpful error messages when workflow parsing fails

3 participants