Skip to content

feat: Add Mover Status (7.4) - #1042

Open
SimonFair wants to merge 36 commits into
unraid:masterfrom
SimonFair:Mover-Progress-NCHAN-rc3+
Open

feat: Add Mover Status (7.4)#1042
SimonFair wants to merge 36 commits into
unraid:masterfrom
SimonFair:Mover-Progress-NCHAN-rc3+

Conversation

@SimonFair

@SimonFair SimonFair commented Mar 8, 2022

Copy link
Copy Markdown
Contributor

Initial code for 6.10+

Summary by CodeRabbit

  • New Features
    • Added optional “Mover Progress” reporting with real-time activity, throughput, completion percentage, and estimated time remaining.
    • Added an enabled/disabled “Mover Progress” scheduler setting with contextual help.
  • UI Improvements
    • Added a mover status panel that displays up to five relevant progress rows.
    • Progress rows now appear or hide automatically based on mover activity and array state.
    • Improved progress updates for overall movement, individual shares, and cleanup operations.

@SimonFair
SimonFair marked this pull request as draft March 8, 2022 20:25
@SimonFair SimonFair changed the title Initial Commit for Mover Status rc3+ Add Mover Status rc3+ Mar 8, 2022
@SimonFair

SimonFair commented Mar 9, 2022

Copy link
Copy Markdown
Contributor Author

Example View

image

@bergware

Copy link
Copy Markdown
Contributor

Very nice!
I like it.

@SimonFair
SimonFair marked this pull request as ready for review March 20, 2022 11:05
@SimonFair

SimonFair commented Mar 20, 2022

Copy link
Copy Markdown
Contributor Author

tom mortensen (@limetech) these changes will be pending your mover and move changes needed to made mover.ini in state dir.

@SimonFair

SimonFair commented Apr 2, 2022

Copy link
Copy Markdown
Contributor Author

Gist for my current test mover script https://gist.github.com/SimonFair/91d54c983a8c9b09c0d803baa25f01ac

@SimonFair SimonFair closed this May 9, 2022
@SimonFair SimonFair reopened this May 26, 2022
@limetech

Copy link
Copy Markdown
Contributor

it's baaaaaaaaaaack

@SimonFair

SimonFair commented Jun 2, 2022

Copy link
Copy Markdown
Contributor Author

tom mortensen (@limetech) Started creating a php version of the mover script to allow status to show file name and current action. But I still need to look at is the progress for each file. Can you provide details of now to get the ioctl from move so I can update the nchan for parity_list to get the progress. Or if you have another way you would like to progress let me know.

WIP https://gist.github.com/SimonFair/5e1f318b20e43afc01dcf29a78aee2c1

image
image
image

@SimonFair SimonFair changed the title Add Mover Status rc3+ Add Mover Status 6.10 Jun 5, 2022
@LoveBootCaptain

Copy link
Copy Markdown

any info from tom mortensen (@limetech) when or if this PR get merged?

@chrisallen

Chris Allen (chrisallen) commented Dec 16, 2022

Copy link
Copy Markdown

Wow this looks amazing!

@okiyama

Copy link
Copy Markdown

Bump, this would be a great feature

@Joly0

Joly0 commented Nov 24, 2023

Copy link
Copy Markdown
Contributor

Any news on this one?

@SimonFair SimonFair changed the title Add Mover Status 6.10 Add Mover Status 6.13 Nov 26, 2023
@nebb00

Copy link
Copy Markdown

is it possible to have this notify the apprise api of its progress ?

@Joly0

Joly0 commented Dec 12, 2024

Copy link
Copy Markdown
Contributor

Is there any reason, why this hasnt been merged yet? Would love to see this feature implemented in unraid 7.1

@skycryer

Copy link
Copy Markdown

Can someone solve the conflicts and merge it into 7 please?

@SimonFair

Copy link
Copy Markdown
Contributor Author

Can someone solve the conflicts and merge it into 7 please?

Unlikely at this point as backend changes are required for pool to pool and progress. These are just the GUI changes.

@ljm42 ljm42 added the TBD label Apr 29, 2025
@coderabbitai

coderabbitai Bot commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e55de895-fd6e-4bb3-9e61-98e7b6d0d42b

📥 Commits

Reviewing files that changed from the base of the PR and between 3080303 and 1de5589.

📒 Files selected for processing (2)
  • emhttp/languages/en_US/helptext.txt
  • emhttp/plugins/dynamix/ArrayOperation.page
🚧 Files skipped from review as they are similar to previous changes (2)
  • emhttp/languages/en_US/helptext.txt
  • emhttp/plugins/dynamix/ArrayOperation.page

Included review availability: Your plan includes up to 2 reviews per rolling hour; 1 remains after this review.


Walkthrough

