Limit issues one user can quickly create using service desk
What does this MR do and why?
It starts using the RateLimitedService
also for service desk issues which were ignored. They are all created by SupportBot user and therefore we needed to include one more value (external_author
) in the scope.
How to set up and validate locally
Preparation
- Enable incoming emails
- Update gitlab-mail_room gem to version 0.0.13 in Gemfile - see !72020 (closed) for more details if interested
- Run
bundle install
- Change limit (means limit per minute) for issue creation to a reasonable number, eg. In rails console run
setting = ApplicationSetting.current
setting.update!(issues_create_limit: 2)
Verification
- If you want to be sure the emails will be processed fast enough stop rails background job
gdk stop rails-background-jobs
- Start mail_room
bundle exec mail_room -c './config/mail_room.yml'
- Find the service desk address in project settings (General)
- Sent at least 3 emails to that address (in case you set limit to 2)
- Only 2 issues should be created
- You should see
RateLimitedService::RateLimitedError
in the logs
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #339644 (closed)
Edited by Jarka Košanová