Conversation
|
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. |
d535137 to
b3e85bf
Compare
|
Right now, we do have the option of making the timeout shorter for our long-running operations than for our other operations. The best way to do this properly is to import only the methods we need in building the dbus-python-client-gen methods and do it exactly where the methods are used. We could still use the public |
816930b to
04dfaf9
Compare
|
Long running operation decorator needs to specify the function that is allowed to run for a long time. Otherwise, if it's |
|
Just one observation: I don't think GetManagedObjects every can be the long-running operation in the current state of stratisd but I'm aware that could change in the future with changes to our locking. |
In a bunch of method we call |
fbae33b to
44a7c56
Compare
44a7c56 to
2c7de08
Compare
f5b8dc0 to
7548550
Compare
|
I do not know why building stratisd man pages was failing...but we do not need those pages built to test stratisd, so I'm just fixing that in the most basic way. |
7548550 to
4f0ec4c
Compare
7826449 to
db3c0ab
Compare
|
Ok. Redirects are working.... |
62146b1 to
b635291
Compare
|
Works again... |
9f0dde8 to
a68cb52
Compare
a68cb52 to
6126d2f
Compare
6126d2f to
6268b23
Compare
Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
We had it as high as two minutes to give a chance of returning on fairly long-running task, like creating encrypted pools, since each device had to be separately encrypted. We do not do that anymore, as the whole pool is encrypted these days, so the create method returns faster. We are about to introduce really long running commands, where 120 minutes will not be enough in almost all cases. So shortening the D-Bus timeout seems like a reasonable thing to do. 60 seconds is a plenty long time to wait for any error messsages that stratisd might return. Signed-off-by: mulhern <amulhern@redhat.com>
6268b23 to
29959dd
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThis PR introduces pool encryption lifecycle management for Stratis CLI, adding encryption subcommands (on/off/reencrypt) with in-place operation support, new D-Bus methods (EncryptPool, DecryptPool, ReencryptPool), supporting utilities for long-running operations, integration and unit tests, and updated documentation. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant CLI as CLI Parser
participant CryptActions
participant LongRunning as long_running_operation
participant DBus as D-Bus (Stratisd)
participant Handler as Error Handler
User->>CLI: Run encryption command<br/>(pool encryption on --in-place)
CLI->>CryptActions: encrypt(namespace)
activate CryptActions
CryptActions->>CryptActions: Validate in_place flag
CryptActions->>CryptActions: Resolve pool via PoolId
CryptActions->>LongRunning: Wrap EncryptPool call
deactivate CryptActions
activate LongRunning
LongRunning->>DBus: Call EncryptPool method
activate DBus
DBus->>DBus: Process encryption
DBus-->>LongRunning: Return results + return_code
deactivate DBus
alt Success (return_code == 0)
LongRunning-->>CLI: Return success
else NoReply/Timeout
LongRunning->>LongRunning: Catch DPClientInvocationError
LongRunning->>Handler: Print long-running message
LongRunning-->>CLI: Return None
else Other Error
LongRunning->>Handler: Propagate exception
Handler-->>CLI: Raise StratisCliEngineError
end
deactivate LongRunning
CLI-->>User: Display result/error
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip You can generate walkthrough in a markdown collapsible section to save space.Enable the |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/stratis_cli/_actions/_utils.py (1)
337-343: Return the wrapped action's result explicitly.
wrapper()dropsfunc(namespace)'s return value on the success path and falls through with an implicitNoneon the accepted-timeout path. That makes the decorator non-transparent and can silently change behavior for any action that ever returns a value or exit code.Possible fix
`@wraps`(func) def wrapper(namespace: Namespace): """ Wrapper """ try: - func(namespace) + return func(namespace) except DPClientInvocationError as err: if not any( isinstance(e, DBusException) and e.get_dbus_name() == "org.freedesktop.DBus.Error.NoReply" for e in get_errors(err) ): raise err context = err.context if ( isinstance(context, DPClientMethodCallContext) and context.method_name in method_names ): print("Operation initiated", file=sys.stderr) + return None else: raise errAlso applies to: 352-357
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/stratis_cli/_actions/_utils.py` around lines 337 - 343, The decorator's inner function wrapper currently calls func(namespace) but does not return its result (and similarly does not return the result on the accepted-timeout path), making the decorator non-transparent; update wrapper to return the value from func(namespace) on the normal path and return the result/value from the accepted-timeout branch as well (i.e., ensure both code paths in wrapper return the wrapped action's result), locating the logic inside the wrapper function around the current func(namespace) call and the accepted-timeout handling (also apply the same fix to the similar block at the other occurrence).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/stratis.txt`:
- Line 285: Replace the phrase "can not" with the standard single-word "cannot"
in the sentence that currently reads "for example, extending filesystems, can
not be taken on the pool." — locate that exact sentence (contains "extending
filesystems, can not be taken on the pool") and update it to use "cannot" for
correct and consistent wording.
In `@src/stratis_cli/_actions/_list_pool.py`:
- Around line 387-394: The "Last Time Reencrypted" output is printed for all
encrypted pools but must only appear for metadata V2 pools; move the call to
mopool.LastReencryptedTimestamp() and the print(f" Last Time Reencrypted:
{reencrypted}") into the metadata V2 branch (the branch that handles V2 pool
output) so it is emitted only when the pool is V2, and remove or avoid invoking
LastReencryptedTimestamp() for non-V2 branches.
In `@src/stratis_cli/_parser/_shared.py`:
- Around line 278-299: The CLEVIS_AND_KERNEL argument bundle is missing
TRUST_URL_OR_THUMBPRINT which causes ClevisEncryptionOptions.__init__ to fail
when it unconditionally accesses namespace.thumbprint and namespace.trust_url;
update CLEVIS_AND_KERNEL to include the same entries used by
TRUST_URL_OR_THUMBPRINT (the arguments that supply namespace.trust_url and
namespace.thumbprint) so the bundle is self-contained and safe to reuse—ensure
the new entries use the same option names, help text and parsing behavior as
TRUST_URL_OR_THUMBPRINT so ClevisEncryptionOptions.__init__ can always read
namespace.trust_url and namespace.thumbprint without AttributeError.
In `@tests/unit/test_running.py`:
- Around line 56-58: The test docstring currently says "Should succeed because
it catches the distinguishing NoReply D-Bus error from the identified method"
but the test actually verifies the opposite (a method name mismatch leading to
exception propagation); update the docstring in tests/unit/test_running.py for
the affected test to clearly state that the call should raise/propagate the
NoReply D-Bus error when the method name does not match, referencing the test
function or assertion that checks exception propagation.
---
Nitpick comments:
In `@src/stratis_cli/_actions/_utils.py`:
- Around line 337-343: The decorator's inner function wrapper currently calls
func(namespace) but does not return its result (and similarly does not return
the result on the accepted-timeout path), making the decorator non-transparent;
update wrapper to return the value from func(namespace) on the normal path and
return the result/value from the accepted-timeout branch as well (i.e., ensure
both code paths in wrapper return the wrapped action's result), locating the
logic inside the wrapper function around the current func(namespace) call and
the accepted-timeout handling (also apply the same fix to the similar block at
the other occurrence).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e3dd3a8c-8dc7-4a52-af8f-f1e794e4d95e
📒 Files selected for processing (17)
.packit.yamldocs/stratis.txtsetup.cfgsrc/stratis_cli/_actions/__init__.pysrc/stratis_cli/_actions/_crypt.pysrc/stratis_cli/_actions/_data.pysrc/stratis_cli/_actions/_introspect.pysrc/stratis_cli/_actions/_list_pool.pysrc/stratis_cli/_actions/_utils.pysrc/stratis_cli/_error_reporting.pysrc/stratis_cli/_errors.pysrc/stratis_cli/_parser/_encryption.pysrc/stratis_cli/_parser/_pool.pysrc/stratis_cli/_parser/_shared.pytests/integration/pool/test_encryption.pytests/integration/test_parser.pytests/unit/test_running.py
💤 Files with no reviewable changes (1)
- .packit.yaml
This way we can relatively cheaply avoid printing the timeout error message and return a zero exit code on the timeout. Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
These are bind, unbind, and rebind. The new commands use the mandatory --name, --uuid option mechanism for specifying the pool to operate on, while the old commands just used name. Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
Signed-off-by: mulhern <amulhern@redhat.com>
29959dd to
4e58fa6
Compare
Summary by CodeRabbit
New Features
Improvements