Skip to content

refactor(array): retire direct disk removal mutation - #2068

Merged
Eli Bosley (elibosley) merged 1 commit into
mainfrom
codex/retire-array-remove-mutation
Aug 29, 2026
Merged

refactor(array): retire direct disk removal mutation#2068
Eli Bosley (elibosley) merged 1 commit into
mainfrom
codex/retire-array-remove-mutation

Conversation

@elibosley

@elibosley Eli Bosley (elibosley) commented Aug 29, 2026

Copy link
Copy Markdown
Member

What changed

  • Remove the removeDiskFromArray GraphQL resolver and the service method that directly cleared an array slot.
  • Remove the obsolete unit coverage for that independent mutation path.
  • Regenerate the public schema and CLI types without the retired field.

Why

Array removal is now coordinated by Core's reviewed, durable storage workflow in the task tray. Keeping a separate GraphQL mutation would allow callers to bypass evacuation, parity-preserving shrink, checkpoints, progress, and recovery handling.

Verification

  • Generated GraphQL schema and CLI types successfully.
  • API ESLint passed.
  • Array resolver/service tests: 22 passed.
  • API TypeScript type-check passed.
  • rg removeDiskFromArray api returns no matches.

Coordination

Work intent: U8-850

Companion changes: Core #937, unraid-e2e #358.

Summary by CodeRabbit

  • Changes
    • Removed the disk-removal operation from the array management API.
    • Disk addition functionality remains available.
  • Bug Fixes
    • Prevents unsupported disk-removal requests from being exposed or processed.

CI note

The dependency-audit job reports advisories in the existing lockfile (nanoid, postcss, and transitive tar, among others). This PR does not change package.json, pnpm-lock.yaml, or any dependency version. Source lint, focused tests, type-check, and generated contract checks pass.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-29T05:29:41.288553Z be432fc PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: f19c3624-586e-4f55-98dd-34be8f4c37a5

📥 Commits

Reviewing files that changed from the base of the PR and between d505800 and be432fc.

⛔ Files ignored due to path filters (1)
  • api/src/unraid-api/cli/generated/graphql.ts is excluded by !**/generated/**
📒 Files selected for processing (5)
  • api/generated-schema.graphql
  • api/src/unraid-api/graph/resolvers/array/array.mutations.resolver.ts
  • api/src/unraid-api/graph/resolvers/array/array.resolver.spec.ts
  • api/src/unraid-api/graph/resolvers/array/array.service.spec.ts
  • api/src/unraid-api/graph/resolvers/array/array.service.ts
💤 Files with no reviewable changes (5)
  • api/src/unraid-api/graph/resolvers/array/array.resolver.spec.ts
  • api/generated-schema.graphql
  • api/src/unraid-api/graph/resolvers/array/array.service.spec.ts
  • api/src/unraid-api/graph/resolvers/array/array.service.ts
  • api/src/unraid-api/graph/resolvers/array/array.mutations.resolver.ts

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


Walkthrough

The removeDiskFromArray GraphQL mutation, resolver, service method, and related tests were removed. The addDiskToArray mutation remains unchanged.

Changes

Array disk removal mutation

Layer / File(s) Summary
Remove disk mutation flow
api/generated-schema.graphql, api/src/unraid-api/graph/resolvers/array/array.mutations.resolver.ts, api/src/unraid-api/graph/resolvers/array/array.service.ts, api/src/unraid-api/graph/resolvers/array/array.service.spec.ts
The schema field, resolver, service method, and tests for removeDiskFromArray were removed.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to be432

This change removes a direct array-disk removal path and updates the generated API surface so callers use the coordinated storage workflow instead. The change is localized, verified by the listed checks, and no actionable merge-blocking risk remains.

Poem

A rabbit checks the array lane

One disk-removal path is gone
The schema sheds its former name
The tests now match what carries on
addDiskToArray still hops along

🚥 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. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 and concisely describes the main change: retiring the direct disk removal mutation for arrays.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/retire-array-remove-mutation

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.

@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: be432fc218

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment on lines 1192 to 1195
"""Add new disk to array"""
addDiskToArray(input: ArrayDiskInput!): UnraidArray!

"""
Remove existing disk from array. NOTE: The array must be stopped before running this otherwise it'll throw an error.
"""
removeDiskFromArray(input: ArrayDiskInput!): UnraidArray!

"""Mount a disk in the array"""

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 Regenerate the web schema types after removing the field

web/codegen.ts consumes this schema, but the checked-in web/src/composables/gql/graphql.ts still exposes ArrayMutations.removeDiskFromArray and its argument type. The resulting client types falsely advertise a mutation the server now rejects, so web code can type-check against an unavailable API; regenerate and commit the web GraphQL output alongside this schema change.

AGENTS.md reference: AGENTS.md:L115-L120

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.16%. Comparing base (d505800) to head (be432fc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2068      +/-   ##
==========================================
- Coverage   53.17%   53.16%   -0.01%     
==========================================
  Files        1041     1041              
  Lines       72476    72455      -21     
  Branches     8363     8353      -10     
==========================================
- Hits        38537    38523      -14     
+ Misses      33812    33805       -7     
  Partials      127      127              

☔ 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/PR2068/dynamix.unraid.net.plg

@elibosley
Eli Bosley (elibosley) merged commit 97f639f into main Aug 29, 2026
13 of 14 checks passed
@elibosley
Eli Bosley (elibosley) deleted the codex/retire-array-remove-mutation branch August 29, 2026 05:50
@github-actions

Copy link
Copy Markdown
Contributor

🔄 PR Merged - Plugin Redirected to Staging

This PR has been merged and the preview plugin has been updated to redirect to the staging version.

For users testing this PR:

  • Your plugin will automatically update to the staging version on the next update check
  • The staging version includes all merged changes from this PR
  • No manual intervention required

Staging URL:

https://preview.dl.unraid.net/unraid-api/dynamix.unraid.net.plg

Thank you for testing! 🚀

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