Skip to content

OSAC-3600: [UI] Create Storage Backend page - #136

Merged
openshift-merge-bot[bot] merged 7 commits into
osac-project:mainfrom
ElayAharoni:OSAC-3600-storage-backend-create-page
Aug 12, 2026
Merged

OSAC-3600: [UI] Create Storage Backend page#136
openshift-merge-bot[bot] merged 7 commits into
osac-project:mainfrom
ElayAharoni:OSAC-3600-storage-backend-create-page

Conversation

@ElayAharoni

@ElayAharoni ElayAharoni commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

OSAC-3600: [UI] Create Storage Backend page

Jira: https://redhat.atlassian.net/browse/OSAC-3600
Story type: [UI]

Summary

Adds StorageBackendCreatePage, a full-page Formik+Yup form for registering a new storage backend (name, provider, endpoint, description, credentials), and wires it into the existing /admin/infrastructure/storage/backends/create route in place of the OSAC-3598 placeholder. Lets a Cloud Provider Admin register a backend without hand-constructing API/CLI calls.

Changes

  • libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx (new) — full-page create form modeled on TenantCreatePage: name (RFC 1035 DNS-label validated), provider (Select constrained to vast/ceph/pure), endpoint (required), description (optional), credentials.username/credentials.password (required, password masked via type="password"). Submits via the existing useCreateStorageBackend() hook and navigates back to the backends list on success; a duplicate-name ALREADY_EXISTS response renders as a form-level error without navigating away.
  • apps/app-frontend/src/shell/StorageRoutes.tsxbackends/create now renders StorageBackendCreatePage instead of the placeholder.
  • libs/i18n/locales/en/translation.json — new translation keys extracted via pnpm i18n.

Testing

  • Unit tests: 9 new tests in StorageBackendCreatePage.test.tsx (field rendering, provider option set, password masking, DNS-label validation, required-field validation, successful create+navigate with exact payload assertions, duplicate-name error without navigation) + 1 updated route test in StorageRoutes.test.tsx.
  • Integration tests: N/A — osac-ui has no persisted integration/E2E suite; the create flow's true E2E coverage is owned by a future osac-test-infra [QE] story.
  • Coverage: Every acceptance criterion below has a corresponding passing test exercising the component's public interface.

Acceptance Criteria

  • /admin/storage/backends/create (real path: /admin/infrastructure/storage/backends/create, renamed in OSAC-3598/3599) renders a full page with fields: name, provider, endpoint, description, credentials.username, credentials.password.
  • name is validated client-side as an RFC 1035 DNS label before submission.
  • provider is a Select constrained to vast/ceph/pure — not a free-text field.
  • credentials.password renders as a masked input (type="password") and is never rendered as plain text.
  • endpoint, credentials.username, and credentials.password are required; submission is blocked client-side if any is empty.
  • Submitting a valid form creates the backend and navigates back to /admin/infrastructure/storage/backends, where the new backend appears.
  • A duplicate-name submission surfaces the server's ALREADY_EXISTS as a form-level error without navigating away.

Summary by CodeRabbit

  • New Features

    • Added a storage backend creation form supporting VAST, Ceph, and Pure.
    • Added provider, endpoint, name, and credential validation with password masking.
    • Added loading states, inline errors, cancellation, breadcrumbs, and navigation after successful creation.
    • Improved storage tier creation with validation and submission feedback.
    • Added warnings when leaving forms with unsaved changes.
  • Bug Fixes

    • Replaced the storage backend route placeholder with the complete creation form.
    • Improved duplicate-name and creation error handling.
image

@openshift-ci-robot

openshift-ci-robot commented Aug 11, 2026

Copy link
Copy Markdown

@ElayAharoni: This pull request references OSAC-3600 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

OSAC-3600: [UI] Create Storage Backend page

Jira: https://redhat.atlassian.net/browse/OSAC-3600
Story type: [UI]

Summary

Adds StorageBackendCreatePage, a full-page Formik+Yup form for registering a new storage backend (name, provider, endpoint, description, credentials), and wires it into the existing /admin/infrastructure/storage/backends/create route in place of the OSAC-3598 placeholder. Lets a Cloud Provider Admin register a backend without hand-constructing API/CLI calls.

Changes

  • libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx (new) — full-page create form modeled on TenantCreatePage: name (RFC 1035 DNS-label validated), provider (Select constrained to vast/ceph/pure), endpoint (required), description (optional), credentials.username/credentials.password (required, password masked via type="password"). Submits via the existing useCreateStorageBackend() hook and navigates back to the backends list on success; a duplicate-name ALREADY_EXISTS response renders as a form-level error without navigating away.
  • apps/app-frontend/src/shell/StorageRoutes.tsxbackends/create now renders StorageBackendCreatePage instead of the placeholder.
  • libs/i18n/locales/en/translation.json — new translation keys extracted via pnpm i18n.

