-
Notifications
You must be signed in to change notification settings - Fork 21
Match org.freedesktop.zbus.Error in error reporting #1251
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: master
Are you sure you want to change the base?
Match org.freedesktop.zbus.Error in error reporting #1251
Conversation
23aa537 to
0045d67
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
WalkthroughConfiguration and error handling adjustments: removed manual trigger setting from copr_build job, eliminated DPClientSetPropertyContext-specific error message handling, and updated test expectations for volume creation from failure to success. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. 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
🤖 Fix all issues with AI agents
In @src/stratis_cli/_error_reporting.py:
- Around line 288-290: Tests don't exercise the branch where dbus_name ==
"org.freedesktop.zbus.Error" with a DPClientSetPropertyContext, so either re-add
the "# pragma: no cover" (with a short comment explaining why this zbus.Error
path is untested/untestable) to the conditional handling or add unit tests that
simulate DPClientSetPropertyContext raising/containing
"org.freedesktop.zbus.Error" and assert the handling code is executed;
specifically update the branch that checks dbus_name and
DPClientSetPropertyContext (symbols: dbus_name, DPClientSetPropertyContext,
"org.freedesktop.zbus.Error") to include the pragma+explanatory comment or
create a test that constructs a DPClientSetPropertyContext and triggers the zbus
error so coverage includes that branch.
🧹 Nitpick comments (1)
tests/integration/logical/test_create.py (1)
49-49: Consider using unpacking syntax for list construction.The list concatenation can be simplified using the unpacking syntax for better readability.
Based on static analysis hints.
♻️ Proposed refactor
- command_line = self._MENU + [self._POOLNAME] + self._VOLNAMES + command_line = [*self._MENU, self._POOLNAME, *self._VOLNAMES]
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.packit.yamlsrc/stratis_cli/_error_reporting.pytests/integration/logical/test_create.py
💤 Files with no reviewable changes (1)
- .packit.yaml
🧰 Additional context used
🪛 Ruff (0.14.10)
tests/integration/logical/test_create.py
49-49: Consider [*self._MENU, self._POOLNAME, *self._VOLNAMES] instead of concatenation
Replace with [*self._MENU, self._POOLNAME, *self._VOLNAMES]
(RUF005)
⏰ 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). (15)
- GitHub Check: osh-diff-scan:fedora-rawhide-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-42-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-rawhide-x86_64:copr_pull
- GitHub Check: rpm-build:fedora-43-x86_64:copr_pull
- GitHub Check: test-runs (3.12)
- GitHub Check: test-runs (3.13)
| Creation of two volumes at once should succeed. | ||
| """ | ||
| command_line = self._MENU + [self._POOLNAME] + self._VOLNAMES | ||
| self.check_error(StratisCliEngineError, command_line, _ERROR) | ||
| TEST_RUNNER(command_line) |
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.
🧩 Analysis chain
🏁 Script executed:
# First, let's read the test file to see lines 47-50 and 109-110
cd tests/integration/logical && wc -l test_create.pyRepository: stratis-storage/stratis-cli
Length of output: 89
🏁 Script executed:
# Read the relevant sections of the test file
sed -n '40,115p' tests/integration/logical/test_create.pyRepository: stratis-storage/stratis-cli
Length of output: 2641
🏁 Script executed:
# Search for comments about filesystem/volume creation restrictions in the entire repository
rg -n -C3 -i 'only one filesystem|one volume per request|single filesystem per'Repository: stratis-storage/stratis-cli
Length of output: 1257
Verify the actual restriction status and update the contradictory code accordingly.
The contradiction identified is real: Create3TestCase.test_creation() creates two volumes in a single call, but Create5TestCase.setUp() explicitly splits volume creation into separate calls with the comment "only one filesystem per request is currently allowed." This inconsistency indicates either:
- The restriction has been lifted and the comment at lines 109-110 (and similar comment in
test_destroy.pyline 85) should be removed. - The test at lines 47-50 is incorrect and should split the volume creation to match the documented restriction.
Clarify which scenario applies and update the code and comments accordingly.
🧰 Tools
🪛 Ruff (0.14.10)
49-49: Consider [*self._MENU, self._POOLNAME, *self._VOLNAMES] instead of concatenation
Replace with [*self._MENU, self._POOLNAME, *self._VOLNAMES]
(RUF005)
@coderabbitai I don't like the unpacking syntax, it doesn't look type-correct. |
|
Tip For best results, initiate chat on the files or code changes. @mulkieran, understood! I'll respect your preference for the list concatenation syntax. Both approaches are functionally equivalent and type-correct in Python, but if you find the concatenation style clearer for your codebase, that's perfectly reasonable. ✏️ Learnings added
|
f55b443 to
3527c55
Compare
At present, the zbus D-Bus error is the only error that can be returned when setting a property. Signed-off-by: mulhern <[email protected]>
Signed-off-by: mulhern <[email protected]>
Signed-off-by: mulhern <[email protected]>
3527c55 to
031d1cf
Compare
Summary by CodeRabbit
Release Notes
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.