Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

OSAC-2493: add --set CLI flag and enforce field_definitions on template_parameters - #953

Merged
openshift-merge-bot[bot] merged 9 commits into
osac-project:mainfrom
alosadagrande:feat/OSAC-2493-set-flag
Jul 29, 2026
Merged

openshift-merge-bot[bot] merged 9 commits into
osac-project:mainfrom
alosadagrande:feat/OSAC-2493-set-flag

Conversation

@alosadagrande

@alosadagrande alosadagrande commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Enforce field_definitions on template_parameters: template_parameters is no longer implicitly allowed. When a resource is created from a catalog item, every template_parameters.<name> path must be listed in field_definitions — just like typed spec fields. This gives admins explicit control over which template parameters users can set.
  • Add --set KEY=VALUE flag to osac create cluster, osac create computeinstance, and osac create baremetalinstance. Works like helm --set: type inference (bool, int, float, string), protobuf Any wrapping for template_parameters.* paths, nested dot-notation for spec fields. Only supported with --catalog-item.
  • Server-side helpers: wrapValueAsAny / unwrapAnyValue for converting between Go values and protobuf Any JSON format when applying defaults from field_definitions.

Breaking change

Existing catalog items that reference template_parameters without listing them in field_definitions will now reject resource creation. Admins must add template_parameters.<name> paths (with editable: true or a locked default) to their catalog item's field_definitions. See docs/CATALOG_ITEMS.md for the updated field_definitions rules and examples.

Jira

OSAC-2493

Test plan

  • Unit tests pass (86 suites, all green)
  • gofmt clean
  • Build passes (go build ./...)
  • Updated 4 existing bare metal tests to match new validation behavior
  • 29 dedicated catalog_item_validation_test.go tests covering field_definitions + template_parameters scenarios
  • 23 fieldutil_test.go tests covering --set parsing, type inference, and proto round-trip

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added repeatable --set KEY=VALUE overrides for catalog-item-based cluster and compute instance creation (dot notation, including template_parameters.*); --set is only allowed with --catalog-item.
    • Added repeatable --set support for bare metal instance spec fields and template parameters.
  • Documentation
    • Updated catalog-item docs with expanded field_definitions/template_parameters behavior, refreshed available-path tables, and updated CLI examples/outcomes.
  • Bug Fixes
    • Improved server validation/defaulting for template_parameters.*, including typed handling and correct rejection/acceptance for editable vs non-editable parameters.
  • Tests
    • Added/expanded automated coverage for --set application and template-parameter validation.

@openshift-ci-robot

openshift-ci-robot commented Jul 23, 2026 •

Copy link
Copy Markdown

@alosadagrande: This pull request references OSAC-2493 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 "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Enforce field_definitions on template_parameters: template_parameters is no longer implicitly allowed. When a resource is created from a catalog item, every template_parameters.<name> path must be listed in field_definitions — just like typed spec fields. This gives admins explicit control over which template parameters users can set.
  • Add --set KEY=VALUE flag to osac create cluster, osac create computeinstance, and osac create baremetalinstance. Works like helm --set: type inference (bool, int, float, string), protobuf Any wrapping for template_parameters.* paths, nested dot-notation for spec fields. Only supported with --catalog-item.
  • Server-side helpers: wrapValueAsAny / unwrapAnyValue for converting between Go values and protobuf Any JSON format when applying defaults from field_definitions.

Breaking change

Existing catalog items that reference template_parameters without listing them in field_definitions will now reject resource creation. Admins must add template_parameters.<name> paths (with editable: true or a locked default) to their catalog item's field_definitions. See docs/CATALOG_ITEMS.md for the updated field_definitions rules and examples.

Jira

OSAC-2493

Test plan

  • Unit tests pass (86 suites, all green)
  • gofmt clean
  • Build passes (go build ./...)
  • Updated 4 existing bare metal tests to match new validation behavior
  • 29 dedicated catalog_item_validation_test.go tests covering field_definitions + template_parameters scenarios
  • 23 fieldutil_test.go tests covering --set parsing, type inference, and proto round-trip

