diff options
Diffstat (limited to 'tooling/danger/product_intelligence.rb')
-rw-r--r-- | tooling/danger/product_intelligence.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tooling/danger/product_intelligence.rb b/tooling/danger/product_intelligence.rb index 58e327408a1..d25f966504f 100644 --- a/tooling/danger/product_intelligence.rb +++ b/tooling/danger/product_intelligence.rb @@ -22,6 +22,11 @@ module Tooling MSG + CHANGED_USAGE_DATA_MESSAGE = <<~MSG + Notice that implementing metrics directly in usage_data.rb has been deprecated. ([Deprecated Usage Metrics](https://docs.gitlab.com/ee/development/service_ping/usage_data.html#usage-data-metrics-guide)) + Please use [Instrumentation Classes](https://docs.gitlab.com/ee/development/service_ping/metrics_instrumentation.html) instead. + MSG + WORKFLOW_LABELS = [ APPROVED_LABEL, REVIEW_LABEL @@ -47,6 +52,13 @@ module Tooling helper.labels_to_add.concat(missing_labels) unless missing_labels.empty? end + def check_usage_data_insertions! + usage_data_changes = helper.changed_lines("lib/gitlab/usage_data.rb") + return if usage_data_changes.none? { |change| change.start_with?("+") } + + warn format(CHANGED_USAGE_DATA_MESSAGE) + end + private def convert_to_table(items) |