OSAC-3995: Public Storage Tier API — fulfillment-service backend - #292
OSAC-3995: Public Storage Tier API — fulfillment-service backend#292wgordon17 wants to merge 13 commits into
Conversation
|
@wgordon17: This pull request references OSAC-3995 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 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wgordon17 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds a public ChangesPublic Storage Tiers API
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant StorageTiersServer
participant PrivateStorageTiersServer
participant StorageBackendsDAO
Client->>StorageTiersServer: List or Get request
StorageTiersServer->>PrivateStorageTiersServer: Validated delegated request
PrivateStorageTiersServer->>StorageBackendsDAO: Resolve backend association
StorageBackendsDAO-->>StorageTiersServer: Backend properties
StorageTiersServer-->>Client: Mapped public StorageTier response
Possibly related PRs
Suggested reviewers: Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (9 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
🤖 Finished Review · ✅ Success · Started 3:43 PM UTC · Completed 4:00 PM UTC Commit: |
ReviewFindingsMedium
Low
Previous runReviewFindingsLow
Labels: PR adds new public StorageTiers API to the fulfillment-service storage subsystem |
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
…ic StorageTiers Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Upstream renamed the Go module path to match its mono-repo location (OSAC-3572). Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
buf.gen.yaml's go_package_prefix changed with the mono-repo module rename (OSAC-3572); regenerate to keep the embedded descriptor metadata in sync. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Cross-cutting review found describe_storagetier_cmd.go's field order, empty-value handling, and labels diverged from both get_storagetier_cmd.go and the established describe_networkclass_cmd.go precedent. Align to match. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
ad0f7d5 to
ac29b87
Compare
|
🤖 Review · Commit: |
fullsend-ai-review flagged that the new public StorageTiers Get/List endpoints were missing from AUTH.md's Client Users permissions list. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@fulfillment-service/internal/cmd/cli/get/storagetier/get_storagetier_cmd.go`:
- Around line 106-159: Update renderTierTable and renderTierDetail in
fulfillment-service/internal/cmd/cli/get/storagetier/get_storagetier_cmd.go
(lines 106-159) to return errors from every fmt.Fprint* call and
tabwriter.Writer.Flush, then propagate those errors through renderStorageTier
and the respective command at lines 66-84. Apply the same output-error
propagation to the storage-tier describe command in
fulfillment-service/internal/cmd/cli/describe/storagetier/describe_storagetier_cmd.go
(lines 88-120), ensuring broken-pipe failures are returned instead of producing
success.
In `@fulfillment-service/internal/servers/storage_tiers_server.go`:
- Around line 214-223: Update the List conversion loop around privateItems and
toPublicTier to log malformed tiers and continue instead of returning the
conversion error; build the result slice with only successfully converted items
and adjust size to match the filtered items count. Keep Get’s existing Internal
error behavior unchanged, and update the affected List test expectations
accordingly.
🪄 Autofix
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: Repository: osac-project/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8696598c-879a-4f50-b239-5a4d1b122027
⛔ Files ignored due to path filters (6)
fulfillment-service/internal/api/osac/public/v1/storage_tier_type.pb.gois excluded by!**/*.pb.gofulfillment-service/internal/api/osac/public/v1/storage_tier_type_protoopaque.pb.gois excluded by!**/*.pb.gofulfillment-service/internal/api/osac/public/v1/storage_tiers_service.pb.gois excluded by!**/*.pb.gofulfillment-service/internal/api/osac/public/v1/storage_tiers_service.pb.gw.gois excluded by!**/*.pb.gw.gofulfillment-service/internal/api/osac/public/v1/storage_tiers_service_grpc.pb.gois excluded by!**/*.pb.gofulfillment-service/internal/api/osac/public/v1/storage_tiers_service_protoopaque.pb.gois excluded by!**/*.pb.go
📒 Files selected for processing (11)
fulfillment-service/internal/auth/policies/authz.regofulfillment-service/internal/cmd/cli/describe/storagetier/describe_storagetier_cmd.gofulfillment-service/internal/cmd/cli/get/get_cmd.gofulfillment-service/internal/cmd/cli/get/storagetier/get_storagetier_cmd.gofulfillment-service/internal/cmd/service/start/grpcserver/start_grpc_server_cmd.gofulfillment-service/internal/cmd/service/start/restgateway/start_rest_gateway_cmd.gofulfillment-service/internal/servers/storage_tiers_server.gofulfillment-service/internal/servers/storage_tiers_server_test.gofulfillment-service/it/it_public_storage_tiers_test.gofulfillment-service/proto/public/osac/public/v1/storage_tier_type.protofulfillment-service/proto/public/osac/public/v1/storage_tiers_service.proto
|
🤖 Review · Commit: |
A tenant can't act on a malformed tier (0 or >1 backend associations) -- that's a cloud-provider-admin data problem, not something the caller can fix. Failing the entire List response for every tenant over one corrupted admin-side row is bad UX. List now logs and omits malformed tiers (adjusting size to match); Get is unchanged and still returns Internal for the specific tier requested. Addresses CodeRabbit review feedback on PR osac-project#292. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
Auto-dismissed: only Prow labels gate merging
|
🤖 Review · Commit: |
CI flagged the int-to-int32 conversion for StorageTiersListResponse.size as a potential integer overflow (gosec G115). Matches the existing, identical pattern already used in external_ip_pools_server.go for the same reason: bounded by page size, cannot realistically overflow. Assisted-by: Claude Code <noreply@anthropic.com> Signed-off-by: Will Gordon <wgordon@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 6:02 PM UTC · Completed 6:19 PM UTC Commit: |
OSAC-3995: Public Storage Tier API — fulfillment-service backend
Jira: https://redhat.atlassian.net/browse/OSAC-3995 (child of epic OSAC-3014)
Summary
Adds a public, tenant-facing
StorageTiersgRPC service (Get+Listonly) tofulfillment-service, wrapping the existing private StorageTier API via the same
builder/delegate/mapper pattern already used for
BareMetalInstanceTypes. Tenants can now browseavailable storage tiers (protocol, bandwidth, quota, encryption) to choose one when provisioning a
ComputeInstance.
Changes
public.v1.StorageTier/StorageTierSpec/StorageTierStatusproto types andStorageTiersservice (Get/List only, no Create/Update/Delete — matches the
BareMetalInstanceTypes/ExternalIPPoolsprecedent for read-only platform-catalog resources).StorageTiersServerimplementation with two-layer CEL filter validation to prevent tenants fromprobing excluded private fields via the filter side-channel (a scoped fix for BUG-018; the
broader pattern across 24 other servers is tracked separately in OSAC-3609).
get storagetier,describe storagetierswitched to the public client).Testing
internal/servers/storage_tiers_server_test.go— builder validation, List/Getdelegation and field flattening, pagination, both filter-validation layers, defensive handling
of malformed backend-association counts, and a schema-drift regression test.
it/it_public_storage_tiers_test.go— end-to-end List/Get, pagination,filtering, the private-API permission boundary, and documented BUG-005 pass-through behavior.
validation (build,
gofmt,go vet, unit suite, integration suite) passed.Acceptance Criteria
StorageTiers/GetRPC implemented in fulfillment-serviceStorageTiers/ListRPC implemented in fulfillment-servicepublic.v1.StorageTiermessage, mirrors private minusbackend_idSummary by CodeRabbit