Repository navigation
OSAC-58: add catalog item proto definitions, services, and database migration - #517
Conversation
|
@tzvatot: This pull request references OSAC-58 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 epic to target the "5.0.0" version, but no target version was set. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (30)
📒 Files selected for processing (13)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (10)
WalkthroughThis PR adds ClusterCatalogItem and ComputeInstanceCatalogItem protobuf messages (private and public), FieldDefinition messages, private and public gRPC+HTTP service contracts (List/Get/Create/Update/Delete/Signal with FieldMask and optimistic-lock support), database migrations creating active and archived tables plus indexes for both catalog types, extends Event.payload to include catalog item variants, and updates reflection tests for new type names. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 1
🧹 Nitpick comments (1)
internal/reflection/reflection_helper_test.go (1)
134-173: ⚡ Quick winAdd direct lookup coverage for the new catalog item types.
Great that singular/plural lists were updated. Please also add
Lookup/Descriptor(and ideallyInstance) table entries forclustercatalogitemandcomputeinstancecatalogitemso resolver regressions are caught explicitly.🤖 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/reflection/reflection_helper_test.go` around lines 134 - 173, The tests updated singular/plural lists but missed adding direct lookup coverage for the new catalog item types; add explicit entries for "clustercatalogitem" and "computeinstancecatalogitem" to the Lookup, Descriptor (and preferably Instance) test tables used by the helper in reflection_helper_test.go so resolver regressions are caught: locate the test tables/fixtures referenced by helper.Lookup/Descriptor/Instance and add rows/entries mapping the singular key to the expected descriptor/lookup values and an example instance entry for each of clustercatalogitem and computeinstancecatalogitem, mirroring the shape of existing entries (e.g., keys, expected type strings, sample IDs) to match the other object types in the file.
🤖 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 `@proto/private/osac/private/v1/cluster_catalog_items_service.proto`:
- Around line 104-105: The Signal RPC lacks a google.api.http binding so it
can't be called via the REST gateway; add a google.api.http option to the rpc
Signal(ClusterCatalogItemsSignalRequest) returns
(ClusterCatalogItemsSignalResponse) (following the same HTTP pattern used by
other methods in this service, e.g. a POST with a REST-style path like
"...:signal") and ensure google/api/annotations.proto is imported if not
already; then apply the identical change to the
ComputeInstanceCatalogItems.Signal rpc so both services expose Signal through
the REST gateway.
---
Nitpick comments:
In `@internal/reflection/reflection_helper_test.go`:
- Around line 134-173: The tests updated singular/plural lists but missed adding
direct lookup coverage for the new catalog item types; add explicit entries for
"clustercatalogitem" and "computeinstancecatalogitem" to the Lookup, Descriptor
(and preferably Instance) test tables used by the helper in
reflection_helper_test.go so resolver regressions are caught: locate the test
tables/fixtures referenced by helper.Lookup/Descriptor/Instance and add
rows/entries mapping the singular key to the expected descriptor/lookup values
and an example instance entry for each of clustercatalogitem and
computeinstancecatalogitem, mirroring the shape of existing entries (e.g., keys,
expected type strings, sample IDs) to match the other object types in the file.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7b100e2a-c906-40d3-9c8d-1b3d82951160
⛔ Files ignored due to path filters (26)
internal/api/osac/private/v1/cluster_catalog_item_type.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/cluster_catalog_item_type_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/cluster_catalog_items_service.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/cluster_catalog_items_service.pb.gw.gois excluded by!**/*.pb.gw.gointernal/api/osac/private/v1/cluster_catalog_items_service_grpc.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/cluster_catalog_items_service_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/compute_instance_catalog_item_type.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/compute_instance_catalog_item_type_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/compute_instance_catalog_items_service.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/compute_instance_catalog_items_service.pb.gw.gois excluded by!**/*.pb.gw.gointernal/api/osac/private/v1/compute_instance_catalog_items_service_grpc.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/compute_instance_catalog_items_service_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/event_type.pb.gois excluded by!**/*.pb.gointernal/api/osac/private/v1/event_type_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/cluster_catalog_item_type.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/cluster_catalog_item_type_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/cluster_catalog_items_service.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/cluster_catalog_items_service.pb.gw.gois excluded by!**/*.pb.gw.gointernal/api/osac/public/v1/cluster_catalog_items_service_grpc.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/cluster_catalog_items_service_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/compute_instance_catalog_item_type.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/compute_instance_catalog_item_type_protoopaque.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/compute_instance_catalog_items_service.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/compute_instance_catalog_items_service.pb.gw.gois excluded by!**/*.pb.gw.gointernal/api/osac/public/v1/compute_instance_catalog_items_service_grpc.pb.gois excluded by!**/*.pb.gointernal/api/osac/public/v1/compute_instance_catalog_items_service_protoopaque.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (11)
internal/database/migrations/37_create_catalog_items_tables.up.sqlinternal/reflection/reflection_helper_test.goproto/private/osac/private/v1/cluster_catalog_item_type.protoproto/private/osac/private/v1/cluster_catalog_items_service.protoproto/private/osac/private/v1/compute_instance_catalog_item_type.protoproto/private/osac/private/v1/compute_instance_catalog_items_service.protoproto/private/osac/private/v1/event_type.protoproto/public/osac/public/v1/cluster_catalog_item_type.protoproto/public/osac/public/v1/cluster_catalog_items_service.protoproto/public/osac/public/v1/compute_instance_catalog_item_type.protoproto/public/osac/public/v1/compute_instance_catalog_items_service.proto
adriengentil
left a comment
There was a problem hiding this comment.
My 2 comments are based on the assumption that private API is only available to Cloud Admin: https://redhat-internal.slack.com/archives/C08ESMFV85Q/p1778504241959329. Let's clarify before merging.
|
/hold |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adriengentil, jhernand, tzvatot 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 |
|
/unhold |
|
/retest |
…igration Add ClusterCatalogItem and ComputeInstanceCatalogItem resource types with FieldDefinition message for controlling user-settable fields via JSON Schema. Includes private (full CRUD) and public service definitions, event type registration, SQL migration for 4 tables, and generated Go code. Generated with [Claude Code](https://claude.com/claude-code)
- Extract FieldDefinition into its own field_definition_type.proto (private + public) to avoid cross-type coupling - Restrict public services to List+Get only (read-only per design) - Add order field to private ListRequest messages for consistency - Add version column to all 4 catalog items tables matching post-migration-25 pattern Generated with [Claude Code](https://claude.com/claude-code)
Private API is CSP-only — Tenant Admins use the public API for CRUD on tenant-scoped catalog items. Confirmed by Juan (EP author) and Adrien. The previous restriction to List+Get was incorrect. Generated with [Claude Code](https://claude.com/claude-code)
The tenant field is internal — managed by the server, not exposed through the public API. Server auto-sets it from caller identity on Tenant Admin creates and strips it from responses. Per EP PR osac-project#41. Generated with [Claude Code](https://claude.com/claude-code)
e36cc2c to
3750452
Compare
|
New changes are detected. LGTM label has been removed. |
|
/retest |
|
@tzvatot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Summary
ClusterCatalogItemandComputeInstanceCatalogItemproto message types withFieldDefinitionfor controlling user-settable fields via JSON SchemaEvent.payloadoneof fields 22, 23)cluster_catalog_items,archived_cluster_catalog_items,compute_instance_catalog_items,archived_compute_instance_catalog_items) with standard indexesbuf generateJIRA: OSAC-58 / OSAC-701
Validations
buf lint— cleanbuf generate— 24 Go files generatedgofmt -s -l .— no formatting issuesgo build ./...— compiles cleanginkgo run -r internal— 52 test suites passed, 0 failuresTest plan
buf lintpasses with new proto definitionsbuf generateproduces compilable Go code for all new types and servicesGenerated with Claude Code
Summary by CodeRabbit
New Features
Tests