OSAC-830: Add private server for Public IP Attachments resource - #542
Conversation
|
@DakCrowder: This pull request references OSAC-830 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 sub-task 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. |
Summary by CodeRabbit
WalkthroughThis pull request introduces a new PublicIPAttachments resource to the fulfillment service. The implementation spans database schema definition via migrations, a private gRPC server with fluent builder dependency injection, integration into both gRPC and REST gateway startup flows, and comprehensive test coverage. The database layer defines public_ip_attachments and archived_public_ip_attachments tables with JSONB and array columns plus optimized indexes. The server delegates CRUD and signal operations to an underlying generic server instance configured with authentication, tenancy, and observability dependencies. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
/test e2e-vmaas |
|
/retest |
bbe1357 to
7ddda1a
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/database/migrations/38_create_public_ip_attachments_tables.up.sql (1)
20-20: ⚡ Quick winConsider adding an index on deletion_timestamp for improved query performance.
Queries filtering active versus soft-deleted records (e.g.,
WHERE deletion_timestamp = 'epoch') are a common pattern. Without an index ondeletion_timestamp, these queries require full table scans as the table grows.📊 Suggested index addition
create index public_ip_attachments_by_name on public_ip_attachments (name); +create index public_ip_attachments_by_deletion_timestamp on public_ip_attachments (deletion_timestamp); create index public_ip_attachments_by_owner on public_ip_attachments using gin (creators);🤖 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/database/migrations/38_create_public_ip_attachments_tables.up.sql` at line 20, Add an index on the deletion_timestamp column in the migration (internal/database/migrations/38_create_public_ip_attachments_tables.up.sql) to speed up common soft-delete filters; update the migration that defines the deletion_timestamp column to create an index (or a partial index targeting the common predicate like WHERE deletion_timestamp = 'epoch' or WHERE deletion_timestamp <> 'epoch') so queries filtering active vs soft-deleted records use the index instead of full table scans.
🤖 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/database/migrations/38_create_public_ip_attachments_tables.up.sql`:
- Line 20: Add an index on the deletion_timestamp column in the migration
(internal/database/migrations/38_create_public_ip_attachments_tables.up.sql) to
speed up common soft-delete filters; update the migration that defines the
deletion_timestamp column to create an index (or a partial index targeting the
common predicate like WHERE deletion_timestamp = 'epoch' or WHERE
deletion_timestamp <> 'epoch') so queries filtering active vs soft-deleted
records use the index instead of full table scans.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 309a8995-2157-4b70-b613-b1c12559f239
📒 Files selected for processing (6)
internal/cmd/service/start/grpcserver/start_grpc_server_cmd.gointernal/cmd/service/start/restgateway/start_rest_gateway_cmd.gointernal/database/migrations/38_create_public_ip_attachments_tables.down.sqlinternal/database/migrations/38_create_public_ip_attachments_tables.up.sqlinternal/servers/private_public_ip_attachments_server.gointernal/servers/private_public_ip_attachments_server_test.go
🚧 Files skipped from review as they are similar to previous changes (5)
- internal/database/migrations/38_create_public_ip_attachments_tables.down.sql
- internal/cmd/service/start/restgateway/start_rest_gateway_cmd.go
- internal/cmd/service/start/grpcserver/start_grpc_server_cmd.go
- internal/servers/private_public_ip_attachments_server.go
- internal/servers/private_public_ip_attachments_server_test.go
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DakCrowder, jhernand 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 |
OSAC-830
Implements the private server for Public IP Attachment resources. There is currently no validation and only basic CRUD is implemented - follow up tickets are planned for validation and the public server.