Skip to content

Disallow additional properties in event definitions

Sarah Yasonik requested to merge sy-fix-event-metric-validations into master

What does this MR do and why?

Changes:
  1. Modifies the schemas used to validate event definitions to prevent the usage of superfluous attributes
  2. Updates existing definition files that contain disallowed attributes
Motivation:

With the transition to internal events, more people are going to mix up the event & metric attributes.

ex) !137564 (merged) merged an event definition that included the "events" key

How to set up and validate locally

  1. In rails console, the below lines should return the definition objects -> not errors
    Gitlab::Tracking::EventDefinition.definitions
    Gitlab::Usage::MetricDefinition.definitions.each_value(&:validate!)

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 Sarah Yasonik

Merge request reports