Skip to content

fix(onboarding): show the native boot pool failure reason (U8-2360) - #2158

Open
Eli Bosley (elibosley) wants to merge 5 commits into
mainfrom
codex/u8-2360-onboarding-storage-reasons
Open

Eli Bosley (elibosley) wants to merge 5 commits into
mainfrom
codex/u8-2360-onboarding-storage-reasons

Conversation

@elibosley

@elibosley Eli Bosley (elibosley) commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

The onboarding wizard already creates its internal boot pool with the native Create Pool and Make Bootable commands. When a checked daemon reply identifies the failure, the existing GraphQL result now gives an action for the reviewed pool. The response for partial boot setup tells the user to check the drives and pending transfer. A typed failure omits the accumulated command transcript from this user message.

Older daemons retain the existing HTTP failure wording. An unknown result or a result associated with a different command also uses that fallback. Checked failures preserve valid pool names such as cold.tier and fast~cache. A malformed or overlong name uses the generic pool label. All 24 focused client and onboarding tests passed. The Vue onboarding consumer renders the result through its existing error message. Installed browser qualification remains pending.

Refs U8-2360.

Summary by CodeRabbit

  • Bug Fixes
    • Storage pool and bootable-drive failures now show clearer, command-specific messages for issues such as active storage, invalid setup, size limits, and pending transfers. Relevant pool or slot details are included when available.
    • When internal boot setup fails because of a native storage error, the reported output now shows the storage error reason directly. Other command failures continue to use the existing error reporting.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Automatic approval withheld

CodeRabbit could not confirm that its review of this commit covered every file the target branch's reviews.path_filters include, for example because this pull request changes those filters.

A reviewer can post @coderabbitai approve as a new top-level comment to request approval.

Commit: 5b3bccd5b417.

No actionable comments were generated in the recent review.

Walkthrough

The change maps recognized native storage command results to specific errors, parses those errors from HTTP 500 response headers, and returns them directly from the onboarding internal boot service. Tests cover the parsing and onboarding error paths.

Changes

Storage error reporting

Layer / File(s) Summary
Map native storage results
api/src/core/utils/clients/storage-command-error.ts
StorageCommandError.fromReply maps recognized pool-creation and bootable-setup results to messages. It validates pool names and storage slots before including them.
Parse storage errors in emcmd
api/src/core/utils/clients/emcmd.ts, api/src/core/utils/clients/emcmd.spec.ts, .limetech/ai-review-markers/*
For HTTP 500 responses, emcmd parses command results from response headers and throws a mapped error when available. Tests cover recognized, mismatched, and unknown results. The review marker records patch metadata.
Return native errors from onboarding
api/src/unraid-api/graph/resolvers/onboarding/onboarding-internal-boot.service.ts, api/src/unraid-api/graph/resolvers/onboarding/onboarding-internal-boot.service.spec.ts
createInternalBootPool returns a StorageCommandError message as failure output. The test checks the failure result and confirms two command calls.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant emcmd
  participant StorageCommandError
  participant OnboardingInternalBootService
  emcmd->>StorageCommandError: Parse commands and response headers
  StorageCommandError-->>emcmd: Return mapped error or undefined
  emcmd-->>OnboardingInternalBootService: Throw mapped storage error
  OnboardingInternalBootService->>OnboardingInternalBootService: Return failure with error message
Loading
Merge Risk: Minimal · up to 5b3bc

The change shows clearer storage failure reasons during onboarding and keeps the existing messages for older daemons and unrecognized results. No merge-blocking risk was found. Installed-browser qualification is still pending.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: onboarding now shows the native boot pool failure reason. The changeset adds StorageCommandError, which maps native Create Pool and Make Bootable results to specific m…
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.
Full details: Title check

Explanation

The title names the main change: onboarding now shows the native boot pool failure reason. The changeset adds StorageCommandError, which maps native Create Pool and Make Bootable results to specific messages, and the onboarding service returns that message. The title matches the primary change. The conventional-commit prefix and ticket ID are acceptable and do not make it vague.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit reads the headers bright,
And maps each storage fault aright.
A pool name passes its careful test,
A boot error leaves the daemon's chest.
The onboarding path returns the reason,
Then hops away in springtime season.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 17d53c23-04bc-41c7-9187-475e88489359
Commits

Reviewing files that changed from the base of the PR and between 8a2649c and 5b3bccd.

Files selected for processing: 2

  • api/src/core/utils/clients/emcmd.spec.ts
  • api/src/core/utils/clients/storage-command-error.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@linear-code
linear-code Bot marked this pull request as ready for review November 23, 2026 03:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T03:07:43.345470Z 8a2649c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a2649cb99

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".

): StorageCommandError | undefined {
const pool = commands.poolName;
const target =
typeof pool === 'string' && /^[a-z][a-z0-9_-]{0,39}$/.test(pool)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept every valid pool-name character

When onboarding uses a valid name containing . or ~ (for example, fast.pool), this allowlist rejects it even though CreateInternalBootPoolInput explicitly permits those characters at onboarding.model.ts:295 and the UI does likewise. Consequently every recognized native failure replaces the actual reviewed pool name with the generic “selected pool”; align this validation with the onboarding pool-name rules while retaining the length bound.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.33333% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.34%. Comparing base (023a3ca) to head (5b3bccd).

Files with missing lines Patch % Lines
...pi/src/core/utils/clients/storage-command-error.ts 68.25% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2158      +/-   ##
==========================================
+ Coverage   54.32%   54.34%   +0.01%     
==========================================
  Files        1046     1047       +1     
  Lines       73611    73686      +75     
  Branches     8883     8908      +25     
==========================================
+ Hits        39987    40042      +55     
- Misses      33498    33518      +20     
  Partials      126      126              

☔ View full report in Codecov by Harness.
📢 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
Copy Markdown
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/PR2158/dynamix.unraid.net.plg

This branch has not been deployed

No deployments
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.

1 participant