Repository navigation
Conversation
Add a read-only api_limit_access_blocked field to the organisation response so the usage dashboard can explain whether access returns automatically or requires support.
|
@PiUnknown is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
0f624b96-9dab-48f4-a16c-f5308c75a06c
📒 Files selected for processing: 12
api/organisations/serializers.pyapi/organisations/views.pyapi/tests/unit/organisations/test_unit_organisations_serializers.pyapi/tests/unit/organisations/test_unit_organisations_views.pyfrontend/common/types/responses.tsfrontend/documentation/components/UsageDashboard.stories.tsxfrontend/web/components/pages/usage/__tests__/limitStatus.test.tsfrontend/web/components/pages/usage/__tests__/limitStatusMessage.test.tsfrontend/web/components/pages/usage/limitStatus.tsfrontend/web/components/pages/usage/limitStatusMessage.tsmcp/src/flagsmith_mcp/openapi.jsonopenapi.yaml
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
| @@ -42,6 +45,7 @@ export const limitStatusOf = ( | |||
| // The block outlives going over the limit, so this cannot key off over. | |||
| if (organisation?.block_access_to_admin || organisation?.stop_serving_flags) { | |||
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Include the API-limit block in the restricted-status condition.
When api_limit_access_blocked is true and both existing restriction flags are false, this condition skips the restricted status. With no overage, limitStatusOf returns undefined. The new API-limit-only case in frontend/web/components/pages/usage/__tests__/limitStatus.test.ts therefore fails, and the recovery message cannot appear for that state. Include organisation?.api_limit_access_blocked in this condition.
Closes #8773.
Changes
api_limit_access_blockedboolean to the organisation response, true when anAPILimitAccessBlockexists.OrganisationViewSetto avoid an N+1 query.How did you test this code?
APILimitAccessBlock.GET /api/v1/organisations/{id}/.ruff check,ruff format --check, and Prettier 3.4.2 checks on the changed files.The full backend/frontend suites were not run locally because Docker/PostgreSQL and frontend
node_moduleswere unavailable.