Skip to content

mgr/dashboard: Add Hosts via CSV Upload - #67935

Merged
Pegonzal merged 1 commit into
ceph:mainfrom
rhcs-dashboard:add-csv
May 26, 2026
Merged

Pegonzal merged 1 commit into
ceph:mainfrom
rhcs-dashboard:add-csv

Conversation

@sagargopale2233

@sagargopale2233 sagargopale2233 commented Mar 23, 2026 •

Copy link
Copy Markdown

mgr/dashboard: Add Hosts via CSV Upload

Fixes: https://tracker.ceph.com/issues/75578

Signed-off-by: Sagar Gopale [email protected]

Screencast :

Screencast.From.2026-04-30.11-02-10.mp4

PR Description : This PR adds CSV-based host import support to the NVMe-oF Subsystem Step 2 flow in Ceph Dashboard, alongside the existing manual host entry path.
It introduces UI updates, validation/error handling, and layout adjustments to support CSV upload and parsed host listing.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-project-automation github-project-automation Bot moved this from New to Reviewer approved in Ceph-Dashboard Apr 14, 2026
@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@devikab25 devikab25 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.

LGTM!

@afreen23

Copy link
Copy Markdown
Contributor

jenkins test dashboard

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@Pegonzal Pegonzal 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.

Hey @sagargopale2233 thanks for the PR. Some comments from my side:

is there any reason to use only .csv? Why not allow for .json or .yaml?

While testing, I was removing an element and got the following error which broke the page:

Uncaught Error: Control 'hostDchapKeyList,6' could not be found!
    at CdFormGroup.get (cd-form-group.ts:29:13)
    at FormGroupDirective._cleanUpFormContainer (forms.mjs:5290:36)
    at FormGroupDirective.removeFormGroup (forms.mjs:5176:14)
    at FormGroupName.ngOnDestroy (forms.mjs:3933:32)
    at executeOnDestroys (core.mjs:13305:32)
    at cleanUpView (core.mjs:13200:9)
    at destroyViewTree (core.mjs:13144:17)
    at destroyLView (core.mjs:13174:5)
    at LiveCollectionLContainerImpl.destroy (core.mjs:27785:9)
    at reconcile (core.mjs:27447:24)

Also, when the file attached (that was uploaded), as can be seen in the below video, is removed the hosts are not removed, but then if I remove a bunch of hosts and try to reupload the file, the missing hosts are not set since the file was already uploaded. Not a big deal but would be cleaner if we could fix this I believe.

screen-capture.16.webm

@sagargopale2233

Copy link
Copy Markdown
Author

Hey @sagargopale2233 thanks for the PR. Some comments from my side:

is there any reason to use only .csv? Why not allow for .json or .yaml?

While testing, I was removing an element and got the following error which broke the page:

Uncaught Error: Control 'hostDchapKeyList,6' could not be found!
    at CdFormGroup.get (cd-form-group.ts:29:13)
    at FormGroupDirective._cleanUpFormContainer (forms.mjs:5290:36)
    at FormGroupDirective.removeFormGroup (forms.mjs:5176:14)
    at FormGroupName.ngOnDestroy (forms.mjs:3933:32)
    at executeOnDestroys (core.mjs:13305:32)
    at cleanUpView (core.mjs:13200:9)
    at destroyViewTree (core.mjs:13144:17)
    at destroyLView (core.mjs:13174:5)
    at LiveCollectionLContainerImpl.destroy (core.mjs:27785:9)
    at reconcile (core.mjs:27447:24)

Also, when the file attached (that was uploaded), as can be seen in the below video, is removed the hosts are not removed, but then if I remove a bunch of hosts and try to reupload the file, the missing hosts are not set since the file was already uploaded. Not a big deal but would be cleaner if we could fix this I believe.

screen-capture.16.webm

Hey @Pegonzal, thanks for the review and for catching those bugs!

I've pushed updates to fix both issues you found with the CSV upload: 1. The page breaking when removing an element (fixed the FormArray lifecycle issue). 2. The uploaded hosts not clearing properly when the file is removed from the UI.

Regarding your suggestion to support .json and .yaml formats alongside .csv: I agree that would be a great addition! However, to keep this PR focused and get these bug fixes merged smoothly, we are going to cover the JSON/YAML support in a separate, follow-up PR.

Let me know if the current fixes look good to you!

@sagargopale2233
sagargopale2233 force-pushed the add-csv branch 5 times, most recently from 3f7de86 to 3d67ca9 Compare May 20, 2026 07:43
@sagargopale2233

Copy link
Copy Markdown
Author

jenkins test make check

@Pegonzal

Copy link
Copy Markdown
Contributor

@sagargopale2233 there are some linting issues as well as a test failure:

............................................................................................................
  ● Test suite failed to run

    Cannot find module 'ngx-toastr' from 'src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystems-form.component.spec.ts'

       6 |
       7 | import { NgbActiveModal, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap';
    >  8 | import { ToastrModule } from 'ngx-toastr';
         | ^
       9 |
      10 | import { SharedModule } from '~/app/shared/shared.module';
      11 | import {

      at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.<anonymous> (src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystems-form.component.spec.ts:8:1)

........................................................................................................................................................................................................................................................................................................................................................................................

[lint:html    ] Checking formatting...
[lint:html    ] All matched files use Prettier code style!
[lint:tsc     ] src/app/ceph/block/nvmeof-subsystems-form/nvmeof-subsystems-form.component.spec.ts(8,30): error TS2307: Cannot find module 'ngx-toastr' or its corresponding type declarations.
[lint:eslint  ] 
[lint:eslint  ] Linting "ceph-dashboard"...
[lint:eslint  ] 
[lint:eslint  ] All files pass linting.
[lint:eslint  ] 

Try running 'npm run fix' to fix some linting errors. Some errors might need a manual fix.

@sagargopale2233

Copy link
Copy Markdown
Author

jenkins test make check arm64

@Pegonzal Pegonzal 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.

Thanks for the update @sagargopale2233 , overall works nicely and this is a great addition.

I wanted to point to a couple things I saw while testing that could be fixed in a followup PR.

On bigger screens space is unused and instead scrollbar is added

screen-capture.21.webm

Drag and drop not working:
Also I don't think "no file selected" should be shown in red as it is not a requisit. I had hosts selected which is what matters.

screen-capture.20.webm

@Pegonzal
Pegonzal merged commit 6aa2276 into ceph:main May 26, 2026
6 checks passed
@Pegonzal
Pegonzal deleted the add-csv branch May 26, 2026 09:06
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard May 26, 2026
@sagargopale2233 sagargopale2233 self-assigned this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants