diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 12:08:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-10 12:08:59 +0000 |
commit | 7351a484d79236b7e9d47c86f2fcc970b7ae10b0 (patch) | |
tree | 651b5fca7ea0460e3ce7c687cfa9e3a3b37eefc8 /app | |
parent | b4ded0ba7b4d2cdbed5b1f331cf2083a25ee4d7c (diff) | |
download | gitlab-ce-7351a484d79236b7e9d47c86f2fcc970b7ae10b0.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
37 files changed, 239 insertions, 52 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index c3e2c09f1d5..c86a4c9f178 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -21,6 +21,9 @@ const MAX_CHAR_LIMIT = 5000; export default function renderMermaid($els) { if (!$els.length) return; + // A diagram may have been truncated in search results which will cause errors, so abort the render. + if (document.querySelector('body').dataset.page === 'search:show') return; + import(/* webpackChunkName: 'mermaid' */ 'mermaid') .then(mermaid => { mermaid.initialize({ diff --git a/app/assets/javascripts/pages/users/activity_calendar.js b/app/assets/javascripts/pages/users/activity_calendar.js index 693125f8a38..4f645e511f9 100644 --- a/app/assets/javascripts/pages/users/activity_calendar.js +++ b/app/assets/javascripts/pages/users/activity_calendar.js @@ -18,7 +18,7 @@ const firstDayOfWeekChoices = Object.freeze({ const LOADING_HTML = ` <div class="text-center"> - <i class="fa fa-spinner fa-spin user-calendar-activities-loading"></i> + <div class="spinner spinner-md"></div> </div> `; diff --git a/app/assets/javascripts/pages/users/user_tabs.js b/app/assets/javascripts/pages/users/user_tabs.js index 885150eef9d..dafd800099c 100644 --- a/app/assets/javascripts/pages/users/user_tabs.js +++ b/app/assets/javascripts/pages/users/user_tabs.js @@ -57,10 +57,8 @@ import UserOverviewBlock from './user_overview_block'; * </div> * </div> * - * <div class="loading-status"> - * <div class="loading"> - * Loading Animation - * </div> + * <div class="loading"> + * Loading Animation * </div> */ @@ -242,7 +240,7 @@ export default class UserTabs { } toggleLoading(status) { - return this.$parentEl.find('.loading-status .loading').toggleClass('hide', !status); + return this.$parentEl.find('.loading').toggleClass('hide', !status); } setCurrentAction(source) { diff --git a/app/assets/stylesheets/framework/common.scss b/app/assets/stylesheets/framework/common.scss index dc119b52f4e..408ca249be2 100644 --- a/app/assets/stylesheets/framework/common.scss +++ b/app/assets/stylesheets/framework/common.scss @@ -581,6 +581,7 @@ img.emoji { .gl-line-height-24 { line-height: $gl-line-height-24; } .gl-line-height-14 { line-height: $gl-line-height-14; } +.gl-font-size-0 { font-size: 0; } .gl-font-size-12 { font-size: $gl-font-size-12; } .gl-font-size-14 { font-size: $gl-font-size-14; } .gl-font-size-16 { font-size: $gl-font-size-16; } diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss index c14ae8a3711..db1b8c559e5 100644 --- a/app/assets/stylesheets/pages/tree.scss +++ b/app/assets/stylesheets/pages/tree.scss @@ -17,7 +17,9 @@ .tree-controls { text-align: right; - .btn { + > .btn, + .project-action-button > .btn, + .git-clone-holder > .btn { margin-left: 8px; } diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index f4e79ae6060..00771aff26c 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -37,10 +37,6 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController define_method(action) { perform_update if submitted? } end - def show - render :general - end - def update perform_update end @@ -73,7 +69,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController RepositoryCheck::ClearWorker.perform_async redirect_to( - admin_application_settings_path, + general_admin_application_settings_path, notice: _('Started asynchronous removal of all repository check states.') ) end @@ -256,7 +252,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController session[:ask_for_usage_stats_consent] = current_user.requires_usage_stats_consent? end - redirect_path = referer_path(request) || admin_application_settings_path + redirect_path = referer_path(request) || general_admin_application_settings_path respond_to do |format| if successful diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb index abd59741e89..3726c05acd8 100644 --- a/app/models/ci/bridge.rb +++ b/app/models/ci/bridge.rb @@ -25,6 +25,14 @@ module Ci # rubocop:enable Cop/ActiveRecordSerialize state_machine :status do + after_transition created: :pending do |bridge| + next unless bridge.downstream_project + + bridge.run_after_commit do + bridge.schedule_downstream_pipeline! + end + end + event :manual do transition all => :manual end @@ -38,6 +46,12 @@ module Ci raise NotImplementedError end + def schedule_downstream_pipeline! + raise InvalidBridgeTypeError unless downstream_project + + ::Ci::CreateCrossProjectPipelineWorker.perform_async(self.id) + end + def inherit_status_from_downstream!(pipeline) case pipeline.status when 'success' diff --git a/app/models/clusters/cluster.rb b/app/models/clusters/cluster.rb index d2eee78f3df..7855db960c9 100644 --- a/app/models/clusters/cluster.rb +++ b/app/models/clusters/cluster.rb @@ -31,6 +31,7 @@ module Clusters has_many :cluster_projects, class_name: 'Clusters::Project' has_many :projects, through: :cluster_projects, class_name: '::Project' has_one :cluster_project, -> { order(id: :desc) }, class_name: 'Clusters::Project' + has_many :deployment_clusters has_many :cluster_groups, class_name: 'Clusters::Group' has_many :groups, through: :cluster_groups, class_name: '::Group' diff --git a/app/models/commit_status_enums.rb b/app/models/commit_status_enums.rb index 2ca6d15e642..dcf23d112d6 100644 --- a/app/models/commit_status_enums.rb +++ b/app/models/commit_status_enums.rb @@ -17,7 +17,12 @@ module CommitStatusEnums archived_failure: 9, unmet_prerequisites: 10, scheduler_failure: 11, - data_integrity_failure: 12 + data_integrity_failure: 12, + insufficient_bridge_permissions: 1_001, + downstream_bridge_project_not_found: 1_002, + invalid_bridge_trigger: 1_003, + bridge_pipeline_is_child_pipeline: 1_006, + downstream_pipeline_creation_failed: 1_007 } end end diff --git a/app/models/deployment.rb b/app/models/deployment.rb index e0daf692665..0c679a3075b 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -18,6 +18,8 @@ class Deployment < ApplicationRecord has_many :merge_requests, through: :deployment_merge_requests + has_one :deployment_cluster + has_internal_id :iid, scope: :project, track_if: -> { !importing? }, init: ->(s) do Deployment.where(project: s.project).maximum(:iid) if s&.project end diff --git a/app/models/deployment_cluster.rb b/app/models/deployment_cluster.rb new file mode 100644 index 00000000000..3390d397bad --- /dev/null +++ b/app/models/deployment_cluster.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +class DeploymentCluster < ApplicationRecord + belongs_to :deployment, optional: false + belongs_to :cluster, optional: false, class_name: 'Clusters::Cluster' +end diff --git a/app/models/project.rb b/app/models/project.rb index 717075161aa..8454ece814f 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -190,6 +190,7 @@ class Project < ApplicationRecord has_one :error_tracking_setting, inverse_of: :project, class_name: 'ErrorTracking::ProjectErrorTrackingSetting' has_one :metrics_setting, inverse_of: :project, class_name: 'ProjectMetricsSetting' has_one :grafana_integration, inverse_of: :project + has_one :project_setting, ->(project) { where_or_create_by(project: project) }, inverse_of: :project # Merge Requests for target project should be removed with it has_many :merge_requests, foreign_key: 'target_project_id', inverse_of: :target_project diff --git a/app/models/project_setting.rb b/app/models/project_setting.rb new file mode 100644 index 00000000000..37e4a7be770 --- /dev/null +++ b/app/models/project_setting.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ProjectSetting < ApplicationRecord + belongs_to :project, inverse_of: :project_setting + + self.primary_key = :project_id + + def self.where_or_create_by(attrs) + where(primary_key => safe_find_or_create_by(attrs)) + end +end diff --git a/app/presenters/commit_status_presenter.rb b/app/presenters/commit_status_presenter.rb index 66ae840a619..ed76f95ac62 100644 --- a/app/presenters/commit_status_presenter.rb +++ b/app/presenters/commit_status_presenter.rb @@ -13,7 +13,12 @@ class CommitStatusPresenter < Gitlab::View::Presenter::Delegated archived_failure: 'The job is archived and cannot be run', unmet_prerequisites: 'The job failed to complete prerequisite tasks', scheduler_failure: 'The scheduler failed to assign job to the runner, please try again or contact system administrator', - data_integrity_failure: 'There has been a structural integrity problem detected, please contact system administrator' + data_integrity_failure: 'There has been a structural integrity problem detected, please contact system administrator', + invalid_bridge_trigger: 'This job could not be executed because downstream pipeline trigger definition is invalid', + downstream_bridge_project_not_found: 'This job could not be executed because downstream bridge project could not be found', + insufficient_bridge_permissions: 'This job could not be executed because of insufficient permissions to create a downstream pipeline', + bridge_pipeline_is_child_pipeline: 'This job belongs to a child pipeline and cannot create further child pipelines', + downstream_pipeline_creation_failed: 'The downstream pipeline could not be created' }.freeze private_constant :CALLOUT_FAILURE_MESSAGES diff --git a/app/services/ci/create_cross_project_pipeline_service.rb b/app/services/ci/create_cross_project_pipeline_service.rb new file mode 100644 index 00000000000..a60793463b4 --- /dev/null +++ b/app/services/ci/create_cross_project_pipeline_service.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +module Ci + # TODO: rename this (and worker) to CreateDownstreamPipelineService + class CreateCrossProjectPipelineService < ::BaseService + include Gitlab::Utils::StrongMemoize + + def execute(bridge) + @bridge = bridge + + pipeline_params = @bridge.downstream_pipeline_params + target_ref = pipeline_params.dig(:target_revision, :ref) + + return unless ensure_preconditions!(target_ref) + + service = ::Ci::CreatePipelineService.new( + pipeline_params.fetch(:project), + current_user, + pipeline_params.fetch(:target_revision)) + + downstream_pipeline = service.execute( + pipeline_params.fetch(:source), pipeline_params[:execute_params]) do |pipeline| + @bridge.sourced_pipelines.build( + source_pipeline: @bridge.pipeline, + source_project: @bridge.project, + project: @bridge.downstream_project, + pipeline: pipeline) + + pipeline.variables.build(@bridge.downstream_variables) + end + + downstream_pipeline.tap do |pipeline| + @bridge.drop!(:downstream_pipeline_creation_failed) if pipeline.has_yaml_errors? + end + end + + private + + def ensure_preconditions!(target_ref) + unless downstream_project_accessible? + @bridge.drop!(:downstream_bridge_project_not_found) + return false + end + + # TODO: Remove this condition if favour of model validation + # https://gitlab.com/gitlab-org/gitlab/issues/38338 + if downstream_project == project && !@bridge.triggers_child_pipeline? + @bridge.drop!(:invalid_bridge_trigger) + return false + end + + # TODO: Remove this condition if favour of model validation + # https://gitlab.com/gitlab-org/gitlab/issues/38338 + if @bridge.triggers_child_pipeline? && @bridge.pipeline.parent_pipeline.present? + @bridge.drop!(:bridge_pipeline_is_child_pipeline) + return false + end + + unless can_create_downstream_pipeline?(target_ref) + @bridge.drop!(:insufficient_bridge_permissions) + return false + end + + true + end + + def downstream_project_accessible? + downstream_project.present? && + can?(current_user, :read_project, downstream_project) + end + + def can_create_downstream_pipeline?(target_ref) + can?(current_user, :update_pipeline, project) && + can?(current_user, :create_pipeline, downstream_project) && + can_update_branch?(target_ref) + end + + def can_update_branch?(target_ref) + ::Gitlab::UserAccess.new(current_user, project: downstream_project).can_update_branch?(target_ref) + end + + def downstream_project + strong_memoize(:downstream_project) do + @bridge.downstream_project + end + end + end +end diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb index 4a109fe4e16..31097b9151a 100644 --- a/app/services/merge_requests/merge_service.rb +++ b/app/services/merge_requests/merge_service.rb @@ -79,6 +79,8 @@ module MergeRequests end merge_request.update!(merge_commit_sha: commit_id) + ensure + merge_request.update_column(:in_progress_merge_commit_sha, nil) end def try_merge @@ -89,8 +91,6 @@ module MergeRequests rescue => e handle_merge_error(log_message: e.message) raise_error('Something went wrong during merge') - ensure - merge_request.update!(in_progress_merge_commit_sha: nil) end def after_merge diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index f3666f100a3..6b1fb92681a 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -90,6 +90,7 @@ module Projects end @project.track_project_repository + @project.create_project_setting unless @project.project_setting event_service.create_project(@project, current_user) system_hook_service.execute_hooks_for(@project, :create) diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 6b138445675..0ec81d0eb04 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -42,7 +42,7 @@ .well-segment.admin-well.admin-well-features %h4 Features = feature_entry(_('Sign up'), - href: admin_application_settings_path(anchor: 'js-signup-settings'), + href: general_admin_application_settings_path(anchor: 'js-signup-settings'), enabled: allow_signup?) = feature_entry(_('LDAP'), @@ -50,11 +50,11 @@ doc_href: help_page_path('administration/auth/ldap')) = feature_entry(_('Gravatar'), - href: admin_application_settings_path(anchor: 'js-account-settings'), + href: general_admin_application_settings_path(anchor: 'js-account-settings'), enabled: gravatar_enabled?) = feature_entry(_('OmniAuth'), - href: admin_application_settings_path(anchor: 'js-signin-settings'), + href: general_admin_application_settings_path(anchor: 'js-signin-settings'), enabled: Gitlab::Auth.omniauth_enabled?, doc_href: help_page_path('integration/omniauth')) @@ -85,7 +85,7 @@ .float-right = version_status_badge %p - %a{ href: admin_application_settings_path } + %a{ href: general_admin_application_settings_path } GitLab %span.float-right = Gitlab::VERSION diff --git a/app/views/instance_statistics/cohorts/_usage_ping.html.haml b/app/views/instance_statistics/cohorts/_usage_ping.html.haml deleted file mode 100644 index 3dda386fcf7..00000000000 --- a/app/views/instance_statistics/cohorts/_usage_ping.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%h2#usage-ping Usage ping - -.bs-callout.clearfix - %p - User cohorts are shown because the usage ping is enabled. The data sent with - this is shown below. To disable this, visit - = succeed '.' do - = link_to 'application settings', admin_application_settings_path(anchor: 'usage-statistics') - -%pre.usage-data.js-syntax-highlight.code.highlight{ data: { endpoint: usage_data_admin_application_settings_path(format: :html) } } diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml index 71fef5df5bc..e8e1da720cd 100644 --- a/app/views/layouts/nav/sidebar/_admin.html.haml +++ b/app/views/layouts/nav/sidebar/_admin.html.haml @@ -221,7 +221,7 @@ = _('Appearance') = nav_link(controller: :application_settings) do - = link_to admin_application_settings_path do + = link_to general_admin_application_settings_path do .nav-icon-container = sprite_icon('settings') %span.nav-item-name.qa-admin-settings-item @@ -229,11 +229,11 @@ %ul.sidebar-sub-level-items.qa-admin-sidebar-settings-submenu = nav_link(controller: :application_settings, html_options: { class: "fly-out-top-item" } ) do - = link_to admin_application_settings_path do + = link_to general_admin_application_settings_path do %strong.fly-out-top-item-name = _('Settings') %li.divider.fly-out-top-item - = nav_link(path: 'application_settings#show') do + = nav_link(path: 'application_settings#general') do = link_to general_admin_application_settings_path, title: _('General'), class: 'qa-admin-settings-general-item' do %span = _('General') diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml index ffc10142259..849d9d7e87c 100644 --- a/app/views/projects/tree/_tree_header.html.haml +++ b/app/views/projects/tree/_tree_header.html.haml @@ -75,7 +75,7 @@ = link_to new_project_tag_path(@project) do #{ _('New tag') } -.tree-controls< +.tree-controls{ class: ("gl-font-size-0" if vue_file_list_enabled?) }< = render_if_exists 'projects/tree/lock_link' - if vue_file_list_enabled? #js-tree-history-link.d-inline-block{ data: { history_link: project_commits_path(@project, @ref) } } diff --git a/app/views/users/_overview.html.haml b/app/views/users/_overview.html.haml index b5bc1180290..7bd2d30a35c 100644 --- a/app/views/users/_overview.html.haml +++ b/app/views/users/_overview.html.haml @@ -3,7 +3,7 @@ .calendar-block.prepend-top-default.append-bottom-default .user-calendar.d-none.d-sm-block{ data: { calendar_path: user_calendar_path(@user, :json), calendar_activities_path: user_calendar_activities_path, utc_offset: Time.zone.utc_offset } } %h4.center.light - = spinner nil, true + .spinner.spinner-md .user-calendar-activities.d-none.d-sm-block .row .col-md-12.col-lg-6 @@ -16,7 +16,7 @@ = link_to s_('UserProfile|View all'), user_activity_path, class: "hide js-view-all" .overview-content-list{ data: { href: user_path } } .center.light.loading - = spinner nil, true + .spinner.spinner-md .col-md-12.col-lg-6 .projects-block @@ -27,4 +27,4 @@ = link_to s_('UserProfile|View all'), user_projects_path, class: "hide js-view-all" .overview-content-list{ data: { href: user_projects_path } } .center.light.loading - = spinner nil, true + .spinner.spinner-md diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index e10dad8aa8d..3c164588b13 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -130,7 +130,8 @@ %h4.prepend-top-20 = s_('UserProfile|Most Recent Activity') .content_list{ data: { href: user_path } } - = spinner + .loading + .spinner.spinner-md - if profile_tab?(:groups) #groups.tab-pane @@ -152,8 +153,8 @@ #snippets.tab-pane -# This tab is always loaded via AJAX - .loading-status - = spinner + .loading.hide + .spinner.spinner-md - if profile_tabs.empty? .row diff --git a/app/workers/admin_email_worker.rb b/app/workers/admin_email_worker.rb index 074b59414ab..a7cc4fb0d11 100644 --- a/app/workers/admin_email_worker.rb +++ b/app/workers/admin_email_worker.rb @@ -2,7 +2,10 @@ class AdminEmailWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category_not_owned! diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 51b91e8e8be..e836dd92770 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -531,6 +531,12 @@ :latency_sensitive: :resource_boundary: :unknown :weight: 3 +- :name: pipeline_default:ci_create_cross_project_pipeline + :feature_category: :continuous_integration + :has_external_dependencies: + :latency_sensitive: + :resource_boundary: :cpu + :weight: 3 - :name: pipeline_default:ci_pipeline_bridge_status :feature_category: :continuous_integration :has_external_dependencies: diff --git a/app/workers/ci/create_cross_project_pipeline_worker.rb b/app/workers/ci/create_cross_project_pipeline_worker.rb new file mode 100644 index 00000000000..91e9317713e --- /dev/null +++ b/app/workers/ci/create_cross_project_pipeline_worker.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Ci + class CreateCrossProjectPipelineWorker + include ::ApplicationWorker + include ::PipelineQueue + + worker_resource_boundary :cpu + + def perform(bridge_id) + ::Ci::Bridge.find_by_id(bridge_id).try do |bridge| + ::Ci::CreateCrossProjectPipelineService + .new(bridge.project, bridge.user) + .execute(bridge) + end + end + end +end diff --git a/app/workers/expire_build_artifacts_worker.rb b/app/workers/expire_build_artifacts_worker.rb index ee57bd6dfe2..07f516a3390 100644 --- a/app/workers/expire_build_artifacts_worker.rb +++ b/app/workers/expire_build_artifacts_worker.rb @@ -2,7 +2,10 @@ class ExpireBuildArtifactsWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category :continuous_integration diff --git a/app/workers/gitlab_usage_ping_worker.rb b/app/workers/gitlab_usage_ping_worker.rb index 577293c2d8d..bf0dc0fdd59 100644 --- a/app/workers/gitlab_usage_ping_worker.rb +++ b/app/workers/gitlab_usage_ping_worker.rb @@ -4,7 +4,10 @@ class GitlabUsagePingWorker LEASE_TIMEOUT = 86400 include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category_not_owned! diff --git a/app/workers/import_export_project_cleanup_worker.rb b/app/workers/import_export_project_cleanup_worker.rb index 8a018024e95..ae236fa1fcd 100644 --- a/app/workers/import_export_project_cleanup_worker.rb +++ b/app/workers/import_export_project_cleanup_worker.rb @@ -2,7 +2,10 @@ class ImportExportProjectCleanupWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category :importers diff --git a/app/workers/prune_old_events_worker.rb b/app/workers/prune_old_events_worker.rb index 1a54b85a384..835c51ec846 100644 --- a/app/workers/prune_old_events_worker.rb +++ b/app/workers/prune_old_events_worker.rb @@ -2,7 +2,10 @@ class PruneOldEventsWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category_not_owned! diff --git a/app/workers/prune_web_hook_logs_worker.rb b/app/workers/prune_web_hook_logs_worker.rb index 7d128a6f1ac..dd4f16a69da 100644 --- a/app/workers/prune_web_hook_logs_worker.rb +++ b/app/workers/prune_web_hook_logs_worker.rb @@ -4,7 +4,10 @@ # table. class PruneWebHookLogsWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category :integrations diff --git a/app/workers/remove_unreferenced_lfs_objects_worker.rb b/app/workers/remove_unreferenced_lfs_objects_worker.rb index b2d2223c64d..5e3998f3915 100644 --- a/app/workers/remove_unreferenced_lfs_objects_worker.rb +++ b/app/workers/remove_unreferenced_lfs_objects_worker.rb @@ -2,7 +2,10 @@ class RemoveUnreferencedLfsObjectsWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category :git_lfs diff --git a/app/workers/repository_archive_cache_worker.rb b/app/workers/repository_archive_cache_worker.rb index bbeb9d9eace..76e08a80c15 100644 --- a/app/workers/repository_archive_cache_worker.rb +++ b/app/workers/repository_archive_cache_worker.rb @@ -2,7 +2,10 @@ class RepositoryArchiveCacheWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category :source_code_management diff --git a/app/workers/repository_check/dispatch_worker.rb b/app/workers/repository_check/dispatch_worker.rb index ca1a82ed160..f68be8832eb 100644 --- a/app/workers/repository_check/dispatch_worker.rb +++ b/app/workers/repository_check/dispatch_worker.rb @@ -3,7 +3,10 @@ module RepositoryCheck class DispatchWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext include ::EachShardWorker include ExclusiveLeaseGuard diff --git a/app/workers/requests_profiles_worker.rb b/app/workers/requests_profiles_worker.rb index 593451eb16b..b711cb99082 100644 --- a/app/workers/requests_profiles_worker.rb +++ b/app/workers/requests_profiles_worker.rb @@ -2,7 +2,10 @@ class RequestsProfilesWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category :source_code_management diff --git a/app/workers/stuck_import_jobs_worker.rb b/app/workers/stuck_import_jobs_worker.rb index 4a72fcedee3..c9675417aa4 100644 --- a/app/workers/stuck_import_jobs_worker.rb +++ b/app/workers/stuck_import_jobs_worker.rb @@ -2,7 +2,11 @@ class StuckImportJobsWorker include ApplicationWorker - include CronjobQueue # rubocop:disable Scalability/CronWorkerContext + # rubocop:disable Scalability/CronWorkerContext + # This worker updates several import states inline and does not schedule + # other jobs. So no context needed + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext feature_category :importers worker_resource_boundary :cpu diff --git a/app/workers/trending_projects_worker.rb b/app/workers/trending_projects_worker.rb index 5db661dd0e6..208d8b3b9b5 100644 --- a/app/workers/trending_projects_worker.rb +++ b/app/workers/trending_projects_worker.rb @@ -2,6 +2,10 @@ class TrendingProjectsWorker include ApplicationWorker + # rubocop:disable Scalability/CronWorkerContext + # This worker does not perform work scoped to a context + include CronjobQueue + # rubocop:enable Scalability/CronWorkerContext include CronjobQueue # rubocop:disable Scalability/CronWorkerContext feature_category :source_code_management |