Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@elibosley
Copy link
Member

@elibosley elibosley commented Sep 23, 2025


Summary by CodeRabbit

  • New Features

    • Adds API version awareness for Unraid Connect: detects server vs. connector API versions, notifies users, and skips installation to avoid downgrades.
  • Bug Fixes

    • Improved pre-install cleanup to remove leftover pkgtools uninstall logs and other stale files, improving install/upgrade reliability and clearer status reporting.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a pre-install cleanup step to the plugin installer that removes leftover pkgtools removal logs (in /var/log/pkgtools/removed_packages/dynamix.unraid.net) during the API install flow; the removal runs after deleting node_modules and is guarded by a directory-existence check. No public APIs changed.

Changes

Cohort / File(s) Summary
Plugin installer
plugin/plugins/dynamix.unraid.net.plg
Adds a pre-install cleanup operation: after removing node_modules and before continuing the install, check for and delete depth-1 items under /var/log/pkgtools/removed_packages/dynamix.unraid.net to clear leftover pkgtools removal logs. No exported/public signatures changed.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Admin
  participant Script as Plugin Script
  participant FS as Filesystem
  participant PKG as Package Install

  Admin->>Script: trigger install
  Script->>FS: remove `node_modules`
  Script->>FS: if `/var/log/pkgtools/removed_packages/dynamix.unraid.net` exists
  alt exists
    Script->>FS: remove depth-1 items (pkgtools removal logs)
  else not exists
    Script->>FS: skip pkgtools cleanup
  end
  Script->>PKG: continue with remaining install flow
  PKG-->>Script: install result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

I hopped through folders, sniffed old logs away,
Cleared crumbs by the node_modules where stale traces lay.
If a rm-ran earlier left a trail in the dark,
I tidy the burrow and leave not a mark. 🥕

Pre-merge checks and finishing touches 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 is a concise, single-sentence statement that clearly describes a main change in the changeset—cleaning up leftover removed packages during upgrades—and aligns with the PR objectives and the raw_summary which show added cleanup steps and upgrade-related handling. It avoids vague phrasing and directly communicates the intent of the patch to reviewers.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88095d5 and 858d776.

📒 Files selected for processing (1)
  • plugin/plugins/dynamix.unraid.net.plg (1 hunks)

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

@codecov
Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.58%. Comparing base (a44473c) to head (858d776).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1719   +/-   ##
=======================================
  Coverage   52.58%   52.58%           
=======================================
  Files         858      858           
  Lines       48091    48091           
  Branches     4792     4792           
=======================================
  Hits        25287    25287           
  Misses      22735    22735           
  Partials       69       69           

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

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/plugins/dynamix.unraid.net.plg (1)

438-444: Harden deletion and also clear removed_scripts

Add -- to rm to prevent option injection on weird filenames, and consider also cleaning the corresponding removed_scripts directory for completeness.

-# Clean up pkgtools removal logs left behind by prior uninstall operations
-REMOVE_PKG_LOG_DIR="/var/log/pkgtools/removed_packages/dynamix.unraid.net"
-if [ -d "$REMOVE_PKG_LOG_DIR" ]; then
-  echo "Cleaning up pkgtools removed_packages logs..."
-  find "$REMOVE_PKG_LOG_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
-fi
+# Clean up pkgtools removal logs left behind by prior uninstall operations
+REMOVE_PKG_LOG_DIR="/var/log/pkgtools/removed_packages/dynamix.unraid.net"
+if [ -d "$REMOVE_PKG_LOG_DIR" ]; then
+  echo "Cleaning up pkgtools removed_packages logs..."
+  find "$REMOVE_PKG_LOG_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +
+fi
+
+# Also clean removed_scripts for completeness
+REMOVE_SCRIPTS_LOG_DIR="/var/log/pkgtools/removed_scripts/dynamix.unraid.net"
+if [ -d "$REMOVE_SCRIPTS_LOG_DIR" ]; then
+  echo "Cleaning up pkgtools removed_scripts logs..."
+  find "$REMOVE_SCRIPTS_LOG_DIR" -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +
+fi
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed9a5c5 and 88095d5.

📒 Files selected for processing (1)
  • plugin/plugins/dynamix.unraid.net.plg (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: elibosley
PR: unraid/api#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-04T18:42:53.531Z
Learnt from: pujitm
PR: unraid/api#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/plugins/dynamix.unraid.net.plg
📚 Learning: 2025-09-04T15:26:34.416Z
Learnt from: elibosley
PR: unraid/api#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/plugins/dynamix.unraid.net.plg

@elibosley elibosley force-pushed the fix/remove-package-upgrade branch from c299f8c to 12baff3 Compare September 23, 2025 15:24
@github-actions
Copy link
Contributor

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/PR1719/dynamix.unraid.net.plg

@elibosley elibosley merged commit 9972a5f into main Sep 23, 2025
13 checks passed
@elibosley elibosley deleted the fix/remove-package-upgrade branch September 23, 2025 15:35
elibosley pushed a commit that referenced this pull request Sep 23, 2025
🤖 I have created a release *beep* *boop*
---


## [4.24.1](v4.24.0...v4.24.1)
(2025-09-23)


### Bug Fixes

* cleanup leftover removed packages on upgrade
([#1719](#1719))
([9972a5f](9972a5f))
* enhance version comparison logic in installation script
([d9c561b](d9c561b))
* issue with incorrect permissions on viewer / other roles
([378cdb7](378cdb7))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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