Add plugin development side quest, restructure side quests for multi-part courses#761
Add plugin development side quest, restructure side quests for multi-part courses#761
Conversation
Add comprehensive training material for Nextflow plugin development covering: - Using existing plugins (discovery, installation, configuration) - Creating plugins with custom functions, operators, and trace observers - Building, testing, and distributing plugins Includes: - Full tutorial documentation with Before/After code comparisons - Starting files for hands-on exercises - Solution files including complete nf-greeting plugin - Supporting images (registry screenshot, test report) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ Deploy Preview for nextflow-training ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Nextflow linting complete! ✅ 171 files had no errors View formatting changes
|
Makefiles require tabs for indentation per POSIX standard. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@pinin4fjords I would completely remove any mention of creating custom factories / operators. Nearly every example of a custom factory / operator that I see in the wild would have been better as a custom function, and they are currently in a precarious position in terms of future type checking support. Otherwise, it looks like the right idea. Custom functions and trace observers are by far the most important to cover. Custom executors and filesystems are also powerful but way more complicated -- if you try to cover them at all, I would put them in a separate tutorial. |
Thanks @bentsherman ! |
Based on feedback from @bentsherman: custom operators/factories are in a precarious position for future type checking support, and nearly every example would have been better as a custom function. Changes: - Remove Section 8 (Custom operators and factories) entirely - Remove Section 10.1 (Channel factories) - Renumber sections 9-11 to 8-10 - Update all references to operators/factories throughout - Update code examples to use functions instead of shoutAll operator - Keep focus on functions and trace observers as the key extension types Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove shoutAll operator from main.nf solution, use reverseGreeting function instead to match the updated tutorial content. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change "functions, factories, etc." to "functions, observers, etc." to avoid confusion with channel factories (which were removed). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove extra features from solution files that aren't covered in the tutorial: - Remove unused prefix/suffix config options from nextflow.config - Simplify output message in main.nf to match tutorial - Remove extra comment block from random_id_example.nf Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
adamrtalbot
left a comment
There was a problem hiding this comment.
Just reviewed the "using plugins" section.
- Let's make it shorter and tighter, it's verbose and wordy.
- Focus on how plugins extend Nextflow functionality rather than sharing code
- Keep it simple and explain it one way and only one way.
- Remove make comparison for Gradle (advanced concept) - Replace reverseString() with samplesheetToList() as example (more recognizable) - Reduce hyperbole throughout, get to the point faster - Add Slack as example for extending pipelines - Clarify that community can add features without modifying Nextflow core - Simplify tip about using plugins section - Add notes about latest version default and runtime download - Restructure "Try it" section: remove local function comparison, use config-only approach, remove CLI flag diversion - Add note about development burden being on plugin developer and Nextflow handling plugin management Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The plugin registry already lists available plugins, so this section was redundant. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace em-dash elaborations with periods or semicolons - Use colons instead of hyphens for list item explanations - Remove unnecessary trailing explanations - Simplify sentences to be more direct Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix section 2.7 -> 2.6 after removing Popular plugins section - Run prettier to fix table formatting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removing plugin files so they can be cleanly merged from the plugin-development-side-quest branch, which has the reviewed and updated version.
|
For section 8 on custom plugin configuration, it might be worth mentioning that you can define your custom config as a proper class with some annotations, so that the Nextflow linter and language server can recognize it. But this tutorial is already pretty long and I've already documented it here, so you could just add a blurb with a link to these docs. |
Links to official docs for defining custom config as a proper class with annotations for IDE and linter support. Addresses review feedback from @adamrtalbot. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Changes based on reviewing transcript of live delivery: - Update Java version requirement from 17 to 21 (matches training env) - Fix error output line numbers in Section 8.3 (was "line 7", now "line 30") - Make Section 4 progressive: add functions one at a time instead of all three at once, reinforcing the @function pattern incrementally Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete list of changes from transcript analysisAfter reviewing the transcript of the live delivery session, the following improvements were made across multiple commits: Structural improvements
"Run it first" pedagogy
Clearer transitions
Additional context and reassurance
Configuration section enhancements
Accuracy fixes (this commit)
All changes verified by running complete tutorial walkthrough in Docker container. |
Convert from pipe syntax to dot syntax for consistency: - `| map` → `.map` - `| view` → `.view()` Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace 14 "Let's" patterns with direct statements per style guide - Change "Don't worry about the warnings!" to "The warnings are expected." - Fix hl_lines at line 1801 to highlight actual code changes (7-8 18) instead of method signatures (5-6 17) - Update solution files to match final tutorial state (section 8.3): - main.nf: add script comment, update output message - nextflow.config: add prefix/suffix settings - random_id_example.nf: use dot notation for consistency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Adjust table column alignment - Use underscore for italics instead of asterisks Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Rob Syme <rob.syme@gmail.com>
Signed-off-by: Rob Syme <rob.syme@gmail.com>
adamrtalbot
left a comment
There was a problem hiding this comment.
Mostly good but needs some tightening up at points. I think it hits all the right points so the rough structure is good.
The only thing I can see which is missing is using a TraceObserver and reading one of the items that originates from it, e.g. onPublish -> use file path for something.
Responds to adamrtalbot's review on PR #761: - Emphasize *why* plugins are useful (proven, tested, reusable code) - Trim observer explanations, point to Part 5 instead - Break up samplesheetToList code for clarity - Add brief Gradle/plugin definitions where relevant (Part 2) - Simplify source file explanations, reduce frontloading - Simplify make install, remove gradlew admonition - Replace baffling Groovy syntax admonition with inline type explanation - Remove redundant exercises and fluff admonitions (Part 3) - Stress independent testing of plugins (Part 4) - Rewrite TraceObserver/Override in plain language (Part 5) - Add onFilePublish section with publishDir example (Part 5) - Remove verbose flag, simplify to enabled/disabled only (Part 6) - Remove mixed-models comparison table (Part 6) - Reorder: teach decorator config first as clearer example (Part 6) - Break distribution into summary.md (Part 6) - Flesh out summary with per-part recaps and distribution content - Update all solution files to match lesson changes Suggested-By: Adam Talbot <adamrtalbot@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The friendlyGreeting exercise was removed from Part 3 lesson but its function and tests remained in solutions 3-6. Remove them to match. Also update run-tutorial skill with guidance for multi-part modules: isolated directories for parallel testing, and JVM resource limits that require sequential execution for Gradle-heavy tutorials. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The multi-part module guidance didn't work well in practice due to JVM resource limits in shared containers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… into subdirectories - Rename hello_plugins to plugin_development and move under side_quests/ - Move each single-page side quest into its own subdirectory (questname/index.md) - Move exercise files from hello-plugins/ to side-quests/plugin_development/ - Remove legacy side-quests/plugin_development/ files from earlier attempt - Update mkdocs.yml nav: flat entries for single-page quests, subsection for multi-part - Update enumerate-headings config for new paths - Fix all cross-references between side quest pages - Update side_quests/index.md with new links and plugin development course box Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… in summary Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
These are unnecessary as a side quest: the shared orientation covers environment setup, and there's no separate survey. Folded the Java prerequisite and working directory into the index page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Unpinned version downloads 1.2.0, which doesn't match the documented output showing version 1.1.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Update nf-co2footprint from 1.1.0 to 1.2.0 and fix documented warning messages to match actual output (CPU model, executor) - Add note about cosmetic config scope warning in section 3.4 - Switch greet.nf from stdout to file output (path 'greeting.txt') in Parts 3-6 so publishDir and onFilePublish work correctly - Update solution files, code blocks, and hl_lines accordingly - Remove tracked nf-greeting/README.md scaffold (learners generate this themselves via nextflow plugin create) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The highlight range was off by two, highlighting lines 25-28 instead of 23-26. The correct range covers the full onFilePublish method block (@OverRide, method signature, println, closing brace). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unreferenced duplicate images from side_quests/img/ (the real copies are in plugin_development/img/) - Remove legacy solution files from side-quests/solutions/plugin_development/ (leftover from an earlier iteration; current solutions are in side-quests/plugin_development/solutions/) - Fix .prettierignore COPYING path from hello-plugins/ to side-quests/plugin_development/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
adamrtalbot
left a comment
There was a problem hiding this comment.
The config section is s still a bit weak and could be tightened but the rest is pretty solid now.
docs/en/docs/side_quests/plugin_development/03_custom_functions.md
Outdated
Show resolved
Hide resolved
- Add intro sentence explaining why plugins need a build step (Part 2) - Fix wording: "types do not need to be declared" (Part 3) - Standardize on `make install` instead of `make assemble && make install` since the Gradle install task already depends on assemble - Remove flip-flopping between separate and chained build commands Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Adds a Plugin Development side quest (6 progressive lessons on Nextflow plugin development) and restructures all side quests to support multi-part courses consistently.
Plugin Development course
nextflow plugin createWritten for Nextflow 25.10.2 using the plugin Gradle plugin (io.nextflow.nextflow-plugin 1.0.0-beta.10) and config.spec.* API.
Side quests restructure
side_quests/questname/index.md), matching the nf4_science pattern and allowing any quest to expand into multiple pages in the futureOther changes
.editorconfig: Makefile tab rule for plugin solutions.gitignore:.gradle/ignore for plugin builds.pre-commit-config.yaml: Excludes for template-generated files (COPYING, gradlew).prettierignore: Exclude COPYING files in plugin solutionsdocs/en/docs/envsetup/02_local.md: Java 21 requirement note for plugin developmentTest plan
-resumecachingFollow-up issues
🤖 Generated with Claude Code