Skip to content

OCPBUGS-76280: Next button is disabled on Optional configurations page#3384

Closed
ElayAharoni wants to merge 2 commits intoopenshift-assisted:masterfrom
ElayAharoni:Next-button-is-disabled-on-Optional-configurations-page
Closed

OCPBUGS-76280: Next button is disabled on Optional configurations page#3384
ElayAharoni wants to merge 2 commits intoopenshift-assisted:masterfrom
ElayAharoni:Next-button-is-disabled-on-Optional-configurations-page

Conversation

@ElayAharoni
Copy link
Contributor

@ElayAharoni ElayAharoni commented Feb 9, 2026

https://issues.redhat.com/browse/OCPBUGS-76280

the next button is disabled on purpose because although the step is called optional configurations, the pull secret fields is required.
so therefore if there is no actual pull secret than the user will have to enter one before clicking on next.
the behaviour was that initially the checkbox was unchecked if there is no pull secret so it looked like nothing is wrong and the next button is disabled due to a bug.
i have fixed it now so that the the user will be able to see that the pull secret is required and it will be more informative.

before:
image

after:
image

Summary by CodeRabbit

  • Bug Fixes

    • The wizard’s Next action now triggers form validation and submission before advancing, preventing navigation without saving changes.
  • Improvements

    • Pull secret editing has been removed from the optional configurations step for existing infra environments.
    • When creating a new infra environment, the default pull secret is automatically applied (not editable in that step), simplifying the UI and submission flow.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 9, 2026
@openshift-ci-robot
Copy link

@ElayAharoni: This pull request references Jira Issue OCPBUGS-76280, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

https://issues.redhat.com/browse/OCPBUGS-76280

the next button is disabled on purpose because although the step is called optional configurations, the pull secret fields is required.
so therefore if there is no actual pull secret than the user will have to enter one before clicking on next.
the behaviour was that initially the checkbox was unchecked if there is no pull secret so it looked like nothing is wrong and the next button is disabled due to a bug.
i have fixed it now so that the the user will be able to see that the pull secret is required and it will be more informative.

before:
image

after:
image

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.

@openshift-ci openshift-ci bot requested review from jgyselov and rawagner February 9, 2026 11:42
@openshift-ci
Copy link

openshift-ci bot commented Feb 9, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ElayAharoni
Once this PR has been reviewed and has the lgtm label, please assign celdrake for approval. For more information see the Code Review Process.

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

Details Needs approval from an approver in each of these files:

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

@openshift-ci openshift-ci bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 9, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

Removes pullSecret from the form model and UI; integrates usePullSecret() to read defaultPullSecret and only include a pull secret when creating a new InfraEnv. Replaces external footer navigation with a local handleNext that submits the form.

Changes

Cohort / File(s) Summary
OptionalConfigurationsStep
libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx
Removed pullSecret from form values, validation, and UI (removed PullSecretField / PullSecretSync and edit flag). Added usePullSecret() / defaultPullSecret; set implicit edit behavior based on defaultPullSecret. On submit, include pullSecret only for InfraEnv creation (defaultPullSecret ?? ''). Replaced external onNext usage with local handleNext that triggers form submit. Adjusted imports and initialValues accordingly.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Form as OptionalConfigurationsStep (Form)
    participant Hook as usePullSecret
    participant API as InfraEnv API
    rect rgba(200,200,255,0.5)
    User->>Form: click Next / submit
    Form->>Hook: read defaultPullSecret
    alt creating InfraEnv
        Form->>API: createInfraEnv(createParams including defaultPullSecret ?? '')
    else updating existing InfraEnv
        Form->>API: updateInfraEnv(updateParams without pullSecret)
    end
    API-->>Form: response
    Form-->>User: navigate next
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

lgtm, approved, size/S

Suggested reviewers

  • rawagner
  • jgyselov

Poem

