Skip to content

fix(onboarding): allow 8GB dedicated boot devices#1978

Closed
Ajit-Mehrotra wants to merge 3 commits intomainfrom
codex/dedicated-boot-8gb
Closed

fix(onboarding): allow 8GB dedicated boot devices#1978
Ajit-Mehrotra wants to merge 3 commits intomainfrom
codex/dedicated-boot-8gb

Conversation

@Ajit-Mehrotra
Copy link
Copy Markdown
Contributor

@Ajit-Mehrotra Ajit-Mehrotra commented Mar 30, 2026

Summary

This updates the onboarding internal boot flow so dedicated boot can use marketed 8 GB devices, while keeping the existing internal sizing contract for hybrid boot reservations.

The final behavior in this branch is:

  • dedicated boot accepts devices at 8,000,000,000 bytes and larger
  • disk capacities continue to be displayed to users in metric/base-10 units (GB)
  • internal boot reservation sizes continue to use MiB internally (16384, 4096, etc.)
  • hybrid eligibility keeps the pre-existing MiB-based threshold behavior

Problem

The Setup Boot step and the internal boot wizard support both:

  • a dedicated boot device flow
  • a hybrid boot + data pool flow

The wizard was still treating dedicated boot devices like the older split-boot flow and only allowing devices that met the larger internal minimum. That blocked marketed 8 GB devices from being used as dedicated boot devices even though they should be valid for the dedicated path.

At the same time, onboarding already follows a mixed sizing model:

  • user-facing capacity labels are shown in decimal storage units
  • internal boot reservation values are stored and sent in MiB

We wanted to fix the dedicated 8 GB issue without changing that established internal contract.

What Changed

Dedicated boot eligibility

In web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue, disk eligibility is now mode-aware:

  • dedicated mode checks the raw device size against an 8,000,000,000 byte minimum
  • hybrid mode continues to use the existing MiB-based boot reservation threshold

That means a marketed 8 GB device is now selectable for dedicated boot, but it is still rejected in hybrid mode if it does not satisfy the existing internal MiB requirement.

Internal sizing contract preserved

The onboarding flow still uses MiB internally for boot reservation sizing:

  • draft state stays on bootSizeMiB
  • onboarding validation and presets stay on values like 4096 and 16384
  • the API input and service path continue to pass poolBootSize in MiB

This keeps the internal contract aligned with the existing implementation while still showing users metric disk sizes.

Tests updated

The onboarding tests were updated to cover the intended behavior:

  • an 8 GB marketed drive is selectable in dedicated mode
  • the same drive is not eligible in hybrid mode
  • displayed disk labels use metric/base-10 capacity formatting where expected

Files of Interest

  • web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue
  • web/src/components/Onboarding/store/onboardingDraft.ts
  • web/__test__/components/Onboarding/OnboardingInternalBootStep.test.ts
  • web/__test__/components/Onboarding/OnboardingSummaryStep.test.ts
  • api/src/unraid-api/cli/generated/graphql.ts

Validation

Ran:

  • cd web && pnpm codegen
  • cd web && pnpm exec vitest run __test__/components/Onboarding/OnboardingInternalBootStep.test.ts __test__/components/Onboarding/internalBoot.test.ts __test__/components/Onboarding/OnboardingSummaryStep.test.ts __test__/components/Onboarding/OnboardingInternalBootStandalone.test.ts __test__/components/Onboarding/OnboardingNextStepsStep.test.ts
  • cd web && pnpm type-check
  • cd api && pnpm test -- src/unraid-api/graph/resolvers/onboarding/onboarding-internal-boot.service.spec.ts src/unraid-api/graph/resolvers/onboarding/onboarding.mutation.spec.ts

Note: the API test command expands to a broader repo suite in this workspace, and that broader run completed successfully as well.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Fixed device eligibility logic for internal boot to correctly account for pool mode (dedicated or hybrid), ensuring appropriate devices display as available options during setup.
  • Tests

    • Updated disk sizing calculations and device eligibility tests to align with accurate measurement standards and mode-dependent eligibility rules.

- Purpose: let dedicated boot pools accept 8 GB class devices in the onboarding and internal boot wizard.\n- Before: eligibility used a MiB-based floor that effectively rejected marketed 8 GB drives because 8,000,000,000 bytes is below 8,192 MiB.\n- Why that was a problem: users could only pick 16 GB and larger devices for dedicated boot even though dedicated boot should support smaller media.\n- Now: dedicated boot checks against an 8,000,000,000-byte minimum while hybrid mode keeps the existing boot-reservation math.\n- How: make device eligibility depend on pool mode and add a regression test covering dedicated vs hybrid behavior for an 8 GB drive.
- Purpose: align the onboarding internal boot flow with Unraid's decimal GB/TB sizing convention.

