Monitor Alert Webhook Endpoint fails with 500 if "severity" is uppercase
Summary
When integrating an external alert source with "Generic HTTP Endpoint" the endpoint responds with a 500 (application error) if the "severity" key in the json payload is uppercase.
Steps to reproduce
- Send a payload to the alert integration with this format:
{"title": "My Alert", "severity": "INFO"}
It will return a 500.
- Send a payload to the alert integration with this format:
{"title": "My Alert", "severity": "info"}
It will return a 200.
Example Project
I have a non-public project which I can easily repro this on.
What is the current bug behavior?
Endpoint fails with 500 Internal server error
and does not create an alert.
What is the expected correct behavior?
Create alert and map uppercased severity accordingly.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
/cc @sarahwaldner