Alert Management - Severity should be ingested by Alerts endpoint
The Alert endpoint should set severity when it exists in the Alert payload.
To reproduce
- Enable the generic alert endpoint (https://docs.gitlab.com/ee/user/project/integrations/generic_alerts.html)
- POST the following data to it:
{"title": "Simple Alert", "severity": "high"}
- for example:
curl --request POST --data '{"title": "Simple Alert", "severity": "high"}' --header "Authorization: Bearer <bearer>" --header "Content-Type: application/json" <url>
- View the alert management list.
Expected Behaviour
- Severity for the new alert should be 'high'
Actual Behaviour
- Severity is
CRITICAL
More info:
"severity": "high"
was just an example. Perhaps the value should be all caps like "HIGH"
or an enum like 4
instead.
See our alert params definition - this is missing severity https://gitlab.com/gitlab-org/gitlab/-/blob/a11d61d1df52df434f006daf509dbda34d85e563/lib/gitlab/alert_management/alert_params.rb#L10
Edited by Tristan Read