Description
Describe the bug
I have found that a .dockstore.yml
file that contains no primaryDescriptorPath
field is parsed without errors by DockstoreYamlHelper.validateDockstoreYamlProperties()
, this should cause an error, as a .dockstore.yml
files without a primaryDescriptorPath
is not a valid .dockstore.yml
.
I have also found that a service that does not contain any files
is parsed by DockstoreYamlHelper.validateDockstoreYamlProperties()
without causing any errors. This again should not happen, as I believe a service requires atleast one file.
To Reproduce
Steps to reproduce the behavior:
Run DockstoreYamlHelper.validateDockstoreYamlProperties()
on the following .dockstore.yml
files and observe that it throws no errors (even though they are invalid). This can be done rather easily using the yaml validate
command in the CLI, as the following line is called:
https://github.com/dockstore/dockstore-cli/blob/ca43df582a43ae7998080978bf3c6ad68699252f/dockstore-client/src/main/java/io/dockstore/client/cli/YamlVerifyUtility.java#L167
version: 1.2
tools:
- subclass: WDL
authors:
- name: Denis Yuen
orcid: 0000-0002-6130-1021
- name: UCSC Genomics Institute
role: Institute
affiliation: UCSC
publish: true
filters:
branches:
- develop
tags:
- gwas*
version: 1.2
tools:
- subclass: WDL
authors:
- name: Denis Yuen
orcid: 0000-0002-6130-1021
- name: UCSC Genomics Institute
role: Institute
affiliation: UCSC
publish: true
primaryDescriptorPath:
filters:
branches:
- develop
tags:
- gwas*
version: 1.2
service:
subclass: DOCKER_COMPOSE
authors:
- name: Test
email: test@test.net
description: This is a test
publish: true
scripts:
start: start.sh
environment:
TEST-1:
default: testing
description: testing testing testing
data:
test-2:
targetDirectory: ~/test
files:
test.txt:
description: test
Expected behavior
Since the above are not valid .dockstore.yml
files, an error should be thrown when you attempt to parse them with DockstoreYamlHelper.validateDockstoreYamlProperties()
.
As a temporary work around for dockstore yaml validate
, we have added lines of code here and here to check if the primaryDescriptorPath
is empty or non-existent and that a service contains at least one file. This should be removed when this ticket is resolved as it should be caught here.
Additional context
https://github.com/dockstore/dockstore-cli/blob/2fce8d66433f487dd4864257eaa48293c5cf3de2/pom.xml#L41
┆Issue is synchronized with this Jira Story
┆Fix Versions: Dockstore 1.14.x
┆Issue Number: DOCK-2362
┆Sprint: 111 - Indus
┆Issue Type: Story