Repository navigation
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Repository: openmeterio/openmeter/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
| @@ -14461,7 +14466,7 @@ type ServerInterface interface { | |||
| ListCustomerEntitlementAccess(w http.ResponseWriter, r *http.Request, customerId ULID) | |||
| // Get customer entitlement access | |||
| // (GET /openmeter/customers/{customerId}/entitlement-access/features/{featureKey}) | |||
| GetCustomerEntitlementAccess(w http.ResponseWriter, r *http.Request, customerId ULID, featureKey ResourceKey, params GetCustomerEntitlementAccessParams) | |||
| GetCustomerEntitlementAccess(w http.ResponseWriter, r *http.Request, customerId ULID, featureKey ResourceKey) | |||
There was a problem hiding this comment.
Generated interface breaks server build
The generated access-check method no longer takes params, but api/v3/server/routes.go:94 still takes the removed api.GetCustomerEntitlementAccessParams type. The method therefore cannot satisfy ServerInterface, and the root Go build fails. The access handlers also still reference the removed BillingEntitlementAccessResult type; they need to be updated alongside the generated contract.
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/v3/api.gen.go
Line: 14469
Comment:
**Generated interface breaks server build**
The generated access-check method no longer takes params, but `api/v3/server/routes.go:94` still takes the removed `api.GetCustomerEntitlementAccessParams` type. The method therefore cannot satisfy `ServerInterface`, and the root Go build fails. The access handlers also still reference the removed `BillingEntitlementAccessResult` type; they need to be updated alongside the generated contract.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
|
||
| // Get the customer's access to a single feature. | ||
| func (s *EntitlementsService) GetCustomerAccess(ctx context.Context, customerID string, featureKey string, params GetCustomerEntitlementAccessParams) (*EntitlementAccessResult, error) { | ||
| func (s *EntitlementsService) GetCustomerAccess(ctx context.Context, customerID string, featureKey string) (*EntitlementAccessCheckResult, error) { |
There was a problem hiding this comment.
SDK change breaks e2e compilation
GetCustomerAccess no longer accepts a fourth argument, and GetCustomerEntitlementAccessParams has been removed. The access, reset, and history e2e tests still pass that type, so the e2e module cannot compile. The plan-entitlement test also names the removed EntitlementAccessResult; these callers need to use the split check and value contracts.
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/v3/client/entitlements.go
Line: 64
Comment:
**SDK change breaks e2e compilation**
`GetCustomerAccess` no longer accepts a fourth argument, and `GetCustomerEntitlementAccessParams` has been removed. The access, reset, and history e2e tests still pass that type, so the e2e module cannot compile. The plan-entitlement test also names the removed `EntitlementAccessResult`; these callers need to use the split check and value contracts.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| * If not provided, the feature has no entitlement defined (has access is always false in this case) | ||
| */ | ||
| @visibility(Lifecycle.Read) | ||
| type?: EntitlementType; |
There was a problem hiding this comment.
Missing entitlements get synthetic type
The new check contract leaves type absent when a feature has no entitlement, but the existing converter assigns static in that case. Once the handler is adapted to the new result model, an access check for a feature without an entitlement will report a static entitlement unless the mapping changes too.
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/spec/packages/aip/src/entitlements/access.tsp
Line: 62
Comment:
**Missing entitlements get synthetic type**
The new check contract leaves `type` absent when a feature has no entitlement, but the existing converter assigns `static` in that case. Once the handler is adapted to the new result model, an access check for a feature without an entitlement will report a static entitlement unless the mapping changes too.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
1df2a19 to
19adcd4
Compare
0a06716 to
3c304c7
Compare
3c304c7 to
901c237
Compare
dd1aa9c
into
feat/v3-customer-entitlement-value
Summary
expandquery parameter from the customer feature access check.Scope
This PR changes the AIP contract and generated artifacts. Handler and service implementation changes will follow separately. The generated Go server interface now differs from the existing handler, so the root API build may fail until that follow-up lands.
Verification
make test-go-sdkStacked on #5149.
The PR is not ready to merge because the existing server and e2e code still do not compile against the generated contract.
Fix with agent prompt
Summary
The PR separates the single-feature access check from the entitlement value contract and regenerates the v3 OpenAPI and SDK artifacts.
expandand returns a smaller result with an optional entitlement type.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Customer feature access check] --> B[EntitlementAccessCheckResult] C[Entitlement value endpoint] --> D[EntitlementValueResult] E[Customer access list] --> DReviews (2) · Last reviewed commit: "feat(api): split entitlement access chec..."