Skip to content

Add tracking to the Start a review & Add to review buttons

Thomas Randolph requested to merge tor/maintenance/track-add-start-review into master

What does this MR do and why?

For #432126 (closed)

  1. Adds 4 new events as standard Redis counters (not unique-user/HLL) for total clicks of:
    • Start a review from the Overview tab
    • Start a review from the Changes tab
    • Add to review from the Overview tab
    • Add to review from the Changes tab
  2. Add 12 new tracking metrics for three time-frames (7d, 28d, all-time) for each of the 4 new events
  3. Sends those tracking events on their respective clicks
  4. Adds tests that the tracking utility is called in appropriate scenarios

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

N/A, these changes are all backstage.

How to set up and validate locally

  1. Go to an MR that has at least one line of diff changes (more than 1 line is a good idea)
  2. On the Changes tab, add a comment to any line
  3. Now, add review (draft) comments in these five scenarios (you can't do all five at once, since you can only start a review once)
    • Start a review by adding a draft to the existing diff on the Overview tab displayed due to your first comment
    • Start a review by adding a draft to the diffs on the Changes tab
    • Add to a review by adding a draft to the existing diff on the Overview tab displayed due to your first comment, after other drafts already exist
    • Add to a review by adding a draft to the diffs on the Changes tab
    • Add to a review by leaving a comment on the MR (not on any diff) on the Overview tab
  4. In each of these situations, confirm that the application is sending the correct event to /api/v4/usage_data/track_event in the browser console. It should be one of:
    • code_review_merge_request_click_start_review_on_overview_tab
    • code_review_merge_request_click_start_review_on_changes_tab
    • code_review_merge_request_click_add_to_review_on_overview_tab
    • code_review_merge_request_click_add_to_review_on_changes_tab
Edited by Thomas Randolph

Merge request reports