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

OSAC-58: add catalog item proto definitions, services, and database migration - #517

Merged
openshift-merge-bot[bot] merged 4 commits into
osac-project:mainfrom
tzvatot:OSAC-58/catalog-items-proto-db
May 12, 2026
Merged

openshift-merge-bot[bot] merged 4 commits into
osac-project:mainfrom
tzvatot:OSAC-58/catalog-items-proto-db

Conversation

@tzvatot

@tzvatot tzvatot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add ClusterCatalogItem and ComputeInstanceCatalogItem proto message types with FieldDefinition for controlling user-settable fields via JSON Schema
  • Add private (full CRUD + Signal) and public (full CRUD) gRPC service definitions for both types with REST gateway annotations
  • Add event type registration (Event.payload oneof fields 22, 23)
  • Add SQL migration 37 creating 4 tables (cluster_catalog_items, archived_cluster_catalog_items, compute_instance_catalog_items, archived_compute_instance_catalog_items) with standard indexes
  • Generate Go code via buf generate
  • Update reflection helper test expectations for new types

JIRA: OSAC-58 / OSAC-701

Validations

  • buf lint — clean
  • buf generate — 24 Go files generated
  • gofmt -s -l . — no formatting issues
  • go build ./... — compiles clean
  • ginkgo run -r internal — 52 test suites passed, 0 failures

Test plan

  • Verify buf lint passes with new proto definitions
  • Verify buf generate produces compilable Go code for all new types and services
  • Verify existing unit tests pass (reflection helper updated for new types)
  • Verify SQL migration runs against PostgreSQL

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added Cluster and Compute Instance catalog items with full CRUD, listing (filtering, pagination, ordering), publication controls, metadata, tenant scoping, user-configurable field definitions, optimistic-lock updates, and archival/history support.
    • Event payloads extended to include both catalog item types.
  • Tests

    • Updated reflection tests to recognize the new catalog item types.

Review Change Stack

@openshift-ci-robot

openshift-ci-robot commented May 11, 2026 •

Copy link
Copy Markdown

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

Details

In response to this:

Summary

  • Add ClusterCatalogItem and ComputeInstanceCatalogItem proto message types with FieldDefinition for controlling user-settable fields via JSON Schema
  • Add private (full CRUD + Signal) and public (full CRUD) gRPC service definitions for both types with REST gateway annotations
  • Add event type registration (Event.payload oneof fields 22, 23)
  • Add SQL migration 37 creating 4 tables (cluster_catalog_items, archived_cluster_catalog_items, compute_instance_catalog_items, archived_compute_instance_catalog_items) with standard indexes
  • Generate Go code via buf generate
  • Update reflection helper test expectations for new types

JIRA: OSAC-58 / OSAC-701

Validations

  • buf lint — clean
  • buf generate — 24 Go files generated
  • gofmt -s -l . — no formatting issues
  • go build ./... — compiles clean
  • ginkgo run -r internal — 52 test suites passed, 0 failures

Test plan

  • Verify buf lint passes with new proto definitions
  • Verify buf generate produces compilable Go code for all new types and services
  • Verify existing unit tests pass (reflection helper updated for new types)
  • Verify SQL migration runs against PostgreSQL

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 May 11, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: af65af7c-b777-4ba1-a777-c9d64a6910fe

📥 Commits

Reviewing files that changed from the base of the PR and between 32054f6 and 3750452.

⛔ Files ignored due to path filters (30)
  • internal/api/osac/private/v1/cluster_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/private/v1/cluster_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/event_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/event_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/field_definition_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/field_definition_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/public/v1/cluster_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/field_definition_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/field_definition_type_protoopaque.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (13)
  • internal/database/migrations/37_create_catalog_items_tables.up.sql
  • internal/reflection/reflection_helper_test.go
  • proto/private/osac/private/v1/cluster_catalog_item_type.proto
  • proto/private/osac/private/v1/cluster_catalog_items_service.proto
  • proto/private/osac/private/v1/compute_instance_catalog_item_type.proto
  • proto/private/osac/private/v1/compute_instance_catalog_items_service.proto
  • proto/private/osac/private/v1/event_type.proto
  • proto/private/osac/private/v1/field_definition_type.proto
  • proto/public/osac/public/v1/cluster_catalog_item_type.proto
  • proto/public/osac/public/v1/cluster_catalog_items_service.proto
  • proto/public/osac/public/v1/compute_instance_catalog_item_type.proto
  • proto/public/osac/public/v1/compute_instance_catalog_items_service.proto
  • proto/public/osac/public/v1/field_definition_type.proto
