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

OSAC-702: add private CRUD servers for catalog items - #520

Merged
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
tzvatot:OSAC-58/catalog-items-private-crud
May 13, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
tzvatot:OSAC-58/catalog-items-private-crud

Conversation

@tzvatot

@tzvatot tzvatot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add private ClusterCatalogItemsServer and ComputeInstanceCatalogItemsServer using the GenericServer pattern (full CRUD + Signal)
  • Register both servers in gRPC startup and REST gateway
  • Add setPayload switch cases for catalog item event notifications
  • Add unit tests for both servers (24 tests: builder validation + CRUD behavior)

JIRA: OSAC-58 / OSAC-702

Depends on: #517 (merged)

Validations

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

Test plan

  • Builder validation: logger, attribution logic, tenancy logic required
  • CRUD operations: create, list, list with limit, list with filter, get, update, delete
  • Field mask update: publish/unpublish via field mask on published field
  • Verify SQL migration runs against PostgreSQL (integration test coverage)

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added private APIs for managing cluster catalog items and compute instance catalog items (list, get, create, update, delete, signal).
    • These private endpoints are now exposed via the gRPC server and REST gateway; internal event payload handling updated to support the new item types.
  • Tests

    • Added comprehensive test suites covering CRUD, filtering, field-mask updates, field-definition round-trips, and delete semantics.

Review Change Stack

@openshift-ci-robot

openshift-ci-robot commented May 12, 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 private ClusterCatalogItemsServer and ComputeInstanceCatalogItemsServer using the GenericServer pattern (full CRUD + Signal)
  • Register both servers in gRPC startup and REST gateway
  • Add setPayload switch cases for catalog item event notifications
  • Add unit tests for both servers (24 tests: builder validation + CRUD behavior)

JIRA: OSAC-58 / OSAC-702

Depends on: #517 (merged)

Validations

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

Test plan

  • Builder validation: logger, attribution logic, tenancy logic required
  • CRUD operations: create, list, list with limit, list with filter, get, update, delete
  • Field mask update: publish/unpublish via field mask on published field
  • Verify SQL migration runs against PostgreSQL (integration test coverage)

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.

@openshift-ci
openshift-ci Bot requested review from jhernand and trewest May 12, 2026 12:08
@coderabbitai

coderabbitai Bot commented May 12, 2026 •

Copy link
Copy Markdown

Walkthrough

This PR adds two new private gRPC servers for managing catalog items: one for cluster catalog items and one for compute instance catalog items. The implementation extends the generic server event handling to recognize the new payload types, then introduces parallel server implementations using a consistent builder pattern with full CRUD operations (List, Get, Create, Update, Delete, Signal). Each server is accompanied by comprehensive test coverage validating construction constraints, persistence, filtering, limit handling, and field masking. Finally, both servers are registered during startup in both the gRPC service and REST gateway layers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jhernand
  • tzumainn
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding private CRUD servers for catalog items, which aligns with the primary objective of implementing PrivateClusterCatalogItemsServer and PrivateComputeInstanceCatalogItemsServer.

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

🧹 Nitpick comments (2)
internal/servers/private_compute_instance_catalog_items_server.go (1)

74-82: 💤 Low value

Consider validating attributionLogic explicitly for consistency.

The Build() method explicitly validates logger and tenancyLogic, but does not validate attributionLogic even though it's passed to the GenericServer builder (line 88) which requires it. While the validation will still occur in GenericServer.Build() and the error will propagate correctly, explicitly checking all required dependencies here would be more consistent and provide clearer error context.

♻️ Suggested explicit validation
 	if b.logger == nil {
 		err = errors.New("logger is mandatory")
 		return
 	}
+	if b.attributionLogic == nil {
+		err = errors.New("attribution logic is mandatory")
+		return
+	}
 	if b.tenancyLogic == nil {
 		err = errors.New("tenancy logic is mandatory")
 		return
 	}
🤖 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/private_compute_instance_catalog_items_server.go` around
lines 74 - 82, The Build() method on
PrivateComputeInstanceCatalogItemsServerBuilder currently validates logger and
tenancyLogic but omits attributionLogic; add an explicit nil-check for
b.attributionLogic in PrivateComputeInstanceCatalogItemsServerBuilder.Build(),
returning an error like "attribution logic is mandatory" when nil so callers get
a clear, immediate message instead of relying on GenericServer.Build() to catch
it; update any related tests or callers if they expect the earlier error path.
internal/servers/private_cluster_catalog_items_server.go (1)

74-82: 💤 Low value

Consider validating attributionLogic explicitly for consistency.

The Build() method explicitly validates logger and tenancyLogic, but does not validate attributionLogic even though it's passed to the GenericServer builder (line 88) which requires it. While the validation will still occur in GenericServer.Build() and the error will propagate correctly, explicitly checking all required dependencies here would be more consistent and provide clearer error context.

♻️ Suggested explicit validation
 	if b.logger == nil {
 		err = errors.New("logger is mandatory")
 		return
 	}
+	if b.attributionLogic == nil {
+		err = errors.New("attribution logic is mandatory")
+		return
+	}
 	if b.tenancyLogic == nil {
 		err = errors.New("tenancy logic is mandatory")
 		return
 	}
🤖 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/private_cluster_catalog_items_server.go` around lines 74 -
82, The Build() method of PrivateClusterCatalogItemsServerBuilder currently
validates logger and tenancyLogic but omits attributionLogic; add an explicit
nil check for attributionLogic in
PrivateClusterCatalogItemsServerBuilder.Build() and return a clear error (e.g.,
"attribution logic is mandatory") if nil so callers get immediate, specific
feedback before delegating to GenericServer.Build(); reference the builder
struct and its attributionLogic field and keep the error messaging consistent
with the existing checks for logger and tenancyLogic.
🤖 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.

Nitpick comments:
In `@internal/servers/private_cluster_catalog_items_server.go`:
- Around line 74-82: The Build() method of
PrivateClusterCatalogItemsServerBuilder currently validates logger and
tenancyLogic but omits attributionLogic; add an explicit nil check for
attributionLogic in PrivateClusterCatalogItemsServerBuilder.Build() and return a
clear error (e.g., "attribution logic is mandatory") if nil so callers get
immediate, specific feedback before delegating to GenericServer.Build();
reference the builder struct and its attributionLogic field and keep the error
messaging consistent with the existing checks for logger and tenancyLogic.

In `@internal/servers/private_compute_instance_catalog_items_server.go`:
- Around line 74-82: The Build() method on
PrivateComputeInstanceCatalogItemsServerBuilder currently validates logger and
tenancyLogic but omits attributionLogic; add an explicit nil-check for
b.attributionLogic in PrivateComputeInstanceCatalogItemsServerBuilder.Build(),
returning an error like "attribution logic is mandatory" when nil so callers get
a clear, immediate message instead of relying on GenericServer.Build() to catch
it; update any related tests or callers if they expect the earlier error path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 80b4b432-c826-4b3e-bbfb-9eb9bc55bf20

📥 Commits

Reviewing files that changed from the base of the PR and between 62c436c and 08c1697.

📒 Files selected for processing (7)
  • internal/cmd/service/start/grpcserver/start_grpc_server_cmd.go
  • internal/cmd/service/start/restgateway/start_rest_gateway_cmd.go
  • internal/servers/generic_server.go
  • internal/servers/private_cluster_catalog_items_server.go
  • internal/servers/private_cluster_catalog_items_server_test.go
  • internal/servers/private_compute_instance_catalog_items_server.go
  • internal/servers/private_compute_instance_catalog_items_server_test.go

@openshift-ci

openshift-ci Bot commented May 12, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tzvatot
tzvatot force-pushed the OSAC-58/catalog-items-private-crud branch from 08c1697 to 1e56d3f Compare May 12, 2026 13:23
@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

2 similar comments
@tzvatot

tzvatot commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@tzvatot

tzvatot commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@tzvatot
tzvatot force-pushed the OSAC-58/catalog-items-private-crud branch from 1e56d3f to d6b1956 Compare May 13, 2026 09:04
@openshift-ci openshift-ci Bot removed the lgtm label May 13, 2026
@openshift-ci

openshift-ci Bot commented May 13, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

- Add private ClusterCatalogItems and ComputeInstanceCatalogItems servers
  using GenericServer pattern (full CRUD + Signal)
- Register both servers in gRPC startup and REST gateway
- Add setPayload switch cases for event notification
- Add unit tests for both servers (builder validation + CRUD behavior
  + FieldDefinition round-trip persistence)

Generated with [Claude Code](https://claude.com/claude-code)
@tzvatot
tzvatot force-pushed the OSAC-58/catalog-items-private-crud branch from d6b1956 to 4e265aa Compare May 13, 2026 11:34
@tzvatot tzvatot added the lgtm label May 13, 2026
@tzvatot

tzvatot commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

/retest ci/prow/e2e-vmaas

@tzvatot

tzvatot commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-vmaas

@tzvatot tzvatot changed the title OSAC-58: add private CRUD servers for catalog items OSAC-702: add private CRUD servers for catalog items May 13, 2026
@openshift-ci-robot

openshift-ci-robot commented May 13, 2026 •

Copy link
Copy Markdown

@tzvatot: This pull request references OSAC-702 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add private ClusterCatalogItemsServer and ComputeInstanceCatalogItemsServer using the GenericServer pattern (full CRUD + Signal)
  • Register both servers in gRPC startup and REST gateway
  • Add setPayload switch cases for catalog item event notifications
  • Add unit tests for both servers (24 tests: builder validation + CRUD behavior)

JIRA: OSAC-58 / OSAC-702

Depends on: #517 (merged)

Validations

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

Test plan

  • Builder validation: logger, attribution logic, tenancy logic required
  • CRUD operations: create, list, list with limit, list with filter, get, update, delete
  • Field mask update: publish/unpublish via field mask on published field
  • Verify SQL migration runs against PostgreSQL (integration test coverage)

Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • Added private APIs for managing cluster catalog items and compute instance catalog items (list, get, create, update, delete, signal).

  • These private endpoints are now exposed via the gRPC server and REST gateway; internal event payload handling updated to support the new item types.

  • Tests

  • Added comprehensive test suites covering CRUD, filtering, field-mask updates, field-definition round-trips, and delete semantics.

Review Change Stack

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.

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