Rate-limit the Orbit graph status API per namespace
What does this MR do and why?
GET /orbit/graph_status has no rate limit. Each call makes Orbit count every entity under the group or project in ClickHouse. The Orbit MR removes the 5-minute cache on these counts, because the cache shows stale zero counts during indexing. This MR limits each user to 10 calls a minute for each group or project.
The limit is per user and namespace. The settings page shows up to 20 groups, and each card polls every 20 seconds, so a per-user limit would block it. A project has its own limit. A 404 does not count.
A per-user cap follows when !259468 (closed) removes the polling cards.
References
- !259468 (closed) (Orbit UI redesign, removes the polling cards)
Screenshots or screen recordings
Not applicable. No UI change.
How to set up and validate locally
- Enable Orbit for a group in GDK and create a personal access token with
read_api. - Call the endpoint 11 times:
for i in $(seq 11); do curl -s -o /dev/null -w '%{http_code}\n' -H "PRIVATE-TOKEN: $TOKEN" "http://gdk.test:3000/api/v4/orbit/graph_status?full_path=<group>"; done - The 11th call returns
429. A call for a project in the same group still returns200.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.