Skip to content

Added Content url property to crate when downloaded - #2755

Merged
fbacall merged 17 commits into
seek4science:seek-1.19from
AbbyGavin:contentUrl-property
Oct 30, 2026
Merged

fbacall merged 17 commits into
seek4science:seek-1.19from
AbbyGavin:contentUrl-property

Conversation

@AbbyGavin

@AbbyGavin AbbyGavin commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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.

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.

🟡 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 contentUrl during 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

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.

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 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.

Looks good, just one minor thing

Comment thread app/models/git/blob.rb Outdated
end

def to_crate_entity(crate, type: ::ROCrate::File, properties: {})
def to_crate_entity(crate, type: ::ROCrate::File, content_url: nil, properties: {})

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.

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) })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@stuzart
stuzart changed the base branch from main to seek-1.19 October 29, 2026 11:26
@stuzart stuzart added this to the 1.19.0 milestone Oct 29, 2026
@fbacall
fbacall merged commit d2217bb into seek4science:seek-1.19 Oct 30, 2026
10 checks passed
@AbbyGavin
AbbyGavin deleted the contentUrl-property branch November 2, 2026 10:05
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.

Include file download links in RO-Crate metadata when exported

4 participants