diff options
Diffstat (limited to 'app')
42 files changed, 282 insertions, 252 deletions
diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index a6d10d37103..a4073133028 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -468,6 +468,7 @@ export default { ref="addMetricBtn" v-gl-modal="$options.addMetric.modalId" variant="outline-success" + data-qa-selector="add_metric_button" class="mr-2 mt-1" >{{ $options.addMetric.title }}</gl-button > diff --git a/app/graphql/mutations/concerns/mutations/resolves_group.rb b/app/graphql/mutations/concerns/mutations/resolves_group.rb index 4306ce512f1..d5a040c84e9 100644 --- a/app/graphql/mutations/concerns/mutations/resolves_group.rb +++ b/app/graphql/mutations/concerns/mutations/resolves_group.rb @@ -5,10 +5,10 @@ module Mutations extend ActiveSupport::Concern def resolve_group(full_path:) - resolver.resolve(full_path: full_path) + group_resolver.resolve(full_path: full_path) end - def resolver + def group_resolver Resolvers::GroupResolver.new(object: nil, context: context) end end diff --git a/app/graphql/mutations/concerns/mutations/resolves_issuable.rb b/app/graphql/mutations/concerns/mutations/resolves_issuable.rb new file mode 100644 index 00000000000..4146bf8fdc8 --- /dev/null +++ b/app/graphql/mutations/concerns/mutations/resolves_issuable.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Mutations + module ResolvesIssuable + extend ActiveSupport::Concern + include Mutations::ResolvesProject + + def resolve_issuable(type:, parent_path:, iid:) + parent = resolve_issuable_parent(parent_path) + + issuable_resolver(type, parent, context).resolve(iid: iid.to_s) + end + + def issuable_resolver(type, parent, context) + resolver_class = "Resolvers::#{type.to_s.classify.pluralize}Resolver".constantize + + resolver_class.single.new(object: parent, context: context) + end + + def resolve_issuable_parent(parent_path) + resolve_project(full_path: parent_path) + end + end +end diff --git a/app/graphql/mutations/concerns/mutations/resolves_project.rb b/app/graphql/mutations/concerns/mutations/resolves_project.rb index da9814e88b0..0e91a25b803 100644 --- a/app/graphql/mutations/concerns/mutations/resolves_project.rb +++ b/app/graphql/mutations/concerns/mutations/resolves_project.rb @@ -5,10 +5,10 @@ module Mutations extend ActiveSupport::Concern def resolve_project(full_path:) - resolver.resolve(full_path: full_path) + project_resolver.resolve(full_path: full_path) end - def resolver + def project_resolver Resolvers::ProjectResolver.new(object: nil, context: context) end end diff --git a/app/graphql/mutations/issues/base.rb b/app/graphql/mutations/issues/base.rb index b7fa234a50b..7c545c3eb00 100644 --- a/app/graphql/mutations/issues/base.rb +++ b/app/graphql/mutations/issues/base.rb @@ -3,7 +3,7 @@ module Mutations module Issues class Base < BaseMutation - include Mutations::ResolvesProject + include Mutations::ResolvesIssuable argument :project_path, GraphQL::ID_TYPE, required: true, @@ -23,11 +23,7 @@ module Mutations private def find_object(project_path:, iid:) - project = resolve_project(full_path: project_path) - resolver = Resolvers::IssuesResolver - .single.new(object: project, context: context) - - resolver.resolve(iid: iid) + resolve_issuable(type: :issue, parent_path: project_path, iid: iid) end end end diff --git a/app/graphql/mutations/merge_requests/base.rb b/app/graphql/mutations/merge_requests/base.rb index 28e0cdc8cc7..96228855ace 100644 --- a/app/graphql/mutations/merge_requests/base.rb +++ b/app/graphql/mutations/merge_requests/base.rb @@ -3,7 +3,7 @@ module Mutations module MergeRequests class Base < BaseMutation - include Mutations::ResolvesProject + include Mutations::ResolvesIssuable argument :project_path, GraphQL::ID_TYPE, required: true, @@ -23,11 +23,7 @@ module Mutations private def find_object(project_path:, iid:) - project = resolve_project(full_path: project_path) - resolver = Resolvers::MergeRequestsResolver - .single.new(object: project, context: context) - - resolver.resolve(iid: iid) + resolve_issuable(type: :merge_request, parent_path: project_path, iid: iid) end end end diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb index bdb0a881b08..b611f700d21 100644 --- a/app/helpers/form_helper.rb +++ b/app/helpers/form_helper.rb @@ -3,18 +3,23 @@ module FormHelper prepend_if_ee('::EE::FormHelper') # rubocop: disable Cop/InjectEnterpriseEditionModule - def form_errors(model, type: 'form') + def form_errors(model, type: 'form', truncate: []) return unless model.errors.any? headline = n_('The %{type} contains the following error:', 'The %{type} contains the following errors:', model.errors.count) % { type: type } + truncate = Array.wrap(truncate) content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do content_tag(:h4, headline) << content_tag(:ul) do - model.errors.full_messages - .map { |msg| content_tag(:li, msg) } - .join - .html_safe + messages = model.errors.map do |attribute, message| + message = model.errors.full_message(attribute, message) + message = content_tag(:span, message, class: 'str-truncated-100') if truncate.include?(attribute) + + content_tag(:li, message) + end + + messages.join.html_safe end end end diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 26beb77a025..c5db42a40ac 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -333,11 +333,15 @@ class WikiPage *dirnames, title = @attributes[:title].split('/') if title.bytesize > MAX_TITLE_BYTES - errors.add(:title, _("exceeds the limit of %{bytes} bytes for page titles") % { bytes: MAX_TITLE_BYTES }) + errors.add(:title, _("exceeds the limit of %{bytes} bytes") % { bytes: MAX_TITLE_BYTES }) end - if dirnames.any? { |d| d.bytesize > MAX_DIRECTORY_BYTES } - errors.add(:title, _("exceeds the limit of %{bytes} bytes for directory names") % { bytes: MAX_DIRECTORY_BYTES }) + invalid_dirnames = dirnames.select { |d| d.bytesize > MAX_DIRECTORY_BYTES } + invalid_dirnames.each do |dirname| + errors.add(:title, _('exceeds the limit of %{bytes} bytes for directory name "%{dirname}"') % { + bytes: MAX_DIRECTORY_BYTES, + dirname: dirname + }) end end end diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 438d390389c..c66799a1598 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -4,7 +4,7 @@ = form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, html: { class: form_classes }, data: { uploads_path: uploads_path } do |f| - = form_errors(@page) + = form_errors(@page, truncate: :title) - if @page.persisted? = f.hidden_field :last_commit_sha, value: @page.last_commit_sha diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 0b7add65d94..259b2efc49f 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -6,1267 +6,1267 @@ - :name: auto_devops:auto_devops_disable :feature_category: :auto_devops :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: auto_merge:auto_merge_process :feature_category: :continuous_delivery :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 3 :idempotent: - :name: chaos:chaos_cpu_spin :feature_category: :chaos_engineering :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: chaos:chaos_db_spin :feature_category: :chaos_engineering :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: chaos:chaos_kill :feature_category: :chaos_engineering :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: chaos:chaos_leak_mem :feature_category: :chaos_engineering :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: chaos:chaos_sleep :feature_category: :chaos_engineering :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: container_repository:cleanup_container_repository :feature_category: :container_registry :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: container_repository:delete_container_repository :feature_category: :container_registry :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:admin_email :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:ci_archive_traces_cron :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:container_expiration_policy :feature_category: :container_registry :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:environments_auto_stop_cron :feature_category: :continuous_delivery :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:expire_build_artifacts :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:gitlab_usage_ping :feature_category: :collection :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:import_export_project_cleanup :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:issue_due_scheduler :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:namespaces_prune_aggregation_schedules :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: cronjob:pages_domain_removal_cron :feature_category: :pages :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: cronjob:pages_domain_ssl_renewal_cron :feature_category: :pages :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:pages_domain_verification_cron :feature_category: :pages :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:personal_access_tokens_expiring :feature_category: :authentication_and_authorization :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:pipeline_schedule :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: cronjob:prune_old_events :feature_category: :users :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:prune_web_hook_logs :feature_category: :integrations :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:remove_expired_group_links :feature_category: :authentication_and_authorization :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:remove_expired_members :feature_category: :authentication_and_authorization :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: cronjob:remove_unreferenced_lfs_objects :feature_category: :git_lfs :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:repository_archive_cache :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:repository_check_dispatch :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:requests_profiles :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:schedule_migrate_external_diffs :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:stuck_ci_jobs :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: cronjob:stuck_import_jobs :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: cronjob:stuck_merge_jobs :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: cronjob:trending_projects :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: deployment:deployments_finished :feature_category: :continuous_delivery :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 3 :idempotent: - :name: deployment:deployments_forward_deployment :feature_category: :continuous_delivery :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 3 :idempotent: - :name: deployment:deployments_success :feature_category: :continuous_delivery :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 3 :idempotent: - :name: gcp_cluster:cluster_configure :feature_category: :kubernetes_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:cluster_configure_istio :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:cluster_install_app :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:cluster_patch_app :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:cluster_project_configure :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:cluster_provision :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:cluster_upgrade_app :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:cluster_wait_for_app_installation :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: gcp_cluster:cluster_wait_for_ingress_ip_address :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:clusters_applications_activate_service :feature_category: :kubernetes_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:clusters_applications_deactivate_service :feature_category: :kubernetes_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:clusters_applications_uninstall :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:clusters_applications_wait_for_uninstall_app :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: gcp_cluster:clusters_cleanup_app :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:clusters_cleanup_project_namespace :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:clusters_cleanup_service_account :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gcp_cluster:wait_for_cluster_creation :feature_category: :kubernetes_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_import_diff_note :feature_category: :importers :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_import_issue :feature_category: :importers :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_import_lfs_object :feature_category: :importers :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_import_note :feature_category: :importers :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_import_pull_request :feature_category: :importers :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_refresh_import_jid :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_stage_finish_import :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_stage_import_base_data :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_stage_import_issues_and_diff_notes :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_stage_import_lfs_objects :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_stage_import_notes :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_stage_import_pull_requests :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_importer:github_import_stage_import_repository :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: hashed_storage:hashed_storage_migrator :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: hashed_storage:hashed_storage_project_migrate :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: hashed_storage:hashed_storage_project_rollback :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: hashed_storage:hashed_storage_rollbacker :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: incident_management:incident_management_process_alert :feature_category: :incident_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: mail_scheduler:mail_scheduler_issue_due :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: mail_scheduler:mail_scheduler_notification_service :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 2 :idempotent: - :name: notifications:new_release :feature_category: :release_orchestration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: object_pool:object_pool_create :feature_category: :gitaly :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: object_pool:object_pool_destroy :feature_category: :gitaly :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: object_pool:object_pool_join :feature_category: :gitaly :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 1 :idempotent: - :name: object_pool:object_pool_schedule_join :feature_category: :gitaly :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: object_storage:object_storage_background_move :feature_category: :not_owned :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: object_storage:object_storage_migrate_uploads :feature_category: :not_owned :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: pipeline_background:archive_trace :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: pipeline_background:ci_build_trace_chunk_flush :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: pipeline_cache:expire_job_cache :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 3 :idempotent: true - :name: pipeline_cache:expire_pipeline_cache :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 3 :idempotent: - :name: pipeline_creation:create_pipeline :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 4 :idempotent: - :name: pipeline_creation:run_pipeline_schedule :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 4 :idempotent: - :name: pipeline_default:build_coverage :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 3 :idempotent: - :name: pipeline_default:build_trace_sections :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 3 :idempotent: - :name: pipeline_default:ci_create_cross_project_pipeline :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 3 :idempotent: - :name: pipeline_default:ci_pipeline_bridge_status :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 3 :idempotent: - :name: pipeline_default:pipeline_metrics :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 3 :idempotent: - :name: pipeline_default:pipeline_notification :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 3 :idempotent: - :name: pipeline_default:pipeline_update_ci_ref_status :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 3 :idempotent: - :name: pipeline_hooks:build_hooks :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 2 :idempotent: - :name: pipeline_hooks:pipeline_hooks :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 2 :idempotent: - :name: pipeline_processing:build_finished :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 5 :idempotent: - :name: pipeline_processing:build_queue :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 5 :idempotent: - :name: pipeline_processing:build_success :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 5 :idempotent: - :name: pipeline_processing:ci_build_prepare :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 5 :idempotent: - :name: pipeline_processing:ci_build_schedule :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 5 :idempotent: - :name: pipeline_processing:ci_resource_groups_assign_resource_from_resource_group :feature_category: :continuous_delivery :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 5 :idempotent: - :name: pipeline_processing:pipeline_process :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 5 :idempotent: - :name: pipeline_processing:pipeline_success :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 5 :idempotent: - :name: pipeline_processing:pipeline_update :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 5 :idempotent: - :name: pipeline_processing:stage_update :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 5 :idempotent: - :name: pipeline_processing:update_head_pipeline_for_merge_request :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 5 :idempotent: - :name: repository_check:repository_check_batch :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: repository_check:repository_check_clear :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: repository_check:repository_check_single_repository :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: todos_destroyer:todos_destroyer_confidential_issue :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: todos_destroyer:todos_destroyer_entity_leave :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: todos_destroyer:todos_destroyer_group_private :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: todos_destroyer:todos_destroyer_private_features :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: todos_destroyer:todos_destroyer_project_private :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: update_namespace_statistics:namespaces_root_statistics :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: update_namespace_statistics:namespaces_schedule_aggregation :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: authorized_projects :feature_category: :authentication_and_authorization :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 2 :idempotent: - :name: background_migration :feature_category: :not_owned :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: chat_notification :feature_category: :chatops :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 2 :idempotent: - :name: create_commit_signature :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: create_evidence :feature_category: :release_governance :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: create_note_diff_file :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: default :feature_category: :has_external_dependencies: - :latency_sensitive: + :urgency: :resource_boundary: :weight: 1 :idempotent: - :name: delete_diff_files :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: delete_merged_branches :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: delete_stored_files :feature_category: :not_owned :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: delete_user :feature_category: :authentication_and_authorization :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: detect_repository_languages :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: email_receiver :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 2 :idempotent: - :name: emails_on_push :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 2 :idempotent: - :name: error_tracking_issue_link :feature_category: :error_tracking :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: expire_build_instance_artifacts :feature_category: :continuous_integration :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: file_hook :feature_category: :integrations :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: git_garbage_collect :feature_category: :gitaly :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: github_import_advance_stage :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: gitlab_shell :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 2 :idempotent: - :name: group_destroy :feature_category: :subgroups :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: group_export :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: group_import :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: import_issues_csv :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :cpu :weight: 2 :idempotent: - :name: invalid_gpg_signature_update :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: irker :feature_category: :integrations :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: mailers :feature_category: :has_external_dependencies: - :latency_sensitive: + :urgency: :resource_boundary: :weight: 2 :idempotent: - :name: merge :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 5 :idempotent: - :name: merge_request_mergeability_check :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: migrate_external_diffs :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: namespaceless_project_destroy :feature_category: :authentication_and_authorization :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: new_issue :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 2 :idempotent: - :name: new_merge_request :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 2 :idempotent: - :name: new_note :feature_category: :issue_tracking :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 2 :idempotent: - :name: pages :feature_category: :pages :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: pages_domain_ssl_renewal :feature_category: :pages :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: pages_domain_verification :feature_category: :pages :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: phabricator_import_import_tasks :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: post_receive :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 5 :idempotent: - :name: process_commit :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 3 :idempotent: - :name: project_cache :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :unknown :weight: 1 :idempotent: - :name: project_daily_statistics :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: project_destroy :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: project_export :feature_category: :importers :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :memory :weight: 1 :idempotent: - :name: project_service :feature_category: :integrations :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: propagate_service_template :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: reactive_caching :feature_category: :not_owned :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 1 :idempotent: - :name: rebase :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: remote_mirror_notification :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: repository_cleanup :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: repository_fork :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: repository_import :feature_category: :importers :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: repository_remove_remote :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: repository_update_remote_mirror :feature_category: :source_code_management :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: self_monitoring_project_create :feature_category: :metrics :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: self_monitoring_project_delete :feature_category: :metrics :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 2 :idempotent: - :name: system_hook_push :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: update_external_pull_requests :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 3 :idempotent: - :name: update_merge_requests :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: true + :urgency: :high :resource_boundary: :cpu :weight: 3 :idempotent: - :name: update_project_statistics :feature_category: :source_code_management :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: upload_checksum :feature_category: :geo_replication :has_external_dependencies: - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: - :name: web_hook :feature_category: :integrations :has_external_dependencies: true - :latency_sensitive: + :urgency: :default :resource_boundary: :unknown :weight: 1 :idempotent: diff --git a/app/workers/authorized_projects_worker.rb b/app/workers/authorized_projects_worker.rb index cd7ce386433..17537cdaa26 100644 --- a/app/workers/authorized_projects_worker.rb +++ b/app/workers/authorized_projects_worker.rb @@ -5,7 +5,7 @@ class AuthorizedProjectsWorker # rubocop:disable Scalability/IdempotentWorker prepend WaitableWorker feature_category :authentication_and_authorization - latency_sensitive_worker! + urgency :high weight 2 # This is a workaround for a Ruby 2.3.7 bug. rspec-mocks cannot restore the diff --git a/app/workers/build_finished_worker.rb b/app/workers/build_finished_worker.rb index 0e69aa07cc1..b6ef9ab4710 100644 --- a/app/workers/build_finished_worker.rb +++ b/app/workers/build_finished_worker.rb @@ -5,7 +5,7 @@ class BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker include PipelineQueue queue_namespace :pipeline_processing - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/workers/build_hooks_worker.rb b/app/workers/build_hooks_worker.rb index 2662e991773..9693d3eb57f 100644 --- a/app/workers/build_hooks_worker.rb +++ b/app/workers/build_hooks_worker.rb @@ -6,7 +6,7 @@ class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker queue_namespace :pipeline_hooks feature_category :continuous_integration - latency_sensitive_worker! + urgency :high # rubocop: disable CodeReuse/ActiveRecord def perform(build_id) diff --git a/app/workers/build_queue_worker.rb b/app/workers/build_queue_worker.rb index 16d347a0e5c..b71afbbeb8f 100644 --- a/app/workers/build_queue_worker.rb +++ b/app/workers/build_queue_worker.rb @@ -6,7 +6,7 @@ class BuildQueueWorker # rubocop:disable Scalability/IdempotentWorker queue_namespace :pipeline_processing feature_category :continuous_integration - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/workers/build_success_worker.rb b/app/workers/build_success_worker.rb index cb670b5bca7..e4a2dd500cc 100644 --- a/app/workers/build_success_worker.rb +++ b/app/workers/build_success_worker.rb @@ -5,7 +5,7 @@ class BuildSuccessWorker # rubocop:disable Scalability/IdempotentWorker include PipelineQueue queue_namespace :pipeline_processing - latency_sensitive_worker! + urgency :high # rubocop: disable CodeReuse/ActiveRecord def perform(build_id) diff --git a/app/workers/chat_notification_worker.rb b/app/workers/chat_notification_worker.rb index 78d4206ec1a..058ac024f8a 100644 --- a/app/workers/chat_notification_worker.rb +++ b/app/workers/chat_notification_worker.rb @@ -7,7 +7,7 @@ class ChatNotificationWorker # rubocop:disable Scalability/IdempotentWorker sidekiq_options retry: false feature_category :chatops - latency_sensitive_worker! + urgency :high weight 2 # TODO: break this into multiple jobs diff --git a/app/workers/ci/pipeline_bridge_status_worker.rb b/app/workers/ci/pipeline_bridge_status_worker.rb index e4e9d8480c2..3f92f4561e0 100644 --- a/app/workers/ci/pipeline_bridge_status_worker.rb +++ b/app/workers/ci/pipeline_bridge_status_worker.rb @@ -5,7 +5,7 @@ module Ci include ::ApplicationWorker include ::PipelineQueue - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu def perform(pipeline_id) diff --git a/app/workers/concerns/worker_attributes.rb b/app/workers/concerns/worker_attributes.rb index 55feba673c4..216f73b58e2 100644 --- a/app/workers/concerns/worker_attributes.rb +++ b/app/workers/concerns/worker_attributes.rb @@ -4,9 +4,12 @@ module WorkerAttributes extend ActiveSupport::Concern # Resource boundaries that workers can declare through the - # `worker_resource_boundary` attribute + # `resource_boundary` attribute VALID_RESOURCE_BOUNDARIES = [:memory, :cpu, :unknown].freeze + # Urgencies that workers can declare through the `urgencies` attribute + VALID_URGENCIES = [:high, :default, :none].freeze + NAMESPACE_WEIGHTS = { auto_devops: 2, auto_merge: 3, @@ -47,21 +50,22 @@ module WorkerAttributes get_worker_attribute(:feature_category) == :not_owned end - # This should be set for jobs that need to be run immediately, or, if - # they are delayed, risk creating inconsistencies in the application - # that could being perceived by the user as incorrect behavior - # (ie, a bug) - # See doc/development/sidekiq_style_guide.md#Latency-Sensitive-Jobs + # This should be set to :high for jobs that need to be run + # immediately, or, if they are delayed, risk creating + # inconsistencies in the application that could being perceived by + # the user as incorrect behavior (ie, a bug) + # + # See + # doc/development/sidekiq_style_guide.md#urgency # for details - def latency_sensitive_worker! - worker_attributes[:latency_sensitive] = true + def urgency(urgency) + raise "Invalid urgency: #{urgency}" unless VALID_URGENCIES.include?(urgency) + + worker_attributes[:urgency] = urgency end - # Returns a truthy value if the worker is latency sensitive. - # See doc/development/sidekiq_style_guide.md#Latency-Sensitive-Jobs - # for details - def latency_sensitive_worker? - worker_attributes[:latency_sensitive] + def get_urgency + worker_attributes[:urgency] || :default end # Set this attribute on a job when it will call to services outside of the diff --git a/app/workers/create_pipeline_worker.rb b/app/workers/create_pipeline_worker.rb index ac00fcc5d57..54698518e4f 100644 --- a/app/workers/create_pipeline_worker.rb +++ b/app/workers/create_pipeline_worker.rb @@ -6,7 +6,7 @@ class CreatePipelineWorker # rubocop:disable Scalability/IdempotentWorker queue_namespace :pipeline_creation feature_category :continuous_integration - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu def perform(project_id, user_id, ref, source, params = {}) diff --git a/app/workers/email_receiver_worker.rb b/app/workers/email_receiver_worker.rb index 37398b18aef..fcb88982c0b 100644 --- a/app/workers/email_receiver_worker.rb +++ b/app/workers/email_receiver_worker.rb @@ -4,7 +4,7 @@ class EmailReceiverWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker feature_category :issue_tracking - latency_sensitive_worker! + urgency :high weight 2 def perform(raw) diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb index 2c546bc3c20..cc114acf7e9 100644 --- a/app/workers/emails_on_push_worker.rb +++ b/app/workers/emails_on_push_worker.rb @@ -6,7 +6,7 @@ class EmailsOnPushWorker # rubocop:disable Scalability/IdempotentWorker attr_reader :email, :skip_premailer feature_category :source_code_management - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu weight 2 diff --git a/app/workers/expire_job_cache_worker.rb b/app/workers/expire_job_cache_worker.rb index 1cd5fa5d1c5..ce27fed7fb1 100644 --- a/app/workers/expire_job_cache_worker.rb +++ b/app/workers/expire_job_cache_worker.rb @@ -5,7 +5,7 @@ class ExpireJobCacheWorker include PipelineQueue queue_namespace :pipeline_cache - latency_sensitive_worker! + urgency :high idempotent! # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/workers/expire_pipeline_cache_worker.rb b/app/workers/expire_pipeline_cache_worker.rb index d92141c70cc..1d2708cdb44 100644 --- a/app/workers/expire_pipeline_cache_worker.rb +++ b/app/workers/expire_pipeline_cache_worker.rb @@ -5,7 +5,7 @@ class ExpirePipelineCacheWorker # rubocop:disable Scalability/IdempotentWorker include PipelineQueue queue_namespace :pipeline_cache - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/workers/gitlab_shell_worker.rb b/app/workers/gitlab_shell_worker.rb index f9b5a7d99ed..ed08069d2bc 100644 --- a/app/workers/gitlab_shell_worker.rb +++ b/app/workers/gitlab_shell_worker.rb @@ -5,7 +5,7 @@ class GitlabShellWorker # rubocop:disable Scalability/IdempotentWorker include Gitlab::ShellAdapter feature_category :source_code_management - latency_sensitive_worker! + urgency :high weight 2 def perform(action, *arg) diff --git a/app/workers/merge_worker.rb b/app/workers/merge_worker.rb index a7b926e143f..cc5fe884aec 100644 --- a/app/workers/merge_worker.rb +++ b/app/workers/merge_worker.rb @@ -4,7 +4,7 @@ class MergeWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker feature_category :source_code_management - latency_sensitive_worker! + urgency :high weight 5 def perform(merge_request_id, current_user_id, params) diff --git a/app/workers/new_issue_worker.rb b/app/workers/new_issue_worker.rb index ded5104c708..e0e28767f8d 100644 --- a/app/workers/new_issue_worker.rb +++ b/app/workers/new_issue_worker.rb @@ -5,7 +5,7 @@ class NewIssueWorker # rubocop:disable Scalability/IdempotentWorker include NewIssuable feature_category :issue_tracking - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu weight 2 diff --git a/app/workers/new_merge_request_worker.rb b/app/workers/new_merge_request_worker.rb index 3b101435f7a..10a79841df9 100644 --- a/app/workers/new_merge_request_worker.rb +++ b/app/workers/new_merge_request_worker.rb @@ -5,7 +5,7 @@ class NewMergeRequestWorker # rubocop:disable Scalability/IdempotentWorker include NewIssuable feature_category :source_code_management - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu weight 2 diff --git a/app/workers/new_note_worker.rb b/app/workers/new_note_worker.rb index af1cef432eb..8ead87a9230 100644 --- a/app/workers/new_note_worker.rb +++ b/app/workers/new_note_worker.rb @@ -4,7 +4,7 @@ class NewNoteWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker feature_category :issue_tracking - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu weight 2 diff --git a/app/workers/pipeline_hooks_worker.rb b/app/workers/pipeline_hooks_worker.rb index 3fa0c5ab9af..85ecdd02fb5 100644 --- a/app/workers/pipeline_hooks_worker.rb +++ b/app/workers/pipeline_hooks_worker.rb @@ -5,7 +5,7 @@ class PipelineHooksWorker # rubocop:disable Scalability/IdempotentWorker include PipelineQueue queue_namespace :pipeline_hooks - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/workers/pipeline_metrics_worker.rb b/app/workers/pipeline_metrics_worker.rb index 65a5a94ed8a..1eb9b4ce089 100644 --- a/app/workers/pipeline_metrics_worker.rb +++ b/app/workers/pipeline_metrics_worker.rb @@ -4,7 +4,7 @@ class PipelineMetricsWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker include PipelineQueue - latency_sensitive_worker! + urgency :high # rubocop: disable CodeReuse/ActiveRecord def perform(pipeline_id) diff --git a/app/workers/pipeline_notification_worker.rb b/app/workers/pipeline_notification_worker.rb index 72663fa19ae..3336383adf7 100644 --- a/app/workers/pipeline_notification_worker.rb +++ b/app/workers/pipeline_notification_worker.rb @@ -4,7 +4,7 @@ class PipelineNotificationWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker include PipelineQueue - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu # rubocop: disable CodeReuse/ActiveRecord diff --git a/app/workers/pipeline_process_worker.rb b/app/workers/pipeline_process_worker.rb index 2f8ab0d6202..66a661dde71 100644 --- a/app/workers/pipeline_process_worker.rb +++ b/app/workers/pipeline_process_worker.rb @@ -6,7 +6,7 @@ class PipelineProcessWorker # rubocop:disable Scalability/IdempotentWorker queue_namespace :pipeline_processing feature_category :continuous_integration - latency_sensitive_worker! + urgency :high # rubocop: disable CodeReuse/ActiveRecord def perform(pipeline_id, build_ids = nil) diff --git a/app/workers/pipeline_success_worker.rb b/app/workers/pipeline_success_worker.rb index 3b4ab461ae7..d84612c52d1 100644 --- a/app/workers/pipeline_success_worker.rb +++ b/app/workers/pipeline_success_worker.rb @@ -5,7 +5,7 @@ class PipelineSuccessWorker # rubocop:disable Scalability/IdempotentWorker include PipelineQueue queue_namespace :pipeline_processing - latency_sensitive_worker! + urgency :high def perform(pipeline_id) # no-op diff --git a/app/workers/pipeline_update_ci_ref_status_worker.rb b/app/workers/pipeline_update_ci_ref_status_worker.rb index 3d6a0d30e9c..96e14e126de 100644 --- a/app/workers/pipeline_update_ci_ref_status_worker.rb +++ b/app/workers/pipeline_update_ci_ref_status_worker.rb @@ -4,7 +4,7 @@ class PipelineUpdateCiRefStatusWorker # rubocop:disable Scalability/IdempotentWo include ApplicationWorker include PipelineQueue - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu def perform(pipeline_id) diff --git a/app/workers/pipeline_update_worker.rb b/app/workers/pipeline_update_worker.rb index b170781202a..7f667057af6 100644 --- a/app/workers/pipeline_update_worker.rb +++ b/app/workers/pipeline_update_worker.rb @@ -5,7 +5,7 @@ class PipelineUpdateWorker # rubocop:disable Scalability/IdempotentWorker include PipelineQueue queue_namespace :pipeline_processing - latency_sensitive_worker! + urgency :high def perform(pipeline_id) Ci::Pipeline.find_by_id(pipeline_id)&.update_legacy_status diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index f0fd3c9a808..d0eb188cc42 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -4,7 +4,7 @@ class PostReceive # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker feature_category :source_code_management - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu weight 5 diff --git a/app/workers/process_commit_worker.rb b/app/workers/process_commit_worker.rb index d604ac12e8a..4039ad45899 100644 --- a/app/workers/process_commit_worker.rb +++ b/app/workers/process_commit_worker.rb @@ -11,7 +11,7 @@ class ProcessCommitWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker feature_category :source_code_management - latency_sensitive_worker! + urgency :high weight 3 # project_id - The ID of the project this commit belongs to. diff --git a/app/workers/project_cache_worker.rb b/app/workers/project_cache_worker.rb index fc79a988c8b..573f903f4e0 100644 --- a/app/workers/project_cache_worker.rb +++ b/app/workers/project_cache_worker.rb @@ -4,7 +4,7 @@ class ProjectCacheWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker - latency_sensitive_worker! + urgency :high LEASE_TIMEOUT = 15.minutes.to_i diff --git a/app/workers/reactive_caching_worker.rb b/app/workers/reactive_caching_worker.rb index bcaeaec5709..716b1de2bf5 100644 --- a/app/workers/reactive_caching_worker.rb +++ b/app/workers/reactive_caching_worker.rb @@ -6,11 +6,11 @@ class ReactiveCachingWorker # rubocop:disable Scalability/IdempotentWorker feature_category_not_owned! # TODO: The reactive caching worker should be split into - # two different workers, one for latency_sensitive jobs without external dependencies - # and another worker without latency_sensitivity, but with external dependencies + # two different workers, one for high urgency jobs without external dependencies + # and another worker without high urgency, but with external dependencies # https://gitlab.com/gitlab-com/gl-infra/scalability/issues/34 # This worker should also have `worker_has_external_dependencies!` enabled - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu def perform(class_name, id, *args) diff --git a/app/workers/stage_update_worker.rb b/app/workers/stage_update_worker.rb index a5097d61927..aface8288e3 100644 --- a/app/workers/stage_update_worker.rb +++ b/app/workers/stage_update_worker.rb @@ -5,7 +5,7 @@ class StageUpdateWorker # rubocop:disable Scalability/IdempotentWorker include PipelineQueue queue_namespace :pipeline_processing - latency_sensitive_worker! + urgency :high def perform(stage_id) Ci::Stage.find_by_id(stage_id)&.update_legacy_status diff --git a/app/workers/update_head_pipeline_for_merge_request_worker.rb b/app/workers/update_head_pipeline_for_merge_request_worker.rb index 47f0d1e0545..69698ba81bd 100644 --- a/app/workers/update_head_pipeline_for_merge_request_worker.rb +++ b/app/workers/update_head_pipeline_for_merge_request_worker.rb @@ -6,7 +6,7 @@ class UpdateHeadPipelineForMergeRequestWorker # rubocop:disable Scalability/Idem queue_namespace :pipeline_processing feature_category :continuous_integration - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu def perform(merge_request_id) diff --git a/app/workers/update_merge_requests_worker.rb b/app/workers/update_merge_requests_worker.rb index 195b455f0aa..4c2a85d6642 100644 --- a/app/workers/update_merge_requests_worker.rb +++ b/app/workers/update_merge_requests_worker.rb @@ -4,7 +4,7 @@ class UpdateMergeRequestsWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker feature_category :source_code_management - latency_sensitive_worker! + urgency :high worker_resource_boundary :cpu weight 3 |