Conversation
'sigma plugin install A B' checked and installed the plugins one by one. If B was incompatible, the command failed after A had already been installed, and the pySigma version check was skipped. All plugins are now resolved and checked for compatibility first; if any is incompatible, all incompatible plugins are reported and nothing is installed. --force-install is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The change achieves the intended all-or-nothing install behavior with targeted tests, with only a minor whitespace nit noted.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR updates sigma plugin install to avoid partial installs by resolving and (optionally) compatibility-checking all requested plugins before installing any of them, ensuring the install is all-or-nothing unless --force-install is used.
Changes:
- Refactor plugin installation into a two-phase flow: resolve/check first, then install.
- Improve the incompatibility error to include all incompatible plugin identifiers and explicitly state that nothing was installed.
- Add offline tests covering incompatible multi-install behavior, all-compatible installs, and
--force-installbypass.
| File | Description |
|---|---|
sigma/cli/plugin.py |
Pre-resolves all plugins, aggregates incompatibilities, and only installs if the compatibility gate passes (or is forced). |
tests/test_plugin.py |
Adds stubbed offline tests to verify multi-plugin install behavior and force-install semantics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+159
to
162
| plugin.install() | ||
| click.echo(f"Successfully installed plugin '{plugin_identifier}'") | ||
|
|
||
| if check_pysigma: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

BLUF
sigma plugin install A Bchecks and installs one plugin at a time. IfBis incompatible, the command fails afterAis already installed, and the pySigma re-check (--check-pysigma, default on) is skipped.sigma plugin install splunk some-incompatible-pluginexits with an error, but leavessplunkinstalled. The pySigma version check thatinstallwould normally run never happens, so the user ends up with a half-applied install they didn't expect.--force-installstill installs everything.--force-install. The first fails onmainand passes with the fix.Priority: low
Details
Root cause:
sigma/cli/plugin.py:138-149After the fix the command works in two phases:
Plugin not compatible with installed pySigma version: 'b'! No plugin was installed.Unknown identifiers already failed before any install, because
get_plugin()raises. They now fail before any install in all cases.Testing
tests/test_plugin.py. They are offline:get_pluginandcheck_pysigma_commandare stubbed.test_plugin_install_incompatible_installs_nothing(fails onmain:awas installed)test_plugin_install_multiple_compatibletest_plugin_install_force_incompatiblepoetry.lock: pySigma 1.4.0, click 8.4.2, pyparsing 3.3.2):pytest --cov=sigma→ 121 passed, 1 skipped.🤖 Generated with Claude Code