Adds configurable mover progress tracking. sbin/mover writes status data, parity_list publishes updates, and ArrayOperation.page displays five live progress rows through /sub/mover.

Changes

Mover Progress Feature

Layer / File(s) Summary
Mover progress setting and help
emhttp/plugins/dynamix/MoverSettings.page, emhttp/languages/en_US/helptext.txt
Adds the shareMoverProgress setting and its help text.
Preserved mover implementation
sbin/mover.old
Adds the preserved mover script with cache-mode handling, process controls, disk emptying, and command dispatch.
Mover status generation
sbin/mover
Adds totals calculation, per-share tracking, mover.ini updates, progress calculations, and cleanup.
Mover status publication
emhttp/plugins/dynamix/nchan/parity_list
Reads mover.ini, builds mover display payloads, publishes them, and adjusts polling intervals.
Live mover progress rows
emhttp/plugins/dynamix/ArrayOperation.page
Adds the /sub/mover subscriber, five mover rows, message parsing, row updates, and state-based hiding.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: ⚪ Minimal · up to 1de55

No actionable merge-blocking risk remains; the PR is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant mover as sbin/mover
  participant mover_ini as mover.ini
  participant parity_list
  participant Browser
  participant mover_rows as mover rows

  mover->>mover: calculate_totals()
  mover->>mover_ini: write progress status
  parity_list->>mover_ini: read mover status
  parity_list->>Browser: publish mover payload
  Browser->>mover_rows: update and show selected rows
Loading

Poem

🐇 I hop beside the moving bytes,
Status blooms in tidy lights.
Totals count and ETAs appear,
Five small rows keep progress clear.
When the mover rests, rows hide—
I twitch my nose with rabbit pride.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding Mover Status functionality for version 7.4.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@johntdyer

Copy link
Copy Markdown

Really hoping this makes it in soon, seems like a great addition with most of the heavy lifting already done

@RobertCajun

Copy link
Copy Markdown

Can we potentially get an update on this?

@kronflux

Copy link
Copy Markdown

+1 for this, this would be fantastic

@omarahmed786

Copy link
Copy Markdown

Would love this to be added soon!

@PilaScat

Copy link
Copy Markdown

+1

@ChristianWilkie

Copy link
Copy Markdown

Came across this when searching for a way to monitor mover progress - this would be a great feature!

@elibosley

Copy link
Copy Markdown
Member

SimonFair do you want to rebase this

@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown

🔧 PR Test Plugin Available

A test plugin has been generated for this PR that includes the modified files.

Version: 2026.08.20.1225
Build: View Workflow Run

📥 Installation Instructions:

Install via Unraid Web UI:

  1. Go to Plugins → Install Plugin
  2. Copy and paste this URL:
https://preview.dl.unraid.net/pr-plugins/pr-1042/webgui-pr-1042.plg
  1. Click Install

Alternative: Direct Download

⚠️ Important Notes:

  • Testing only: This plugin is for testing PR changes
  • Backup included: Original files are automatically backed up
  • Easy removal: Files are restored when plugin is removed
  • Conflicts: Remove this plugin before installing production updates
  • Post-merge behavior: This preview stays available after merge until preview storage expires or it is manually cleaned up

📝 Modified Files:

Click to expand file list
emhttp/languages/en_US/helptext.txt
emhttp/plugins/dynamix/ArrayOperation.page
emhttp/plugins/dynamix/MoverSettings.page
emhttp/plugins/dynamix/nchan/parity_list
sbin/mover
sbin/mover.old

🔄 To Remove:

Navigate to Plugins → Installed Plugins and remove webgui-pr-1042, or run:

plugin remove webgui-pr-1042

