- 
                Notifications
    You must be signed in to change notification settings 
- Fork 739
Generate plugin spec #6361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate plugin spec #6361
Conversation
| ✅ Deploy Preview for nextflow-docs-staging ready!
 To edit notification comments on pull requests, go to your Netlify project configuration. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not look to have dependency with the nextflow runtime, does it? could make sense to keep it in its own module or even keep it in the gradle plugin source? it would be preferable to have the gradle plugin to no depend on the main nextflow runtime
| The  Long-term, I think we'll want to have a module in Nextflow that defines a versioned "runtime API" that is stable across Nextflow versions. For now I'm just trying to make it work | 
e2cf820    to
    ec096ff      
    Compare
  
    b5f5437    to
    dff137f      
    Compare
  
    | 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would not make sense to create a JSON schema for the definition spec? it could be used to have more a "formal" definition and above all to validate it in the upload
| Okay I have written a JSON schema for plugin "specs" We need to store this schema somewhere on GitHub so that a plugin spec can refer to it, for example: {
    "$schema": "https://raw.githubusercontent.com/nextflow-io/nextflow/master/plugin_schema.json",
    "definitions": [
        // ...
    ]
}We should probably keep it in a separate repo since it is not tied to the Nextflow version. We could extend https://github.com/nextflow-io/schema-spec to include both input/output schemas and plugin schemas | 
| Nice. I'm fine both with a separate repo or keep in nextflow one, in cause the shema should have its own version. | 
dff137f    to
    7899bd9      
    Compare
  
    Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
20bebf6    to
    9b8669d      
    Compare
  
    Signed-off-by: Ben Sherman <[email protected]>
| @claude review | 
| Claude finished @pditommaso's task —— View job Code Review CompleteI've completed a comprehensive review of the plugin spec generation PR. Here are my findings: Overall AssessmentThis is a well-designed and implemented feature that addresses a real need for external systems (language server, registry UI) to understand plugin capabilities without loading them in the JVM. The implementation is clean and follows good practices. Strengths✅ Clean Architecture: The separation of concerns between  Issues to Address🐛 Critical: Generic Type Detection BugLocation:  if( cn.getGenericsTypes() != null ) {Problem: This condition can be true even for non-generic types that have an empty generics array. The original codebase uses  Fix: Change to: if( cn.isUsingGenerics() ) {🐛 Minor: Missing Child Names in Nested ScopesLocation:  final children = node.children().collect { name, child ->
    fromNode(child, name)  // name is passed correctly
}Actually, looking at this more carefully, this appears to be working correctly - the  📝 ADR Filename ConventionThe ADR filename uses the requested  Minor Observations
 Test QualityThe test coverage is excellent with a realistic example that covers: 
 Refactoring AssessmentThe PluginSpec → PluginRef refactoring is well-executed: 
 RecommendationApprove with minor fix required: This PR significantly enhances the plugin ecosystem's extensibility. The only blocking issue is the generic type detection bug, which should be fixed before merging. | 
Signed-off-by: Ben Sherman <[email protected]>
| @pditommaso ready to merge | 
        
          
                modules/nextflow/src/main/groovy/nextflow/plugin/spec/FunctionSpec.groovy
          
            Show resolved
            Hide resolved
        
      | Cursor does not agree! 😆 | 
Signed-off-by: Ben Sherman <[email protected]>
        
          
                modules/nextflow/src/main/groovy/nextflow/plugin/spec/PluginSpec.groovy
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                modules/nextflow/src/main/groovy/nextflow/plugin/spec/PluginSpec.groovy
              
                Outdated
          
            Show resolved
            Hide resolved
        
      64fb43d    to
    7474482      
    Compare
  
    Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Paolo Di Tommaso <[email protected]>
| Green on my side! ✅ | 
This PR adds an entrypoint for generating a "plugin index file", which contains a list of plugin definitions (config scopes, functions, etc).
It should be used by the Nextflow Gradle plugin to generate the index file when building/releasing a plugin, and it should be consumed by the plugin registry for use by the language server, registry UI, etc.
Note
Introduces JSON plugin spec generation (config scopes, functions, factories, operators) with a CLI entrypoint, adds schema hooks to config AST, and renames the plugin id/version model from PluginSpec to PluginRef across code and tests.
adrs/2025-09-22-plugin-spec.mddescribing the plugin spec; include ADR template.nextflow.plugin.spec.PluginSpec,FunctionSpec,ConfigSpecto emit JSONdefinitionsforConfigScope,ConfigOption,ConfigPlaceholderScope,Function,Factory,Operator.PluginSpecWriterentrypoint to write spec JSON at build-time.PluginSpecTest.groovyvalidating emitted spec structure.ConfigNodenow carriesSchemaNode.Scope(getter/setter) for schema-aware config processing.PluginSpec(id/version pair) toPluginRefacrossnf-commons(e.g.,DefaultPlugins,HttpPluginRepository,PluginUpdater,PluginsFacade,PrefetchUpdateRepository), diagrams, and tests.Written by Cursor Bugbot for commit 8b772f4. This will update automatically on new commits. Configure here.