Skip to content

Add a new danger rule to prevent adding new metrics to UsageData class

What does this MR do and why?

Since we deprecated adding new metrics directly to usage_data.rb we use instrumentation classes instead.

To simplify Product Intelligence reviews we expect that it would be beneficial to add a new Danger rule to warn developers if they add new code to usage_data.

Adds a warning to the MR if any insertions has been made to lib/gitlab/usage_data.rb.

Screenshots or screen recordings

Screenshot_2023-02-10_at_14.10.14

How to set up and validate locally

!111577 (closed) demonstrates what happens when you add code to usage_data.rb.

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 #377341 (closed)

Edited by Jonas Larsen

Merge request reports