Loading
Rate limit epic board moves per user
What does this MR do and why?
epicMoveList has no rate limit. This MR adds a per user limit of 200 moves per minute, configurable with the epic_move_list_limit application setting (beta). The key rolls out in log mode first: while the epic_move_list_rate_limit gitlab_com_derisk flag is off, moves over the limit are logged under limit_epic_board_moves_by_user_log but not blocked. Enabling the flag enforces the limit.
5d74f299adds the setting and theepic_move_listrule.c50916f8checks the limit in the mutation. Each GraphQL alias counts against the limit, so one aliased request cannot go over it.0ed7c92ddefines the rule withstaged_rule, so the flag switches it from log mode to enforcement.fb967884moves the setting and the rule to the EE overrides, becauseepicMoveListexists only in EE.
The limit follows the pattern of gitlab-org/gitlab!266323.
References
Related to gitlab-org/gitlab#638275
Feature flag rollout: gitlab-org/gitlab#639098
How to set up and validate locally
- Set a low limit:
ApplicationSetting.current.update!(epic_move_list_limit: 1). - Move an epic between two lists on an epic board twice in one minute. Both moves succeed, and the request log line carries
applimiter_epic_move_list:limit_epic_board_moves_by_user_log:loginrate_limit_state. - Enable the flag:
Feature.enable(:epic_move_list_rate_limit). - Move the epic twice again in one minute. The second move returns the rate limit error.
Edited by Jorge Tomás