Skip to content

OCPBUGS-79542: populate default values in local ui from infraEnv#3502

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
ElayAharoni:values-not-populated-from-SaaS-to-local-OVE-UI
Mar 25, 2026
Merged

OCPBUGS-79542: populate default values in local ui from infraEnv#3502
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
ElayAharoni:values-not-populated-from-SaaS-to-local-OVE-UI

Conversation

@ElayAharoni
Copy link
Copy Markdown
Collaborator

@ElayAharoni ElayAharoni commented Mar 25, 2026

https://redhat.atlassian.net/browse/OCPBUGS-79542

Summary by CodeRabbit

  • New Features

    • Enhanced NTP (Network Time Protocol) source configuration in the cluster wizard. The system now intelligently selects between cluster-level and infrastructure environment NTP sources when creating or updating clusters.
  • also changes the way we pass the infraEnv to the wizard in the local disconnected UI, so all other fields could be populated from the infraEnv.

Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 25, 2026

@ElayAharoni: This pull request references AGENT-1463 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1463

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 batzionb and jgyselov March 25, 2026 14:14
@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

The PR extends the cluster details workflow to fetch and propagate infrastructure environment data through the wizard and service layers, enabling the ClusterDetailsService to populate NTP source parameters from infrastructure environment or cluster data during cluster creation and update operations.

Changes

Cohort / File(s) Summary
Wizard & Form Components
libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx, libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx
Updated NewClusterWizard to derive clusterId from route and fetch infraEnv; enhanced ClusterDetailsForm's handleSubmit to pass cluster and infraEnv to service methods; both now propagate infraEnv through the cluster details flow.
Service Layer
libs/ui-lib/lib/ocm/services/ClusterDetailsService.ts
Added ntpSourceForCluster() helper to select NTP source from cluster or infraEnv; extended getClusterCreateParams() and getClusterUpdateParams() to accept optional infraEnv/cluster parameters and conditionally set additionalNtpSource in returned params.
Type Definitions
libs/ui-lib/lib/ocm/services/types.ts
Expanded ClusterDetailsUpdateParams type to include additionalNtpSource field alongside existing cluster detail parameters.

Sequence Diagram

sequenceDiagram
    participant W as NewClusterWizard
    participant D as ClusterDetailsForm
    participant S as ClusterDetailsService
    participant API as Backend
    
    W->>W: Extract clusterId from route
    W->>W: Fetch infraEnv via useInfraEnv(clusterId)
    W->>D: Pass infraEnv to ClusterDetails step
    
    D->>D: User submits form (create or update)
    
    alt Create Path
        D->>S: getClusterCreateParams(values, infraEnv)
        S->>S: ntpSourceForCluster(undefined, infraEnv)
        S-->>D: Return params with additionalNtpSource
    else Update Path
        D->>S: getClusterUpdateParams(values, platform, cluster, infraEnv)
        S->>S: ntpSourceForCluster(cluster, infraEnv)
        S-->>D: Return params with additionalNtpSource
    end
    
    D->>API: Send cluster update/create request
    API-->>D: Cluster updated/created
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested labels

lgtm, approved, size/M

Suggested reviewers

  • jgyselov
  • LiorSoffer
  • rawagner

Poem

🐰 A wizard hops through clustered dreams,
Fetching infraEnv, or so it seems,
NTP sources trimmed with care,
Propagated through the builder's lair,
Where service layers dance and gleam! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly summarizes the main change: populating default values in the local UI from infraEnv, which is exactly what the changeset implements across multiple components and services.

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

✨ 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 and usage tips.

@ElayAharoni ElayAharoni requested review from rawagner and removed request for batzionb and jgyselov March 25, 2026 14:15
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 25, 2026

@ElayAharoni: This pull request references AGENT-1463 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1463

Summary by CodeRabbit

  • New Features
  • Enhanced NTP (Network Time Protocol) source configuration in the cluster wizard. The system now intelligently selects between cluster-level and infrastructure environment NTP sources when creating or updating clusters.

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.

