Skip to content

Migrate EE issue events to GIET

Michał Wielich requested to merge michold-giet-issue-v2 into master

What does this MR do and why?

Related to #410053 (closed)

Migrate EE issue events into new GIET system.

Here's the script I used for generating new files:

Click to expand
[
['g_project_management_issue_added_to_epic', 'An issue has been added to an epic'],
['g_project_management_issue_changed_epic', "An issue's epic has been changed"],
['g_project_management_issue_health_status_changed', "An issue's health status has been changed"],
['g_project_management_issue_iteration_changed', "An issue's iteration has been changed"],
['g_project_management_issue_removed_from_epic', "An issue has been removed from an epic"],
['g_project_management_issue_weight_changed', "An issue's weight has been changed"],
].each do |event_name, event_desc|
  IssueEventGenerator.new([], {
    event: event_name,
    event_desc: event_desc,
    section: 'dev',
    stage: 'plan',
    group: 'project_management',
    mr: 'https://gitlab.com/gitlab-org/gitlab/-/merge_requests/124431'
  }).invoke_all
  ['28d', '7d'].each do |days|
    files = Dir["ee/config/metrics/counts_#{days}/*_#{event_name}_*"]
    raise StandardError, "Multiple files found: #{files}" unless files.count == 1
    file_name = files.first

    text = File.read(file_name)
    new_contents = text.gsub(/distribution:/, "events:
  - name: #{event_name}
    unique: user_id\ndistribution:")

    File.open(file_name, "w") {|file| file.puts new_contents }
  end
end

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Set up snowplow-micro
  2. Trigger the events migrated here:
    • Add an issue to an epic
    • Remove an issue from an epic
    • Change an issue's health status
    • Change an issue's iteration
    • Change an issue's epic
    • Change an issue's weight
  3. Make sure that the events have been triggered with content as per their new event definition files [eg. - category sent as InternalEventTracking] on the http://localhost:9091/micro/good snowplow micro endpoint.

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 Michał Wielich

Merge request reports