Skip to content

Conversation

bentsherman
Copy link
Member

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.

@bentsherman bentsherman requested a review from pditommaso August 22, 2025 17:47
Copy link

netlify bot commented Aug 22, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit dff137f
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68d18c68047355000880c654

Copy link
Member

@pditommaso pditommaso left a 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

@bentsherman
Copy link
Member Author

The PluginIndexWriter does depend pretty heavily on runtime classes, mainly around plugin extensions and config schema. This is why I placed it in a separate configuration, so that the main build doesn't depend on the specific Nextflow version

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

@bentsherman bentsherman marked this pull request as ready for review September 12, 2025 15:19
@bentsherman bentsherman added this to the 25.10 milestone Sep 22, 2025
@bentsherman bentsherman changed the title Generate plugin index file Generate plugin schema Sep 22, 2025
@bentsherman
Copy link
Member Author

  • Add ADR with description of plugin schema (JSON)
  • Add unit test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use YYYYMMDD as prefix

Copy link
Member

@pditommaso pditommaso left a 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

"spec": {
"name": "hello",
"description": "The `hello` scope controls the behavior of the `nf-hello` plugin.",
"children": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially a non-basic type, would not make sense to call it object ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean by this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean object instead of children

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The properties here are based on the domain classes in SchemaNode

@bentsherman
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants