Skip to content

mgr/dashboard: NVMe-of Initiator Hostname Pre-validation - #68224

Merged
afreen23 merged 1 commit into
ceph:mainfrom
rhcs-dashboard:fix/nvmeof-initiator-hostname-prevalidation
Apr 21, 2026
Merged

afreen23 merged 1 commit into
ceph:mainfrom
rhcs-dashboard:fix/nvmeof-initiator-hostname-prevalidation

Conversation

@sagargopale2233

@sagargopale2233 sagargopale2233 commented Apr 6, 2026 •

Copy link
Copy Markdown

mgr/dashboard: NVMe-oF Initiator Hostname Pre-validation

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

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

This PR adds pre-validation of hostnames in the NVMe-oF Initiator form
to prevent invalid submissions and provide better user feedback.

Screencast.From.2026-04-06.18-26-11.mp4

What Changed:

  1. Tearsheet component validation: Added form validation logic to
    handleSubmit() that marks all form fields as touched and updates
    validity state for each step before checking for invalid steps. This
    ensures all validation errors are properly displayed.

  2. Hostname filtering: The NVMe-oF Initiator form now filters out
    empty or whitespace-only hostnames from both:

    • DHCHAP key list entries (checks host_nqn field)
    • Manually added hostname entries
  3. Pre-submission validation: When no valid hosts remain after
    filtering, the form:

    • Marks the hostname form field as touched to show validation errors
    • Navigates the user back to the hosts step
    • Prevents submission instead of attempting an invalid request
  4. Comprehensive tests: Added test cases to verify the validation
    logic in the specification file.

Why:

This prevents invalid form submissions with empty hostnames, improves
the user experience by:

  • Showing validation errors clearly before submission attempts
  • Automatically navigating to the problematic step
  • Reducing API errors caused by invalid hostname data

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 Review in progress in Ceph-Dashboard Apr 6, 2026
@sagargopale2233
sagargopale2233 requested a review from afreen23 April 8, 2026 06:36
@sagargopale2233 sagargopale2233 changed the title mgr/dashboard: NVMe-oF Initiator Hostname Pre-validation mgr/dashboard: NVMe-of Initiator Hostname Pre-validation Apr 8, 2026
@sagargopale2233
sagargopale2233 force-pushed the fix/nvmeof-initiator-hostname-prevalidation branch from 9da681d to 7a50d93 Compare April 8, 2026 08:27
@sagargopale2233
sagargopale2233 force-pushed the fix/nvmeof-initiator-hostname-prevalidation branch from 7a50d93 to ca99feb Compare April 9, 2026 06:46
@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Ceph-Dashboard Apr 21, 2026
@afreen23
afreen23 merged commit ad8e304 into ceph:main Apr 21, 2026
9 checks passed
@afreen23
afreen23 deleted the fix/nvmeof-initiator-hostname-prevalidation branch April 21, 2026 10:48
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Ceph-Dashboard Apr 21, 2026
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log ad8e3049ac94c5ce6c0611bdecaa0e2645745de3^..ad8e3049ac94c5ce6c0611bdecaa0e2645745de3

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/24718257855

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.

4 participants