Testing

  • Unit tests: 9 new tests in StorageBackendCreatePage.test.tsx (field rendering, provider option set, password masking, DNS-label validation, required-field validation, successful create+navigate with exact payload assertions, duplicate-name error without navigation) + 1 updated route test in StorageRoutes.test.tsx.
  • Integration tests: N/A — osac-ui has no persisted integration/E2E suite; the create flow's true E2E coverage is owned by a future osac-test-infra [QE] story.
  • Coverage: Every acceptance criterion below has a corresponding passing test exercising the component's public interface.

Acceptance Criteria

  • /admin/storage/backends/create (real path: /admin/infrastructure/storage/backends/create, renamed in OSAC-3598/3599) renders a full page with fields: name, provider, endpoint, description, credentials.username, credentials.password.
  • name is validated client-side as an RFC 1035 DNS label before submission.
  • provider is a Select constrained to vast/ceph/pure — not a free-text field.
  • credentials.password renders as a masked input (type="password") and is never rendered as plain text.
  • endpoint, credentials.username, and credentials.password are required; submission is blocked client-side if any is empty.
  • Submitting a valid form creates the backend and navigates back to /admin/infrastructure/storage/backends, where the new backend appears.
  • A duplicate-name submission surfaces the server's ALREADY_EXISTS as a form-level error without navigating away.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 665916aa-4451-4250-948c-0876b1cd6849

📥 Commits

Reviewing files that changed from the base of the PR and between 285d2d3 and 411749e.

📒 Files selected for processing (3)
  • libs/i18n/locales/en/translation.json
  • libs/ui-components/src/pages/admin/StorageBackendCreatePage.test.tsx
  • libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/i18n/locales/en/translation.json

Walkthrough

The PR replaces the storage backend creation placeholder with a validated creation form. It adds provider labels and validation messages, handles submission and navigation, updates storage-tier submission behavior, and expands related tests.

Changes

Storage backend creation

Layer / File(s) Summary
Form fields and validation
libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx, libs/i18n/locales/en/translation.json, libs/ui-components/src/pages/admin/StorageBackendCreatePage.test.tsx
Adds backend fields, provider options, required-field validation, translated labels, and rendering and validation tests.
Submission and feedback
libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx, libs/ui-components/src/pages/admin/StorageBackendCreatePage.test.tsx, libs/ui-components/src/test-utils/createMockConnectTransport.ts, libs/ui-components/src/components/Form/LeaveFormConfirmation.tsx, libs/i18n/locales/en/translation.json
Builds and submits the storage backend request, handles pending and error states, supports asynchronous test callbacks, updates leave-warning text, and tests submission, cancellation, and navigation.
Storage tier submission alignment
libs/ui-components/src/components/Storage/StorageTierCreatePage.tsx, libs/ui-components/src/components/Storage/StorageTierCreatePage.test.tsx, libs/ui-components/src/test-utils/createMockConnectTransport.ts
Uses nested metadata and asynchronous submission for storage tiers. Formik submission state controls button states, and tests cover pending submission and navigation.
Route integration
apps/app-frontend/src/shell/StorageRoutes.tsx, apps/app-frontend/src/shell/StorageRoutes.test.tsx
Renders StorageBackendCreatePage for backends/create and verifies the form heading and Name textbox.

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

Sequence Diagram(s)

sequenceDiagram
  actor Operator
  participant StorageBackendCreatePage
  participant StorageBackendMutation
  participant BackendListRoute
  Operator->>StorageBackendCreatePage: enter backend details and submit
  StorageBackendCreatePage->>StorageBackendMutation: send storage backend request
  StorageBackendMutation-->>StorageBackendCreatePage: return success or creation error
  StorageBackendCreatePage->>BackendListRoute: navigate after success
Loading

Possibly related PRs