- Before: the wizard stored and validated hybrid boot sizes in MiB-based values like 16384 and converted capacities with 1024-based math.

- Problem: the UI labels said GB while the underlying thresholds, presets, summaries, and GraphQL payloads were still using binary units, which made marketed drive sizes behave unexpectedly at the boundary.

- Change: rename the onboarding boot-size contract to bootSizeMb and switch onboarding thresholds, presets, summaries, device eligibility math, and tests to decimal MB/GB semantics.

- How: convert device sizes with 1000-based math in the web step, send decimal boot-size values through GraphQL and the internal boot service, regenerate schema/types, and update onboarding specs to assert the new 8,000 MB boundary.
- Purpose: align onboarding with the existing convention of showing decimal-sized disks to users while keeping internal boot reservation values in MiB.

- Before: the follow-up decimal migration changed the onboarding boot-size contract, defaults, presets, and hybrid validation to decimal MB values like 16000 and 4000.

- Problem: that no longer matched the prior internal contract, changed the hybrid 8 GB boundary behavior, and would send a different poolBootSize value to the backend than the feature previously expected.

- Change: restore bootSizeMiB across onboarding state, GraphQL types, API inputs, service payloads, presets, and validation while preserving metric device labels and the dedicated 8,000,000,000-byte minimum from the earlier fix.

- How: switch the onboarding boot-size pipeline back to MiB values such as 16384 and 4096, regenerate the web GraphQL artifacts, and update the onboarding specs to assert dedicated 8 GB eligibility with the original hybrid MiB threshold.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 216db302-acc6-4e94-9434-a695ab62577c

📥 Commits

Reviewing files that changed from the base of the PR and between 7dadaa2 and eb8d651.

⛔ Files ignored due to path filters (1)
  • api/src/unraid-api/cli/generated/graphql.ts is excluded by !**/generated/**
📒 Files selected for processing (4)
  • web/__test__/components/Onboarding/OnboardingInternalBootStep.test.ts
  • web/__test__/components/Onboarding/OnboardingSummaryStep.test.ts
  • web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue
  • web/src/components/Onboarding/store/onboardingDraft.ts

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

This change refactors internal boot device eligibility logic to be pool-mode-aware (dedicated vs hybrid), replacing precomputed ineligibility codes with runtime calculations based on pool mode and normalized device sizes. Disk size metrics are updated from GiB (1024³) to GB (1000³) throughout tests.

Changes

Cohort / File(s) Summary
Test Disk Size Metrics
web/__test__/components/Onboarding/OnboardingSummaryStep.test.ts, web/__test__/components/Onboarding/OnboardingInternalBootStep.test.ts
Updated disk size calculations and expected UI text from GiB (1024^3) to GB (1000^3) values. Added test case verifying device eligibility differs between dedicated and hybrid pool modes.
Device Eligibility Refactoring
web/src/components/Onboarding/steps/OnboardingInternalBootStep.vue
Replaced ineligibilityCodes with sizeBytes in InternalBootDeviceOption. Introduced getIneligibilityCodes() helper for pool-mode-aware eligibility checks. Updated device filtering and issue aggregation to use runtime eligibility derivation instead of precomputed codes.
Boot Size Normalization
web/src/components/Onboarding/store/onboardingDraft.ts
Extracted DEFAULT_BOOT_SIZE_MIB constant and refactored internal boot selection normalization to use it for fallback logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Pooling modes now guide our way,
Dedicated bytes, hybrid MiB at play,
From gibibytes to gigabytes we've sprung,
Device eligibility logic freshly sung,
A refactor refined, the boot steps align! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/dedicated-boot-8gb

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 and usage tips.

@Ajit-Mehrotra
Copy link
Copy Markdown
Contributor Author

Closing this draft after verifying the reported issue was due to unit confusion: current main already uses an 8 GiB minimum, so there is no product change to ship here.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.11%. Comparing base (86d31ee) to head (eb8d651).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...src/components/Onboarding/store/onboardingDraft.ts 20.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1978      +/-   ##
==========================================
+ Coverage   52.08%   52.11%   +0.03%     
==========================================
  Files        1031     1032       +1     
  Lines       71564    71628      +64     
  Branches     8090     8113      +23     
==========================================
+ Hits        37275    37332      +57     
- Misses      34164    34171       +7     
  Partials      125      125              

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

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

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