Copy link
Copy Markdown

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

🧹 Nitpick comments (1)
libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx (1)

35-36: Replace hard type assertion with optional typing and guard clause.

The route definition includes both path="~new" (without :clusterId) and path=":clusterId" in Routes.tsx. When the component is mounted via the ~new route, useParams() will return clusterId as undefined, but the hard cast suppresses this at the type level. While the downstream useInfraEnv hook will detect the missing clusterId in InfraEnvIdsCacheService.getInfraEnvId() and return an error, the unsafe cast creates unnecessary coupling to internal error handling.

Change:

const { clusterId } = useParams() as { clusterId: string };

to:

const { clusterId } = useParams() as { clusterId?: string };
// Add guard: if (!clusterId) return <ErrorUI />; or similar

This makes the constraint explicit and ensures the component only renders when clusterId is actually present.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx` around
lines 35 - 36, Replace the unsafe hard-cast of useParams so clusterId is
optional and add an explicit guard before calling useInfraEnv: change the typing
from useParams() as { clusterId: string } to useParams() as { clusterId?: string
} and add a check like if (!clusterId) return an error/placeholder UI (e.g.,
<ErrorUI /> or null) at the top of NewClusterWizard so you only call
useInfraEnv(clusterId, CpuArchitecture.USE_DAY1_ARCHITECTURE) when clusterId is
present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx`:
- Around line 35-36: Replace the unsafe hard-cast of useParams so clusterId is
optional and add an explicit guard before calling useInfraEnv: change the typing
from useParams() as { clusterId: string } to useParams() as { clusterId?: string
} and add a check like if (!clusterId) return an error/placeholder UI (e.g.,
<ErrorUI /> or null) at the top of NewClusterWizard so you only call
useInfraEnv(clusterId, CpuArchitecture.USE_DAY1_ARCHITECTURE) when clusterId is
present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 219d11b4-7e68-4a21-9ad3-9d34a0cb34a6

📥 Commits

Reviewing files that changed from the base of the PR and between 854cbf1 and 03b6151.

📒 Files selected for processing (4)
  • libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx
  • libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx
  • libs/ui-lib/lib/ocm/services/ClusterDetailsService.ts
  • libs/ui-lib/lib/ocm/services/types.ts

@pawanpinjarkar
Copy link
Copy Markdown
Contributor

/retitle OCPBUGS-79542: populate default values in local ui from infraEnv

@openshift-ci openshift-ci bot changed the title AGENT-1463: populate default values in local ui from infraEnv OCPBUGS-79542: populate default values in local ui from infraEnv Mar 25, 2026
@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Mar 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@ElayAharoni: This pull request references Jira Issue OCPBUGS-79542, 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.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1463

Summary by CodeRabbit

  • New Features
  • Enhanced NTP (Network Time Protocol) source configuration in the cluster wizard. The system now intelligently selects between cluster-level and infrastructure environment NTP sources when creating or updating clusters.

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.

@pawanpinjarkar
Copy link
Copy Markdown
Contributor

/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 Mar 25, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@pawanpinjarkar: This pull request references Jira Issue OCPBUGS-79542, which is valid. The bug has been moved to the POST state.

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 New, 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
Copy Markdown

openshift-ci bot commented Mar 25, 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:

@pawanpinjarkar: This pull request references Jira Issue OCPBUGS-79542, which is valid. The bug has been moved to the POST state.

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 New, 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
Copy link
Copy Markdown
Collaborator Author

/cherrypick release-4.21

@openshift-cherrypick-robot
Copy link
Copy Markdown
Contributor

@ElayAharoni: once the present PR merges, I will cherry-pick it on top of release-4.21 in a new PR and assign it to you.

Details

In response to this:

/cherrypick release-4.21

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.

@openshift-ci-robot
Copy link
Copy Markdown

@ElayAharoni: This pull request references Jira Issue OCPBUGS-79542, 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:

https://redhat.atlassian.net/browse/AGENT-1463

