Skip to content

Fix false warning for executor selectors - #7555

Open
bentsherman wants to merge 1 commit into
masterfrom
fix-7551-executor-selector
Open

Fix false warning for executor selectors#7555
bentsherman wants to merge 1 commit into
masterfrom
fix-7551-executor-selector

Conversation

@bentsherman

Copy link
Copy Markdown
Member

Fix #7551

Treat a $-prefixed scope as a selector in ConfigValidator so that executor selectors such as executor.$local.cpus are accepted.

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>
@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for nextflow-docs canceled.

Name Link
🔨 Latest commit 4edab60
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs/deploys/6a905fc90aac130008c4a296

*/
private boolean isSelector(String name) {
return name.startsWith('withLabel:') || name.startsWith('withName:')
return name.startsWith('withLabel:') || name.startsWith('withName:') || name.startsWith('$')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConfigValidator flags executor.$local.cpus / executor.$local.memory as unrecognized, even though they are documented and honored at runtime

2 participants