Skip to content

Migrate to Nextflow 26.04 syntax - #46

Merged
FloWuenne merged 3 commits into
mainfrom
migrate-nextflow-26.04
Oct 15, 2026
Merged

FloWuenne merged 3 commits into
mainfrom
migrate-nextflow-26.04

Conversation

@adamrtalbot

Copy link
Copy Markdown
Collaborator

Summary

Migrates the pipeline to Nextflow 26.04 strict / static-typing syntax.

Static types

  • Typed params {} block in main.nf
  • Typed process inputs/outputs (name: Type) in PUBLISH_REPORT, PRINT_PRIVACY_MESSAGE, PRINT_ASCII_LOGO, CONGRATULATIONS under nextflow.enable.types

Record types

  • New shared types.nf defining the EventConfig record (optional fields nullable so every event config duck-types to it)
  • Event config built with record(...) and consumed as a record input by PRINT_PRIVACY_MESSAGE

Workflow output syntax

  • publishDir in PUBLISH_REPORT replaced by a workflow publish: + output {} block
  • --outdir mapped to outputDir in nextflow.config

Misc

  • Lowercase channel. namespace, explicit closure parameters, and the onComplete: workflow section

Deliberate legacy carve-out

ENTER_RAFFLE and main.nf's onComplete: are kept legacy (untyped) because they read workflow.session.config.navigate('tower.enabled' / 'tower.accessToken') to detect Platform monitoring — an accessor the typed workflow namespace does not expose. This preserves the exact platform_enabled value submitted to the raffle form. It's also why EventConfig lives in its own types.nf rather than inlined in main.nf (declaring the record would force the types flag onto the whole file and break workflow.session).

Validation

  • nextflow lint — clean across all 8 files
  • nextflow run . -preview — builds the typed DAG, constructs the EventConfig record, runs validation + onComplete, resolves the output target; no type/compile errors

adamrtalbot and others added 2 commits October 1, 2026 15:26
Adopt the Nextflow 26.04 strict/static-typing syntax across the pipeline:

- Static types: typed `params {}` block in main.nf; typed process inputs
  and outputs (`name: Type`) in PUBLISH_REPORT, PRINT_PRIVACY_MESSAGE,
  PRINT_ASCII_LOGO and CONGRATULATIONS under `nextflow.enable.types`.
- Record types: new shared types.nf defining the EventConfig record
  (optional fields nullable); event config built with `record(...)` and
  consumed as a record input by PRINT_PRIVACY_MESSAGE.
- Workflow output syntax: replace publishDir in PUBLISH_REPORT with a
  workflow `publish:`/`output {}` block; map --outdir to outputDir in
  nextflow.config.
- Misc: lowercase `channel.` namespace, explicit closure params, and the
  `onComplete:` workflow section.

ENTER_RAFFLE and main.nf's onComplete remain legacy (untyped) because they
read `workflow.session.config` to detect Platform monitoring, which the
typed `workflow` namespace does not expose. Keeping them legacy preserves
the exact platform_enabled value submitted to the raffle form.

Validated: `nextflow lint` clean across all 8 files; `nextflow run -preview`
builds the typed DAG and constructs the record with no type errors.
- Remove obvious/narrating comments that explain what code does
- Keep brief comments explaining non-obvious 'why' (untyped workflow.session.config usage, immutability constraint)
- Reduce comment verbosity in main.nf, enter_raffle/main.nf, types.nf, and nextflow.config

Co-authored-by: Adam Talbot <adamrtalbot@users.noreply.github.com>
The params{} default for outdir in main.nf is not visible when the config is read, so outputDir resolved to null without --outdir. Fall back to 'results'.

Add manifest.nextflowVersion '!>=26.04.0' so older versions fail with a clear error, and update the README install section (Java 17, Nextflow 26.04).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FloWuenne

Copy link
Copy Markdown
Collaborator

Some minor changes but LGTM, merge!

@FloWuenne
FloWuenne merged commit c32e3c6 into main Oct 15, 2026
1 check passed
@FloWuenne
FloWuenne deleted the migrate-nextflow-26.04 branch October 16, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants