From 2a25d3097091af9174fbcb43204161ffe79c266b Mon Sep 17 00:00:00 2001 From: Helena Rasche Date: Mon, 24 Jun 2024 17:10:04 +0200 Subject: [PATCH] finalise our IDs --- _plugins/gtn/ro-crate.rb | 7 +++---- _plugins/jekyll-topic-filter.rb | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/_plugins/gtn/ro-crate.rb b/_plugins/gtn/ro-crate.rb index 4450a4968f2e61..60407464a5196d 100644 --- a/_plugins/gtn/ro-crate.rb +++ b/_plugins/gtn/ro-crate.rb @@ -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? @@ -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 diff --git a/_plugins/jekyll-topic-filter.rb b/_plugins/jekyll-topic-filter.rb index c94f169249b005..23a5b43d4cb968 100644 --- a/_plugins/jekyll-topic-filter.rb +++ b/_plugins/jekyll-topic-filter.rb @@ -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?, @@ -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),