-
Notifications
You must be signed in to change notification settings - Fork 60
Fix calling md_activate with UUID in MDTestActivateDeactivate #1151
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 calling md_activate with UUID in MDTestActivateDeactivate #1151
Conversation
We need to provide the UUID in the MD format, not in the rfc4122 format.
WalkthroughThe pull request modifies the MD RAID test file to derive the MD UUID through a BlockDev API call after obtaining md_info, then uses this derived UUID in subsequent md_activate calls instead of the raw md_info.uuid value. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
Summary of ChangesHello @vojtechtrefny, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a bug in the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request correctly addresses the issue of passing the UUID in the wrong format to md_activate. The introduction of BlockDev.md_get_md_uuid ensures that the UUID is converted to the expected MD RAID format before activation, which is a crucial fix for the test's correctness. The added assertion self.assertIsNotNone(md_uuid) also provides a good check for the conversion process within the test case.
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)
tests/mdraid_test.py (1)
268-270: Deriving MD‑formatted UUID frommd_info.uuidis correct and keeps concerns separatedUsing
BlockDev.md_get_md_uuid(md_info.uuid)here correctly converts the canonical (RFC4122) array UUID into the MD‑specific format expected by lower layers. The explicitassertIsNotNone(md_uuid)gives a clear failure if conversion ever regresses and is consistent with the dedicatedtest_get_md_uuidabove.If you ever want stronger validation here, you could optionally assert the MD‑style pattern (e.g. with a
re.match) rather than just non‑None, but the dedicatedtest_get_md_uuidalready covers the format well.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/mdraid_test.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/mdraid_test.py (1)
src/python/gi/overrides/BlockDev.py (1)
md_activate(1056-1058)
⏰ 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). (42)
- GitHub Check: testing-farm:fedora-43-x86_64
- GitHub Check: testing-farm:fedora-43-aarch64
- GitHub Check: testing-farm:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: testing-farm:fedora-43-aarch64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-43-ppc64le
- GitHub Check: rpm-build:fedora-43-ppc64le
- GitHub Check: rpm-build:fedora-rawhide-aarch64
- GitHub Check: rpm-build:fedora-rawhide-ppc64le
- GitHub Check: rpm-build:fedora-rawhide-ppc64le
- GitHub Check: rpm-build:fedora-rawhide-aarch64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:fedora-43-aarch64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-43-aarch64
- GitHub Check: testing-farm:fedora-43-x86_64:revdeps_udisks
- GitHub Check: testing-farm:fedora-43-x86_64:revdeps_blivet
- GitHub Check: testing-farm:fedora-43-x86_64
- GitHub Check: testing-farm:fedora-43-aarch64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:fedora-43-aarch64
- GitHub Check: rpm-build:fedora-rawhide-ppc64le
- GitHub Check: rpm-build:fedora-43-ppc64le
- GitHub Check: rpm-build:fedora-rawhide-aarch64
- GitHub Check: compilation (gcc-13)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (cpp)
- GitHub Check: blivet-tests
- GitHub Check: udisks-build
- GitHub Check: csmock
- GitHub Check: compilation (clang-17)
- GitHub Check: compilation (clang-14)
- GitHub Check: compilation (clang-15)
- GitHub Check: compilation (clang-18)
- GitHub Check: compilation (gcc-12)
- GitHub Check: compilation (gcc-11)
- GitHub Check: compilation (gcc-14)
- GitHub Check: compilation (clang-16)
- GitHub Check: compilation (gcc-10)
- GitHub Check: symbols
🔇 Additional comments (3)
tests/mdraid_test.py (3)
272-272: Activation with name + members + UUID now passes MD‑formatted UUIDSwitching this
md_activate("bd_test_md", [...], md_uuid)call to use the MD‑formattedmd_uuidaligns the test with the expected API contract ofmd_activatewithout changing argument ordering or semantics.
279-279: Activation by UUID with explicit members correctly uses MD UUIDFor the “UUID only with members” path, using
md_uuidinstead of the canonicalmd_info.uuidensures this scenario exercises the same MD‑UUID behavior as real‑world callers, while still matching themd_activate(raid_spec=None, members=..., uuid=...)signature.
286-286: Activation by UUID‑only (no members) now consistently uses MD UUIDThis final
md_activate(None, None, md_uuid)call completes the transition so all UUID‑based activation variants use the MD‑formatted UUID, keeping test expectations consistent across all activation modes.
We need to provide the UUID in the MD format, not in the rfc4122 format.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.