Enhanced telemetry for MR reviewer sidebar reviewer selection
We need to enhance the telemetry reported by the sidebar reviewers dropdown(s).
When the user searches/filters and then selects a reviewer, we want to be able to identify what position that reviewer was in before the user searched, to help inform our suggestion algorithm.
Phase 2
For the more advanced tracking, we'll need to "invent" (more likely implement existing concepts of) the idea of long-running tracking events at GitLab.
It's possible GitLab already has this kind of long-running tracking (maybe for observing user flows through important journeys that we want them to complete, or something similar), but it's definitely not implemented in Code Review.
The basic steps of what we'd need to track go something like this:
- Reviewer dropdown loads after user interaction
- STORE (somewhere in memory) the position of each user in the list by a stable identifier (probably an array of
@
usernames is enough) - [.... time passes ....]
- User filters dropdown to a search query
- We MUST NOT store this new list, as it is a "customized" order (by the user input)
- User selects a reviewer
- RETRIEVE the original list of reviewers ordering
- Report a tracking event like
userSelectedReviewerAfterSearchInMergeRequestSidebar
with a payload like{ "position": #, "originalPosition": #|0 }
where0
is they were never in the original list, and 1+ is their position in the original list.
Note that steps 1-4 can be repeated infinite times before step 5 happens, so we need to keep performance in mind for our storage mechanism (particularly for writing, but also for retrieving). Fortunately, the data isn't too substantial as we're (currently) capping the results to 20 (alphabetical) users.