Add version utility functions to plugin API for topic channel support #23
+256
−0
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.
Overview
This PR exposes three essential version utility functions to the plugin API that are required by the nf-core pipeline template and enable proper topic channel support for version management.
Problem
The nf-core/tools pipeline template uses three key functions for version management:
processVersionsFromYAML()workflowVersionToYAML()softwareVersionsToYAML()While these functions existed in the plugin's
NfcoreVersionUtilsutility class with comprehensive implementation and test coverage, they were not exposed as@Functionmethods inNfUtilsExtension, making them inaccessible to Nextflow pipelines.Solution
Added three
@Functionannotated wrapper methods toNfUtilsExtensionthat delegate to the existing, well-tested utility implementations:1.
processVersionsFromYAML(String yamlFile)Parses and flattens YAML version strings by removing nested tool prefixes.
Example:
2.
workflowVersionToYAML()Returns workflow version information as formatted YAML, including workflow name, version, and Nextflow version.
Example:
3.
softwareVersionsToYAML(List<String> chVersions)Primary function - Combines version YAMLs from multiple processes, deduplicates entries, and appends workflow version info. This matches the standard nf-core pipeline pattern.
Example:
include { softwareVersionsToYAML } from 'plugin/nf-core-utils' workflow PIPELINE { ch_versions = Channel.empty() FASTQC(samples) ch_versions = ch_versions.mix(FASTQC.out.versions.first()) MULTIQC(reports) ch_versions = ch_versions.mix(MULTIQC.out.versions.first()) // Generate unified versions file softwareVersionsToYAML(ch_versions.collect()) .collectFile( name: 'software_versions.yml', storeDir: "${params.outdir}/pipeline_info" ) }Changes
@Functionmethods with comprehensive JavaDocTesting
The underlying utility functions have comprehensive test coverage (15+ tests) in
NfcoreVersionUtilsTest.groovy. The extension methods are thin wrappers that delegate to these tested implementations.Benefits
Closes #[issue_number]
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/nf-core/tools/pulls/3779curl -s REDACTED(http block)packages.seqera.io/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14-bin/38aieal9i53h9rfe7vjup95b9/gradle-8.14/lib/gradle-daemon-main-8.14.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.14-bin/38aieal9i53h9rfe7vjup95b9/gradle-8.14/lib/agents/gradle-instrumentation-agent-8.14.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.14(dns block)s3-eu-west-1.amazonaws.com/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14-bin/38aieal9i53h9rfe7vjup95b9/gradle-8.14/lib/gradle-daemon-main-8.14.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.14-bin/38aieal9i53h9rfe7vjup95b9/gradle-8.14/lib/agents/gradle-instrumentation-agent-8.14.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.14(dns block)nslookup s3-eu-west-1.amazonaws.com(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #22
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.