-
Notifications
You must be signed in to change notification settings - Fork 10
fix: cleanup leftover removed packages on upgrade #1719
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
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds a pre-install cleanup step to the plugin installer that removes leftover pkgtools removal logs (in Changes
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches and finishing touches✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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)
plugin/plugins/dynamix.unraid.net.plg (1)
438-444: Harden deletion and also clear removed_scriptsAdd
--tormto 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
📒 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
c299f8c to
12baff3
Compare
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
🤖 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>
Summary by CodeRabbit
New Features
Bug Fixes