🐰 I found a secret, tucked away,
The hook brings it out for the create day.
I hop, I submit, no extra field to mend,
Create or update — the flow won't bend.
Hooray for small changes, carrots to send!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main issue fixed by the PR: the disabled Next button on the Optional configurations page. The summary confirms the PR resolves the bug by adjusting UI behavior for the pull secret field.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx`:
- Around line 140-145: The editPullSecret state is incorrectly initialized from
the async usePullSecret result (defaultPullSecret) causing it to be true on
first render; add a useEffect that watches defaultPullSecret and calls
setEditPullSecret(!defaultPullSecret) (or explicitly set false when
defaultPullSecret is truthy) to update editPullSecret after the fetch resolves;
keep the initial useState as a safe default (e.g., true or false) and ensure the
effect only runs when defaultPullSecret changes to avoid flipping user edits,
referencing editPullSecret, setEditPullSecret, usePullSecret, and
defaultPullSecret.
🧹 Nitpick comments (1)
libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx (1)

140-140: Duplicate usePullSecret() call triggers a redundant API fetch.

usePullSecret() is already invoked inside PullSecretSync (line 121). Calling it again here creates a second independent hook instance with its own state and a second network request to fetch the pull secret. Consider lifting the result from a shared source (e.g., pass it down, or use a context/shared state) rather than calling the hook twice.

@ElayAharoni
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Feb 9, 2026
@openshift-ci-robot
Copy link

@ElayAharoni: This pull request references Jira Issue OCPBUGS-76280, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @bmanzari

Details

In response to this:

/jira refresh

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.

@openshift-ci
Copy link

openshift-ci bot commented Feb 9, 2026

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: bmanzari.

Note that only openshift-assisted members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

@ElayAharoni: This pull request references Jira Issue OCPBUGS-76280, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @bmanzari

In response to this:

/jira refresh

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.

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 kubernetes-sigs/prow repository.

@ElayAharoni ElayAharoni force-pushed the Next-button-is-disabled-on-Optional-configurations-page branch from c9a1560 to 64034a3 Compare February 9, 2026 12:17
Copy link
Contributor

@jgyselov jgyselov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not just use PullSecret.tsx for this? Isn't the desired behavior basically the same?

Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@ElayAharoni ElayAharoni force-pushed the Next-button-is-disabled-on-Optional-configurations-page branch from 64034a3 to 32da038 Compare February 12, 2026 14:25
@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 12, 2026
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx`:
- Line 201: The form currently allows submitting an InfraEnv with an empty pull
secret because usePullSecret() can be undefined or '' and the current
isNextDisabled check doesn't verify defaultPullSecret; update the component to
require a truthy pull secret before enabling Next and to avoid sending an empty
string as InfraEnvCreateParams.pullSecret: change the payload assignment for
pullSecret to use defaultPullSecret only when truthy (do not default to ''), and
update the isNextDisabled logic (the check used to enable the Next button) to
include a `!defaultPullSecret` check (or `!Boolean(defaultPullSecret)`) so Next
remains disabled until usePullSecret() resolves to a non-empty value.
🧹 Nitpick comments (3)
libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx (3)

68-68: Remove commented-out code.

Dead commented-out line // pullSecret, should be removed to keep the codebase clean.

