From d48b4f47d93c36df499eab92452e8470b3ef4445 Mon Sep 17 00:00:00 2001 From: Zhaochen Li Date: Thu, 24 Jul 2025 11:40:28 +1000 Subject: [PATCH] Clean up legacy workspace events and metrics Set to removal status for workspace legacy events users_updating_workspaces and users_creating_workspaces and corresponding metric. Workspace Category has implemented newer events and metrics. Changelog: deprecated --- .../remote_development/workspace_operations/create.rb | 6 ------ .../remote_development/workspace_operations/update.rb | 7 ------- ee/config/metrics/counts_all/users_creating_workspaces.yml | 4 +++- ee/config/metrics/counts_all/users_updating_workspaces.yml | 4 +++- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb b/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb index 85963b77e923e3..a3de05be19cf78 100644 --- a/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb +++ b/ee/app/graphql/mutations/remote_development/workspace_operations/create.rb @@ -5,9 +5,6 @@ module RemoteDevelopment module WorkspaceOperations class Create < BaseMutation graphql_name 'WorkspaceCreate' - - include Gitlab::Utils::UsageData - authorize :create_workspace field :workspace, @@ -114,9 +111,6 @@ def resolve(args) # noinspection RubyNilAnalysis - RubyMine thinks project or agent may be nil, but this is not possible # because authorized_find! would have thrown an exception. - # noinspection RubyNilAnalysis - This is because the superclass #current_user uses #[], which can return nil - track_usage_event(:users_creating_workspaces, current_user.id) - params = args.merge( agent: agent, user: current_user, diff --git a/ee/app/graphql/mutations/remote_development/workspace_operations/update.rb b/ee/app/graphql/mutations/remote_development/workspace_operations/update.rb index 1fafc3a3aaeb2d..ed40fb6bcc591c 100644 --- a/ee/app/graphql/mutations/remote_development/workspace_operations/update.rb +++ b/ee/app/graphql/mutations/remote_development/workspace_operations/update.rb @@ -5,9 +5,6 @@ module RemoteDevelopment module WorkspaceOperations class Update < BaseMutation graphql_name 'WorkspaceUpdate' - - include Gitlab::Utils::UsageData - authorize :update_workspace field :workspace, @@ -35,10 +32,6 @@ def resolve(id:, **args) workspace = authorized_find!(id: id) - # noinspection RubyNilAnalysis - This is because the superclass #current_user uses #[], which can return nil - # TODO: Change the superclass to use context.fetch(:current_user) instead of context[:current_user] - track_usage_event(:users_updating_workspaces, current_user.id) - domain_main_class_args = { user: current_user, workspace: workspace, diff --git a/ee/config/metrics/counts_all/users_creating_workspaces.yml b/ee/config/metrics/counts_all/users_creating_workspaces.yml index 3dc4232c0aca20..2f9020f190f0ba 100644 --- a/ee/config/metrics/counts_all/users_creating_workspaces.yml +++ b/ee/config/metrics/counts_all/users_creating_workspaces.yml @@ -3,7 +3,9 @@ key_path: redis_hll_counters.workspaces.users_creating_workspaces description: Count of users creating workspaces product_group: remote_development value_type: number -status: active +status: removed +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/198826 +milestone_removed: "18.3" milestone: "16.0" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120341 time_frame: diff --git a/ee/config/metrics/counts_all/users_updating_workspaces.yml b/ee/config/metrics/counts_all/users_updating_workspaces.yml index 8baf8599ea0171..1ef0bf798602fa 100644 --- a/ee/config/metrics/counts_all/users_updating_workspaces.yml +++ b/ee/config/metrics/counts_all/users_updating_workspaces.yml @@ -3,7 +3,9 @@ key_path: redis_hll_counters.workspaces.users_updating_workspaces description: Count of users updating workspaces product_group: remote_development value_type: number -status: active +status: removed +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/198826 +milestone_removed: "18.3" milestone: "16.0" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120341 time_frame: -- GitLab