Skip to content

fix: Fix the role running grubby commands in check mode#221

Open
spetrosi wants to merge 1 commit into
linux-system-roles:mainfrom
spetrosi:fix-check-mode
Open

fix: Fix the role running grubby commands in check mode#221
spetrosi wants to merge 1 commit into
linux-system-roles:mainfrom
spetrosi:fix-check-mode

Conversation

@spetrosi

@spetrosi spetrosi commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Enhancement: Fix the role running grubby commands in check mode

Reason: bootloader_setting module was running grubby commands unconditionally.

Result: grubby write operations run only when check_mode=False.

Issue Tracker Tickets (Jira or BZ if any): https://redhat.atlassian.net/browse/RHEL-180862
Fixes #190

Assisted-by: Cursor AI

@spetrosi
spetrosi requested a review from richm as a code owner July 15, 2026 12:52
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@spetrosi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 51030edf-7af2-4aa7-94d3-82fd4d266475

📥 Commits

Reviewing files that changed from the base of the PR and between a19e0dd and e9655ea.

📒 Files selected for processing (2)
  • library/bootloader_settings.py
  • tests/unit/test_bootloader_settings.py
📝 Walkthrough

Walkthrough

Changes

Check-mode support

Layer / File(s) Summary
Centralized grubby command application
library/bootloader_settings.py
Adds apply_command() and routes grubby write operations through it, recording actions while skipping command execution in check mode.
Check-mode test coverage
tests/unit/test_bootloader_settings.py
Adds mocked check_mode state and verifies read behavior, skipped writes, and changed/action results.

Suggested reviewers: richm

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description Format ⚠️ Warning The PR description has Enhancement/Reason/Result, but it lacks the required Signed-off-by line and does not use the bug-fix Cause/Consequences/Fix template. Add a Signed-off-by: line, and for this bug fix use Cause/Consequences/Fix/Result sections (or switch the description to the bug-fix template) in the PR body.
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes stop grubby write commands in check mode and add tests, matching issue #190.
Out of Scope Changes check ✅ Passed The patch stays focused on check mode handling and unit tests with no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title follows Conventional Commits and clearly describes the check mode grubby fix.
Description check ✅ Passed The description includes all required template sections and the linked issue/ticket information.

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.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.64%. Comparing base (63d7c0c) to head (e9655ea).
⚠️ Report is 126 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #221      +/-   ##
==========================================
+ Coverage   78.43%   79.64%   +1.21%     
==========================================
  Files           2        3       +1     
  Lines         255      339      +84     
==========================================
+ Hits          200      270      +70     
- Misses         55       69      +14     
Flag Coverage Δ
sanity ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Fix the bootloader_setting module running grubby commands
unconditionally.
Now it runs grubby write operations only when check_mode=False.

Add unit tests for this.

Fixes linux-system-roles#190

Assisted-by: Cursor AI
@spetrosi

Copy link
Copy Markdown
Contributor Author

[citest]

@richm

richm commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

[citest_bad]

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.

Role ignores check mode / files changed in check mode

2 participants