Skip to content

Add checks on reserved names#2632

Merged
limetech merged 5 commits into
unraid:masterfrom
SimonFair:ZFS-reserved-name-check-
May 11, 2026
Merged

Add checks on reserved names#2632
limetech merged 5 commits into
unraid:masterfrom
SimonFair:ZFS-reserved-name-check-

Conversation

@SimonFair
Copy link
Copy Markdown
Contributor

@SimonFair SimonFair commented May 8, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved pool-name validation: trims input, uses case-insensitive comparisons, and supports wildcard/prefix-style reserved entries (e.g., foo* blocks foo, foobar, etc.), including common reserved prefixes like mirror/raidz/spare.
  • New Features

    • Added a centralized client-side reserved-name check.
    • Tightened UI rendering: BTRFS pool status and ZFS pool status summary now display only for top-level pools.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

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

Run ID: 41052e4e-a419-4b69-8cf8-4aeadb851cef

📥 Commits

Reviewing files that changed from the base of the PR and between 71ab00e and e77e0d2.

📒 Files selected for processing (2)
  • emhttp/plugins/dynamix/CacheDevices.page
  • emhttp/plugins/dynamix/DeviceInfo.page
🚧 Files skipped from review as they are similar to previous changes (2)
  • emhttp/plugins/dynamix/CacheDevices.page
  • emhttp/plugins/dynamix/DeviceInfo.page

Walkthrough

A normalized helper is added to match reserved pool names with exact and *-suffix prefix rules; both pages now trim pool names early and use the helper in validate(poolname). PHP template checks were tightened so BTRFS and ZFS status sections only render for top-level pools.

Changes

Reserved Pool Name Validation Enhancement

Layer / File(s) Summary
Helper Function Definition
emhttp/plugins/dynamix/CacheDevices.page, emhttp/plugins/dynamix/DeviceInfo.page
New isReservedPoolName(poolname, reserved) trims and lowercases the candidate, checks exact matches and reserved entries ending in * as prefix matches, and recognizes a small set of reserved prefixes.
Validation Integration
emhttp/plugins/dynamix/CacheDevices.page, emhttp/plugins/dynamix/DeviceInfo.page
Both validate(poolname) functions trim the input early and replace reserved.includes(poolname) with isReservedPoolName(poolname, reserved); other validation steps are unchanged.
Template Conditional Tightening
emhttp/plugins/dynamix/DeviceInfo.page
BTRFS Pool Status form is emitted only when fsType('btrfs') and isPool($name); ZFS Pool Status Summary rendering now also requires isPool($name) in addition to existing checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I trim and lower, hop in line,
Wildcards guard a name that's mine,
Templates peek where top pools play,
Validation tidy — hip hooray,
A little rabbit cheers the day 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add checks on reserved names' directly describes the main changes in both modified files, which add JavaScript helpers and validation logic to prevent use of reserved pool names.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

🔧 PR Test Plugin Available

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

Version: 2026.05.09.2026
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-2632/webgui-pr-2632.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/plugins/dynamix/CacheDevices.page
emhttp/plugins/dynamix/DeviceInfo.page

🔄 To Remove:

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

plugin remove webgui-pr-2632

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

Copy link
Copy Markdown
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: 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 `@emhttp/plugins/dynamix/DeviceInfo.page`:
- Around line 203-210: The reserved-name check is incorrectly treating
non-wildcard entries as prefix matches; inside the reserved.some(...) anonymous
function (variables reservedName and name) change the non-wildcard branch to
require an exact match only (return name === reservedName) while preserving the
current wildcard branch (reservedName.endsWith('*') ->
name.startsWith(reservedName.slice(0, -1))). Ensure you still normalize case via
(entry || '').toLowerCase() and keep the early return for empty reservedName.
🪄 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: fc7affa6-0e02-40df-99de-5731549d3916

📥 Commits

Reviewing files that changed from the base of the PR and between c72475e and 4236ba4.

📒 Files selected for processing (2)
  • emhttp/plugins/dynamix/CacheDevices.page
  • emhttp/plugins/dynamix/DeviceInfo.page

Comment thread emhttp/plugins/dynamix/DeviceInfo.page
@SimonFair SimonFair marked this pull request as ready for review May 8, 2026 11:20
@SimonFair SimonFair added the 7.3 label May 8, 2026
@limetech limetech merged commit 240cdd7 into unraid:master May 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants