Add ChRIS plugin creation guide#11
Conversation
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The PR introduces a comprehensive guide for creating ChRIS plugins, including initialization, CI/CD configuration, and registration steps. The content aligns well with the intended scope and correctly links the new guide into the existing documentation structure.
However, a significant documentation gap was identified regarding the main function signature. The current draft only provides the signature for 'ds' (data synthesis) plugins. As 'fs' (feed synthesis) plugins are a core component of the ecosystem, this omission could lead to runtime failures for developers. Resolving this discrepancy is recommended before merging to ensure the guide is technically accurate for all standard use cases.
Codacy analysis indicates the changes are up to standards with no new quality issues or complexity regressions.
Test suggestions
- Verify that 'pnpm run build' completes successfully with the new content.
- Ensure the relative link from docs/plugins/index.md correctly points to the new create.md file.
- Confirm that relative tutorial links (e.g., ../tutorials/upload_plugin/) within the new guide resolve correctly.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
| The Python entry point is the function that _ChRIS_ will run inside the container. In `app.py`, | ||
| that function is `main`. It uses the | ||
| [`chris_plugin`](https://github.com/FNNDSC/chris_plugin) decorator. In practice, this means: | ||
| define the command-line options with `argparse`, write `main(options, inputdir, outputdir)`, read |
There was a problem hiding this comment.
🟡 MEDIUM RISK
The signature main(options, inputdir, outputdir) is specific to ds type plugins. For fs plugins, the inputdir argument must be omitted. Since 'fs' plugins are a core plugin type described in the documentation, it is important to clarify this requirement to prevent runtime failures.
Try running the following prompt in your coding agent:
In docs/plugins/create.md, add a note explaining that while 'ds' plugins use
main(options, inputdir, outputdir), 'fs' plugins must use the signaturemain(options, outputdir).
|
|
||
| _ChRIS_ does not yet have a production plugin factory. `pf_build` is a proof of concept that collects plugin metadata through a web form, creates a GitHub repository from `python-chrisapp-template`, runs the template bootstrap path, and commits the result. This demonstrates the desired automation model, but it is not yet a schema-driven factory. | ||
|
|
||
| ## What Remains Manual | ||
|
|
||
| Until a production factory exists, new plugin authors still need to understand and edit several project surfaces: | ||
|
|
||
| - Python packaging metadata | ||
| - Dockerfile and container image name | ||
| - command entry point | ||
| - GitHub Actions secrets and publication policy | ||
| - ChRIS metadata generation | ||
| - ChRIS backend/plugin store registration | ||
|
|
||
| This is the main onboarding gap for new contributors. The desired factory should make these values derive from one project specification instead of requiring repeated edits in multiple files. | ||
|
|
||
|
|
||
| ## Future: Plugin Factory | ||
|
|
||
| The long-term goal is a plugin factory: a web or local tool that creates a working plugin repository from one project specification. A contributor would provide the plugin name, command name, plugin type, package layout, dependencies, container image target, supported architectures, GitHub repository target, and publication intent. The factory would then generate the source tree, Python packaging metadata, Dockerfile, tests, README, GitHub Actions, and registration guidance from the same source of truth. | ||
|
|
||
| A factory should reduce repeated manual edits, keep Docker and Python packaging in agreement, and support both simple single-file plugins and larger package-style plugins. It should also leave room for non-Python plugins by preserving the outer _ChRIS_ contract: a container image, a command-line interface, declared parameters, and metadata that can be registered with a _ChRIS_ backend. | ||
|
|
||
| ## Related Pages | ||
|
|
||
| - [Plugin concepts](./) | ||
| - [GitHub Actions for plugins](./github_actions.md) | ||
| - [Multi-architecture images](./multiarch.md) | ||
| - [Convert an existing Python app](../tutorials/convert_python_app.md) | ||
| - [Upload a plugin](../tutorials/upload_plugin/) |
There was a problem hiding this comment.
⚪ LOW RISK
Nitpick: Link styles are inconsistent across the file (e.g., ../tutorials/convert_python_app.md vs ../tutorials/upload_plugin/). Use a consistent format for all tutorial references.
|
Accurate and well-organized; no build-breaking issues. All internal links resolve ( The PR documents the main undocumented gotcha: the CI ships disabled by default (if: false). The However three weaknesses keep it from fully landing:
Improvements
Structure / scope
Nits
|
Adds a contributor-facing guide for creating ChRIS plugins. The page documents the current python-chrisapp-template workflow, manual and bootstrap initialization paths, GitHub Actions and publication assumptions, ChRIS registration prerequisites, and the future plugin factory direction.
Validation: