diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 21:08:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 21:08:05 +0000 |
commit | abae8f34f377519946a91101ef7abf504454531c (patch) | |
tree | 359fab0082860b6850d4a0a492b8f12eb3d4eb0b /app | |
parent | 580622bdb3c762a8e89facd8a3946881ee480442 (diff) | |
download | gitlab-ce-abae8f34f377519946a91101ef7abf504454531c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
5 files changed, 19 insertions, 3 deletions
diff --git a/app/assets/javascripts/monitoring/components/panel_type.vue b/app/assets/javascripts/monitoring/components/panel_type.vue index d6d60c2d5da..77ba17b6e68 100644 --- a/app/assets/javascripts/monitoring/components/panel_type.vue +++ b/app/assets/javascripts/monitoring/components/panel_type.vue @@ -259,7 +259,7 @@ export default { :data-clipboard-text="clipboardText" @click="showToast(clipboardText)" > - {{ __('Generate link to chart') }} + {{ __('Copy link to chart') }} </gl-dropdown-item> <gl-dropdown-item v-if="alertWidgetAvailable" diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index ee102248cb7..ff65f040335 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -13,6 +13,7 @@ class Projects::PipelinesController < Projects::ApplicationController before_action do push_frontend_feature_flag(:junit_pipeline_view) end + before_action :ensure_pipeline, only: [:show] around_action :allow_gitaly_ref_name_caching, only: [:index, :show] @@ -214,6 +215,10 @@ class Projects::PipelinesController < Projects::ApplicationController params.require(:pipeline).permit(:ref, variables_attributes: %i[key variable_type secret_value]) end + def ensure_pipeline + render_404 unless pipeline + end + # rubocop: disable CodeReuse/ActiveRecord def pipeline @pipeline ||= if params[:id].blank? && params[:latest] diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 7dc47c55a04..4c8b703d60e 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -919,7 +919,7 @@ :urgency: :low :resource_boundary: :unknown :weight: 1 - :idempotent: + :idempotent: true - :name: authorized_keys :feature_category: :source_code_management :has_external_dependencies: diff --git a/app/workers/namespaces/schedule_aggregation_worker.rb b/app/workers/namespaces/schedule_aggregation_worker.rb index 94343a9e378..cbf5ed44572 100644 --- a/app/workers/namespaces/schedule_aggregation_worker.rb +++ b/app/workers/namespaces/schedule_aggregation_worker.rb @@ -1,11 +1,12 @@ # frozen_string_literal: true module Namespaces - class ScheduleAggregationWorker # rubocop:disable Scalability/IdempotentWorker + class ScheduleAggregationWorker include ApplicationWorker queue_namespace :update_namespace_statistics feature_category :source_code_management + idempotent! def perform(namespace_id) return unless aggregation_schedules_table_exists? diff --git a/app/workers/project_update_repository_storage_worker.rb b/app/workers/project_update_repository_storage_worker.rb index ecee33e6421..bb40107494b 100644 --- a/app/workers/project_update_repository_storage_worker.rb +++ b/app/workers/project_update_repository_storage_worker.rb @@ -3,11 +3,21 @@ class ProjectUpdateRepositoryStorageWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker + SameFilesystemError = Class.new(StandardError) + feature_category :gitaly def perform(project_id, new_repository_storage_key) project = Project.find(project_id) + raise SameFilesystemError if same_filesystem?(project.repository.storage, new_repository_storage_key) + ::Projects::UpdateRepositoryStorageService.new(project).execute(new_repository_storage_key) end + + private + + def same_filesystem?(old_storage, new_storage) + Gitlab::GitalyClient.filesystem_id(old_storage) == Gitlab::GitalyClient.filesystem_id(new_storage) + end end |