🤖 This comment is automatically generated and will be updated with each new push to this PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@emhttp/plugins/dynamix/ArrayOperation.page`:
- Around line 517-528: The issue is that when moverlines decreases from a higher
value, previously visible rows above the new limit remain visible instead of
being hidden, because only rows 0 through moverlines-1 are updated in the
visibility loop. Before the main loop starting with `for (let i = 0; i <
moverlines; i++)`, add a reset loop to hide all mover rows (from 0 through
maxmoverlines) to ensure that any rows now outside the updated range are
properly hidden regardless of their previous visibility state.

In `@emhttp/plugins/dynamix/MoverSettings.page`:
- Around line 137-145: The form control for `shareMoverProgress` is defined in
the MoverSettings.page file but lacks backend implementation. You need to add
code to read the `shareMoverProgress` setting from the configuration storage,
pass this value to the mover process or service that handles progress display
functionality, and implement the conditional logic to enable or disable progress
display based on whether the setting is "enabled" or "disabled". This ensures
the toggle state actually affects the mover's behavior rather than just
persisting without effect.

In `@sbin/mover`:
- Around line 75-81: The PID file creation using the echo statement that writes
to /var/run/mover.pid needs to be moved to execute before the sleep 5 command
rather than after. Move the line containing echo $$ >/var/run/mover.pid to
execute immediately after the writestatus call and before the sleep 5 statement
to ensure the PID file is created early and prevent a race condition where a
second mover instance could start during the sleep window before the first
instance has written its PID.

In `@sbin/mover.old`:
- Around line 48-55: The stop and status command sections (at lines 134-143 and
163-165) do not validate that the PID in the file actually belongs to the mover
process before acting on it, unlike the startup section which checks with ps and
grep. Add the same PID ownership validation check (ps h $(cat $PIDFILE) | grep
mover) to both the stop function before calling killtree and the status function
before reporting the process as running, ensuring that only the actual mover
process is terminated or reported, preventing the termination of unrelated
processes with reused or stale PIDs.
- Around line 99-103: The EMPTYING variable can be blank, which causes the for
loop over the arr array to iterate with an empty DISK value, resulting in
scanning /mnt directly. Add a guard condition to check if the EMPTYING variable
is not empty before entering the for DISK in "${arr[@]}" loop. If EMPTYING is
empty, skip the entire disk iteration to prevent unintended operations on the
/mnt root directory.

In `@sbin/moverprogress`:
- Around line 144-145: The variables $DUARGSI and $DUARGSO containing file paths
are being directly interpolated into shell commands passed to shell_exec(),
which creates a shell injection vulnerability. Escape these variables using the
escapeshellarg() function before concatenating them into the shell commands to
prevent malicious input from breaking or manipulating the du commands. Apply
this same escapeshellarg() protection to all other instances mentioned in the
comment at lines 172, 177, 184-185, 217, 222, and 229-230 where file paths are
being concatenated into shell commands.
- Around line 72-76: In the startMover() function where the PID file content is
checked, add process liveness verification before refusing startup. Instead of
immediately exiting when the PID file exists, first check if the process with
that PID is actually running using a system call like kill -0 or equivalent.
Only exit with the "already running" message if the process is confirmed to be
alive. If the process is not running, allow the startup to proceed and
optionally clean up the stale PID file to prevent future blocks.
- Around line 263-275: The stopMover() function reads the process ID from the
PID file but never actually terminates the running mover process before removing
the PID file. After validating that $pid exists, you need to actually kill the
process using a system call like posix_kill() or exec() to send a termination
signal to the process with the retrieved $pid before sleeping and removing the
/var/run/mover.pid file. This ensures the mover process is properly terminated
rather than just orphaning it while the UI reports it as stopped.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: eb2452a6-b999-4cc9-8b2e-831134540ab0

📥 Commits

Reviewing files that changed from the base of the PR and between cc6a800 and 68aece2.

📒 Files selected for processing (7)
  • emhttp/languages/en_US/helptext.txt
  • emhttp/plugins/dynamix/ArrayOperation.page
  • emhttp/plugins/dynamix/MoverSettings.page
  • emhttp/plugins/dynamix/nchan/parity_list
  • sbin/mover
  • sbin/mover.old
  • sbin/moverprogress

Comment thread emhttp/plugins/dynamix/ArrayOperation.page
Comment thread emhttp/plugins/dynamix/MoverSettings.page
Comment thread sbin/mover
Comment thread sbin/mover.old
Comment thread sbin/mover.old
Comment thread sbin/moverprogress Outdated
Comment thread sbin/moverprogress Outdated
Comment thread sbin/moverprogress Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sbin/mover`:
- Around line 271-279: The calculate_totals function is being called
unconditionally even when mover progress is disabled, causing unnecessary tree
scanning. Wrap the calculate_totals function call and the related writestatus
calls (the ones before and after it) in a conditional block that checks if
mover_progress_enabled is true, so that the expensive tree walk is skipped when
progress tracking is disabled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4c08eb94-80c2-47cd-91ef-b381b752a3b4

📥 Commits

Reviewing files that changed from the base of the PR and between 68aece2 and 60ac24a.

📒 Files selected for processing (3)
  • emhttp/plugins/dynamix/ArrayOperation.page
  • emhttp/plugins/dynamix/nchan/parity_list
  • sbin/mover
🚧 Files skipped from review as they are similar to previous changes (1)
  • emhttp/plugins/dynamix/ArrayOperation.page

Comment thread sbin/mover Outdated
@elibosley Eli Bosley (elibosley) added 7.4.0 Approved for release 7.4.0 (auto-managed by notification-worker) and removed TBD labels Aug 20, 2026
@elibosley Eli Bosley (elibosley) changed the title Add Mover Status 6.13 feat: Add Mover Status (7.4) Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.4.0 Approved for release 7.4.0 (auto-managed by notification-worker)

Projects

None yet

Development

Successfully merging this pull request may close these issues.