Allow conditional process execution from configuration#1393
Merged
mahesh-panchal merged 2 commits intonf-core:devfrom Feb 4, 2022
mahesh-panchal:add_when
Merged
Allow conditional process execution from configuration#1393mahesh-panchal merged 2 commits intonf-core:devfrom mahesh-panchal:add_when
mahesh-panchal merged 2 commits intonf-core:devfrom
mahesh-panchal:add_when
Conversation
Member
Author
|
Bonus insight from @drpatelh: Allows one to skip mirroring conditional logic in the configuration file. |
JoseEspinosa
approved these changes
Feb 3, 2022
Member
JoseEspinosa
left a comment
There was a problem hiding this comment.
Really nice @mahesh-panchal , if with this we don't need to use all these ifs in the modules.config to avoid the warning regarding the process config selectors, we really owe you something 🙏
Member
Author
|
I already began a trial. It's not so simple. |
This was referenced Feb 4, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addition:
Allow modules to use
when:block by moving it to configuration.Allows modules to flexibly use the
when:from the configuration file.Allows conditional process execution on settings not available in the
workflowblock.Configuration is set using
process.ext.whenallowing one to use process selectors and other configuration benefits toapply a when condition to a group of processes or test process specific values.
Execution conditions
process { withName: 'FOO' { ext.args = 'module1,module2' // Example settings ext.when = null // Process executes - no conditional defined. ext.when = true // Process executes - e.g. override for existing configuration ext.when = !params.skip_module // Process executes if set, or if null ext.when = ext.args.tokenize(',').contains('module1') // Process does not execute - evaluated in configuration context. ext.when = { task.ext.args.tokenize(',').contains('module1') } // Process does not execute - evaluated in task context. } }PR checklist
CHANGELOG.mdis updateddocsis updated