✅ Files skipped from review due to trivial changes (1)
  • internal/reflection/reflection_helper_test.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • proto/public/osac/public/v1/field_definition_type.proto
  • proto/private/osac/private/v1/compute_instance_catalog_item_type.proto
  • proto/private/osac/private/v1/field_definition_type.proto
  • proto/private/osac/private/v1/cluster_catalog_items_service.proto
  • proto/private/osac/private/v1/cluster_catalog_item_type.proto
  • proto/private/osac/private/v1/event_type.proto
  • internal/database/migrations/37_create_catalog_items_tables.up.sql
  • proto/private/osac/private/v1/compute_instance_catalog_items_service.proto
  • proto/public/osac/public/v1/cluster_catalog_items_service.proto
  • proto/public/osac/public/v1/compute_instance_catalog_items_service.proto

Walkthrough

This 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

lgtm

Suggested reviewers

  • adriengentil
  • eranco74
  • akshaynadkarni
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding catalog item proto definitions, services, and database migration, which aligns with all the significant file additions in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ 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.

@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: 1

🧹 Nitpick comments (1)
internal/reflection/reflection_helper_test.go (1)

134-173: ⚡ Quick win

Add direct lookup coverage for the new catalog item types.

Great that singular/plural lists were updated. Please also add Lookup/Descriptor (and ideally Instance) table entries for clustercatalogitem and computeinstancecatalogitem so 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

📥 Commits

Reviewing files that changed from the base of the PR and between 33ec3ab and 3cde3c5.

⛔ Files ignored due to path filters (26)
  • internal/api/osac/private/v1/cluster_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/private/v1/cluster_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/cluster_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/compute_instance_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/event_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/private/v1/event_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/public/v1/cluster_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/cluster_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_item_type.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_item_type_protoopaque.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service.pb.gw.go is excluded by !**/*.pb.gw.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service_grpc.pb.go is excluded by !**/*.pb.go
  • internal/api/osac/public/v1/compute_instance_catalog_items_service_protoopaque.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (11)
  • internal/database/migrations/37_create_catalog_items_tables.up.sql
  • internal/reflection/reflection_helper_test.go
  • proto/private/osac/private/v1/cluster_catalog_item_type.proto
  • proto/private/osac/private/v1/cluster_catalog_items_service.proto
  • proto/private/osac/private/v1/compute_instance_catalog_item_type.proto
  • proto/private/osac/private/v1/compute_instance_catalog_items_service.proto
  • proto/private/osac/private/v1/event_type.proto
  • proto/public/osac/public/v1/cluster_catalog_item_type.proto
  • proto/public/osac/public/v1/cluster_catalog_items_service.proto
  • proto/public/osac/public/v1/compute_instance_catalog_item_type.proto
  • proto/public/osac/public/v1/compute_instance_catalog_items_service.proto

Comment thread proto/private/osac/private/v1/cluster_catalog_items_service.proto

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

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.

Comment thread proto/public/osac/public/v1/cluster_catalog_item_type.proto Outdated
@tzvatot

tzvatot commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci

openshift-ci Bot commented May 11, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [adriengentil,jhernand,tzvatot]

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 lgtm label May 11, 2026
@tzvatot

tzvatot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

/unhold

@tzvatot

tzvatot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

/retest

tzvatot added 4 commits May 12, 2026 12:55
…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)
@tzvatot
tzvatot force-pushed the OSAC-58/catalog-items-proto-db branch from e36cc2c to 3750452 Compare May 12, 2026 09:55
@openshift-ci openshift-ci Bot removed the lgtm label May 12, 2026
@openshift-ci

openshift-ci Bot commented May 12, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@tzvatot tzvatot added the lgtm label May 12, 2026
@tzvatot

tzvatot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-merge-bot
openshift-merge-bot Bot merged commit 62c436c into osac-project:main May 12, 2026
20 checks passed
@openshift-ci

openshift-ci Bot commented May 12, 2026

Copy link
Copy Markdown

@tzvatot: The following test 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/e2e-metal-vmaas-compute-instance-delete-during-provision 3750452 link unknown /test e2e-metal-vmaas-compute-instance-delete-during-provision

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.

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.

4 participants