🤖 Generated with Claude Code

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 Jul 23, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@alosadagrande, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d5395fbf-cbc9-40fc-8479-493debf4bac1

📥 Commits

Reviewing files that changed from the base of the PR and between 7b6ce85 and 506b4fb.

📒 Files selected for processing (3)
  • internal/cmd/cli/create/fieldutil/fieldutil.go
  • internal/maputil/maputil.go
  • internal/servers/catalog_item_validation.go

Walkthrough

The change adds repeatable --set overrides to resource creation commands, introduces proto field and template-parameter handling, tightens catalog item validation and defaulting, expands tests, and documents template parameter configuration and overrides.

Changes

Catalog template parameter support

Layer / File(s) Summary
Field override utility
internal/cmd/cli/create/fieldutil/*
Adds ApplyFields for dotted specification fields and template_parameters.*, including scalar inference, protobuf Any encoding, parsing errors, and tests.
CLI catalog-item overrides
internal/cmd/cli/create/baremetalinstance/..., internal/cmd/cli/create/cluster/..., internal/cmd/cli/create/computeinstance/...
Adds repeatable --set flags, applies overrides to generated specifications, and rejects the flag without --catalog-item where required.
Template parameter validation and defaults
internal/servers/catalog_item_validation.go, internal/servers/catalog_item_validation_test.go, internal/servers/private_baremetal_instances_server_test.go
Requires listed template parameter paths, validates unwrapped values against schemas, applies Any-wrapped defaults, and tests editable, locked, required, typed, and unlisted cases.
Catalog item documentation
docs/CATALOG_ITEMS.md
Documents template parameter field definitions, expanded cluster examples, available paths, --set usage, and rejection of non-editable overrides.

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

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant CatalogItem
  participant ApplyFields
  participant CatalogValidation
  participant ResourceAPI
  CLI->>CatalogItem: request creation with --catalog-item
  CatalogItem-->>CLI: generated specification
  CLI->>ApplyFields: apply repeatable --set overrides
  ApplyFields-->>CLI: updated specification
  CLI->>CatalogValidation: submit catalog-derived values
  CatalogValidation-->>ResourceAPI: validated resource request
Loading

Possibly related PRs

Suggested labels: ok-to-test

Suggested reviewers: sk-ilya, ygalblum, rgolangh

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: adding the --set CLI flag and enforcing field_definitions for template_parameters.
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 No hardcoded secrets found; only placeholder test values/public SSH keys and docs examples, with no private keys, tokens, or embedded credentials in the diff.
No-Weak-Crypto ✅ Passed Scanned the PR-touched Go files; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB use, custom crypto, or secret/token comparisons were introduced.
No-Injection-Vectors ✅ Passed No flagged injection patterns were added; the PR only parses --set inputs and applies them via proto/JSON, with no exec/eval/YAML/SQL/shell sinks.
Container-Privileges ✅ Passed Scanned all changed YAML/workflow files and touched service commands; no privileged, hostPID/network/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings were added.
No-Sensitive-Data-In-Logs ✅ Passed New --set and validation code adds no logging; the only logger.DebugContext calls are pre-existing template-parse debug logs, not introduced by this PR.
Ai-Attribution ✅ Passed AI use is disclosed and the PR commits carry Red Hat Assisted-by: trailers; no Co-Authored-By: AI attribution was found.
✨ 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.

@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

Caution

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

⚠️ Outside diff range comments (1)
internal/servers/catalog_item_validation.go (1)

90-97: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Enforce per-parameter field definitions. Empty definitions and a parent template_parameters definition can still authorize arbitrary parameter keys.

  • internal/servers/catalog_item_validation.go#L90-L97: reject template parameters unless each key has an exact template_parameters.<name> definition; do not let the parent map cover descendants.
  • internal/servers/catalog_item_validation_test.go#L411-L447: add empty-definition and parent-definition rejection coverage.
🤖 Prompt for 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.

In `@internal/servers/catalog_item_validation.go` around lines 90 - 97, Update the
allowed-path construction in catalog item validation so template parameter keys
are authorized only by exact template_parameters.<name> field definitions, never
by an empty definition or the parent template_parameters definition; add
rejection coverage for both cases in
internal/servers/catalog_item_validation_test.go:411-447.
🤖 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 `@docs/CATALOG_ITEMS.md`:
- Around line 317-324: Update the --set documentation to remove the
Helm-compatible parsing claim and describe the actual supported format: each
occurrence accepts one KEY=VALUE pair, split at the first equals sign. Keep the
existing template parameter examples and command usage unchanged.

In `@internal/cmd/cli/create/fieldutil/fieldutil.go`:
- Around line 95-97: Preserve exact CLI integer overrides in the field parsing
logic by returning the parsed integer or a string-backed json.Number instead of
converting it through strconv.ParseFloat. Update the affected expectation in
internal/cmd/cli/create/fieldutil/fieldutil_test.go:53-57 and add a regression
covering 9007199254740993; the production change belongs in
internal/cmd/cli/create/fieldutil/fieldutil.go:95-97.

---

Outside diff comments:
In `@internal/servers/catalog_item_validation.go`:
- Around line 90-97: Update the allowed-path construction in catalog item
validation so template parameter keys are authorized only by exact
template_parameters.<name> field definitions, never by an empty definition or
the parent template_parameters definition; add rejection coverage for both cases
in internal/servers/catalog_item_validation_test.go:411-447.
🪄 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: 45092268-9433-4ac4-bc08-2328e92e3f70

📥 Commits

Reviewing files that changed from the base of the PR and between 1364fc2 and 1cb6c4d.

📒 Files selected for processing (10)
  • docs/CATALOG_ITEMS.md
  • internal/cmd/cli/create/baremetalinstance/create_bare_metal_instance_cmd.go
  • internal/cmd/cli/create/cluster/create_cluster_cmd.go
  • internal/cmd/cli/create/computeinstance/create_compute_instance_cmd.go
  • internal/cmd/cli/create/fieldutil/fieldutil.go
  • internal/cmd/cli/create/fieldutil/fieldutil_suite_test.go
  • internal/cmd/cli/create/fieldutil/fieldutil_test.go
  • internal/servers/catalog_item_validation.go
  • internal/servers/catalog_item_validation_test.go
  • internal/servers/private_baremetal_instances_server_test.go

Comment thread docs/CATALOG_ITEMS.md
Comment thread internal/cmd/cli/create/fieldutil/fieldutil.go Outdated

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

Caution

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

⚠️ Outside diff range comments (1)
internal/cmd/cli/create/fieldutil/fieldutil.go (1)

67-69: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve the original spec when applying fields fails.

proto.Reset(spec) runs before protojson.Unmarshal(updatedJSON, spec), so an invalid JSON generated by --set can return an error after clearing the caller’s message. Unmarshal into a reset temporary message first, then replace spec only on success.

🤖 Prompt for 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.

In `@internal/cmd/cli/create/fieldutil/fieldutil.go` around lines 67 - 69, Update
the field-application flow around protojson.Unmarshal to unmarshal updatedJSON
into a reset temporary message first, preserving the original spec when
unmarshalling fails. Replace the caller’s spec only after successful
unmarshalling, while retaining the existing error wrapping.
🤖 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.

Outside diff comments:
In `@internal/cmd/cli/create/fieldutil/fieldutil.go`:
- Around line 67-69: Update the field-application flow around
protojson.Unmarshal to unmarshal updatedJSON into a reset temporary message
first, preserving the original spec when unmarshalling fails. Replace the
caller’s spec only after successful unmarshalling, while retaining the existing
error wrapping.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b0fd62ac-2198-4d39-8268-fa9186e050ca

📥 Commits

Reviewing files that changed from the base of the PR and between 1cb6c4d and 28e9937.

📒 Files selected for processing (3)
  • docs/CATALOG_ITEMS.md
  • internal/cmd/cli/create/fieldutil/fieldutil.go
  • internal/cmd/cli/create/fieldutil/fieldutil_test.go

@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 `@internal/cmd/cli/create/fieldutil/fieldutil.go`:
- Around line 98-100: The float inference logic in inferValue and inferAnyType
must recognize exponent-form values such as 1e3, 1E3, and -2E-4 as doubles;
apply the decimal-point count restriction only to non-exponent forms. Update
fieldutil.go at lines 98-100 and 111-113, and add exponent-form coverage to
fieldutil_test.go at line 57 for both inferValue and inferAnyType.

In `@internal/servers/catalog_item_validation.go`:
- Around line 91-92: The applyFieldDefinitions logic in
internal/servers/catalog_item_validation.go at lines 91-92 must enforce the
template-parameter allowlist even when field_definitions is empty, while
retaining only catalog_item and template as implicitly allowed; update the
early-return flow accordingly. Add coverage in
internal/servers/catalog_item_validation_test.go at lines 411-447 verifying that
an empty field_definitions list rejects template_parameters.vpc_id.
🪄 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: 284e0905-ca44-4690-8f2d-237755c72f00

📥 Commits

Reviewing files that changed from the base of the PR and between 28e9937 and 92dbebe.

📒 Files selected for processing (10)
  • docs/CATALOG_ITEMS.md
  • internal/cmd/cli/create/baremetalinstance/create_bare_metal_instance_cmd.go
  • internal/cmd/cli/create/cluster/create_cluster_cmd.go
  • internal/cmd/cli/create/computeinstance/create_compute_instance_cmd.go
  • internal/cmd/cli/create/fieldutil/fieldutil.go
  • internal/cmd/cli/create/fieldutil/fieldutil_suite_test.go
  • internal/cmd/cli/create/fieldutil/fieldutil_test.go
  • internal/servers/catalog_item_validation.go
  • internal/servers/catalog_item_validation_test.go
  • internal/servers/private_baremetal_instances_server_test.go

Comment thread internal/cmd/cli/create/fieldutil/fieldutil.go
Comment thread internal/servers/catalog_item_validation.go
@alosadagrande

Copy link
Copy Markdown
Contributor Author

/retest

@github-actions

Copy link
Copy Markdown

Re-triggered failed runs:

  • E2E BMaaS Full Install (#30075920903)

@tzvatot tzvatot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall the PR is well-structured - the CLI --set flag design, protobuf Any wrapping, and server-side validation tightening all look solid. One UX issue with error messages when template parameters are rejected.

Category Count
🔴 Critical 0
🟡 Important 1
💡 Suggestion 0

Comment thread internal/servers/catalog_item_validation.go
Remove template_parameters from the allowedPaths bypass in
applyFieldDefinitions. Template parameters must now be listed
in field_definitions to be accepted, giving admins control over
which Ansible extra variables tenants can set.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Alberto Losada Grande <alosadag@redhat.com>
Add a --set KEY=VALUE flag to cluster, compute-instance, and
bare-metal-instance create commands. The flag allows users to set
spec fields and template parameters when creating resources from
catalog items. Parsing follows the same approach as helm --set:
split on the first '=' only, preserving values that contain '='.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Alberto Losada Grande <alosadag@redhat.com>
Signed-off-by: Alberto Losada Grande <alosadag@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Simplify inferValue logic in fieldutil for readability without changing
behavior. Fix typo in CATALOG_ITEMS.md. Update 4 bare metal tests to
include template_parameters in field_definitions, adapting them to the
new validation behavior.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Alberto Losada Grande <alosadag@redhat.com>
Return int64 directly from inferValue instead of converting to float64,
preserving precision for large integers. Remove misleading Helm parsing
claim from docs. Add regression test for int64 precision.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Alberto Losada Grande <alosadag@redhat.com>
…aths

Stop recursing into protobuf Any wrapper keys (@type, value) when
collecting leaf paths for field_definitions validation. This produces
user-friendly error messages like "template_parameters.vpc_id" instead
of leaking internal encoding details.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Alberto Losada Grande <alosadag@redhat.com>

@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

Caution

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

⚠️ Outside diff range comments (1)
internal/servers/catalog_item_validation.go (1)

90-97: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Reject the parent template-parameter path.

validateFieldDefinitions currently allows template_parameters alone, and isPathCovered then permits every template_parameters.* value. Reject the bare template_parameters path unless the allowed template parameters are explicitly enumerated below it.

🤖 Prompt for 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.

In `@internal/servers/catalog_item_validation.go` around lines 90 - 97, Update
validateFieldDefinitions and its allowedPaths setup to exclude the bare
template_parameters path, while still permitting explicitly enumerated
template_parameters.* paths. Ensure isPathCovered cannot treat
template_parameters alone as covering every descendant value.

Source: Path instructions

🤖 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 `@internal/servers/catalog_item_validation.go`:
- Line 67: Qualify the comment near applyFieldDefinitions in
internal/servers/catalog_item_validation.go to state that unknown spec fields
are rejected only when field_definitions is non-empty. Update
docs/CATALOG_ITEMS.md sections covering omitted template parameters and required
parameters to document that an absent or empty field_definitions list preserves
unrestricted template-parameter access subject to template-level validation, so
required parameters need listing only when definitions are provided.
- Around line 201-224: Update wrapValueAsAny and its callers to derive the
generated protobuf wrapper type from each template parameter’s declared type
instead of inferring all numeric values as Int64Value or DoubleValue. Preserve
the corresponding value representation for Int32Value, FloatValue, UInt64Value,
and other supported wrappers, and add coverage in
internal/servers/catalog_item_validation_test.go:205-225 for these non-Int64
numeric types; apply the root fix in
internal/servers/catalog_item_validation.go:201-224.

---

Outside diff comments:
In `@internal/servers/catalog_item_validation.go`:
- Around line 90-97: Update validateFieldDefinitions and its allowedPaths setup
to exclude the bare template_parameters path, while still permitting explicitly
enumerated template_parameters.* paths. Ensure isPathCovered cannot treat
template_parameters alone as covering every descendant value.
🪄 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: 1e8c648c-0a47-473b-a2fe-4d629c9859c6

📥 Commits

Reviewing files that changed from the base of the PR and between 92dbebe and 7b6ce85.

📒 Files selected for processing (10)
  • docs/CATALOG_ITEMS.md
  • internal/cmd/cli/create/baremetalinstance/create_bare_metal_instance_cmd.go
  • internal/cmd/cli/create/cluster/create_cluster_cmd.go
  • internal/cmd/cli/create/computeinstance/create_compute_instance_cmd.go
  • internal/cmd/cli/create/fieldutil/fieldutil.go
  • internal/cmd/cli/create/fieldutil/fieldutil_suite_test.go
  • internal/cmd/cli/create/fieldutil/fieldutil_test.go
  • internal/servers/catalog_item_validation.go
  • internal/servers/catalog_item_validation_test.go
  • internal/servers/private_baremetal_instances_server_test.go

Comment thread internal/servers/catalog_item_validation.go
Comment thread internal/servers/catalog_item_validation.go

@tzvatot tzvatot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review

Previous finding (protobuf Any internals in error message): FIXED - collectLeafPaths now treats template_parameters entries as opaque leaves.

Category Count
🔴 Critical 0
🟡 Important 1
💡 Suggestion 1

💡 wrapValueAsAny and inferAnyType duplicate type-mapping logic - Both map values to protobuf Any @type URLs with hardcoded strings in catalog_item_validation.go and fieldutil.go respectively. Different input types (any vs string) make full consolidation non-trivial, but shared constants for the type URLs would reduce coupling.

Comment thread internal/cmd/cli/create/fieldutil/fieldutil.go Outdated
Move duplicated map traversal helpers into a shared package to avoid
divergence between the CLI (fieldutil) and server (catalog_item_validation)
copies.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Alberto Losada Grande <alosadag@redhat.com>
@tzvatot

tzvatot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm label Jul 29, 2026
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alosadagrande, tzvatot

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-merge-bot
openshift-merge-bot Bot merged commit 7b63749 into osac-project:main Jul 29, 2026
17 checks passed

This branch was previously deployed

1 inactive deployment
e2e-test — 506b4fbf Deployed Jul 28, 2026 by alosadagrande via e2e-vmaas-full-install / e2e #770
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants