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

PublicIPPool gRPC server - #434

Merged
openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
SiddarthR56:main
Apr 23, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
osac-project:mainfrom
SiddarthR56:main

Conversation

@SiddarthR56

@SiddarthR56 SiddarthR56 commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

Added the PublicIPPool resource to the private gRPC API. PublicIPPool represents a named pool of public IP address CIDR ranges (IPv4 or IPv6) from which individual PublicIP addresses can be allocated to compute instances.

Testing done:

  • Unit tests in private_public_ip_pools_server_test.go
  • Manually verified end-to-end via REST gateway (curl) and gRPC (grpcurl) with a local PostgreSQL instance

Summary by CodeRabbit

Release Notes

  • New Features
    • Introduced the Public IP Pools API with full Create, Read, Update, and Delete operations, available through both gRPC and REST endpoints
    • Added database persistence with archival capabilities for public IP pool resources
    • Integrated event notification system to track and notify on public IP pool resource changes

@SiddarthR56
SiddarthR56 removed the request for review from tzumainn April 22, 2026 19:41
@coderabbitai

coderabbitai Bot commented Apr 22, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@SiddarthR56 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 7 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 7 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8e5a19d-460b-4340-8a4d-5e3f2d84a5ea

📥 Commits

Reviewing files that changed from the base of the PR and between 0a63c73 and 4696c1e.

📒 Files selected for processing (6)
  • internal/cmd/service/start/grpcserver/start_grpc_server_cmd.go
  • internal/cmd/service/start/restgateway/start_rest_gateway_cmd.go
  • internal/database/migrations/30_create_public_ip_pools_tables.up.sql
  • internal/servers/generic_server.go
  • internal/servers/private_public_ip_pools_server.go
  • internal/servers/private_public_ip_pools_server_test.go

Walkthrough

This pull request introduces a new PublicIPPool resource type to the system. The changes include a new gRPC server implementation with builder pattern that delegates to a generic server, database schema migration creating public_ip_pools and archived_public_ip_pools tables with indexes, protobuf event payload support for the new resource type, comprehensive test coverage, and integration points registering the server with both gRPC and REST gateway startup flows.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • akshaynadkarni
  • eranco74
  • larsks
  • adriengentil
🚥 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 PR title 'PublicIPPool gRPC server' directly and clearly describes the main change: adding a new gRPC server implementation for PublicIPPool resources.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

🧹 Nitpick comments (1)
internal/servers/private_public_ip_pools_server.go (1)

84-102: Consider validating attribution logic in this builder too.

GenericServer.Build() will catch the missing attribution logic, but checking it here keeps PrivatePublicIPPoolsServerBuilder’s mandatory dependency validation explicit and consistent with logger/tenancyLogic.

♻️ Proposed refactor
 	if b.tenancyLogic == nil {
 		err = errors.New("tenancy logic is mandatory")
 		return
 	}
+	if b.attributionLogic == nil {
+		err = errors.New("attribution logic is mandatory")
+		return
+	}
 
 	generic, err := NewGenericServer[*privatev1.PublicIPPool]().
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/servers/private_public_ip_pools_server.go` around lines 84 - 102,
The builder currently checks logger and tenancyLogic but not attributionLogic;
update PrivatePublicIPPoolsServerBuilder.Build to validate that
b.attributionLogic is not nil and return an error (e.g., errors.New("attribution
logic is mandatory")) before calling
NewGenericServer[...]().SetAttributionLogic(...).Build(), so the mandatory
dependency check is explicit in the PrivatePublicIPPoolsServerBuilder.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@internal/servers/private_public_ip_pools_server.go`:
- Around line 84-102: The builder currently checks logger and tenancyLogic but
not attributionLogic; update PrivatePublicIPPoolsServerBuilder.Build to validate
that b.attributionLogic is not nil and return an error (e.g.,
errors.New("attribution logic is mandatory")) before calling
NewGenericServer[...]().SetAttributionLogic(...).Build(), so the mandatory
dependency check is explicit in the PrivatePublicIPPoolsServerBuilder.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bff97515-bdfa-4655-9191-7c71777b11ca

📥 Commits

Reviewing files that changed from the base of the PR and between 3efd7e5 and 0a63c73.

⛔ Files ignored due to path filters (2)
  • 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
📒 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/database/migrations/28_create_public_ip_pools_tables.up.sql
  • internal/servers/generic_server.go
  • internal/servers/private_public_ip_pools_server.go
  • internal/servers/private_public_ip_pools_server_test.go
  • proto/private/osac/private/v1/event_type.proto

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

Nice!
Changes LGTM.

@openshift-ci

openshift-ci Bot commented Apr 23, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akshaynadkarni, SiddarthR56

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

@akshaynadkarni

Copy link
Copy Markdown
Contributor

/unhold

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.

2 participants