-
Notifications
You must be signed in to change notification settings - Fork 5
feat: extend API for plugin type validation and retrieval #82
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
Conversation
… and use that to provide better CLI help texts
📝 WalkthroughWalkthroughAdds plugin type derivation in PluginRegistryBase, validates package names (stubbed), and propagates plugin_type into plugin CLI registration. Updates PluginBase.register_cli_args to accept plugin_type and adjust the argument group label. Registry now computes plugin_type via regex on its class name and passes it to each plugin during CLI arg registration. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User as User
participant CLI as CLI (ArgumentParser)
participant Registry as PluginRegistryBase
participant Plugin as PluginBase
User->>CLI: Invoke CLI
CLI->>Registry: register_cli_args(argparser)
rect rgba(230,240,255,0.5)
note right of Registry: New: derive plugin_type via regex from registry class name
Registry->>Registry: plugin_type = get_plugin_type()
end
loop For each plugin
Registry->>Plugin: register_cli_args(argparser, plugin_type)
note over Plugin: Uses plugin_type in group label<br/>"<plugin> <plugin_type> plugin settings"
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🧪 Early access (Sonnet 4.5): enabledWe are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pyproject.toml
is excluded by!pyproject.toml
📒 Files selected for processing (2)
src/snakemake_interface_common/plugin_registry/__init__.py
(3 hunks)src/snakemake_interface_common/plugin_registry/plugin.py
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
⚙️ CodeRabbit configuration file
**/*.py
: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of theself
argument of methods.
Do not suggest type annotation of thecls
argument of classmethods.
Do not suggest return type annotation if a function or method does not contain areturn
statement.
Files:
src/snakemake_interface_common/plugin_registry/plugin.py
src/snakemake_interface_common/plugin_registry/__init__.py
🧬 Code graph analysis (2)
src/snakemake_interface_common/plugin_registry/plugin.py (1)
src/snakemake_interface_common/plugin_registry/__init__.py (1)
register_cli_args
(65-70)
src/snakemake_interface_common/plugin_registry/__init__.py (1)
src/snakemake_interface_common/plugin_registry/plugin.py (2)
register_cli_args
(133-192)name
(84-84)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: quality-control
🔇 Additional comments (4)
src/snakemake_interface_common/plugin_registry/plugin.py (1)
154-156
: LGTM! Improved argument group label clarity.The argument group label now includes the plugin type (e.g., "executor plugin settings" instead of just "plugin settings"), making it more descriptive for users.
src/snakemake_interface_common/plugin_registry/__init__.py (3)
7-7
: LGTM! Required import for plugin type derivation.The
re
module is correctly imported to support the regex-based plugin type extraction inget_plugin_type
.
68-70
: LGTM! Plugin type correctly derived and propagated.The method now derives the plugin type once and passes it to each plugin's
register_cli_args
, which aligns with the updated signature inplugin.py
.
72-80
: Verify naming of PluginRegistry subclasses
No concrete*PluginRegistry
subclasses were found in this repo; please manually confirm that any actual registry classes (including those loaded externally) follow the<Type>PluginRegistry
naming pattern or adjust the regex to handle edge cases.
🤖 I have created a release *beep* *boop* --- ## [1.22.0](v1.21.0...v1.22.0) (2025-09-30) ### Features * expand variables and user dirs in settings of type Path. ([#83](#83)) ([ea3357f](ea3357f)) * extend API for plugin type validation and retrieval ([#82](#82)) ([f641114](f641114)) ### Bug Fixes * add help text for user dir and env var expansion ([#85](#85)) ([75ff281](75ff281)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Refactor
Chores
Note