-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix: skip account setting upon user request #224
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis pull request modifies error handling in a Mastodon posting shell script, updates documentation regarding SLURM account configuration in Snakemake, and enhances the SLURM executor functionality. Specifically, error messages in the workflow script are now sent to standard error, the docs explain nuances around multiple SLURM accounts and the Changes
Possibly related PRs
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Cherry picking the commit and putting it on top of main worked for me. |
good. I will add some docs, tomorrow. |
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: 0
🧹 Nitpick comments (1)
docs/further.md (1)
21-22
: Typos in the new documentationThe explanation of the SLURM account configuration is helpful, but there are a couple of typos in the text:
- "attept" should be "attempt"
- "behauvior" should be "behavior"
-Some clusters, however, have a pre-defined default per user and _do not_ allow users to set their account. The plugin will attept to always set an account. To override this behauvior, the `--slurm-no-account` flag can be used. +Some clusters, however, have a pre-defined default per user and _do not_ allow users to set their account. The plugin will attempt to always set an account. To override this behavior, the `--slurm-no-account` flag can be used.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/post_to_mastodon.sh
(1 hunks)docs/further.md
(1 hunks)snakemake_executor_plugin_slurm/__init__.py
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: testing
🔇 Additional comments (3)
.github/workflows/post_to_mastodon.sh (1)
4-5
: Improved error handling by redirecting to stderrThe change properly redirects error messages to standard error (stderr) using
>&2
instead of printing them to standard output. This follows shell scripting best practices for error reporting.snakemake_executor_plugin_slurm/__init__.py (2)
88-96
: Well-defined new no_account settingThe new
no_account
field inExecutorSettings
is properly structured with appropriate defaults and clear help documentation. This addition aligns with the PR objective of allowing users to skip account settings when required.
225-227
: Clean implementation of conditional account settingThe conditional addition of the account argument based on the
no_account
setting is well implemented. This change directly addresses the PR objective by providing a way to skip account settings upon user request.
@DrYak there is now rudimentary documentation. Please review. More detailed documentation changes are upcoming. |
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: 0
🧹 Nitpick comments (1)
snakemake_executor_plugin_slurm/__init__.py (1)
644-686
: Improve exception chaining in the error handling.The account validation logic has been improved to first try
sshare
and then fall back tosacctmgr
, with appropriate warning when both return empty results. However, there's a minor issue with the exception handling.According to best practices for Python exception handling, you should use explicit exception chaining with
raise ... from e
:raise WorkflowError( f"The 'sshare' reported: '{sshare_report}' " f"and likewise 'sacctmgr' reported: '{sacctmgr_report}'." - ) + ) from eThis helps distinguish between errors in the original operation and errors in exception handling.
🧰 Tools
🪛 Ruff (0.8.2)
671-674: Within an
except
clause, raise exceptions withraise ... from err
orraise ... from None
to distinguish them from errors in exception handling(B904)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
snakemake_executor_plugin_slurm/__init__.py
(3 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
snakemake_executor_plugin_slurm/__init__.py
671-674: Within an except
clause, raise exceptions with raise ... from err
or raise ... from None
to distinguish them from errors in exception handling
(B904)
🔇 Additional comments (2)
snakemake_executor_plugin_slurm/__init__.py (2)
88-96
: LGTM: Clean implementation of the no_account setting.The new boolean field follows the established pattern for boolean settings in the ExecutorSettings class, with appropriate default value and helpful documentation.
225-227
: LGTM: Core functionality implemented correctly.The conditional check for the no_account setting works as intended, allowing users to skip account settings upon request, which aligns with the PR objectives.
@DrYak now, the order of account tests with @coderabbitai please, update the PR summary accordingly. |
🧩 Analysis chainI'll need to gather more information about issue #233 and check the code changes to properly update the PR summary. 🏁 Script executed:
Length of output: 3973 @cmeesters I'll update the PR summary to include the information about the new order of account tests and how this PR also addresses issue #233. The PR now accomplishes two main things:
✅ Actions performedSummary regeneration triggered. |
Summary by CodeRabbit
Bug Fixes
Documentation
New Features