Summary by CodeRabbit

  • New Features

  • Enhanced NTP (Network Time Protocol) source configuration in the cluster wizard. The system now intelligently selects between cluster-level and infrastructure environment NTP sources when creating or updating clusters.

  • also changes the way we pass the infraEnv to the wizard in the local disconnected UI, so all other fields could be populated from the infraEnv.

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
Copy Markdown

openshift-ci bot commented Mar 25, 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-79542, 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:

https://redhat.atlassian.net/browse/AGENT-1463

Summary by CodeRabbit

  • New Features

  • Enhanced NTP (Network Time Protocol) source configuration in the cluster wizard. The system now intelligently selects between cluster-level and infrastructure environment NTP sources when creating or updating clusters.

  • also changes the way we pass the infraEnv to the wizard in the local disconnected UI, so all other fields could be populated from the infraEnv.

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.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 25, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Mar 25, 2026

[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:

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 6ca9368 into openshift-assisted:master Mar 25, 2026
14 checks passed
@openshift-ci-robot
Copy link
Copy Markdown

@ElayAharoni: Jira Issue OCPBUGS-79542: Some pull requests linked via external trackers have merged:

The following pull request, linked via external tracker, has not merged:

All associated pull requests must be merged or unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-79542 has not been moved to the MODIFIED state.

Details

In response to this:

https://redhat.atlassian.net/browse/AGENT-1463

Summary by CodeRabbit

  • New Features

  • Enhanced NTP (Network Time Protocol) source configuration in the cluster wizard. The system now intelligently selects between cluster-level and infrastructure environment NTP sources when creating or updating clusters.

  • also changes the way we pass the infraEnv to the wizard in the local disconnected UI, so all other fields could be populated from the infraEnv.

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-cherrypick-robot
Copy link
Copy Markdown
Contributor

@ElayAharoni: #3502 failed to apply on top of branch "release-4.21":

Applying: populate default values in local ui from infraEnv
Using index info to reconstruct a base tree...
M	libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx
M	libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx
M	libs/ui-lib/lib/ocm/services/ClusterDetailsService.ts
M	libs/ui-lib/lib/ocm/services/types.ts
Falling back to patching base and 3-way merge...
Auto-merging libs/ui-lib/lib/ocm/services/types.ts
Auto-merging libs/ui-lib/lib/ocm/services/ClusterDetailsService.ts
Auto-merging libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx
CONFLICT (content): Merge conflict in libs/ui-lib/lib/ocm/components/clusterWizard/NewClusterWizard.tsx
Auto-merging libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx
CONFLICT (content): Merge conflict in libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 populate default values in local ui from infraEnv

Details

In response to this:

/cherrypick release-4.21

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.

@openshift-ci-robot
Copy link
Copy Markdown

@ElayAharoni: Jira Issue OCPBUGS-79542: Some pull requests linked via external trackers have merged:

The following pull request, linked via external tracker, has not merged:

All associated pull requests must be merged or unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-79542 has not been moved to the MODIFIED state.

Details

In response to this:

https://redhat.atlassian.net/browse/OCPBUGS-79542

Summary by CodeRabbit

  • New Features

  • Enhanced NTP (Network Time Protocol) source configuration in the cluster wizard. The system now intelligently selects between cluster-level and infrastructure environment NTP sources when creating or updating clusters.

  • also changes the way we pass the infraEnv to the wizard in the local disconnected UI, so all other fields could be populated from the infraEnv.

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.

@ElayAharoni
Copy link
Copy Markdown
Collaborator Author

/jira refresh

@openshift-ci-robot
Copy link
Copy Markdown

@ElayAharoni: Jira Issue OCPBUGS-79542: Some pull requests linked via external trackers have merged:

The following pull request, linked via external tracker, has not merged:

All associated pull requests must be merged or unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-79542 has not been moved to the MODIFIED state.

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-merge-robot
Copy link
Copy Markdown

Fix included in accepted release 4.22.0-0.nightly-2026-04-03-204456

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. lgtm Indicates that a PR is ready to be merged. 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.

6 participants