diff options
Diffstat (limited to 'app/services/ci/job_artifacts/track_artifact_report_service.rb')
-rw-r--r-- | app/services/ci/job_artifacts/track_artifact_report_service.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/services/ci/job_artifacts/track_artifact_report_service.rb b/app/services/ci/job_artifacts/track_artifact_report_service.rb new file mode 100644 index 00000000000..1be1d98394f --- /dev/null +++ b/app/services/ci/job_artifacts/track_artifact_report_service.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Ci + module JobArtifacts + class TrackArtifactReportService + include Gitlab::Utils::UsageData + + REPORT_TRACKED = %i[test].freeze + + def execute(pipeline) + REPORT_TRACKED.each do |report| + if pipeline.complete_and_has_reports?(Ci::JobArtifact.of_report_type(report)) + track_usage_event(event_name(report), pipeline.user_id) + end + end + end + + def event_name(report) + "i_testing_#{report}_report_uploaded" + end + end + end +end |