Suggested reviewers: batzionb

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding the UI page for creating storage backends.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
No-Hardcoded-Secrets ✅ Passed The feature diff adds only testBackendPassword='test-password' in a .test.tsx file, which meets the stated test exception; no real-secret shapes or credential URLs were added.
No-Weak-Crypto ✅ Passed The PR diff adds no MD5, SHA1, DES, RC4, Blowfish, ECB, or custom crypto; production code has no secret/token comparison. The password equality is test-only payload verification.
No-Injection-Vectors ✅ Passed The PR diff adds form/API/UI code but no SQL concatenation, shell execution, eval/exec, pickle/yaml loads, or dangerous HTML sinks; errors render as normal React children.
Container-Privileges ✅ Passed The aggregate PR diff changes only UI, tests, and translations; it adds no container/Kubernetes manifest or privilege setting such as privileged, hostPID, SYS_ADMIN, or allowPrivilegeEscalation.
No-Sensitive-Data-In-Logs ✅ Passed The main-to-HEAD diff adds no console, logger, print, or JSON.stringify calls; credentials are used only in the mutation payload and API errors render in the UI.
Ai-Attribution ✅ Passed All seven PR commits attribute Claude Code with an Assisted-by trailer, and the commit range contains no Co-Authored-By trailer.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ElayAharoni
ElayAharoni marked this pull request as ready for review August 11, 2026 11:59
@ElayAharoni
ElayAharoni requested review from batzionb and removed request for omer-vishlitzky August 11, 2026 12:02

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx`:
- Around line 96-112: Update the storage-backend create flow in the onSubmit
handler to include the established CSRF token mechanism when calling mutate, and
ensure the corresponding /api/fulfillment request path validates that token
before processing the state-changing operation. Reuse existing token generation,
transport, and proxy validation utilities rather than introducing a parallel
implementation.
- Around line 96-112: Update the form submission flow around onSubmit to return
mutateAsync, and disable the Create action whenever the form isSubmitting or the
mutation isPending. Configure the shared production transport to include CSRF
protection alongside connectErrorInterceptor, then add regression coverage for
rapid repeated activation and rejected requests without a valid CSRF token.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bb9806b4-d817-408c-9362-6b575fcfdd0d

📥 Commits

Reviewing files that changed from the base of the PR and between 86b7cff and 93fb48a.

📒 Files selected for processing (5)
  • apps/app-frontend/src/shell/StorageRoutes.test.tsx
  • apps/app-frontend/src/shell/StorageRoutes.tsx
  • libs/i18n/locales/en/translation.json
  • libs/ui-components/src/pages/admin/StorageBackendCreatePage.test.tsx
  • libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx

Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
@ElayAharoni
ElayAharoni requested a review from rawagner August 11, 2026 13:14
@ElayAharoni
ElayAharoni force-pushed the OSAC-3600-storage-backend-create-page branch from 7e6dc55 to 4b31139 Compare August 12, 2026 08:14
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx Outdated
Comment thread libs/ui-components/src/pages/admin/StorageBackendCreatePage.tsx
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
…t guard, unsaved-changes prompt

- Reuse the shared NameField component for the name input, restructuring
  Formik values/Yup schema from a flat name to nested metadata.name.
- Drop the redundant provider oneOf validator (the Select already
  constrains the value); this also fixes a latent bug where an empty
  provider showed the wrong error message instead of "Provider is required".
- Switch to mutateAsync and disable Create/Cancel while Formik's
  isSubmitting or the mutation's isPending is true, preventing duplicate
  submissions.
- Mount LeaveFormConfirmation to warn on navigating away with unsaved
  changes; generalize its copy since it's no longer wizard-only.
- Extract a hardcoded test password into a named fixture constant.
- Widen the mock transport's onStorageBackendCreate override type to
  allow an async handler, matching what the router already supports.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
…onventions

- Switch to mutateAsync and disable Create/Cancel while Formik's
  isSubmitting or the mutation's isPending is true, preventing
  duplicate submissions.
- Reuse the shared NameField component, restructuring Formik values/Yup
  schema from a flat name to nested metadata.name.
- Mount LeaveFormConfirmation to warn on navigating away with unsaved
  changes.
- Widen the mock transport's onStorageTierCreate override type to allow
  an async handler, matching onStorageBackendCreate and what the router
  already supports.
- Add a test verifying the Create/Cancel buttons disable during a
  pending submission.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
Formik's isSubmitting already covers the full window mutateAsync is
in flight (it only resets once onSubmit's returned promise settles),
so the separate isPending check on the Create/Cancel buttons was
redundant. Applied the same simplification to StorageTierCreatePage
for consistency.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@ElayAharoni
ElayAharoni force-pushed the OSAC-3600-storage-backend-create-page branch from 4513f68 to 285d2d3 Compare August 12, 2026 10:27
Credentials are not required by the backend, but the create form forced
username and password. Add a 'Use credentials' checkbox (checked by
default): when unchecked, the credential fields are hidden, their
validation is skipped, and the credentials object is omitted from the
create request entirely. When checked, both username and password remain
required, so credentials are always all-or-nothing by construction.

Addresses review feedback that the UI should reflect the backend's
optional credentials.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ElayAharoni, rawagner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [ElayAharoni,rawagner]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit 4bcc5df into osac-project:main Aug 12, 2026
17 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants