Skip to content

Allow additionalProperties for db-indicators-settings attr

What does this MR do and why?

Allows additionalProperties: true for ApplicationSetting.prometheus_alert_db_indicators_settings column.

!128365 (merged) - adds WAL rate config to prometheus_alert_db_indicators_settings, the db changes should go in before the code changes. But the existing JSON schema validator doesn't allow new attributes to be added, so this MR handles it.

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

as = ApplicationSetting.last
settings = as.prometheus_alert_db_indicators_settings

# Please refer https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128674#note_1506036857 to populate the initial value if the settings is empty.

as.prometheus_alert_db_indicators_settings = settings.merge(new_indicator: 'test')
as.valid?
=> true # returns 'true' for the new indicator config

as.prometheus_alert_db_indicators_settings = settings.merge(apdex_sli_query: 10)
as.valid?
=> false # returns 'false' for identified keys

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 Prabakaran Murugesan

Merge request reports

Loading