diff --git a/app/assets/javascripts/notes/components/mr_discussion_filter.vue b/app/assets/javascripts/notes/components/mr_discussion_filter.vue index 13fa3dee5f3081f7851074afc2250e8f6ebf3d2e..81c76f5e66b8b23814215e17a672804b0c150011 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); diff --git a/app/assets/javascripts/notes/constants.js b/app/assets/javascripts/notes/constants.js index 4d07039dbafc8c305b27bfddf00ad9847a574be8..282bf93a5741c4348bef88fe69fe440873fdabe8 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'; 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 0000000000000000000000000000000000000000..3802c832fcd9f917e87cc56f0222cd41d40581d0 --- /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 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 0000000000000000000000000000000000000000..602497676a3d699d5b3a5ce59e5b6872671e061e --- /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 0000000000000000000000000000000000000000..3b36b40200c173c08610f544a3a4d11ff33d4b32 --- /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 0000000000000000000000000000000000000000..17e3c7bf3b8b9a5e38c6caec607c142a012b775d --- /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 0000000000000000000000000000000000000000..d2ce9672a2e383c5e867405c5e2664f8cb0a1f95 --- /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 diff --git a/spec/frontend/notes/components/mr_discussion_filter_spec.js b/spec/frontend/notes/components/mr_discussion_filter_spec.js index 8f712e2af9054ab5a7476e3b71053e9e573ae964..cd75567ea0d2e3bdc406e2c793ec72d4116510d6 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 }) => {