Filter autoLabels to selected workflow-metadata fields#7049
Merged
pditommaso merged 17 commits intomasterfrom Apr 20, 2026
Merged
Filter autoLabels to selected workflow-metadata fields#7049pditommaso merged 17 commits intomasterfrom
pditommaso merged 17 commits intomasterfrom
Conversation
Spec for honouring process.resourceLabels in nf-seqera with cumulative semantics: config-level baseline on the Sched run, per-task delta on Sched task. Removes the now-redundant seqera.executor.labels option. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Task-by-task TDD plan implementing the spec from docs/superpowers/specs/2026-04-17-seqera-resource-labels-design.md. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
…ess.resourceLabels Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Picks up the published artifact so the build resolves without the includeBuild composite. The transitive sched-api 0.52.0-SNAPSHOT is now also published. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
- Labels.toStringMap now accepts Object and throws IllegalArgumentException when the value is not a Map, giving a clear error when process.resourceLabels is misconfigured (e.g. as a list). - SeqeraExecutor.getRunResourceLabels wraps the cached map in Collections.unmodifiableMap, matching Labels.getEntries. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
…ds [ci fast] Widen seqera.executor.autoLabels to accept a list or comma-separated string of short names (e.g. ['runName','projectName']) in addition to true/false. Valid names: projectName, userName, runName, sessionId, resume, revision, commitId, repository, manifestName, runtimeVersion, workflowId. Unknown names throw IllegalArgumentException at config parse time. true still emits all labels; false/null/empty remain disabled. Labels.withWorkflowMetadata gains a 2-arg overload that filters by the given include set; the single-arg form delegates with the full set so existing call sites and tests are unchanged. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
bentsherman
approved these changes
Apr 20, 2026
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
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.
Summary
Extends
seqera.executor.autoLabelsso users can pick which workflow-metadata labels are attached to a run, instead of the prior all-or-nothing boolean.Stacked on top of #7048 (base branch:
feat/seqera-resource-labels). Merge that one first.Config shape
seqera.executor.autoLabelsnow accepts any of:true— emit all 11 default labels (current behaviour, back-compatible).false/null/ empty list / empty string — disable (default).List<String>— e.g.['runName', 'projectName'].String— comma-separated form, e.g.'runName,projectName'. Whitespace around tokens is trimmed; leading/trailing spaces in list entries are trimmed as well.Valid short names (11 total):
Each maps internally to
nextflow.io/<name>exceptworkflowIdwhich maps toseqera.io/platform/workflowId.Unknown names fail fast at config parse time with a clear error listing the valid values:
Changes
plugins/nf-seqera/src/main/io/seqera/config/ExecutorOpts.groovystatic final Set<String> VALID_AUTO_LABELSconstant (11 names).autoLabelsfield widens frombooleantoSet<String>; getter signature likewise.protected static Set<String> parseAutoLabels(Object value)normalises every accepted input form and trims whitespace on both theCharSequence(post-tokenize) andListpaths.@Descriptionupdated to document the new forms and the valid names.plugins/nf-seqera/src/main/io/seqera/executor/Labels.groovystatic final Set<String> ALL_AUTO_LABELSconstant.withWorkflowMetadata(WorkflowMetadata)becomes a thin delegate to a new 2-arg overloadwithWorkflowMetadata(WorkflowMetadata, Set<String> include).entries.put(...)oninclude.contains('<shortName>').plugins/nf-seqera/src/main/io/seqera/executor/SeqeraExecutor.groovycreateRun()now passesseqeraConfig.autoLabelsto the filtered overload. The gateif( seqeraConfig.autoLabels )still works: an emptySetis Groovy-falsy, a non-emptySetis truthy.Tests
ExecutorOptsTest— one existing test rewritten ('should enable auto labels'→'should enable all auto labels when set to true') + 8 new tests covering every input path: explicitfalse, list, comma-string, comma-string with whitespace, list entries with whitespace, empty list, empty string, unknown name rejection.LabelsTest— 3 new filter tests (include subset,workflowId-only, empty-set emits nothing).Test plan
./gradlew :plugins:nf-seqera:test— green (180 tests)Notes
ExecutorOpts.VALID_AUTO_LABELSandLabels.ALL_AUTO_LABELSare intentionally separate constants (config-layer validation vs label-emission concern). They are identical today; a future label addition must update both. Worth a guard test if this ever drifts.