fix(reconcile): honor product behavior, reject a credit amount without the credits behavior, and keep feature names verbatim on apply - #1890
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 44 minutes Limit details: You’ve used all 2 included reviews currently available. 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 within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
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 |
Coverage Report for CI Build 32238858271Coverage increased (+0.03%) to 48.807%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
|
Review: honor behavior on create, match feature-name case on apply (RFC 0001 Rule 2) Verified on this branch: Both claims hold. Case normalization is now one shared function I also checked whether the same raw-case-on-apply gap remains for price names. It does not bite, because the billing service lowercases price names server-side on create and update (billing/product/service.go:456 and :518), unlike features. So leaving prices untouched is correct. Verdict: approve with nits. Nit:
|
df70845 to
75aa967
Compare
1be71eb to
f60571f
Compare
|
Follow-up on the nit. Agreed, and left as is on purpose. This PR makes the diff and the apply agree on feature-name case, which removes the symmetric fork risk. The residual case, a legacy or externally created mixed-case feature row, needs the server to canonicalize feature names on store and on lookup. That is a server change outside this reconcile PR, so it is a follow-up, not part of this change. |
|
Re-review (head 75aa967) The head moved only because of the rebase onto #1889. #1890's own patch is byte-for-byte identical to the previous review, so nothing in this PR's content changed. Build, tests, and lint are all green. Re-confirmed: feature-name case is normalized by one shared The residual mixed-case feature fork is still open and needs a server-side feature-name canonicalization ( Verdict: approve with nits. |
f60571f to
3cd15ce
Compare
75aa967 to
6f72be1
Compare
6f72be1 to
6f632cd
Compare
8190849 to
adfa630
Compare
… feature-name case on apply
…d feature names verbatim
5c1f51f to
10ce276
Compare
What
Two ways the BillingProduct file's stated intent was not what got applied:
Behavior on create.
Service.Createforcedbehavior = creditswhenevercredit_amount > 0, ignoring the behavior the file set. Now an explicit behavior is honored; only an omitted behavior on a credit product falls back tocredits(the server's create-time default). The reconciler's diff mirrors the same rule, so a file that names a behavior the product was not created with fails the plan instead of being silently overridden.Feature name case. The diff compared feature names lowercased and trimmed, but the apply sent them raw. Since the server looks features up by name, a case difference read as "no change" yet could fork a duplicate feature on a co-occurring update. Both sides now use one
normalizeFeatureNamehelper.Why
RFC 0001 Rule 2: the file is the desired state. The applied result must match what the file stated, with no silent override and no duplicate created behind a "no change" plan.
Testing
TestService_Createcases: an explicit behavior is honored on a credit product, and an omitted behavior defaults to credits.billing/...andinternal/reconcilepass.Stack
Stacked on
fix/reconcile-permission-spicedb-grammar.