Proposed fix
   return {
-    // pullSecret,
     ...(values.sshPublicKey && { sshAuthorizedKey: values.sshPublicKey }),

225-229: handleNext is recreated on every render inside the render-prop.

This is minor but handleNext is defined inline in the Formik render prop without memoization. Since submitForm identity is stable from Formik, this is functionally fine, but worth noting if you see unnecessary re-renders of ClusterWizardFooter.


147-157: initialValues is recreated on every render, which can cause Formik to reset.

initialValues is declared inside the component body without memoization. If the parent re-renders, a new object reference is created each time. With enableReinitialize off (default) this is typically harmless, but wrapping it in useMemo or hoisting it outside the component is a small defensive improvement.

openshiftVersion: cluster.openshiftVersion,
cpuArchitecture: DEFAULT_CPU_ARCHITECTURE,
imageType: DISCONNECTED_IMAGE_TYPE,
pullSecret: defaultPullSecret ?? '',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Risk of creating InfraEnv with an empty pull secret.

usePullSecret() returns undefined on initial render and '' on fetch failure. Since isNextDisabled on line 239 doesn't gate on defaultPullSecret being available, a user can submit the form before the pull secret resolves (or after it fails), sending an empty string to InfraEnvCreateParams.pullSecret.

Disable "Next" until a valid pull secret is available:

Proposed fix
-                isNextDisabled={!isValid || !cluster}
+                isNextDisabled={!isValid || !cluster || !defaultPullSecret}

This also covers the error/empty-data cases from usePullSecret (which sets ''), since an empty string is falsy.

Also applies to: 239-239

🤖 Prompt for AI Agents
In
`@libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx`
at line 201, The form currently allows submitting an InfraEnv with an empty pull
secret because usePullSecret() can be undefined or '' and the current
isNextDisabled check doesn't verify defaultPullSecret; update the component to
require a truthy pull secret before enabling Next and to avoid sending an empty
string as InfraEnvCreateParams.pullSecret: change the payload assignment for
pullSecret to use defaultPullSecret only when truthy (do not default to ''), and
update the isNextDisabled logic (the check used to enable the Next button) to
include a `!defaultPullSecret` check (or `!Boolean(defaultPullSecret)`) so Next
remains disabled until usePullSecret() resolves to a non-empty value.

@ElayAharoni ElayAharoni requested a review from jgyselov February 12, 2026 15:18
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx (3)

48-67: ⚠️ Potential issue | 🟡 Minor

Leftover pullSecret in DEFAULT_INITIAL_VALUES not in type.

pullSecret was removed from OptionalConfigurationsFormValues (lines 48–54) but still appears on line 58. This is either a TypeScript error (excess property on an object literal) or dead code. Same issue in infraEnvToFormValues on line 78.

Proposed fix
 const DEFAULT_INITIAL_VALUES: OptionalConfigurationsFormValues = {
   sshPublicKey: '',
-  pullSecret: '',
   enableProxy: false,
   httpProxy: '',
   httpsProxy: '',

And in infraEnvToFormValues:

 const infraEnvToFormValues = (
   infraEnv: InfraEnv,
-  storedPullSecret?: string,
 ): OptionalConfigurationsFormValues => ({
   ...DEFAULT_INITIAL_VALUES,
   sshPublicKey: infraEnv.sshAuthorizedKey ?? '',
-  pullSecret: storedPullSecret ?? '',
   enableProxy: !!(infraEnv.proxy?.httpProxy || infraEnv.proxy?.httpsProxy),

233-236: ⚠️ Potential issue | 🟠 Major

values.pullSecret is undefined — type no longer includes pullSecret.

Since pullSecret was removed from OptionalConfigurationsFormValues, values.pullSecret is always undefined. This silently sets the wizard context's pull secret to undefined on both the update path (line 233) and the create path (line 254), which may break downstream consumers expecting a string.

If the pull secret is no longer managed through the form, these calls should use defaultPullSecret (or be removed if no longer needed).

Proposed fix
-            setDisconnectedFormPullSecret(values.pullSecret);
+            setDisconnectedFormPullSecret(defaultPullSecret ?? '');

Apply the same change on line 254.


72-90: ⚠️ Potential issue | 🟡 Minor

Remove unused infraEnvToFormValues function.

The function is never called anywhere in the codebase. Its JSDoc indicates it was intended to rehydrate form values from an existing infraEnv, but the form currently always initializes from DEFAULT_INITIAL_VALUES, meaning any edits on back-navigation would be lost. Either remove this dead code or restore the call to rehydrate form state.

🤖 Fix all issues with AI agents
In
`@libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx`:
- Around line 192-202: The form's initialValues in
OptionalConfigurationsStep.tsx are hardcoded, causing user inputs to be lost
when revisiting; replace the static initialValues with values derived from
disconnectedInfraEnv (using the existing infraEnvToFormValues helper or
equivalent) and/or compute initialValues from disconnectedInfraEnv before
passing to Formik, and enable Formik's enableReinitialize so the form rehydrates
when disconnectedInfraEnv changes; update references to
OptionalConfigurationsFormValues and ensure hostsNetworkConfigurationType and
other fields are populated from infraEnvToFormValues/disconnectedInfraEnv rather
than empty defaults.
🧹 Nitpick comments (1)
libs/ui-lib/lib/ocm/components/clusterWizard/disconnected/OptionalConfigurationsStep.tsx (1)

104-106: Remove commented-out code.

Line 105 has a leftover // pullSecret, comment. Clean it up.

@openshift-ci
Copy link

openshift-ci bot commented Feb 12, 2026

@ElayAharoni: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 93097d0 link true /test images
ci/prow/okd-scos-images 93097d0 link true /test okd-scos-images
ci/prow/lint 93097d0 link true /test lint

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link

@ElayAharoni: This pull request references Jira Issue OCPBUGS-76280. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

https://issues.redhat.com/browse/OCPBUGS-76280

the next button is disabled on purpose because although the step is called optional configurations, the pull secret fields is required.
so therefore if there is no actual pull secret than the user will have to enter one before clicking on next.
the behaviour was that initially the checkbox was unchecked if there is no pull secret so it looked like nothing is wrong and the next button is disabled due to a bug.
i have fixed it now so that the the user will be able to see that the pull secret is required and it will be more informative.

before:
image

after:
image

Summary by CodeRabbit

  • Bug Fixes

  • The wizard’s Next action now triggers form validation and submission before advancing, preventing navigation without saving changes.

  • Improvements

  • Pull secret editing has been removed from the optional configurations step for existing infra environments.

  • When creating a new infra environment, the default pull secret is automatically applied (not editable in that step), simplifying the UI and submission flow.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants