Add validation to Alert Rules Templates which were created from YAML files

Description

User story:

UI/UX: designer

Acceptance criteria PO

Out of scope: PO/Team on grooming/pre-grooming**

Suggested implementation: Team on grooming/pre-grooming**

How to test: Team on grooming

Details:

Notes

At the moment, there are two ways to create new Alert Rules Templates:

a) upload a YAML "string" through the API

b) drop a YAML file in the correct directory in the server

Alert Rules Templates created through the API undergo validations. But the templates created directly in the server (b) do NOT currently undergo the same validations as (a).
We should therefore add validations to those templates created as described in (b).

Furthermore, we also have validations applied at different point of the data flow.

For instance, the parameter `unit` is a free format string and as such any value will be accepted when a new template is created.

However, in the API method `ListTemplates` we have a predefined subset of possible values for `unit`. Right now, the only known value is "percentage".

So, we need to unify these rules making sure that values added to fields such as `unit` are validated in the same way, regardless of how the template was created.

How to test

None

How to document

None

Smart Checklist

Activity

Show:

Jira Bot March 31, 2021 at 6:56 PM

Hello ,
I'm jira-bot, Percona's automated helper script. Your bug report is important
to us but we've been unable to reproduce it, and asked you for more
information. If we haven't heard from you on this in 3 more weeks, the issue
will be automatically closed.

Details

Assignee

Reporter

Priority

Components

Needs QA

Needs Doc

Reviewer

Smart Checklist

Created December 21, 2020 at 11:27 AM
Updated March 6, 2024 at 3:27 AM