Fix danger rule for Analytics Instrumentation
requested to merge 427889-analytics-instrumentation-review-did-not-get-triggered-for-gitlab-tracking-event into master
What does this MR do and why?
Analytics Instrumentation review did not trigger most calls to Gitlab::Tracking.event
. This MR fixes that.
The rule would only trigger if Gitlab::Tracking.event
was at the end of a line. In most cases it is not at the end of the line.
This fix also applies to calls to Gitlab::Tracking.enabled?
and Gitlab::Tracking.options
.
How to set up and validate locally
On master
the below steps does not provide a warning. On this branch it should output an error like this
- Create a new Ruby file that calls
Gitlab::Tracking.event
:echo -e "# frozen_string_literal: true\n" \ "\n" \ "module Demo\n" \ " Gitlab::Tracking.event('abc')\n" \ "end" > demo.rb
- Make a new commit with the change
git add demo.rb && git commit -m"To test danger"
- Run Danger:
bundle exec rake danger_local
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #427889 (closed)
Edited by Jonas Larsen