OSAC-3277: resolve StorageTier at volume creation - #342
Conversation
|
@akshaynadkarni: This pull request references OSAC-3277 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.1.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: akshaynadkarni 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 |
|
Warning Review limit reached
Next review available in: 10 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository: osac-project/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe gRPC startup path creates and injects a tenancy-aware storage-tier DAO. Private volume creation resolves the requested tier, validates it, selects its first backend association, and records the backend ID and protocol in volume status. ChangesStorage-tier volume resolution
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The Volume creation path now resolves storage tiers before persisting routing details; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 11✅ Passed checks (11 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
|
🤖 Finished Review · ✅ Success · Started 4:40 PM UTC · Completed 4:58 PM UTC Commit: |
ReviewFindingsLow
Previous runReviewFindingsCritical
Medium
Low
Labels: PR modifies storage tier resolution in fulfillment-service Next steps:
Previous run (2)ReviewFindingsHigh
Medium
Low
Next steps:
|
Auto-dismissed: only Prow labels gate merging
|
🤖 Review · Commit: |
…tion When a Volume is created, the Volume server now resolves the spec.storage_tier name to a concrete backend and protocol before persisting. Resolution looks up the StorageTier by name, validates it is ACTIVE with at least one BackendAssociation, and selects the first association. The resolved backend ID and protocol are written to status.backend and status.protocol so the reconciler and operator controller have the information they need without a second lookup. Fails fast with appropriate gRPC status codes: NotFound if the tier does not exist, FailedPrecondition if the tier is not active or has no backends. Integration test coverage tracked under OSAC-4046. Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
Use this.metadata.name (required by the CEL environment) and strconv.Quote for safe string escaping, matching the pattern used by all other server-side filters. Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
1af7885 to
14807cf
Compare
|
🤖 Finished Review · ✅ Success · Started 6:10 PM UTC · Completed 6:30 PM UTC Commit: |
Auto-dismissed: only Prow labels gate merging
Replace the DAO dependency on the Volume server with a TierResolverFunc function type. The server calls the injected function without knowing where tier data comes from. Production wiring creates a DAO-backed closure in the gRPC startup. Tests pass a stub that returns a fixed backend and protocol. Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com> Assisted-by: Cursor/Claude Signed-off-by: akshaynadkarni <25892229+akshaynadkarni@users.noreply.github.com>
|
🤖 Finished Review · ✅ Success · Started 7:55 PM UTC · Completed 8:10 PM UTC Commit: |
There was a problem hiding this comment.
Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:
fulfillment-service/internal/servers/private_volumes_server_test.go(file-level): Line 151 · [low] test-adequacy
Create test doesn't assert backend/protocol values in status. Stub resolver returns BackendID='test-backend' and Protocol=STORAGE_PROTOCOL_BLOCK but no Create test checks GetStatus().GetBackend() or GetStatus().GetProtocol(). A regression that silently drops tier resolution results would go undetected by unit tests.
Suggested fix: Add assertions to the Create test verifying status contains expected backend and protocol values.
fulfillment-service/internal/servers/private_volumes_server_test.go:90: [low] test-adequacy
All Behaviour tests use a stub resolver that always succeeds. No tests exercise resolver error paths (tier not found, not active, no backends). Create handler error propagation when resolver fails is untested at the unit level.
Suggested fix: Add test with failing resolver returning grpcstatus error and verify Create returns expected error code without persisting.
fulfillment-service/internal/cmd/service/start/grpcserver/start_grpc_server_cmd.go:1224: [low] architectural-coherence
The new storageTiersDAO is created without SetMetricsRegisterer(metricsRegisterer). This is consistent with the established pattern for auxiliary/helper DAOs (storageBackendsDAO at line 1199 also omits it).
fulfillment-service/internal/servers/private_volumes_server.go:40: [low] pattern-inconsistency
TierResolverFunc is a bare function type while most cross-resource dependencies use interfaces. However, ReferenceLookupFunc uses the same pattern, making this a minor stylistic preference.
Suggested fix: Consider defining a TierResolver interface if this pattern grows to multiple methods.
fulfillment-service/internal/servers/private_volumes_server.go:33: [low] code-organization
TierResolution and TierResolverFunc are exported types placed at top of volumes server file. They are tightly coupled to this server (8 lines total).
Suggested fix: Consider moving to a dedicated tier_resolver.go if the type grows.
fulfillment-service/internal/cmd/service/start/grpcserver/start_grpc_server_cmd.go:1222: [low] pattern-inconsistency
The new DAO/resolver creation block does not emit a c.logger.InfoContext log line, unlike most resource-creation blocks in this function (though storageBackendsDAO also omits it).
Suggested fix: Add c.logger.InfoContext(ctx, 'Creating tier resolver for volumes server') before the DAO creation.
Summary
OSAC-3277: Add tier resolution to the Volume Create handler in fulfillment-service.
When a Volume is created, the server now resolves spec.storage_tier to a concrete
backend and protocol before persisting. Resolution looks up the StorageTier by name,
validates it is ACTIVE with at least one BackendAssociation, and selects the first
association. The resolved backend ID and protocol are written to status.backend and
status.protocol so the reconciler and operator controller have the routing information
without a second lookup.
Fails fast with gRPC status codes: NotFound if the tier does not exist,
FailedPrecondition if the tier is not active or has no backends.
Why
Without tier resolution, volumes were persisted with an empty backend and protocol.
The Volume controller on the operator side needs to know which vendor CSI driver to
call, and the feedback controller needs to propagate the protocol back. Resolving at
creation time is the natural place since the fulfillment-service has direct DAO access
to StorageTier records.
Testing
Integration test coverage for the full Volume create flow is tracked under OSAC-4046.
Ticket
OSAC-3277 (under OSAC-3273 epic, under OSAC-2872 feature)
Signed-off-by: akshaynadkarni 25892229+akshaynadkarni@users.noreply.github.com
Assisted-by: Cursor/Claude
Summary by CodeRabbit
New Features
Bug Fixes