Repository navigation
Static typing in main.nf, nf-schema validation, mock-form CI, and a new-event script - #48
Merged
Merged
Conversation
…assets Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
…s current events Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
…th nf-schema - nextflow.enable.types in main.nf; event configs are validated against assets/schema_event_config.json and cast to the EventConfig record - tower config read via a single towerConfig() helper (the typed workflow namespace has no session accessor), preserving platform_enabled - nf-schema 3.0.0 validateParameters() and --help - default event unified to ashg_2026; require Nextflow 26.10 - hidden --event_config param and test profile for local mock-form runs Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
…lues Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
… link - 'add' builds event_configs/<event>.json from a pre-filled link or a public viewform page (read-only), deriving required_fields from Required questions - 'sync' regenerates the --event enum/default in nextflow_schema.json and main.nf plus the README event table from event_configs/; --check for CI Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
The form already has hostname, user_name, workspace_id and platform_workflow_id questions; entry IDs read from the public viewform page. Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
…d nextflow lint - test profile posts to tests/mock_form_server.py (also stubs the Platform API so -with-tower can be exercised with platform_enabled=true) - checks submitted fields, the generated ticket, invalid --event and missing required fields, event config schema validation and event list drift Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
…vent checklist - default event ashg_2026, Nextflow 26.10, Java 17 - example commands include name/affiliation required by the default event - docs/ADDING_AN_EVENT.md: form questions, form settings checklist, new_event.py usage and config reference Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
…launch form Empty defaults still pass on the CLI; per-event requiredness is enforced by required_fields in main.nf. Co-authored-by: Florian Wuennemann <flowuenne@gmail.com>
- Restore workflow name 'Run nf-raffle Pipeline' and job id 'run-pipeline' - Drop 'message' from the mock Platform reply so runs no longer print 'WARN: ok' - Remove shebang from tests/validate_event_configs.nf - Restore blank line in the onComplete warning and the docker example in CLAUDE.md - Ignore requests.jsonl written by the local mock server Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robsyme
approved these changes
Oct 16, 2026
robsyme
left a comment
Member
There was a problem hiding this comment.
This one is mostly just a re-org. lgtm
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.
Targets Nextflow 26.10 (
manifest.nextflowVersion = '!>=26.10.0'). This PR doesn't change where the form endpoint lives: event configs stay inevent_configs/*.json, so #13 is untouched. Nothing in this PR or its CI submits to a real event form.1. Static typing in
main.nfnextflow.enable.types = true.nextflow lint .is clean on 26.10.2 across all 8 scripts. The 11 errors it reported before are fixed.loadEventConfig()inutils.nfparses the JSON and validates it against the newassets/schema_event_config.jsonwith nf-schemavalidate(). It then casts it withas EventConfig, which fails if a field is missing. Bad configs now fail with specific messages, e.g./form_fields/uuid ("1234") does not match ^entry\.[0-9]+$, an unknownform_fieldskey, or an invalidrequired_fieldsvalue.platform_enabled: the typedworkflownamespace in 26.10 has no accessor for the session or thetowerconfig. I checked the docs and theWorkflowNamespacesource, and there's no public replacement. A config-file workaround wouldn't see-with-tower, because the CLI applies it after config parsing. So access is isolated in one helper,towerConfig()inutils.nf. It readsnextflow.Global.session.config['tower']. It passes type checking and gives the same value as before (tower.enabled ?: false), both for-with-towerand fornextflow auth login.nextflow.Globalis the only internal API used. Verified by running against a mock Platform endpoint: the form receivesplatform_enabled=trueand the "extra tickets" message prints.PUBLISH_REPORT.outis replaced by an assigned output, which the typed workflow requires.2. nf-schema params validation
nf-schema@3.0.0:validateParameters()runs first, and--helpnow usesparamsHelp().--eventstops the run before anything is submitted:* --event (nope): Expected any of [ashg_2026, biotechx_basel_2026, eccb_2026, fog_2026, ismb_bosc_2026]errorMessage. The old pattern rejected TLDs longer than 5 characters, so it's loosened.event_configs/*.jsonbyscripts/new_event.py sync, and CI runssync --check. To make that work, configs for past events (2024/2025, plusgeneral) moved toevent_configs/archive/. They were already not selectable from the schema.$idand title fixed.first_name,last_nameandaffiliationstay inrequiredso the Seqera Platform launch form still marks them. Their empty defaults still pass on the CLI, andrequired_fieldsin each event config decides what's actually needed (checked).3. Default event:
ashg_2026Before this PR,
main.nfsaideccb_2026, the schema saidbiotechx_basel_2026, and the README saidismb_bosc_2026(README text) andeccb_2026.docs/INSTRUCTIONS.mdsaidfog_2026. ASHG 2026 is the next upcoming event (October 2026) and was the most recently added config (#47). ECCB (2 Sept) and ISMB/BOSC (July) are over, and FOG was in January.ashg_2026is now the default inmain.nf, the schema, README, docs and CLAUDE.md. The examples include--first_name/--last_name/--affiliation, since ASHG requires them.4. CI never hits a real form
testprofile sets a hidden--event_config tests/test_event.json, which points athttp://localhost:8765/formResponse.tests/mock_form_server.py(standard library only) records submissions and also stubs the Platform API.nextflow lint .sync --checkraffle_ticket.htmlhas the event name and the run name used as ticket number-with-tower http://localhost:8765, expectingplatform_enabled=true,platform_workflow_idsent, and the unmappedworkspace_idskipped--eventand a missing required field must both fail with zero new submissionsworkflow_dispatchemail/event inputs that posted to the live form. Nextflow is pinned to26.10.2.5. Staff-demo fields
ENTER_RAFFLEnow builds a single field→value map and sends only fields that are mapped inform_fieldsand non-empty. Unmapped fields are skipped. Values are shell-quoted, soO'Brien $HOMEarrives intact.uuidfalls back to/proc/sys/kernel/random/uuidwhenuuidgenisn't installed.docs/ADDING_AN_EVENT.md, which lists the questions a form should include and which must never be Required.hostname,user_name,workspace_idandplatform_workflow_idquestions. Onlyashg_2026.jsonwas missing them. The entry IDs were read from the public viewform page with a GET; nothing was submitted. They're added in a separate commit (168ee08), so it's easy to drop if you'd rather not change ASHG's payload days before the event.6. Cleanup
PRINT_ASCII_LOGOandCONGRATULATIONSmodules and their assets (congratulations.txt,ismb_bosc2024/). Nothing referenced them.docs/INSTRUCTIONS.md,docs/index.htmland CLAUDE.md now match actual behaviour:--help7. Adding a new event
scripts/new_event.py add --event ashg_2027 --name "ASHG 2027" --url <link> [--winner-announcement ...] [--set-default](standard library only).required_fields. The script refuses forms where a question the pipeline can't always fill is Required, since Google Forms silently drops those entries.syncupdates the schema enum and default, themain.nfdefault, and the README event table.ashg_2026.jsonexactly, plus the four demo mappings.docs/ADDING_AN_EVENT.mdcovers:Validation
nextflow lint .: ✅ 8 files, no errors, with types on (26.10.2).-profile testagainst the mock server producedresults/raffle_ticket.html. Submitted fields were as expected.--event, an invalid--email, an unknown param, and a missing required field each fail early with no submission.Trade-offs / not done
towerConfig()relies onnextflow.Global(internal), because 26.10 has no typed accessor. It's isolated to one function.-previewhangs on typedmapoperators in 26.10.2, so CI validates configs withtests/validate_event_configs.nfinstead of previewing the pipeline.--helpfooter suggests--showHidden/--helpFull. The typed params block rejects those flags. This is cosmetic and comes from nf-schema.--event_configset, the required-field error still names--event's value. This only affects the test-only param.