fix: match Scale-Up plan ids case-insensitively - #8249
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughScale-Up plan version extraction now matches plan identifiers without regard to letter case. Invalid-plan regular expressions also use case-insensitive matching. Unit tests cover mixed-case yearly and monthly Scale-Up v4 identifiers and an invalid-plan expression. The event catalogue source line was corrected. OpenAPI URL schemas now include URI format and maximum length metadata. Estimated code review effort: 2 (Simple) | ~10 minutes 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 |
Docker builds report
|
Scale-Up v4 Chargebee plan ids are mixed-case (Scale-Up-v4-USD-Yearly), but get_scaleup_plan_version() and ReadOnlyIfNotValidPlanMixin matched plan ids case-sensitively, so v4 organisations were treated as pre-v4 (unlimited audit log visibility) and plan-gated project fields became writable. Part of #8074. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3f96109 to
6ab7f51
Compare
✅ oss · depot-ubuntu-latest-16 — run #19151 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
🗂️ Previous results✅ oss · depot-ubuntu-latest-arm-16 — run #19151 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #19150 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19150 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Skipped testsfirefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss ✅ oss · depot-ubuntu-latest-arm-16 — run #19150 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19150 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #19148 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #19148 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19149 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #19148 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19149 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #19148 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression19 screenshots compared. See report for details. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8249 +/- ##
=======================================
Coverage 98.72% 98.72%
=======================================
Files 1558 1558
Lines 61948 61948
=======================================
Hits 61160 61160
Misses 788 788 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Scale-Up returned as v4 with mixed-case Chargebee plan ids (
Scale-Up-v4-USD-Yearly/Scale-Up-v4-USD-Monthly), but two plan-id checks still match case-sensitively:Subscription.get_scaleup_plan_version()fails to match the v4 ids and falls back to version 1, so v4 Scale-Up organisations are treated as pre-v4 and keep unlimited audit log visibility (audit_log_visibility_days = None).ReadOnlyIfNotValidPlanMixincompilesinvalid_plans_regexcase-sensitively, soProjectCreateSerializer'sscale-up.*gate misses v4 plans and the plan-gated project fields (stale_flags_limit_days,enable_realtime_updates) become writable for Scale-Up v4 organisations.Both now match case-insensitively. Chargebee plan ids cannot be renamed, and
SubscriptionPlanFamily.get_by_plan_idalready normalises its input for exactly this reason — this brings the remaining two checks in line.Part of #8074 (the two backend acceptance criteria in this repo; the stale-flags tagging item lives in flagsmith-private and the billing-page plan descriptions are a separate frontend change).
Test plan
test_get_scaleup_plan_version__given_plan__returns_expectedwith the production v4 plan ids — fails without the fix.ReadOnlyIfNotValidPlanMixinread-only parametrisation with a mixed-case plan id against the production regex fromProjectCreateSerializer.🤖 Generated with Claude Code