diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 12:10:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 12:10:10 +0300 |
commit | 22e9f240efba67d752e33ebdb8ba8205f187dc83 (patch) | |
tree | b8800e461d7a5c0f8d42400bfaa64a4165a6e4bd /app | |
parent | 82009412a065a58d076adbaa723268188fd9b20a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/services/ci/create_pipeline_service.rb | 1 | ||||
-rw-r--r-- | app/services/ci/register_job_service.rb | 16 | ||||
-rw-r--r-- | app/services/user_project_access_changed_service.rb | 2 | ||||
-rw-r--r-- | app/views/projects/services/_form.html.haml | 2 | ||||
-rw-r--r-- | app/views/users/show.html.haml | 2 | ||||
-rw-r--r-- | app/workers/all_queues.yml | 9 | ||||
-rw-r--r-- | app/workers/authorized_project_update/user_refresh_from_replica_worker.rb | 15 |
7 files changed, 32 insertions, 15 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb index fd333e24860..c039f31aafc 100644 --- a/app/services/ci/create_pipeline_service.rb +++ b/app/services/ci/create_pipeline_service.rb @@ -13,6 +13,7 @@ module Ci Gitlab::Ci::Pipeline::Chain::Validate::SecurityOrchestrationPolicy, Gitlab::Ci::Pipeline::Chain::Config::Content, Gitlab::Ci::Pipeline::Chain::Config::Process, + Gitlab::Ci::Pipeline::Chain::Validate::AfterConfig, Gitlab::Ci::Pipeline::Chain::RemoveUnwantedChatJobs, Gitlab::Ci::Pipeline::Chain::Skip, Gitlab::Ci::Pipeline::Chain::SeedBlock, diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb index 124912fee77..6280bf4c986 100644 --- a/app/services/ci/register_job_service.rb +++ b/app/services/ci/register_job_service.rb @@ -125,20 +125,12 @@ module Ci builds = builds.queued_before(params[:job_age].seconds.ago) end - if Feature.enabled?(:ci_register_job_service_one_by_one, runner, default_enabled: true) - build_ids = retrieve_queue(-> { builds.pluck(:id) }) + build_ids = retrieve_queue(-> { builds.pluck(:id) }) - @metrics.observe_queue_size(-> { build_ids.size }, @runner.runner_type) + @metrics.observe_queue_size(-> { build_ids.size }, @runner.runner_type) - build_ids.each do |build_id| - yield Ci::Build.find(build_id) - end - else - builds_array = retrieve_queue(-> { builds.to_a }) - - @metrics.observe_queue_size(-> { builds_array.size }, @runner.runner_type) - - builds_array.each(&blk) + build_ids.each do |build_id| + yield Ci::Build.find(build_id) end end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/services/user_project_access_changed_service.rb b/app/services/user_project_access_changed_service.rb index a3e7c4ce5bb..f52502e0379 100644 --- a/app/services/user_project_access_changed_service.rb +++ b/app/services/user_project_access_changed_service.rb @@ -20,7 +20,7 @@ class UserProjectAccessChangedService if priority == HIGH_PRIORITY AuthorizedProjectsWorker.bulk_perform_async(bulk_args) # rubocop:disable Scalability/BulkPerformWithContext else - AuthorizedProjectUpdate::UserRefreshWithLowUrgencyWorker.bulk_perform_in( # rubocop:disable Scalability/BulkPerformWithContext + AuthorizedProjectUpdate::UserRefreshFromReplicaWorker.bulk_perform_in( # rubocop:disable Scalability/BulkPerformWithContext DELAY, bulk_args, batch_size: 100, batch_delay: 30.seconds) end end diff --git a/app/views/projects/services/_form.html.haml b/app/views/projects/services/_form.html.haml index e8f3f6575aa..724684c9a0a 100644 --- a/app/views/projects/services/_form.html.haml +++ b/app/views/projects/services/_form.html.haml @@ -8,7 +8,7 @@ = form_for(integration, as: :service, url: scoped_integration_path(integration), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_service_path(@project, integration) } }) do |form| = render 'shared/service_settings', form: form, integration: integration - %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referrer } + %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referer } - if lookup_context.template_exists?('show', "projects/services/#{integration.to_param}", true) %hr diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 789854b56a4..effd58ad200 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -23,7 +23,7 @@ data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } }> = sprite_icon('error') - else - = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referrer), class: link_classes + 'btn gl-button btn-default btn-icon', + = link_to new_abuse_report_path(user_id: @user.id, ref_url: request.referer), class: link_classes + 'btn gl-button btn-default btn-icon', title: s_('UserProfile|Report abuse'), data: { toggle: 'tooltip', placement: 'bottom', container: 'body' } do = sprite_icon('error') - if can?(current_user, :read_user_profile, @user) diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 4c68c62f404..31c590183d1 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -30,6 +30,15 @@ :weight: 1 :idempotent: true :tags: [] +- :name: authorized_project_update:authorized_project_update_user_refresh_from_replica + :worker_name: AuthorizedProjectUpdate::UserRefreshFromReplicaWorker + :feature_category: :authentication_and_authorization + :has_external_dependencies: + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] - :name: authorized_project_update:authorized_project_update_user_refresh_over_user_range :worker_name: AuthorizedProjectUpdate::UserRefreshOverUserRangeWorker :feature_category: :authentication_and_authorization diff --git a/app/workers/authorized_project_update/user_refresh_from_replica_worker.rb b/app/workers/authorized_project_update/user_refresh_from_replica_worker.rb new file mode 100644 index 00000000000..5ca9de63fd7 --- /dev/null +++ b/app/workers/authorized_project_update/user_refresh_from_replica_worker.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module AuthorizedProjectUpdate + class UserRefreshFromReplicaWorker < ::AuthorizedProjectsWorker + feature_category :authentication_and_authorization + urgency :low + queue_namespace :authorized_project_update + deduplicate :until_executing, including_scheduled: true + + idempotent! + + # This worker will start reading data from the replica database soon + # Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/333219 + end +end |