[go: up one dir, main page]

Corrective action: Improve rate limited endpoint shared RSpec examples to enforce testing with multiple scopes

!204751 (merged) caused an S1 incident because it didn't test rate limiting with multiple scopes. The existing rate limited endpoint shared RSpec examples only exercise a single scope, making it difficult to catch these types of problems. We should improve the examples to allow for adding a second scope that is used to more thoroughly verify the intended behavior.

Implementation plan

  • Change the rate limited endpoint shared example to default to use_second_scope: true
  • Go through each use of rate limited endpoint shared examples that were not specifying use_second_scope and default to opt-out of use_second_scope
  • Remove the now default use_second_scope: true from tests that specify it
  • Ensure that a user-friendly message is output if the test context doesn't specify a request_with_second_scope method
  • Go through existing tests and adapt them to test with a second scope (removing the need for use_second_scope: false)
Edited by 🤖 GitLab Bot 🤖