Fix false warning for executor selectors - #7555
Open
bentsherman wants to merge 1 commit into
Open
Conversation
ConfigValidator strips process selectors (withLabel:, withName:) from the
key path before checking an option against its scope spec, but it did not
know about the per-executor `$<executor>` selector. As a result the
documented `executor { $local { cpus = 8 } }` syntax was validated as the
literal path `executor.$local.cpus`, which no scope declares, and warned
even though ClusterConfig reads and applies the value correctly.
Treat a $-prefixed key as a selector so the option is checked against the
parent scope, matching runtime resolution. This also covers the deprecated
`process.$name` selector.
Closes #7551
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
✅ Deploy Preview for nextflow-docs canceled.
|
jorgee
reviewed
Aug 31, 2026
| */ | ||
| private boolean isSelector(String name) { | ||
| return name.startsWith('withLabel:') || name.startsWith('withName:') | ||
| return name.startsWith('withLabel:') || name.startsWith('withName:') || name.startsWith('$') |
Contributor
There was a problem hiding this comment.
If I am not wrong, the $ selector should be only a valid selector for executor level. Here, it is considerin a selector any segment starting by $.
Shouldn't be better to define isSelector as something like the following?
private boolean isSelector(List<String> names) {
final name = names.last()
if( name.startsWith('withLabel:') || name.startsWith('withName:') )
return true
// a per-executor selector is only valid directly within a selector scope,
// e.g. `executor.$local`, matching how it is resolved at runtime
return name.startsWith('$')
&& names.size() == 2
&& names.first() in SELECTOR_SCOPES
}
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.
Fix #7551
Treat a $-prefixed scope as a selector in ConfigValidator so that executor selectors such as
executor.$local.cpusare accepted.