Skip to content

Limit issues one user can quickly create using service desk

Jarka Košanová requested to merge 339644-sd-limit into master

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

  1. Enable incoming emails
  2. Update gitlab-mail_room gem to version 0.0.13 in Gemfile - see !72020 (closed) for more details if interested
  3. Run bundle install
  4. 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

  1. If you want to be sure the emails will be processed fast enough stop rails background job gdk stop rails-background-jobs
  2. Start mail_room bundle exec mail_room -c './config/mail_room.yml'
  3. Find the service desk address in project settings (General)
  4. Sent at least 3 emails to that address (in case you set limit to 2)
  5. Only 2 issues should be created
  6. 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.

Related to #339644 (closed)

Edited by Jarka Košanová

Merge request reports

Loading