Skip to content

Conversation

@vojtechtrefny
Copy link
Member

@vojtechtrefny vojtechtrefny commented Dec 2, 2025

We need to provide the UUID in the MD format, not in the rfc4122 format.

Summary by CodeRabbit

  • Tests
    • Optimized MD RAID UUID retrieval and validation in test workflows
    • Enhanced test coverage for multiple activation scenarios including UUID-based and device-based approaches
    • Strengthened consistency across MD array initialization and deactivation testing paths

✏️ Tip: You can customize this high-level summary in your review settings.

We need to provide the UUID in the MD format, not in the rfc4122
format.
@coderabbitai
Copy link

coderabbitai bot commented Dec 2, 2025

Walkthrough

The 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

Cohort / File(s) Change Summary
MD UUID derivation in test flow
tests/mdraid_test.py
Adds retrieval of MD UUID by calling BlockDev.md_get_md_uuid(md_info.uuid) after obtaining md_info, with assertion that result is not None. Replaces uses of md_info.uuid with the newly derived md_uuid in md_activate calls across multiple activation scenarios (with UUID, by UUID only, and with both member devices and UUID). Other activation and deactivation calls remain unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus on verifying the MD UUID derivation API call behaves correctly and the replacement pattern is consistent across all affected activation calls
  • Confirm that non-activation code paths are unmodified and test coverage remains intact

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing md_activate calls to use UUID in the MDTestActivateDeactivate test.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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 md_activate function's usage within a test suite, where UUIDs were not being provided in the expected MD format. By introducing a dedicated conversion step, the change ensures that UUIDs are correctly formatted before activation attempts, thereby enhancing the robustness and correctness of RAID array management operations and their associated tests.

Highlights

  • UUID Format Correction: The pull request fixes an issue where the md_activate function was being called with a UUID in RFC4122 format instead of the required MD format.
  • UUID Conversion Utility: A new utility function, BlockDev.md_get_md_uuid, has been introduced to correctly convert UUIDs to the MD format.
  • Test Case Update: The MDTestActivateDeactivate test case has been updated to utilize this new conversion utility, ensuring md_activate is called with the proper UUID format.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

Copy link

@coderabbitai coderabbitai bot left a 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 from md_info.uuid is correct and keeps concerns separated

Using 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 explicit assertIsNotNone(md_uuid) gives a clear failure if conversion ever regresses and is consistent with the dedicated test_get_md_uuid above.

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 dedicated test_get_md_uuid already covers the format well.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f327bf7 and ceaf47b.

📒 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 UUID

Switching this md_activate("bd_test_md", [...], md_uuid) call to use the MD‑formatted md_uuid aligns the test with the expected API contract of md_activate without changing argument ordering or semantics.


279-279: Activation by UUID with explicit members correctly uses MD UUID

For the “UUID only with members” path, using md_uuid instead of the canonical md_info.uuid ensures this scenario exercises the same MD‑UUID behavior as real‑world callers, while still matching the md_activate(raid_spec=None, members=..., uuid=...) signature.


286-286: Activation by UUID‑only (no members) now consistently uses MD UUID

This 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.

@vojtechtrefny vojtechtrefny merged commit 0cab9de into storaged-project:master Dec 3, 2025
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants