NO-ISSUE: catalog-items-ui: node_sets are template-driven, not freely composed - #167
Conversation
fulfillment-service's PrivateClustersServer.validateNodeSets (internal/ servers/private_clusters_server.go) rejects any node_sets entry whose map key isn't a key on the associated ClusterTemplate, or whose host type doesn't match the template's value for that key. This design previously had the map key "auto-derived from the host type" and had NodeSetsFieldEditor reuse the tenant wizard's freely add/remove ClusterNodeSetsArrayField — neither holds once that backend validation is in effect. Revises the NodeSetsFieldEditor section to match what OSAC-2936 (PR osac-project#102) actually implements: the editor takes the selected ClusterTemplate as a prop and renders one fixed row per template node-set key, host type shown read-only, only size admin-editable. Removes the "Allow add/remove" toggle (no longer a real capability once node sets can't be added or removed) and updates the Formik state shape, payload example, Yup validation, and test plan accordingly. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Elay Aharoni <elayaha@gmail.com>
WalkthroughThe catalog item UI design now defines ChangesCatalog node set editor
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 `@enhancements/catalog-items/ui-design.md`:
- Around line 510-516: Update the NodeSetsFieldEditor example to pass the
selected ClusterTemplate through its required template prop instead of rendering
<NodeSetsFieldEditor /> without arguments. Use the example’s existing
selected-template value so the editor can render the template’s fixed node-set
rows.
- Around line 556-573: Update the dynamically generated nodeSetsSchema
validation so each size value must be a positive integer, not a fractional
number. Pass the selected template’s sizeMin and sizeMax into the schema and
enforce those configured bounds for every key, then add component tests covering
fractional values and below/above-bound values.
🪄 Autofix (Beta)
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: ASSERTIVE
Plan: Pro Plus
Run ID: fa988f56-04a3-4983-8290-25e150233701
📒 Files selected for processing (1)
enhancements/catalog-items/ui-design.md
|
@ElayAharoni: This pull request explicitly references no jira issue. DetailsIn response to this:
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. |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: batzionb, ElayAharoni The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary
PrivateClustersServer.validateNodeSets(internal/servers/private_clusters_server.go) rejects anynode_setsentry whose map key isn't a key on the associatedClusterTemplate, or whose host type doesn't match the template's value for that key.enhancements/catalog-items/ui-design.md, the design doc for OSAC-2936 / OSAC-2936: add catalog item create wizard for Cluster, VM, and Bare Metal osac-ui#102) previously had the map key "auto-derived from the host type" and hadNodeSetsFieldEditorreuse the tenant wizard's freely add/removeClusterNodeSetsArrayField— neither holds once that backend validation is accounted for.NodeSetsFieldEditorsection to match what PR OSAC-2402: add AGENTS.md for AI agent onboarding #102 actually implements: the editor takes the selectedClusterTemplateas a prop and renders one fixed row per template node-set key, host type shown read-only, only size admin-editable. Removes the "Allow add/remove" toggle (no longer a real capability) and updates the Formik state shape, payload example, Yup validation, and test plan.Context
Surfaced from a review comment on osac-project/osac-ui#102 (batzionb) and confirmed against fulfillment-service's current validation logic. Companion doc update for the tenant-facing wizard (OSAC-1421) is in #166.
Assisted-by: Claude Code noreply@anthropic.com
Summary by CodeRabbit