Prevent oversized alert notifications from raising
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
- In a project with maintainer+ permissions, nav to
Settings > Monitor > Alerts
- Create an alert integration or open an existing one
- easiest form values:
HTTP
, any name,active
, skip the mapping fields, save
- easiest form values:
- Open the
Send test alert
tab for the integration - Send a very big payload (> 1 megabyte) & open the alert under
Monitor > Alerts
- Sample payload: very_large_alert_payload.json
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Sarah Yasonik