-
Notifications
You must be signed in to change notification settings - Fork 11
feat: adapt to changes in accessing executor settings in executor plugins #98
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
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe executor plugin initialization now reads executor settings from self.executor_settings instead of self.workflow.executor_settings. No other logic or public interfaces were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
snakedeploy/templates/plugins/executor-plugins/init.py
(1 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:
snakedeploy/templates/plugins/executor-plugins/init.py
🪛 Ruff (0.12.2)
snakedeploy/templates/plugins/executor-plugins/init.py
88-88: Found useless expression. Either assign it to a variable or remove it.
(B018)
⏰ 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: testing
🔇 Additional comments (2)
snakedeploy/templates/plugins/executor-plugins/init.py (2)
88-88
: API switch to self.executor_settings looks correct.Matches the stated PR objective to read executor settings from the executor instance, not the workflow.
84-90
: Migration complete: noself.workflow.executor_settings
references found.
# access workflow | ||
self.workflow | ||
# access executor specific settings | ||
self.workflow.executor_settings | ||
self.executor_settings | ||
|
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.
🛠️ Refactor suggestion
Fix Ruff B018: remove useless expressions in post_init.
Bare expressions self.workflow
and self.executor_settings
do nothing and trigger B018. Either remove them or bind to _
to demonstrate access without linter noise.
Apply one of the following diffs (Option A preferred).
Option A — minimal, linter-friendly:
@@
def __post_init__(self):
- # access workflow
- self.workflow
- # access executor specific settings
- self.executor_settings
+ # Access to interfaces (kept for illustration without tripping linters)
+ _ = self.workflow
+ _ = self.executor_settings
Option B — just delete, the preceding comments already explain access:
@@
def __post_init__(self):
- # access workflow
- self.workflow
- # access executor specific settings
- self.executor_settings
+ # access workflow / executor settings as needed
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
# access workflow | |
self.workflow | |
# access executor specific settings | |
self.workflow.executor_settings | |
self.executor_settings | |
def __post_init__(self): | |
- # access workflow | |
- self.workflow | |
- # access executor specific settings | |
# Access to interfaces (kept for illustration without tripping linters) | |
_ = self.workflow | |
_ = self.executor_settings |
🧰 Tools
🪛 Ruff (0.12.2)
86-86: Found useless expression. Either assign it to a variable or remove it.
(B018)
88-88: Found useless expression. Either assign it to a variable or remove it.
(B018)
🤖 Prompt for AI Agents
In snakedeploy/templates/plugins/executor-plugins/init.py around lines 85 to 89,
there are bare expressions `self.workflow` and `self.executor_settings` in
__post_init__ that trigger Ruff B018; replace them with a linter-friendly no-op
access by assigning to underscore (e.g., `_ = self.workflow` and `_ =
self.executor_settings`) or simply remove the lines if the preceding comments
already convey the intent — Option A (assign to `_`) is preferred to show
intentional access while avoiding linter noise.
Wait for release of PR snakemake/snakemake-interface-executor-plugins#96
Summary by CodeRabbit
Bug Fixes
Chores