Repository navigation
Added Content url property to crate when downloaded - #2755
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Historical and remote workflow URLs can be invalid, coverage is missing, and the linked issue does not match the implementation.
2 open findings
What changed in this PR
Adds a contentUrl to generated workflow RO-Crates, linking to the main workflow file.
Changes:
- Adds
contentUrlduring RO-Crate generation. - Introduces a helper for constructing the main workflow download URL.
| File | Description |
|---|---|
app/models/concerns/workflow_extraction.rb |
Adds main workflow URLs to generated RO-Crate metadata. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| crate['datePublished'] = Time.now unless crate['datePublished'] | ||
| crate['sdDatePublished'] = Time.now unless crate['sdDatePublished'] | ||
| crate['creativeWorkStatus'] = I18n.t("maturity_level.#{maturity_level}") if maturity_level | ||
| crate['contentUrl'] = main_workflow_url |
There was a problem hiding this comment.
The contentUrl should be on the data entities (main workflow etc.) that are added earlier on in the method, rather than on the crate entity itself.
fbacall
left a comment
There was a problem hiding this comment.
Looks good, just one minor thing
| end | ||
|
|
||
| def to_crate_entity(crate, type: ::ROCrate::File, properties: {}) | ||
| def to_crate_entity(crate, type: ::ROCrate::File, content_url: nil, properties: {}) |
There was a problem hiding this comment.
I would remove this option - I think you can just pass contentUrl in via the properties argument
e.g.
c.to_crate_entity(crate, type: ROCrate::WorkflowDescription, properties: { contentUrl: content_url(c) })


Fixes #2298. Though, if that workflow was uploaded as a crate then this will not change anything as the initial crate is provided instead of creating it.