From f42b141543915eaa7ff189e22e365d560381a790 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 2 May 2024 22:53:29 -0600 Subject: [PATCH 1/5] Add tracking event name for toggling bot comments --- app/assets/javascripts/notes/constants.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/notes/constants.js b/app/assets/javascripts/notes/constants.js index 4d07039dbafc8c..282bf93a5741c4 100644 --- a/app/assets/javascripts/notes/constants.js +++ b/app/assets/javascripts/notes/constants.js @@ -129,3 +129,4 @@ export const MR_FILTER_OPTIONS = [ ]; export const MR_FILTER_TRACKING_OPENED = 'user_clicks_comment_filter_dropdown'; export const MR_FILTER_TRACKING_USER_COMMENTS = 'click_comment_filter_toggle_user_comments_in_mr'; +export const MR_FILTER_TRACKING_BOT_COMMENTS = 'click_comment_filter_toggle_bot_comments_in_mr'; -- GitLab From 651910e0893acd6ba65b814841a3b1ef7b3a9d17 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 2 May 2024 22:58:39 -0600 Subject: [PATCH 2/5] Add tracking event for toggling bot comments --- ...mment_filter_toggle_bot_comments_in_mr.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/events/click_comment_filter_toggle_bot_comments_in_mr.yml diff --git a/config/events/click_comment_filter_toggle_bot_comments_in_mr.yml b/config/events/click_comment_filter_toggle_bot_comments_in_mr.yml new file mode 100644 index 00000000000000..3802c832fcd9f9 --- /dev/null +++ b/config/events/click_comment_filter_toggle_bot_comments_in_mr.yml @@ -0,0 +1,20 @@ +--- +description: A user clicks the merge request comment filter dropdown option to toggle comments from bots +internal_events: true +action: click_comment_filter_toggle_bot_comments_in_mr +identifiers: +- project +- namespace +- user +product_section: dev +product_stage: create +product_group: code_review +milestone: '17.0' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146940 +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate -- GitLab From d248412bc0056bc49c22e7adf66f90844e11ba59 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 2 May 2024 23:05:12 -0600 Subject: [PATCH 3/5] Add instrumentation metrics for toggling bot comments --- ...lter_toggle_bot_comments_in_mr_monthly.yml | 24 +++++++++++++++++++ ...lter_toggle_bot_comments_in_mr_monthly.yml | 23 ++++++++++++++++++ ...ilter_toggle_bot_comments_in_mr_weekly.yml | 24 +++++++++++++++++++ ...ilter_toggle_bot_comments_in_mr_weekly.yml | 23 ++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 config/metrics/counts_28d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml create mode 100644 config/metrics/counts_28d/count_total_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml create mode 100644 config/metrics/counts_7d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml create mode 100644 config/metrics/counts_7d/count_total_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml diff --git a/config/metrics/counts_28d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml b/config/metrics/counts_28d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml new file mode 100644 index 00000000000000..602497676a3d69 --- /dev/null +++ b/config/metrics/counts_28d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml @@ -0,0 +1,24 @@ +--- +key_path: redis_hll_counters.count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_monthly +description: Monthly count of unique users who toggled the bot comments option in the MR comment filter dropdown +product_section: dev +product_stage: create +product_group: code_review +performance_indicator_type: [] +value_type: number +status: active +milestone: '17.0' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146940 +time_frame: 28d +data_source: internal_events +data_category: optional +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate +events: +- name: click_comment_filter_toggle_bot_comments_in_mr + unique: user.id diff --git a/config/metrics/counts_28d/count_total_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml b/config/metrics/counts_28d/count_total_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml new file mode 100644 index 00000000000000..3b36b40200c173 --- /dev/null +++ b/config/metrics/counts_28d/count_total_click_comment_filter_toggle_bot_comments_in_mr_monthly.yml @@ -0,0 +1,23 @@ +--- +key_path: counts.count_total_click_comment_filter_toggle_bot_comments_in_mr_monthly +description: Monthly count of times the bot comments option in the MR comment filter dropdown was toggled +product_section: dev +product_stage: create +product_group: code_review +performance_indicator_type: [] +value_type: number +status: active +milestone: '17.0' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146940 +time_frame: 28d +data_source: internal_events +data_category: optional +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate +events: +- name: click_comment_filter_toggle_bot_comments_in_mr diff --git a/config/metrics/counts_7d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml b/config/metrics/counts_7d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml new file mode 100644 index 00000000000000..17e3c7bf3b8b9a --- /dev/null +++ b/config/metrics/counts_7d/count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml @@ -0,0 +1,24 @@ +--- +key_path: redis_hll_counters.count_distinct_user_id_from_click_comment_filter_toggle_bot_comments_in_mr_weekly +description: Weekly count of unique users who toggled the bot comments option in the MR comment filter dropdown +product_section: dev +product_stage: create +product_group: code_review +performance_indicator_type: [] +value_type: number +status: active +milestone: '17.0' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146940 +time_frame: 7d +data_source: internal_events +data_category: optional +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate +events: +- name: click_comment_filter_toggle_bot_comments_in_mr + unique: user.id diff --git a/config/metrics/counts_7d/count_total_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml b/config/metrics/counts_7d/count_total_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml new file mode 100644 index 00000000000000..d2ce9672a2e383 --- /dev/null +++ b/config/metrics/counts_7d/count_total_click_comment_filter_toggle_bot_comments_in_mr_weekly.yml @@ -0,0 +1,23 @@ +--- +key_path: counts.count_total_click_comment_filter_toggle_bot_comments_in_mr_weekly +description: Weekly count of times the bot comments option in the MR comment filter dropdown was toggled +product_section: dev +product_stage: create +product_group: code_review +performance_indicator_type: [] +value_type: number +status: active +milestone: '17.0' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146940 +time_frame: 7d +data_source: internal_events +data_category: optional +distribution: +- ce +- ee +tier: +- free +- premium +- ultimate +events: +- name: click_comment_filter_toggle_bot_comments_in_mr -- GitLab From e4524b47613083710bf717d29a5771beb51ccda8 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 2 May 2024 23:11:53 -0600 Subject: [PATCH 4/5] Connect tracking to user interface toggles of bot comments --- .../javascripts/notes/components/mr_discussion_filter.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/notes/components/mr_discussion_filter.vue b/app/assets/javascripts/notes/components/mr_discussion_filter.vue index 13fa3dee5f3081..81c76f5e66b8b2 100644 --- a/app/assets/javascripts/notes/components/mr_discussion_filter.vue +++ b/app/assets/javascripts/notes/components/mr_discussion_filter.vue @@ -9,10 +9,12 @@ import { MR_FILTER_OPTIONS, MR_FILTER_TRACKING_OPENED, MR_FILTER_TRACKING_USER_COMMENTS, + MR_FILTER_TRACKING_BOT_COMMENTS, } from '~/notes/constants'; const filterOptionToTrackingEventMap = { comments: MR_FILTER_TRACKING_USER_COMMENTS, + bot_comments: MR_FILTER_TRACKING_BOT_COMMENTS, }; const allFilters = MR_FILTER_OPTIONS.map((f) => f.value); -- GitLab From a2d31ab2e4c3fb3ed16b767565fe1b53e38ff1a3 Mon Sep 17 00:00:00 2001 From: Thomas Randolph Date: Thu, 2 May 2024 23:14:25 -0600 Subject: [PATCH 5/5] Test that bot comment toggling works --- spec/frontend/notes/components/mr_discussion_filter_spec.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spec/frontend/notes/components/mr_discussion_filter_spec.js b/spec/frontend/notes/components/mr_discussion_filter_spec.js index 8f712e2af9054a..cd75567ea0d2e3 100644 --- a/spec/frontend/notes/components/mr_discussion_filter_spec.js +++ b/spec/frontend/notes/components/mr_discussion_filter_spec.js @@ -9,6 +9,7 @@ import { MR_FILTER_OPTIONS, MR_FILTER_TRACKING_OPENED, MR_FILTER_TRACKING_USER_COMMENTS, + MR_FILTER_TRACKING_BOT_COMMENTS, } from '~/notes/constants'; Vue.use(Vuex); @@ -164,8 +165,9 @@ describe('Merge request discussion filter component', () => { }); it.each` - item | trackingEvent - ${'comments'} | ${MR_FILTER_TRACKING_USER_COMMENTS} + item | trackingEvent + ${'comments'} | ${MR_FILTER_TRACKING_USER_COMMENTS} + ${'bot_comments'} | ${MR_FILTER_TRACKING_BOT_COMMENTS} `( 'Send the correct event ($trackingEvent) for clicks on the filter item "$item"', ({ item, trackingEvent }) => { -- GitLab