diff --git a/_plugins/jekyll-topic-filter.rb b/_plugins/jekyll-topic-filter.rb index 23a5b43d4cb968..d5ae4029e309b3 100644 --- a/_plugins/jekyll-topic-filter.rb +++ b/_plugins/jekyll-topic-filter.rb @@ -692,7 +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], + 'workflowhub_id' => (site.data['workflowhub'] || {}).fetch(wfhkey, nil), 'history' => git_log(wf_path), 'test_results' => workflow_test_outputs, 'modified' => File.mtime(wf_path), diff --git a/bin/wfh-upload.py b/bin/wfh-upload.py index 16f1202483533c..dfe08133764e67 100755 --- a/bin/wfh-upload.py +++ b/bin/wfh-upload.py @@ -36,19 +36,14 @@ def doUpload(crate_path): print(response.text) return None + add_discussion_channel = False + wfid = response.json()['data']['id'] permissions_update = { "data": { "id": wfid, "type": "workflows", "attributes": { - # Adds duplicate links so, commented for now. No bug has been filed. - # "discussion_links": [ - # { - # "label": "Matrix", - # "url": "https://matrix.to/#/%23galaxyproject_admin:gitter.im" - # } - # ], "policy": { "access": "download", "permissions": [ @@ -64,6 +59,18 @@ def doUpload(crate_path): } } } + + if response.json()['data']['attributes']['discussion_links'] and not any( + x['label'] == 'GTN Matrix' for x in response.json()['data']['attributes']['discussion_links'] + ): + permissions_update['data']['attributes']['discussion_links'] = [ + { + "label": "GTN Matrix", + "url": "https://matrix.to/#/%23galaxyproject_admin:gitter.im" # Must encode the second # + } + ] + + headers.update({ 'Content-type': 'application/json', 'Accept': 'application/json',