Skip to content

Add snowplow metrics for failing masked variable validation

What does this MR do and why?

This MR adds the Snowplow events for the validation errors during the variable creation in the ci_cariable_modal.

The events are:

  1. label: 'ci_variable_modal', action: 'validation_error', property: 'displaysMaskedError' for the error masking the variable. It is checked on the variable change and on the Mask variable checkbox toggle.
  2. label: 'ci_variable_modal', action: 'validation_error', property: 'displaysVariableReferenceError' for the case when variable contains $ character.

The events are sent only once after the modal is opened. It will be sent once more if the user closes and opens the modal for the second time.

Screenshots or screen recordings

No visual changes. Adding screenshots for the context.

Képernyőfotó_2021-11-23_-_20.57.01

Képernyőfotó_2021-11-23_-_20.56.17

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Go to Settings -> CI/CD -> Variables
  2. Try creating a variable that contains $ or doesn't match the masked variables rules.
  3. For the events testing you can use the Chrome Extension

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #346395 (closed)

Edited by Anna Vovchenko

Merge request reports