diff options
67 files changed, 1261 insertions, 191 deletions
diff --git a/app/controllers/projects/google_cloud/base_controller.rb b/app/controllers/projects/google_cloud/base_controller.rb index d1eb86c5e49..dfb73821b0f 100644 --- a/app/controllers/projects/google_cloud/base_controller.rb +++ b/app/controllers/projects/google_cloud/base_controller.rb @@ -12,7 +12,7 @@ class Projects::GoogleCloud::BaseController < Projects::ApplicationController def admin_project_google_cloud! unless can?(current_user, :admin_project_google_cloud, project) - track_event('admin_project_google_cloud!', 'error_access_denied', 'invalid_user') + track_event(:error_invalid_user) access_denied! end end @@ -20,11 +20,7 @@ class Projects::GoogleCloud::BaseController < Projects::ApplicationController def google_oauth2_enabled! config = Gitlab::Auth::OAuth::Provider.config_for('google_oauth2') if config.app_id.blank? || config.app_secret.blank? - track_event( - 'google_oauth2_enabled!', - 'error_access_denied', - { reason: 'google_oauth2_not_configured', config: config } - ) + track_event(:error_google_oauth2_not_enabled) access_denied! 'This GitLab instance not configured for Google Oauth2.' end end @@ -35,7 +31,7 @@ class Projects::GoogleCloud::BaseController < Projects::ApplicationController enabled_for_project = Feature.enabled?(:incubation_5mp_google_cloud, project) feature_is_enabled = enabled_for_user || enabled_for_group || enabled_for_project unless feature_is_enabled - track_event('feature_flag_enabled!', 'error_access_denied', 'feature_flag_not_enabled') + track_event(:error_feature_flag_not_enabled) access_denied! end end @@ -69,16 +65,14 @@ class Projects::GoogleCloud::BaseController < Projects::ApplicationController session[GoogleApi::CloudPlatform::Client.session_key_for_expires_at] end - def track_event(action, label, property) - options = { label: label, project: project, user: current_user } - - if property.is_a?(String) - options[:property] = property - else - options[:extra] = property - end - - Gitlab::Tracking.event('Projects::GoogleCloud', action, **options) + def track_event(action, label = nil) + Gitlab::Tracking.event( + self.class.name, + action.to_s, + label: label, + project: project, + user: current_user + ) end def gcp_projects diff --git a/app/controllers/projects/google_cloud/configuration_controller.rb b/app/controllers/projects/google_cloud/configuration_controller.rb index 8d252c35031..06a6674d578 100644 --- a/app/controllers/projects/google_cloud/configuration_controller.rb +++ b/app/controllers/projects/google_cloud/configuration_controller.rb @@ -16,7 +16,7 @@ module Projects revokeOauthUrl: revoke_oauth_url } @js_data = js_data.to_json - track_event('configuration#index', 'success', js_data) + track_event(:render_page) end private diff --git a/app/controllers/projects/google_cloud/databases_controller.rb b/app/controllers/projects/google_cloud/databases_controller.rb index fb442f87666..8f7554f248b 100644 --- a/app/controllers/projects/google_cloud/databases_controller.rb +++ b/app/controllers/projects/google_cloud/databases_controller.rb @@ -19,7 +19,7 @@ module Projects } @js_data = js_data.to_json - track_event('databases#index', 'success', nil) + track_event(:render_page) end def new @@ -37,6 +37,7 @@ module Projects tiers: Projects::GoogleCloud::CloudsqlHelper::TIERS }.to_json + track_event(:render_form) render template: 'projects/google_cloud/databases/cloudsql_form', formats: :html end @@ -46,7 +47,7 @@ module Projects .execute if enable_response[:status] == :error - track_event('databases#cloudsql_create', 'error_enable_cloudsql_service', enable_response) + track_event(:error_enable_cloudsql_services) flash[:error] = error_message(enable_response[:message]) else permitted_params = params.permit(:gcp_project, :ref, :database_version, :tier) @@ -55,10 +56,10 @@ module Projects .execute if create_response[:status] == :error - track_event('databases#cloudsql_create', 'error_create_cloudsql_instance', create_response) + track_event(:error_create_cloudsql_instance) flash[:warning] = error_message(create_response[:message]) else - track_event('databases#cloudsql_create', 'success', nil) + track_event(:create_cloudsql_instance, permitted_params.to_s) flash[:notice] = success_message end end diff --git a/app/controllers/projects/google_cloud/deployments_controller.rb b/app/controllers/projects/google_cloud/deployments_controller.rb index 1ac4697a63f..f6cc8d5eafb 100644 --- a/app/controllers/projects/google_cloud/deployments_controller.rb +++ b/app/controllers/projects/google_cloud/deployments_controller.rb @@ -12,7 +12,7 @@ class Projects::GoogleCloud::DeploymentsController < Projects::GoogleCloud::Base enableCloudStorageUrl: project_google_cloud_deployments_cloud_storage_path(project) } @js_data = js_data.to_json - track_event('deployments#index', 'success', js_data) + track_event(:render_page) end def cloud_run @@ -21,7 +21,7 @@ class Projects::GoogleCloud::DeploymentsController < Projects::GoogleCloud::Base .new(project, current_user, params).execute if enable_cloud_run_response[:status] == :error - track_event('deployments#cloud_run', 'error_enable_cloud_run', enable_cloud_run_response) + track_event(:error_enable_services) flash[:error] = enable_cloud_run_response[:message] redirect_to project_google_cloud_deployments_path(project) else @@ -30,17 +30,17 @@ class Projects::GoogleCloud::DeploymentsController < Projects::GoogleCloud::Base .new(project, current_user, params).execute if generate_pipeline_response[:status] == :error - track_event('deployments#cloud_run', 'error_generate_pipeline', generate_pipeline_response) + track_event(:error_generate_cloudrun_pipeline) flash[:error] = 'Failed to generate pipeline' redirect_to project_google_cloud_deployments_path(project) else cloud_run_mr_params = cloud_run_mr_params(generate_pipeline_response[:branch_name]) - track_event('deployments#cloud_run', 'success', cloud_run_mr_params) + track_event(:generate_cloudrun_pipeline) redirect_to project_new_merge_request_path(project, merge_request: cloud_run_mr_params) end end - rescue Google::Apis::ClientError, Google::Apis::ServerError, Google::Apis::AuthorizationError => e - track_event('deployments#cloud_run', 'error_gcp', e) + rescue Google::Apis::Error => e + track_event(:error_google_api) flash[:warning] = _('Google Cloud Error - %{error}') % { error: e } redirect_to project_google_cloud_deployments_path(project) end diff --git a/app/controllers/projects/google_cloud/gcp_regions_controller.rb b/app/controllers/projects/google_cloud/gcp_regions_controller.rb index 39f33624804..2f0bc05030f 100644 --- a/app/controllers/projects/google_cloud/gcp_regions_controller.rb +++ b/app/controllers/projects/google_cloud/gcp_regions_controller.rb @@ -15,13 +15,13 @@ class Projects::GoogleCloud::GcpRegionsController < Projects::GoogleCloud::BaseC cancelPath: project_google_cloud_configuration_path(project) } @js_data = js_data.to_json - track_event('gcp_regions#index', 'success', js_data) + track_event(:render_form) end def create permitted_params = params.permit(:ref, :gcp_region) - response = GoogleCloud::GcpRegionAddOrReplaceService.new(project).execute(permitted_params[:ref], permitted_params[:gcp_region]) - track_event('gcp_regions#create', 'success', response) + GoogleCloud::GcpRegionAddOrReplaceService.new(project).execute(permitted_params[:ref], permitted_params[:gcp_region]) + track_event(:configure_region) redirect_to project_google_cloud_configuration_path(project), notice: _('GCP region configured') end end diff --git a/app/controllers/projects/google_cloud/revoke_oauth_controller.rb b/app/controllers/projects/google_cloud/revoke_oauth_controller.rb index 1a9a2daf4f2..dbf91806722 100644 --- a/app/controllers/projects/google_cloud/revoke_oauth_controller.rb +++ b/app/controllers/projects/google_cloud/revoke_oauth_controller.rb @@ -9,10 +9,10 @@ class Projects::GoogleCloud::RevokeOauthController < Projects::GoogleCloud::Base if response.success? redirect_message = { notice: s_('GoogleCloud|Google OAuth2 token revocation requested') } - track_event('revoke_oauth#create', 'success', response.to_json) + track_event(:revoke_oauth) else redirect_message = { alert: s_('GoogleCloud|Google OAuth2 token revocation request failed') } - track_event('revoke_oauth#create', 'error', response.to_json) + track_event(:error) end session.delete(GoogleApi::CloudPlatform::Client.session_key_for_token) diff --git a/app/controllers/projects/google_cloud/service_accounts_controller.rb b/app/controllers/projects/google_cloud/service_accounts_controller.rb index 7f25054177e..89d624764df 100644 --- a/app/controllers/projects/google_cloud/service_accounts_controller.rb +++ b/app/controllers/projects/google_cloud/service_accounts_controller.rb @@ -5,7 +5,7 @@ class Projects::GoogleCloud::ServiceAccountsController < Projects::GoogleCloud:: def index if gcp_projects.empty? - track_event('service_accounts#index', 'error_form', 'no_gcp_projects') + track_event(:error_no_gcp_projects) flash[:warning] = _('No Google Cloud projects - You need at least one Google Cloud project') redirect_to project_google_cloud_configuration_path(project) else @@ -16,10 +16,10 @@ class Projects::GoogleCloud::ServiceAccountsController < Projects::GoogleCloud:: } @js_data = js_data.to_json - track_event('service_accounts#index', 'success', js_data) + track_event(:render_form) end - rescue Google::Apis::ClientError, Google::Apis::ServerError, Google::Apis::AuthorizationError => e - track_event('service_accounts#index', 'error_gcp', e) + rescue Google::Apis::Error => e + track_event(:error_google_api) flash[:warning] = _('Google Cloud Error - %{error}') % { error: e } redirect_to project_google_cloud_configuration_path(project) end @@ -35,10 +35,10 @@ class Projects::GoogleCloud::ServiceAccountsController < Projects::GoogleCloud:: environment_name: permitted_params[:ref] ).execute - track_event('service_accounts#create', 'success', response) + track_event(:create_service_account) redirect_to project_google_cloud_configuration_path(project), notice: response.message - rescue Google::Apis::ClientError, Google::Apis::ServerError, Google::Apis::AuthorizationError => e - track_event('service_accounts#create', 'error_gcp', e) + rescue Google::Apis::Error => e + track_event(:error_google_api) flash[:warning] = _('Google Cloud Error - %{error}') % { error: e } redirect_to project_google_cloud_configuration_path(project) end diff --git a/app/services/spam/spam_constants.rb b/app/services/spam/spam_constants.rb index d300525710c..9ac3bcf8a1d 100644 --- a/app/services/spam/spam_constants.rb +++ b/app/services/spam/spam_constants.rb @@ -2,6 +2,7 @@ module Spam module SpamConstants + ERROR_TYPE = 'spamcheck' BLOCK_USER = 'block' DISALLOW = 'disallow' CONDITIONAL_ALLOW = 'conditional_allow' diff --git a/app/services/spam/spam_verdict_service.rb b/app/services/spam/spam_verdict_service.rb index 382545556ab..08634ec840c 100644 --- a/app/services/spam/spam_verdict_service.rb +++ b/app/services/spam/spam_verdict_service.rb @@ -85,7 +85,7 @@ module Spam [result, attribs] rescue StandardError => e - Gitlab::ErrorTracking.log_exception(e) + Gitlab::ErrorTracking.log_exception(e, error: ERROR_TYPE) # Default to ALLOW if any errors occur [ALLOW, attribs, true] diff --git a/app/views/projects/merge_requests/creations/_new_compare.html.haml b/app/views/projects/merge_requests/creations/_new_compare.html.haml index 8cd0d2f9e32..17b1e5a757c 100644 --- a/app/views/projects/merge_requests/creations/_new_compare.html.haml +++ b/app/views/projects/merge_requests/creations/_new_compare.html.haml @@ -8,7 +8,7 @@ .col-lg-6 .card-new-merge-request %h2.gl-font-size-h2 - Source branch + = _('Source branch') .clearfix .merge-request-select.dropdown = f.hidden_field :source_project_id @@ -38,7 +38,7 @@ .col-lg-6 .card-new-merge-request %h2.gl-font-size-h2 - Target branch + = _('Target branch') .clearfix - projects = target_projects(@project) .merge-request-select.dropdown @@ -68,4 +68,4 @@ - if @merge_request.errors.any? = form_errors(@merge_request) - = f.submit 'Compare branches and continue', class: "gl-button btn btn-confirm mr-compare-btn gl-mt-4", data: { qa_selector: "compare_branches_button" } + = f.submit _('Compare branches and continue'), class: "gl-button btn btn-confirm mr-compare-btn gl-mt-4", data: { qa_selector: "compare_branches_button" } diff --git a/config/events/1662373051_Projects__GoogleCloud__ConfigurationController_error_invalid_user.yml b/config/events/1662373051_Projects__GoogleCloud__ConfigurationController_error_invalid_user.yml new file mode 100644 index 00000000000..5a71e2df485 --- /dev/null +++ b/config/events/1662373051_Projects__GoogleCloud__ConfigurationController_error_invalid_user.yml @@ -0,0 +1,26 @@ +--- +description: Invalid or unauthorized user +category: Projects::GoogleCloud::ConfigurationController +action: error_invalid_user +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373057_Projects__GoogleCloud__ConfigurationController_error_google_oauth2_not_enabled.yml b/config/events/1662373057_Projects__GoogleCloud__ConfigurationController_error_google_oauth2_not_enabled.yml new file mode 100644 index 00000000000..483225e0def --- /dev/null +++ b/config/events/1662373057_Projects__GoogleCloud__ConfigurationController_error_google_oauth2_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Google OAuth2 not enabled on GitLab instance +category: Projects::GoogleCloud::ConfigurationController +action: error_google_oauth2_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373062_Projects__GoogleCloud__ConfigurationController_error_feature_flag_not_enabled.yml b/config/events/1662373062_Projects__GoogleCloud__ConfigurationController_error_feature_flag_not_enabled.yml new file mode 100644 index 00000000000..b24a326ab30 --- /dev/null +++ b/config/events/1662373062_Projects__GoogleCloud__ConfigurationController_error_feature_flag_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Feature flag not enabled on the GitLab instance +category: Projects::GoogleCloud::ConfigurationController +action: error_feature_flag_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373069_Projects__GoogleCloud__ConfigurationController_render_page.yml b/config/events/1662373069_Projects__GoogleCloud__ConfigurationController_render_page.yml new file mode 100644 index 00000000000..21083a7596b --- /dev/null +++ b/config/events/1662373069_Projects__GoogleCloud__ConfigurationController_render_page.yml @@ -0,0 +1,26 @@ +--- +description: Configuration page rendered +category: Projects::GoogleCloud::ConfigurationController +action: render_page +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373075_Projects__GoogleCloud__ServiceAccountsController_error_invalid_user.yml b/config/events/1662373075_Projects__GoogleCloud__ServiceAccountsController_error_invalid_user.yml new file mode 100644 index 00000000000..850b8e81c0b --- /dev/null +++ b/config/events/1662373075_Projects__GoogleCloud__ServiceAccountsController_error_invalid_user.yml @@ -0,0 +1,26 @@ +--- +description: Invalid or unauthorized user +category: Projects::GoogleCloud::ServiceAccountsController +action: error_invalid_user +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373081_Projects__GoogleCloud__ServiceAccountsController_error_google_oauth2_not_enabled.yml b/config/events/1662373081_Projects__GoogleCloud__ServiceAccountsController_error_google_oauth2_not_enabled.yml new file mode 100644 index 00000000000..726ba6af7aa --- /dev/null +++ b/config/events/1662373081_Projects__GoogleCloud__ServiceAccountsController_error_google_oauth2_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Google OAuth2 not enabled on GitLab instance +category: Projects::GoogleCloud::ServiceAccountsController +action: error_google_oauth2_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373087_Projects__GoogleCloud__ServiceAccountsController_error_feature_flag_not_enabled.yml b/config/events/1662373087_Projects__GoogleCloud__ServiceAccountsController_error_feature_flag_not_enabled.yml new file mode 100644 index 00000000000..713e1a35584 --- /dev/null +++ b/config/events/1662373087_Projects__GoogleCloud__ServiceAccountsController_error_feature_flag_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Feature flag not enabled on the GitLab instance +category: Projects::GoogleCloud::ServiceAccountsController +action: error_feature_flag_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373092_Projects__GoogleCloud__ServiceAccountsController_render_form.yml b/config/events/1662373092_Projects__GoogleCloud__ServiceAccountsController_render_form.yml new file mode 100644 index 00000000000..55e0c87dd6c --- /dev/null +++ b/config/events/1662373092_Projects__GoogleCloud__ServiceAccountsController_render_form.yml @@ -0,0 +1,26 @@ +--- +description: Service account form rendered +category: Projects::GoogleCloud::ServiceAccountsController +action: render_form +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373098_Projects__GoogleCloud__ServiceAccountsController_error_no_gcp_projects.yml b/config/events/1662373098_Projects__GoogleCloud__ServiceAccountsController_error_no_gcp_projects.yml new file mode 100644 index 00000000000..a57df38aa6e --- /dev/null +++ b/config/events/1662373098_Projects__GoogleCloud__ServiceAccountsController_error_no_gcp_projects.yml @@ -0,0 +1,26 @@ +--- +description: No GCP projects found for user +category: Projects::GoogleCloud::ServiceAccountsController +action: error_no_gcp_projects +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373103_Projects__GoogleCloud__ServiceAccountsController_create_service_account.yml b/config/events/1662373103_Projects__GoogleCloud__ServiceAccountsController_create_service_account.yml new file mode 100644 index 00000000000..e147eaea44c --- /dev/null +++ b/config/events/1662373103_Projects__GoogleCloud__ServiceAccountsController_create_service_account.yml @@ -0,0 +1,26 @@ +--- +description: Service account created +category: Projects::GoogleCloud::ServiceAccountsController +action: create_service_account +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373109_Projects__GoogleCloud__ServiceAccountsController_error_google_api.yml b/config/events/1662373109_Projects__GoogleCloud__ServiceAccountsController_error_google_api.yml new file mode 100644 index 00000000000..f5404c0b318 --- /dev/null +++ b/config/events/1662373109_Projects__GoogleCloud__ServiceAccountsController_error_google_api.yml @@ -0,0 +1,26 @@ +--- +description: Google API error +category: Projects::GoogleCloud::ServiceAccountsController +action: error_google_api +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373114_Projects__GoogleCloud__GcpRegionsController_error_invalid_user.yml b/config/events/1662373114_Projects__GoogleCloud__GcpRegionsController_error_invalid_user.yml new file mode 100644 index 00000000000..e190dc68e05 --- /dev/null +++ b/config/events/1662373114_Projects__GoogleCloud__GcpRegionsController_error_invalid_user.yml @@ -0,0 +1,26 @@ +--- +description: Invalid or unauthorized user +category: Projects::GoogleCloud::GcpRegionsController +action: error_invalid_user +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373120_Projects__GoogleCloud__GcpRegionsController_error_google_oauth2_not_enabled.yml b/config/events/1662373120_Projects__GoogleCloud__GcpRegionsController_error_google_oauth2_not_enabled.yml new file mode 100644 index 00000000000..4ceb9567a31 --- /dev/null +++ b/config/events/1662373120_Projects__GoogleCloud__GcpRegionsController_error_google_oauth2_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Google OAuth2 not enabled on GitLab instance +category: Projects::GoogleCloud::GcpRegionsController +action: error_google_oauth2_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373125_Projects__GoogleCloud__GcpRegionsController_error_feature_flag_not_enabled.yml b/config/events/1662373125_Projects__GoogleCloud__GcpRegionsController_error_feature_flag_not_enabled.yml new file mode 100644 index 00000000000..c7b9c4ac2f6 --- /dev/null +++ b/config/events/1662373125_Projects__GoogleCloud__GcpRegionsController_error_feature_flag_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Feature flag not enabled on the GitLab instance +category: Projects::GoogleCloud::GcpRegionsController +action: error_feature_flag_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373131_Projects__GoogleCloud__GcpRegionsController_render_form.yml b/config/events/1662373131_Projects__GoogleCloud__GcpRegionsController_render_form.yml new file mode 100644 index 00000000000..227e0117e84 --- /dev/null +++ b/config/events/1662373131_Projects__GoogleCloud__GcpRegionsController_render_form.yml @@ -0,0 +1,26 @@ +--- +description: GCP regions configuration form rendered +category: Projects::GoogleCloud::GcpRegionsController +action: render_form +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373136_Projects__GoogleCloud__GcpRegionsController_configure_region.yml b/config/events/1662373136_Projects__GoogleCloud__GcpRegionsController_configure_region.yml new file mode 100644 index 00000000000..f301c068188 --- /dev/null +++ b/config/events/1662373136_Projects__GoogleCloud__GcpRegionsController_configure_region.yml @@ -0,0 +1,26 @@ +--- +description: GCP region configured +category: Projects::GoogleCloud::GcpRegionsController +action: configure_region +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373142_Projects__GoogleCloud__GcpRegionsController_error_create.yml b/config/events/1662373142_Projects__GoogleCloud__GcpRegionsController_error_create.yml new file mode 100644 index 00000000000..67bbc1a7465 --- /dev/null +++ b/config/events/1662373142_Projects__GoogleCloud__GcpRegionsController_error_create.yml @@ -0,0 +1,26 @@ +--- +description: Failed to configure GCP region +category: Projects::GoogleCloud::GcpRegionsController +action: error_create +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373147_Projects__GoogleCloud__RevokeOauthController_error_invalid_user.yml b/config/events/1662373147_Projects__GoogleCloud__RevokeOauthController_error_invalid_user.yml new file mode 100644 index 00000000000..a316efda189 --- /dev/null +++ b/config/events/1662373147_Projects__GoogleCloud__RevokeOauthController_error_invalid_user.yml @@ -0,0 +1,26 @@ +--- +description: Invalid or unauthorized user +category: Projects::GoogleCloud::RevokeOauthController +action: error_invalid_user +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373153_Projects__GoogleCloud__RevokeOauthController_error_google_oauth2_not_enabled.yml b/config/events/1662373153_Projects__GoogleCloud__RevokeOauthController_error_google_oauth2_not_enabled.yml new file mode 100644 index 00000000000..fc2bf9a5bcd --- /dev/null +++ b/config/events/1662373153_Projects__GoogleCloud__RevokeOauthController_error_google_oauth2_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Google OAuth2 not enabled on GitLab instance +category: Projects::GoogleCloud::RevokeOauthController +action: error_google_oauth2_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373158_Projects__GoogleCloud__RevokeOauthController_error_feature_flag_not_enabled.yml b/config/events/1662373158_Projects__GoogleCloud__RevokeOauthController_error_feature_flag_not_enabled.yml new file mode 100644 index 00000000000..33fdb94c3d8 --- /dev/null +++ b/config/events/1662373158_Projects__GoogleCloud__RevokeOauthController_error_feature_flag_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Feature flag not enabled on the GitLab instance +category: Projects::GoogleCloud::RevokeOauthController +action: error_feature_flag_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373164_Projects__GoogleCloud__RevokeOauthController_revoke_oauth.yml b/config/events/1662373164_Projects__GoogleCloud__RevokeOauthController_revoke_oauth.yml new file mode 100644 index 00000000000..a621d57271a --- /dev/null +++ b/config/events/1662373164_Projects__GoogleCloud__RevokeOauthController_revoke_oauth.yml @@ -0,0 +1,26 @@ +--- +description: OAuth token revoked +category: Projects::GoogleCloud::RevokeOauthController +action: revoke_oauth +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373170_Projects__GoogleCloud__DeploymentsController_error_invalid_user.yml b/config/events/1662373170_Projects__GoogleCloud__DeploymentsController_error_invalid_user.yml new file mode 100644 index 00000000000..4543251dd08 --- /dev/null +++ b/config/events/1662373170_Projects__GoogleCloud__DeploymentsController_error_invalid_user.yml @@ -0,0 +1,26 @@ +--- +description: Invalid or unauthorized user +category: Projects::GoogleCloud::DeploymentsController +action: error_invalid_user +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373175_Projects__GoogleCloud__DeploymentsController_error_google_oauth2_not_enabled.yml b/config/events/1662373175_Projects__GoogleCloud__DeploymentsController_error_google_oauth2_not_enabled.yml new file mode 100644 index 00000000000..119db94c828 --- /dev/null +++ b/config/events/1662373175_Projects__GoogleCloud__DeploymentsController_error_google_oauth2_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Google OAuth2 not enabled on GitLab instance +category: Projects::GoogleCloud::DeploymentsController +action: error_google_oauth2_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373181_Projects__GoogleCloud__DeploymentsController_error_feature_flag_not_enabled.yml b/config/events/1662373181_Projects__GoogleCloud__DeploymentsController_error_feature_flag_not_enabled.yml new file mode 100644 index 00000000000..1d4ba496e82 --- /dev/null +++ b/config/events/1662373181_Projects__GoogleCloud__DeploymentsController_error_feature_flag_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Feature flag not enabled on the GitLab instance +category: Projects::GoogleCloud::DeploymentsController +action: error_feature_flag_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373187_Projects__GoogleCloud__DeploymentsController_render_page.yml b/config/events/1662373187_Projects__GoogleCloud__DeploymentsController_render_page.yml new file mode 100644 index 00000000000..0335988d5c5 --- /dev/null +++ b/config/events/1662373187_Projects__GoogleCloud__DeploymentsController_render_page.yml @@ -0,0 +1,26 @@ +--- +description: Deployments page rendered +category: Projects::GoogleCloud::DeploymentsController +action: render_page +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373192_Projects__GoogleCloud__DeploymentsController_generate_cloudrun_pipeline.yml b/config/events/1662373192_Projects__GoogleCloud__DeploymentsController_generate_cloudrun_pipeline.yml new file mode 100644 index 00000000000..8e3920015a2 --- /dev/null +++ b/config/events/1662373192_Projects__GoogleCloud__DeploymentsController_generate_cloudrun_pipeline.yml @@ -0,0 +1,26 @@ +--- +description: Cloud Run pipeline generated +category: Projects::GoogleCloud::DeploymentsController +action: generate_cloudrun_pipeline +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373198_Projects__GoogleCloud__DeploymentsController_error_enable_cloudrun_services.yml b/config/events/1662373198_Projects__GoogleCloud__DeploymentsController_error_enable_cloudrun_services.yml new file mode 100644 index 00000000000..4a3fdd48a0d --- /dev/null +++ b/config/events/1662373198_Projects__GoogleCloud__DeploymentsController_error_enable_cloudrun_services.yml @@ -0,0 +1,26 @@ +--- +description: Failed to enable Cloud Run services +category: Projects::GoogleCloud::DeploymentsController +action: error_enable_cloudrun_services +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373204_Projects__GoogleCloud__DeploymentsController_error_generate_cloudrun_pipeline.yml b/config/events/1662373204_Projects__GoogleCloud__DeploymentsController_error_generate_cloudrun_pipeline.yml new file mode 100644 index 00000000000..ecf2ef4ae37 --- /dev/null +++ b/config/events/1662373204_Projects__GoogleCloud__DeploymentsController_error_generate_cloudrun_pipeline.yml @@ -0,0 +1,26 @@ +--- +description: Failed to enable Cloud Run services +category: Projects::GoogleCloud::DeploymentsController +action: error_generate_cloudrun_pipeline +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373209_Projects__GoogleCloud__DeploymentsController_error_google_api.yml b/config/events/1662373209_Projects__GoogleCloud__DeploymentsController_error_google_api.yml new file mode 100644 index 00000000000..81e7a881b5a --- /dev/null +++ b/config/events/1662373209_Projects__GoogleCloud__DeploymentsController_error_google_api.yml @@ -0,0 +1,26 @@ +--- +description: Google API error +category: Projects::GoogleCloud::DeploymentsController +action: error_google_api +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373215_Projects__GoogleCloud__DatabasesController_error_invalid_user.yml b/config/events/1662373215_Projects__GoogleCloud__DatabasesController_error_invalid_user.yml new file mode 100644 index 00000000000..21734eb875f --- /dev/null +++ b/config/events/1662373215_Projects__GoogleCloud__DatabasesController_error_invalid_user.yml @@ -0,0 +1,26 @@ +--- +description: Invalid or unauthorized user +category: Projects::GoogleCloud::DatabasesController +action: error_invalid_user +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373220_Projects__GoogleCloud__DatabasesController_error_google_oauth2_not_enabled.yml b/config/events/1662373220_Projects__GoogleCloud__DatabasesController_error_google_oauth2_not_enabled.yml new file mode 100644 index 00000000000..b9a4e3f2c7d --- /dev/null +++ b/config/events/1662373220_Projects__GoogleCloud__DatabasesController_error_google_oauth2_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Google OAuth2 not enabled on GitLab instance +category: Projects::GoogleCloud::DatabasesController +action: error_google_oauth2_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373226_Projects__GoogleCloud__DatabasesController_error_feature_flag_not_enabled.yml b/config/events/1662373226_Projects__GoogleCloud__DatabasesController_error_feature_flag_not_enabled.yml new file mode 100644 index 00000000000..04c03b87dd3 --- /dev/null +++ b/config/events/1662373226_Projects__GoogleCloud__DatabasesController_error_feature_flag_not_enabled.yml @@ -0,0 +1,26 @@ +--- +description: Feature flag not enabled on the GitLab instance +category: Projects::GoogleCloud::DatabasesController +action: error_feature_flag_not_enabled +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373232_Projects__GoogleCloud__DatabasesController_render_page.yml b/config/events/1662373232_Projects__GoogleCloud__DatabasesController_render_page.yml new file mode 100644 index 00000000000..b5bf9853e44 --- /dev/null +++ b/config/events/1662373232_Projects__GoogleCloud__DatabasesController_render_page.yml @@ -0,0 +1,26 @@ +--- +description: Databases page rendered +category: Projects::GoogleCloud::DatabasesController +action: render_page +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373237_Projects__GoogleCloud__DatabasesController_render_cloudsql_form.yml b/config/events/1662373237_Projects__GoogleCloud__DatabasesController_render_cloudsql_form.yml new file mode 100644 index 00000000000..5fab18d965d --- /dev/null +++ b/config/events/1662373237_Projects__GoogleCloud__DatabasesController_render_cloudsql_form.yml @@ -0,0 +1,26 @@ +--- +description: Cloud SQL form rendered +category: Projects::GoogleCloud::DatabasesController +action: render_cloudsql_form +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373243_Projects__GoogleCloud__DatabasesController_create_cloudsql_instance.yml b/config/events/1662373243_Projects__GoogleCloud__DatabasesController_create_cloudsql_instance.yml new file mode 100644 index 00000000000..3f5a2b5d8ba --- /dev/null +++ b/config/events/1662373243_Projects__GoogleCloud__DatabasesController_create_cloudsql_instance.yml @@ -0,0 +1,26 @@ +--- +description: Cloud SQL instance created +category: Projects::GoogleCloud::DatabasesController +action: create_cloudsql_instance +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373249_Projects__GoogleCloud__DatabasesController_error_enable_cloudsql_services.yml b/config/events/1662373249_Projects__GoogleCloud__DatabasesController_error_enable_cloudsql_services.yml new file mode 100644 index 00000000000..a6fb46df4b8 --- /dev/null +++ b/config/events/1662373249_Projects__GoogleCloud__DatabasesController_error_enable_cloudsql_services.yml @@ -0,0 +1,26 @@ +--- +description: Error enabling Cloud SQL services +category: Projects::GoogleCloud::DatabasesController +action: error_enable_cloudsql_services +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/events/1662373254_Projects__GoogleCloud__DatabasesController_error_create_cloudsql_instance.yml b/config/events/1662373254_Projects__GoogleCloud__DatabasesController_error_create_cloudsql_instance.yml new file mode 100644 index 00000000000..df9e28fabf5 --- /dev/null +++ b/config/events/1662373254_Projects__GoogleCloud__DatabasesController_error_create_cloudsql_instance.yml @@ -0,0 +1,26 @@ +--- +description: Error creating Cloud SQL instance +category: Projects::GoogleCloud::DatabasesController +action: error_create_cloudsql_instance +label_description: +property_description: +value_description: +extra_properties: +identifiers: +- project +- user +- namespace +product_section: google_cloud +product_stage: configure +product_group: group::incubation +product_category: cloud_seed +milestone: "15.4" +introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96683" +distributions: +- ce +- ee +tiers: +- free +- premium +- ultimate + diff --git a/config/feature_flags/development/bypass_batch_pop_queueing_for_merge_trains.yml b/config/feature_flags/development/bypass_batch_pop_queueing_for_merge_trains.yml new file mode 100644 index 00000000000..4517bd5360e --- /dev/null +++ b/config/feature_flags/development/bypass_batch_pop_queueing_for_merge_trains.yml @@ -0,0 +1,8 @@ +--- +name: bypass_batch_pop_queueing_for_merge_trains +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96793 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/372366 +milestone: '15.4' +type: development +group: group::scalability +default_enabled: false diff --git a/doc/administration/user_settings.md b/doc/administration/user_settings.md index 2e879f8789d..0a3f351c695 100644 --- a/doc/administration/user_settings.md +++ b/doc/administration/user_settings.md @@ -8,10 +8,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w GitLab administrators can modify user settings for the entire GitLab instance. -## Prevent users from creating top-level groups +## Prevent new users from creating top-level groups -By default, new users can create top-level groups. To disable your users' -ability to create top-level groups: +By default, new users can create top-level groups. To disable new users' +ability to create top-level groups (does not affect existing users' setting): **Omnibus GitLab installations** @@ -33,6 +33,13 @@ ability to create top-level groups: 1. [Restart GitLab](restart_gitlab.md#installations-from-source). +### Prevent existing users from creating top-level groups + +Administrators can: + +- Use the Admin Area to [prevent an existing user from creating top-level groups](../user/admin_area/index.md#prevent-a-user-from-creating-groups). +- Use the [modify an existing user API endpoint](../api/users.md#user-modification) to change the `can_create_group` setting. + ## Prevent users from changing their usernames By default, new users can change their usernames. To disable your users' diff --git a/doc/api/groups.md b/doc/api/groups.md index aaeb92a4630..b8545f57cc7 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -926,7 +926,7 @@ Transfer a group to a new parent group or turn a subgroup to a top-level group. - With the Owner role for the group to transfer. - With permission to [create a subgroup](../user/group/subgroups/index.md#create-a-subgroup) in the new parent group if transferring a group. -- With [permission to create a top-level group](../administration/user_settings.md#prevent-users-from-creating-top-level-groups) if turning a subgroup into a top-level group. +- With [permission to create a top-level group](../administration/user_settings.md) if turning a subgroup into a top-level group. ```plaintext POST /groups/:id/transfer diff --git a/doc/operations/incident_management/incidents.md b/doc/operations/incident_management/incidents.md index b66f1d3e1f6..2cb2e5f8045 100644 --- a/doc/operations/incident_management/incidents.md +++ b/doc/operations/incident_management/incidents.md @@ -320,7 +320,7 @@ team members can join the Zoom call without requesting a link. ## Linked resources -In an incident, you can [links to various resources](linked_resources.md), +In an incident, you can add [links to various resources](linked_resources.md), for example: - The incident Slack channel diff --git a/doc/operations/incident_management/linked_resources.md b/doc/operations/incident_management/linked_resources.md index d2254a30f91..f2a1e60e9c0 100644 --- a/doc/operations/incident_management/linked_resources.md +++ b/doc/operations/incident_management/linked_resources.md @@ -50,11 +50,27 @@ To add a linked resource: 1. Complete the required fields. 1. Select **Add**. +### Link Zoom meetings from an incident **(PREMIUM)** + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/230853) in GitLab 15.4. + +Use the `/zoom` [quick action](../../user/project/quick_actions.md) to add multiple Zoom links to an incident: + +```plaintext +/zoom https://example.zoom.us/j/123456789 +``` + +You can also submit a short optional description with the link. The description shows instead of the URL in the **Linked resources** section of the incident issue: + +```plaintext +/zoom https://example.zoom.us/j/123456789, Low on memory incident +``` + ## Remove a linked resource You can also remove a linked resource. -Prerequisities: +Prerequisites: - You must have at least the Reporter role for the project. diff --git a/doc/user/project/issues/associate_zoom_meeting.md b/doc/user/project/issues/associate_zoom_meeting.md index 41de91d9bd7..ef864dc2743 100644 --- a/doc/user/project/issues/associate_zoom_meeting.md +++ b/doc/user/project/issues/associate_zoom_meeting.md @@ -8,8 +8,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16609) in GitLab 12.4. -In order to communicate synchronously for incidents management, -GitLab allows to associate a Zoom meeting with an issue. +To communicate synchronously for incidents management, +you can associate a Zoom meeting with an issue. After you start a Zoom call for a fire-fight, you need a way to associate the conference call with an issue. This is so that your team members can join swiftly without requesting a link. @@ -36,6 +36,9 @@ You are only allowed to attach a single Zoom meeting to an issue. If you attempt to add a second Zoom meeting using the `/zoom` quick action, it doesn't work. You need to [remove it](#removing-an-existing-zoom-meeting-from-an-issue) first. +Users on GitLab Premium and higher can also +[add multiple Zoom links to incidents](../../../operations/incident_management/linked_resources.md#link-zoom-meetings-from-an-incident). + ## Removing an existing Zoom meeting from an issue Similarly to adding a Zoom meeting, you can remove it with a quick action: diff --git a/doc/user/project/quick_actions.md b/doc/user/project/quick_actions.md index 216d040734d..fe2d3cd6cd1 100644 --- a/doc/user/project/quick_actions.md +++ b/doc/user/project/quick_actions.md @@ -100,7 +100,7 @@ threads. Some quick actions might not be available to all subscription tiers. | `/remove_milestone` | **{check-circle}** Yes | **{check-circle}** Yes | **{dotted-circle}** No | Remove milestone. | | `/remove_parent_epic` | **{dotted-circle}** No | **{dotted-circle}** No | **{check-circle}** Yes | Remove parent epic from epic ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10556) in GitLab 12.1). | | `/remove_time_spent` | **{check-circle}** Yes | **{check-circle}** Yes | **{dotted-circle}** No | Remove time spent. | -| `/remove_zoom` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Remove Zoom meeting from this issue ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16609) in GitLab 12.4). | +| `/remove_zoom` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Remove Zoom meeting from this issue. | | `/reopen` | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | Reopen. | | `/severity <severity>` | **{check-circle}** Yes | **{check-circle}** No | **{check-circle}** No | Set the severity. Options for `<severity>` are `S1` ... `S4`, `critical`, `high`, `medium`, `low`, `unknown`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/334045) in GitLab 14.2. | | `/shrug <comment>` | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | Append the comment with `¯\_(ツ)_/¯`. | @@ -121,7 +121,7 @@ threads. Some quick actions might not be available to all subscription tiers. | `/unlock` | **{check-circle}** Yes | **{check-circle}** Yes | **{dotted-circle}** No | Unlock the discussions. | | `/unsubscribe` | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | Unsubscribe from notifications. | | `/weight <value>` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Set weight. Valid options for `<value>` include `0`, `1`, `2`, and so on. | -| `/zoom <Zoom URL>` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Add Zoom meeting to this issue ([introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16609) in GitLab 12.4). | +| `/zoom <Zoom URL>` | **{check-circle}** Yes | **{dotted-circle}** No | **{dotted-circle}** No | Add a Zoom meeting to this issue or incident. In [GitLab 15.3 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/230853) users on GitLab Premium can add a short description when [adding a Zoom link to an incident](../../operations/incident_management/linked_resources.md#link-zoom-meetings-from-an-incident).| ## Commit messages diff --git a/lib/api/admin/batched_background_migrations.rb b/lib/api/admin/batched_background_migrations.rb index 32980c192f7..5e03c27062b 100644 --- a/lib/api/admin/batched_background_migrations.rb +++ b/lib/api/admin/batched_background_migrations.rb @@ -27,9 +27,33 @@ module API end end end + + resources 'batched_background_migrations/:id/resume' do + desc 'Resume a batched background migration' + params do + optional :database, + type: String, + values: Gitlab::Database.all_database_names, + desc: 'The name of the database', + default: 'main' + requires :id, + type: Integer, + desc: 'The batched background migration id' + end + put do + Gitlab::Database::SharedModel.using_connection(base_model.connection) do + batched_background_migration.execute! + present_entity(batched_background_migration) + end + end + end end helpers do + def batched_background_migration + @batched_background_migration ||= Gitlab::Database::BackgroundMigration::BatchedMigration.find(params[:id]) + end + def base_model database = params[:database] || Gitlab::Database::MAIN_DATABASE_NAME @base_model ||= Gitlab::Database.database_base_models[database] diff --git a/lib/gitlab/quick_actions/issue_actions.rb b/lib/gitlab/quick_actions/issue_actions.rb index 189627506f3..1d122bb2b6e 100644 --- a/lib/gitlab/quick_actions/issue_actions.rb +++ b/lib/gitlab/quick_actions/issue_actions.rb @@ -207,19 +207,22 @@ module Gitlab desc { _('Add Zoom meeting') } explanation { _('Adds a Zoom meeting.') } - params '<Zoom URL>' + params do + zoom_link_params + end types Issue condition do @zoom_service = zoom_link_service + @zoom_service.can_add_link? end - parse_params do |link| - @zoom_service.parse_link(link) + parse_params do |link_params| + @zoom_service.parse_link(link_params) end - command :zoom do |link| - result = @zoom_service.add_link(link) + command :zoom do |link, link_text = nil| + result = add_zoom_link(link, link_text) @execution_message[:zoom] = result.message - @updates.merge!(result.payload) if result.payload + merge_updates(result, @updates) end desc { _('Remove Zoom meeting') } @@ -314,12 +317,24 @@ module Gitlab command :remove_contacts do |contact_emails| @updates[:remove_contacts] = contact_emails.split(' ') end + end - private + private - def zoom_link_service - ::Issues::ZoomLinkService.new(project: quick_action_target.project, current_user: current_user, params: { issue: quick_action_target }) - end + def zoom_link_service + ::Issues::ZoomLinkService.new(project: quick_action_target.project, current_user: current_user, params: { issue: quick_action_target }) + end + + def zoom_link_params + '<Zoom URL>' + end + + def add_zoom_link(link, _link_text) + zoom_link_service.add_link(link) + end + + def merge_updates(result, update_hash) + update_hash.merge!(result.payload) if result.payload end end end diff --git a/lib/gitlab/spamcheck/client.rb b/lib/gitlab/spamcheck/client.rb index b7ac6224e5c..0b9f3baa4de 100644 --- a/lib/gitlab/spamcheck/client.rb +++ b/lib/gitlab/spamcheck/client.rb @@ -34,7 +34,7 @@ module Gitlab end def spam?(spammable:, user:, context: {}, extra_features: {}) - metadata = { 'authorization' => Gitlab::CurrentSettings.spam_check_api_key } + metadata = { 'authorization' => Gitlab::CurrentSettings.spam_check_api_key || '' } protobuf_args = { spammable: spammable, user: user, context: context, extra_features: extra_features } pb, grpc_method = build_protobuf(**protobuf_args) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index a2c4d167ee5..c2a4609123d 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -9575,6 +9575,9 @@ msgstr "" msgid "Compare Revisions" msgstr "" +msgid "Compare branches and continue" +msgstr "" + msgid "Compare changes" msgstr "" diff --git a/spec/frontend/work_items/components/item_title_spec.js b/spec/frontend/work_items/components/item_title_spec.js index de20369eb1b..13e04ef6671 100644 --- a/spec/frontend/work_items/components/item_title_spec.js +++ b/spec/frontend/work_items/components/item_title_spec.js @@ -49,6 +49,6 @@ describe('ItemTitle', () => { findInputEl().element.innerText = mockUpdatedTitle; await findInputEl().trigger(sourceEvent); - expect(wrapper.emitted(eventName)).toBeTruthy(); + expect(wrapper.emitted(eventName)).toBeDefined(); }); }); diff --git a/spec/requests/api/admin/batched_background_migrations_spec.rb b/spec/requests/api/admin/batched_background_migrations_spec.rb index 8763089488d..dce4c19b4e7 100644 --- a/spec/requests/api/admin/batched_background_migrations_spec.rb +++ b/spec/requests/api/admin/batched_background_migrations_spec.rb @@ -75,4 +75,52 @@ RSpec.describe API::Admin::BatchedBackgroundMigrations do end end end + + describe 'PUT /admin/batched_background_migrations/:id/resume' do + let!(:migration) { create(:batched_background_migration, :paused) } + let(:database) { :main } + + subject(:resume) do + put api("/admin/batched_background_migrations/#{migration.id}/resume", admin), params: { database: database } + end + + it 'pauses the batched background migration' do + resume + + aggregate_failures "testing response" do + expect(response).to have_gitlab_http_status(:ok) + expect(json_response['id']).to eq(migration.id) + expect(json_response['status']).to eq('active') + end + end + + context 'when the batched background migration does not exist' do + let(:params) { { database: database } } + + it 'returns 404' do + put api("/admin/batched_background_migrations/#{non_existing_record_id}/pause", admin), params: params + + expect(response).to have_gitlab_http_status(:not_found) + end + end + + context 'when multiple database is enabled', :add_ci_connection do + let(:ci_model) { Ci::ApplicationRecord } + let(:database) { :ci } + + it 'uses the correct connection' do + expect(Gitlab::Database::SharedModel).to receive(:using_connection).with(ci_model.connection).and_yield + + resume + end + end + + context 'when authenticated as a non-admin user' do + it 'returns 403' do + get api('/admin/batched_background_migrations', unauthorized_user) + + expect(response).to have_gitlab_http_status(:forbidden) + end + end + end end diff --git a/spec/requests/projects/google_cloud/configuration_controller_spec.rb b/spec/requests/projects/google_cloud/configuration_controller_spec.rb index cb7f0d76930..41593b8d7a7 100644 --- a/spec/requests/projects/google_cloud/configuration_controller_spec.rb +++ b/spec/requests/projects/google_cloud/configuration_controller_spec.rb @@ -26,10 +26,9 @@ RSpec.describe Projects::GoogleCloud::ConfigurationController do get url expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::ConfigurationController', + action: 'error_invalid_user', + label: nil, project: project, user: unauthorized_member ) @@ -65,11 +64,9 @@ RSpec.describe Projects::GoogleCloud::ConfigurationController do expect(response).to have_gitlab_http_status(:forbidden) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'google_oauth2_enabled!', - label: 'error_access_denied', - extra: { reason: 'google_oauth2_not_configured', - config: unconfigured_google_oauth2 }, + category: 'Projects::GoogleCloud::ConfigurationController', + action: 'error_google_oauth2_not_enabled', + label: nil, project: project, user: authorized_member ) @@ -90,10 +87,9 @@ RSpec.describe Projects::GoogleCloud::ConfigurationController do expect(response).to have_gitlab_http_status(:not_found) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'feature_flag_enabled!', - label: 'error_access_denied', - property: 'feature_flag_not_enabled', + category: 'Projects::GoogleCloud::ConfigurationController', + action: 'error_feature_flag_not_enabled', + label: nil, project: project, user: authorized_member ) @@ -114,20 +110,9 @@ RSpec.describe Projects::GoogleCloud::ConfigurationController do expect(response).to be_successful expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'configuration#index', - label: 'success', - extra: { - configurationUrl: project_google_cloud_configuration_path(project), - deploymentsUrl: project_google_cloud_deployments_path(project), - databasesUrl: project_google_cloud_databases_path(project), - serviceAccounts: [], - createServiceAccountUrl: project_google_cloud_service_accounts_path(project), - emptyIllustrationUrl: ActionController::Base.helpers.image_path('illustrations/pipelines_empty.svg'), - configureGcpRegionsUrl: project_google_cloud_gcp_regions_path(project), - gcpRegions: [], - revokeOauthUrl: nil - }, + category: 'Projects::GoogleCloud::ConfigurationController', + action: 'render_page', + label: nil, project: project, user: authorized_member ) diff --git a/spec/requests/projects/google_cloud/databases_controller_spec.rb b/spec/requests/projects/google_cloud/databases_controller_spec.rb index cdd0555d526..4edef71f326 100644 --- a/spec/requests/projects/google_cloud/databases_controller_spec.rb +++ b/spec/requests/projects/google_cloud/databases_controller_spec.rb @@ -105,10 +105,9 @@ RSpec.describe Projects::GoogleCloud::DatabasesController, :snowplow do expect(response).to redirect_to(project_google_cloud_databases_path(project)) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'databases#cloudsql_create', - label: 'error_enable_cloudsql_service', - extra: { status: :error, message: 'error' }, + category: 'Projects::GoogleCloud::DatabasesController', + action: 'error_enable_cloudsql_services', + label: nil, project: project, user: user ) @@ -133,10 +132,9 @@ RSpec.describe Projects::GoogleCloud::DatabasesController, :snowplow do expect(response).to redirect_to(project_google_cloud_databases_path(project)) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'databases#cloudsql_create', - label: 'error_create_cloudsql_instance', - extra: { status: :error, message: 'error' }, + category: 'Projects::GoogleCloud::DatabasesController', + action: 'error_create_cloudsql_instance', + label: nil, project: project, user: user ) @@ -156,10 +154,9 @@ RSpec.describe Projects::GoogleCloud::DatabasesController, :snowplow do expect(response).to redirect_to(project_google_cloud_databases_path(project)) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'databases#cloudsql_create', - label: 'success', - extra: nil, + category: 'Projects::GoogleCloud::DatabasesController', + action: 'create_cloudsql_instance', + label: "{}", project: project, user: user ) diff --git a/spec/requests/projects/google_cloud/deployments_controller_spec.rb b/spec/requests/projects/google_cloud/deployments_controller_spec.rb index 9e854e01516..ad6a3912e0b 100644 --- a/spec/requests/projects/google_cloud/deployments_controller_spec.rb +++ b/spec/requests/projects/google_cloud/deployments_controller_spec.rb @@ -29,10 +29,9 @@ RSpec.describe Projects::GoogleCloud::DeploymentsController do expect(response).to have_gitlab_http_status(:not_found) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::DeploymentsController', + action: 'error_invalid_user', + label: nil, project: project, user: nil ) @@ -48,10 +47,9 @@ RSpec.describe Projects::GoogleCloud::DeploymentsController do expect(response).to have_gitlab_http_status(:not_found) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::DeploymentsController', + action: 'error_invalid_user', + label: nil, project: project, user: nil ) @@ -75,6 +73,30 @@ RSpec.describe Projects::GoogleCloud::DeploymentsController do end end + describe 'Authorized GET project/-/google_cloud/deployments', :snowplow do + before do + sign_in(user_maintainer) + + allow_next_instance_of(GoogleApi::CloudPlatform::Client) do |client| + allow(client).to receive(:validate_token).and_return(true) + end + end + + it 'renders template' do + get "#{project_google_cloud_deployments_path(project)}" + + expect(response).to render_template(:index) + + expect_snowplow_event( + category: 'Projects::GoogleCloud::DeploymentsController', + action: 'render_page', + label: nil, + project: project, + user: user_maintainer + ) + end + end + describe 'Authorized GET project/-/google_cloud/deployments/cloud_run', :snowplow do let_it_be(:url) { "#{project_google_cloud_deployments_cloud_run_path(project)}" } @@ -92,11 +114,9 @@ RSpec.describe Projects::GoogleCloud::DeploymentsController do expect(response).to redirect_to(project_google_cloud_deployments_path(project)) # since GPC_PROJECT_ID is not set, enable cloud run service should return an error expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'deployments#cloud_run', - label: 'error_enable_cloud_run', - extra: { message: 'No GCP projects found. Configure a service account or GCP_PROJECT_ID ci variable.', - status: :error }, + category: 'Projects::GoogleCloud::DeploymentsController', + action: 'error_enable_services', + label: nil, project: project, user: user_maintainer ) @@ -113,10 +133,9 @@ RSpec.describe Projects::GoogleCloud::DeploymentsController do expect(response).to redirect_to(project_google_cloud_deployments_path(project)) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'deployments#cloud_run', - label: 'error_gcp', - extra: mock_gcp_error, + category: 'Projects::GoogleCloud::DeploymentsController', + action: 'error_google_api', + label: nil, project: project, user: user_maintainer ) @@ -136,10 +155,9 @@ RSpec.describe Projects::GoogleCloud::DeploymentsController do expect(response).to redirect_to(project_google_cloud_deployments_path(project)) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'deployments#cloud_run', - label: 'error_generate_pipeline', - extra: { status: :error }, + category: 'Projects::GoogleCloud::DeploymentsController', + action: 'error_generate_cloudrun_pipeline', + label: nil, project: project, user: user_maintainer ) @@ -159,15 +177,9 @@ RSpec.describe Projects::GoogleCloud::DeploymentsController do expect(response).to have_gitlab_http_status(:found) expect(response.location).to include(project_new_merge_request_path(project)) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'deployments#cloud_run', - label: 'success', - extra: { "title": "Enable deployments to Cloud Run", - "description": "This merge request includes a Cloud Run deployment job in the pipeline definition (.gitlab-ci.yml).\n\nThe `deploy-to-cloud-run` job:\n* Requires the following environment variables\n * `GCP_PROJECT_ID`\n * `GCP_SERVICE_ACCOUNT_KEY`\n* Job definition can be found at: https://gitlab.com/gitlab-org/incubation-engineering/five-minute-production/library\n\nThis pipeline definition has been committed to the branch ``.\nYou may modify the pipeline definition further or accept the changes as-is if suitable.\n", - "source_project_id": project.id, - "target_project_id": project.id, - "source_branch": nil, - "target_branch": project.default_branch }, + category: 'Projects::GoogleCloud::DeploymentsController', + action: 'generate_cloudrun_pipeline', + label: nil, project: project, user: user_maintainer ) diff --git a/spec/requests/projects/google_cloud/gcp_regions_controller_spec.rb b/spec/requests/projects/google_cloud/gcp_regions_controller_spec.rb index f88273080d5..e77bcdb40b8 100644 --- a/spec/requests/projects/google_cloud/gcp_regions_controller_spec.rb +++ b/spec/requests/projects/google_cloud/gcp_regions_controller_spec.rb @@ -13,10 +13,9 @@ RSpec.describe Projects::GoogleCloud::GcpRegionsController do it "tracks event" do is_expected.to be(404) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::GcpRegionsController', + action: 'error_invalid_user', + label: nil, project: project, user: nil ) @@ -27,10 +26,9 @@ RSpec.describe Projects::GoogleCloud::GcpRegionsController do it "tracks event" do is_expected.to be(404) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::GcpRegionsController', + action: 'error_invalid_user', + label: nil, project: project, user: nil ) @@ -41,10 +39,9 @@ RSpec.describe Projects::GoogleCloud::GcpRegionsController do it "tracks event" do is_expected.to be(404) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'feature_flag_enabled!', - label: 'error_access_denied', - property: 'feature_flag_not_enabled', + category: 'Projects::GoogleCloud::GcpRegionsController', + action: 'error_feature_flag_not_enabled', + label: nil, project: project, user: user_maintainer ) @@ -55,10 +52,9 @@ RSpec.describe Projects::GoogleCloud::GcpRegionsController do it "tracks event" do is_expected.to be(403) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'google_oauth2_enabled!', - label: 'error_access_denied', - extra: { reason: 'google_oauth2_not_configured', config: config }, + category: 'Projects::GoogleCloud::GcpRegionsController', + action: 'error_google_oauth2_not_enabled', + label: nil, project: project, user: user_maintainer ) diff --git a/spec/requests/projects/google_cloud/revoke_oauth_controller_spec.rb b/spec/requests/projects/google_cloud/revoke_oauth_controller_spec.rb index 36441a184cb..9bd8468767d 100644 --- a/spec/requests/projects/google_cloud/revoke_oauth_controller_spec.rb +++ b/spec/requests/projects/google_cloud/revoke_oauth_controller_spec.rb @@ -50,10 +50,9 @@ RSpec.describe Projects::GoogleCloud::RevokeOauthController do expect(response).to redirect_to(project_google_cloud_configuration_path(project)) expect(flash[:notice]).to eq('Google OAuth2 token revocation requested') expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'revoke_oauth#create', - label: 'success', - property: '{}', + category: 'Projects::GoogleCloud::RevokeOauthController', + action: 'revoke_oauth', + label: nil, project: project, user: user ) @@ -73,10 +72,9 @@ RSpec.describe Projects::GoogleCloud::RevokeOauthController do expect(response).to redirect_to(project_google_cloud_configuration_path(project)) expect(flash[:alert]).to eq('Google OAuth2 token revocation request failed') expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'revoke_oauth#create', - label: 'error', - property: '{}', + category: 'Projects::GoogleCloud::RevokeOauthController', + action: 'error', + label: nil, project: project, user: user ) diff --git a/spec/requests/projects/google_cloud/service_accounts_controller_spec.rb b/spec/requests/projects/google_cloud/service_accounts_controller_spec.rb index ae2519855db..133c6f9153d 100644 --- a/spec/requests/projects/google_cloud/service_accounts_controller_spec.rb +++ b/spec/requests/projects/google_cloud/service_accounts_controller_spec.rb @@ -30,10 +30,9 @@ RSpec.describe Projects::GoogleCloud::ServiceAccountsController do expect(response).to have_gitlab_http_status(:not_found) expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::ServiceAccountsController', + action: 'error_invalid_user', + label: nil, project: project, user: nil ) @@ -53,10 +52,9 @@ RSpec.describe Projects::GoogleCloud::ServiceAccountsController do get url expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::ServiceAccountsController', + action: 'error_invalid_user', + label: nil, project: project, user: unauthorized_member ) @@ -71,10 +69,9 @@ RSpec.describe Projects::GoogleCloud::ServiceAccountsController do post url expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'admin_project_google_cloud!', - label: 'error_access_denied', - property: 'invalid_user', + category: 'Projects::GoogleCloud::ServiceAccountsController', + action: 'error_invalid_user', + label: nil, project: project, user: unauthorized_member ) @@ -135,10 +132,9 @@ RSpec.describe Projects::GoogleCloud::ServiceAccountsController do expect(response).to redirect_to(project_google_cloud_configuration_path(project)) expect(flash[:warning]).to eq('No Google Cloud projects - You need at least one Google Cloud project') expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'service_accounts#index', - label: 'error_form', - property: 'no_gcp_projects', + category: 'Projects::GoogleCloud::ServiceAccountsController', + action: 'error_no_gcp_projects', + label: nil, project: project, user: authorized_member ) @@ -207,11 +203,10 @@ RSpec.describe Projects::GoogleCloud::ServiceAccountsController do expect(response).to redirect_to(project_google_cloud_configuration_path(project)) expect(flash[:warning]).to eq('Google Cloud Error - client-error') expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'service_accounts#index', - label: 'error_gcp', - extra: google_client_error, + category: 'Projects::GoogleCloud::ServiceAccountsController', + action: 'error_google_api', project: project, + label: nil, user: authorized_member ) end @@ -226,10 +221,9 @@ RSpec.describe Projects::GoogleCloud::ServiceAccountsController do expect(response).to redirect_to(project_google_cloud_configuration_path(project)) expect(flash[:warning]).to eq('Google Cloud Error - client-error') expect_snowplow_event( - category: 'Projects::GoogleCloud', - action: 'service_accounts#create', - label: 'error_gcp', - extra: google_client_error, + category: 'Projects::GoogleCloud::ServiceAccountsController', + action: 'error_google_api', + label: nil, project: project, user: authorized_member ) diff --git a/spec/services/spam/spam_verdict_service_spec.rb b/spec/services/spam/spam_verdict_service_spec.rb index 02dbc1004bf..b89c96129c2 100644 --- a/spec/services/spam/spam_verdict_service_spec.rb +++ b/spec/services/spam/spam_verdict_service_spec.rb @@ -371,6 +371,9 @@ RSpec.describe Spam::SpamVerdictService do end it 'returns nil' do + expect(Gitlab::ErrorTracking).to receive(:log_exception).with( + an_instance_of(GRPC::Aborted), error: ::Spam::SpamConstants::ERROR_TYPE + ) expect(subject).to eq([ALLOW, attribs, true]) end end @@ -383,17 +386,20 @@ RSpec.describe Spam::SpamVerdictService do expect(subject).to eq [DISALLOW, attribs] end end - end - context 'if the endpoint times out' do - let(:attribs) { nil } + context 'if the endpoint times out' do + let(:attribs) { nil } - before do - allow(spam_client).to receive(:spam?).and_raise(GRPC::DeadlineExceeded) - end + before do + allow(spam_client).to receive(:spam?).and_raise(GRPC::DeadlineExceeded) + end - it 'returns nil' do - expect(subject).to eq([ALLOW, attribs, true]) + it 'returns nil' do + expect(Gitlab::ErrorTracking).to receive(:log_exception).with( + an_instance_of(GRPC::DeadlineExceeded), error: ::Spam::SpamConstants::ERROR_TYPE + ) + expect(subject).to eq([ALLOW, attribs, true]) + end end end end |