Skip to content

Conversation

@ljm42
Copy link
Member

@ljm42 ljm42 commented Dec 8, 2025

…ownloaded as part of the upgrade

Summary by CodeRabbit

  • Bug Fixes
    • Improved cleanup of temporary plugin configuration files during update cancellation operations.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

Walkthrough

A cleanup operation is added to the revertFiles function in UnraidUpdateCancel.php, which now removes the /boot/config/plugins-nextboot directory after restoring README content. No control flow or error handling paths are modified.

Changes

Cohort / File(s) Summary
Directory Cleanup in Revert
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidUpdateCancel.php
Adds shell command to remove /boot/config/plugins-nextboot directory during the revertFiles cleanup sequence

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file modification with straightforward addition
  • No complex logic or control flow changes
  • Simple directory removal operation with no error handling implications

Poem

🐰 A rabbit hops through directories clean,
Sweeping nextboot paths that shouldn't be seen,
With a flick of a command and a bash-fu delight,
The cleanup is done, everything's right! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main feature being added: deleting plugin files downloaded during an OS upgrade when the upgrade is cancelled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-cancel-upgrade-delete-downloads

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.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.06%. Comparing base (832e9d0) to head (2d653f2).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1823      +/-   ##
==========================================
+ Coverage   52.04%   52.06%   +0.02%     
==========================================
  Files         874      874              
  Lines       50372    50396      +24     
  Branches     5017     5014       -3     
==========================================
+ Hits        26214    26238      +24     
  Misses      24083    24083              
  Partials       75       75              

☔ View full report in Codecov by Sentry.
📢 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.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR1823/dynamix.unraid.net.plg

Copy link
Contributor

@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)
plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidUpdateCancel.php (1)

49-52: LGTM! Cleanup logic correctly implements the feature.

The code appropriately checks for directory existence before deletion and uses a hardcoded path that eliminates injection risks. The implementation is consistent with existing file operation patterns in this function (e.g., line 38's shell_exec("mv -f ...")).

Optional enhancement: Consider capturing the result of shell_exec to verify the deletion succeeded, though the current approach is consistent with the existing codebase style:

 // Delete plugin files that were downloaded during the OS upgrade
 if (is_dir("/boot/config/plugins-nextboot")) {
-  shell_exec("rm -rf /boot/config/plugins-nextboot");
+  $result = shell_exec("rm -rf /boot/config/plugins-nextboot 2>&1");
+  if ($result !== null && $result !== "") {
+    error_log("Warning: Issue deleting plugins-nextboot: " . $result);
+  }
 }

Based on learnings, rm -rf for broader cleanup is intentional and accepted practice in this codebase.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23a7120 and 2d653f2.

📒 Files selected for processing (1)
  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidUpdateCancel.php (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit inference engine (.cursor/rules/default.mdc)

Never add comments unless they are needed for clarity of function

Files:

  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidUpdateCancel.php
🧠 Learnings (3)
📓 Common learnings
Learnt from: elibosley
Repo: unraid/api PR: 1657
File: web/scripts/deploy-dev.sh:37-41
Timestamp: 2025-09-04T15:26:34.416Z
Learning: In web/scripts/deploy-dev.sh, the command `rm -rf /usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/*` intentionally removes all contents of the unraid-components directory before deploying standalone components. This broader cleanup is desired behavior according to the maintainer elibosley.
📚 Learning: 2025-09-04T15:26:34.416Z
Learnt from: elibosley
Repo: unraid/api PR: 1657
File: web/scripts/deploy-dev.sh:37-41
Timestamp: 2025-09-04T15:26:34.416Z
Learning: In web/scripts/deploy-dev.sh, the command `rm -rf /usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/*` intentionally removes all contents of the unraid-components directory before deploying standalone components. This broader cleanup is desired behavior according to the maintainer elibosley.

Applied to files:

  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidUpdateCancel.php
📚 Learning: 2025-09-04T18:42:53.531Z
Learnt from: pujitm
Repo: unraid/api PR: 1658
File: plugin/plugins/dynamix.unraid.net.plg:73-79
Timestamp: 2025-09-04T18:42:53.531Z
Learning: In the dynamix.unraid.net plugin, versions 6.12.1-6.12.14 and 6.12.15 prereleases are intentionally allowed to install with warnings (rather than immediate cleanup) to provide users with a grace period and notice before functionality is completely removed. This is a deliberate UX decision to avoid immediately breaking existing setups while encouraging upgrades.

Applied to files:

  • plugin/source/dynamix.unraid.net/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidUpdateCancel.php

@zackspear zackspear requested a review from elibosley December 8, 2025 20:58
@ljm42 ljm42 merged commit 74df938 into main Dec 8, 2025
13 checks passed
@ljm42 ljm42 deleted the feat-cancel-upgrade-delete-downloads branch December 8, 2025 21:18
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.

3 participants