Skip to content

Commit

Permalink
finalise our IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Jun 24, 2024
1 parent 19260c0 commit 2a25d30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 3 additions & 4 deletions _plugins/gtn/ro-crate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ def self.write(site, dir, associated_material, workflow, url, baseurl, time_base
Jekyll.logger.debug "[GTN/API/WFRun] dot -T png #{dot_path} > graph.png"
`dot -T png '#{dot_path}' > '#{File.join(wfdir, 'graph.png')}'`

# Replace last / with # to make a valid URL
wfurlid = url + baseurl + '/' + workflow['path'].gsub(%r{/workflows/},
'/workflows#')
# Our new workflow IDs
wfurlid = url + baseurl + '/' + workflow['path'].gsub(/.ga$/, '.html')

uuids = workflow['creators'].map do |c|
if c.key?('identifier') && !c['identifier'].empty?
Expand Down Expand Up @@ -195,7 +194,7 @@ def self.write(site, dir, associated_material, workflow, url, baseurl, time_base
# p "Writing #{File.join(wfdir, 'mod.ga')}"

zip_path = File.join(wfdir, 'rocrate.zip')
p "[GTN/API/WFRun] Zipping #{zip_path}"
Jekyll.logger.debug "[GTN/API/WFRun] Zipping #{zip_path}"
if File.exist?(zip_path)
File.delete(zip_path)
end
Expand Down
3 changes: 3 additions & 0 deletions _plugins/jekyll-topic-filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ def self.resolve_material(site, material)
end
workflow_test_outputs = nil if workflow_test_outputs.empty?

wfhkey = [page['topic_name'], page['tutorial_name'], wfname].join('/')

{
'workflow' => wf,
'tests' => Dir.glob("#{folder}/workflows/" + wf.gsub(/.ga/, '-test*')).length.positive?,
Expand All @@ -690,6 +692,7 @@ def self.resolve_material(site, material)
'comments' => (wf_json['comments'] || []).length.positive?,
'parameters' => wf_json['steps'].map{|_, x| x['type']}.any?{|x| x == "parameter_input"},
},
'workflowhub_id' => site.data['workflowhub'][wfhkey],
'history' => git_log(wf_path),
'test_results' => workflow_test_outputs,
'modified' => File.mtime(wf_path),
Expand Down

0 comments on commit 2a25d30

Please sign in to comment.