Skip to content

Workflow linting and best practices#1028

Merged
jmchilton merged 3 commits intogalaxyproject:masterfrom
jmchilton:dockstore_lint
Jul 28, 2020
Merged

Workflow linting and best practices#1028
jmchilton merged 3 commits intogalaxyproject:masterfrom
jmchilton:dockstore_lint

Conversation

@jmchilton
Copy link
Member

@jmchilton jmchilton commented Jul 22, 2020

Add best practices guide for workflow development to the docs and implement a few new commands to support it.

  • workflow_lint [path]+: Lints workflows - all the structural/correctness stuff from gxformat2 validation and linting, (from gxformat2) verify it has outputs and they have labels, verify it has test data, verify the inputs on the test data match inputs in the workflow, verify all non-optional inputs of the workflow are specified in the test data. Verify files referenced by any .dockstore.yml encountered has the appropriate YAML structure and references existent files.
  • dockstore_init: Walk directory for workflows and test files and create an appropriate .dockstore.yml.
  • workflow_test_init: Create a stub test and job file to aid in (and generally demystify) assembling test cases for workflows.

All these commands (like test, run, and serve already) transparently work with either traditional Galaxy workflows (.ga files) or newer Format 2 YAML workflows.

@jmchilton jmchilton changed the title [WIP] Outline Dockstore integration & workflow linting. [WIP] Workflow linting and best practices Jul 23, 2020
@jmchilton jmchilton force-pushed the dockstore_lint branch 2 times, most recently from c0d6e95 to a897c5d Compare July 24, 2020 02:09
cat-bro added a commit to cat-bro/training-material that referenced this pull request Jul 25, 2020
cat-bro added a commit to cat-bro/training-material that referenced this pull request Jul 25, 2020
cat-bro added a commit to cat-bro/training-material that referenced this pull request Jul 25, 2020
cat-bro added a commit to cat-bro/training-material that referenced this pull request Jul 25, 2020
@jmchilton jmchilton force-pushed the dockstore_lint branch 5 times, most recently from 8a84059 to c0f7dd6 Compare July 27, 2020 20:26
- Bring in all structural linting from gxformat2.
- Add a bunch more linting for tests and Dockstore configs.
- Add a command to generate a Dockstore configuration from a repository of Galaxy workflows.
- Add a command to stub out a workflow test case from a supplied workflow.
@jmchilton jmchilton changed the title [WIP] Workflow linting and best practices Workflow linting and best practices Jul 28, 2020
@jmchilton jmchilton merged commit 79c967e into galaxyproject:master Jul 28, 2020
Copy link
Member

@mvdbeek mvdbeek left a comment

Choose a reason for hiding this comment

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

Sorry for the late review, 2 small suggestions here.

job_output = new_workflow_associated_path(workflow_path, suffix="job1")
test_description = [{
'doc': 'Test outline for %s' % path_basename,
'job': os.path.basename(job_output),
Copy link
Member

Choose a reason for hiding this comment

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

Can we combine these into a single file ? I think that's easier to edit.

test_description = [{
'doc': 'Test outline for %s' % path_basename,
'job': os.path.basename(job_output),
'outputs': {}
Copy link
Member

Choose a reason for hiding this comment

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

It would be great of we can prefill these with all labeled outputs

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.

2 participants