Skip to content

Prevent oversized alert notifications from raising

Sarah Yasonik requested to merge sy-fix-alert-payload-size-check into master

What does this MR do and why?

Passing an ActionController::Parameters object to Gitlab::Utils::DeepSize#valid? always returns true, regardless of size. As a result, there are false positives in the tests for the size limits on our alert integration endpoints. The issue gets caught later in the flow, but the error is unhandled at that point. This MR fixes the checks and the tests.

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/348676 (I'm refactoring for that issue & could this out into a separate MR)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. In a project with maintainer+ permissions, nav to Settings > Monitor > Alerts
  2. Create an alert integration or open an existing one
    • easiest form values: HTTP, any name, active, skip the mapping fields, save
  3. Open the Send test alert tab for the integration
  4. Send a very big payload (> 1 megabyte) & open the alert under Monitor > Alerts
  5. Request should return 400 instead of uncaught 500

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sarah Yasonik

Merge request reports

Loading