-
Notifications
You must be signed in to change notification settings - Fork 79
allow multiple standalone steps in workflows #3490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lucaspatel
merged 6 commits into
qiita-spots:dev
from
antgonza:allow-multiple-stanalone-steps-workflows
Nov 20, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
005d948
allow multiple standalone steps in workflows
antgonza 5e88735
flake8
antgonza d13be53
adding a test
antgonza 0f27dda
2 commands from start & extra commands
antgonza d3d89c7
more tests
antgonza 3d620b3
artifact.parents
antgonza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,52 @@ def test_get(self): | |
| self.assertIn('FASTA upstream workflow', body) | ||
| DefaultWorkflow(2).active = True | ||
|
|
||
| def test_retrive_workflows_standalone(self): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very nice |
||
| # let's create a new workflow, add 1 commands, and make parameters not | ||
| # required to make sure the stanalone is "active" | ||
| with TRN: | ||
| # 5 per_sample_FASTQ | ||
| sql = """INSERT INTO qiita.default_workflow | ||
| (name, artifact_type_id, description, parameters) | ||
| VALUES ('', 5, '', '{"prep": {}, "sample": {}}') | ||
| RETURNING default_workflow_id""" | ||
| TRN.add(sql) | ||
| wid = TRN.execute_fetchlast() | ||
| # 11 is per-sample-FASTQ split libraries commands | ||
| sql = """INSERT INTO qiita.default_workflow_node | ||
| (default_workflow_id, default_parameter_set_id) | ||
| VALUES (%s, 11) | ||
| RETURNING default_workflow_node_id""" | ||
| TRN.add(sql, [wid]) | ||
| nid = TRN.execute_fetchflatten() | ||
| sql = """UPDATE qiita.command_parameter SET required = false""" | ||
| TRN.add(sql) | ||
| TRN.execute() | ||
|
|
||
| # here we expect 1 input node and 1 edge | ||
| obs = _retrive_workflows(True)[-1] | ||
| exp_value = f'input_params_{nid[0]}_per_sample_FASTQ' | ||
| self.assertEqual(1, len( | ||
| [x for x in obs['nodes'] if x[0] == exp_value])) | ||
| self.assertEqual(1, len( | ||
| [x for x in obs['edges'] if x[0] == exp_value])) | ||
|
|
||
| # now let's insert another command using the same input | ||
| with TRN: | ||
| # 12 is per-sample-FASTQ split libraries commands | ||
| sql = """INSERT INTO qiita.default_workflow_node | ||
| (default_workflow_id, default_parameter_set_id) | ||
| VALUES (%s, 12)""" | ||
| TRN.add(sql, [wid]) | ||
| TRN.execute() | ||
|
|
||
| # we should still have 1 node but now with 2 edges | ||
| obs = _retrive_workflows(True)[-1] | ||
| self.assertEqual(1, len( | ||
| [x for x in obs['nodes'] if x[0] == exp_value])) | ||
| self.assertEqual(2, len( | ||
| [x for x in obs['edges'] if x[0] == exp_value])) | ||
|
|
||
| def test_retrive_workflows(self): | ||
| # we should see all 3 workflows | ||
| DefaultWorkflow(2).active = False | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole section is not very clear to me but I imagine it is part of the workflow management.