diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-10 12:12:15 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-10 12:12:15 +0000 |
commit | 70eb0cf7518e1ccc2a26d9aaa9fc16e21c6de5f1 (patch) | |
tree | 01b2cad5224d5f9664b840ff75610db60b9ff095 /app | |
parent | ae1c8db2c805a6d3fad3a66fa31bd414cc071490 (diff) | |
download | gitlab-ce-70eb0cf7518e1ccc2a26d9aaa9fc16e21c6de5f1.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/users_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 2 | ||||
-rw-r--r-- | app/graphql/types/query_type.rb | 2 | ||||
-rw-r--r-- | app/helpers/admin/identities_helper.rb | 28 | ||||
-rw-r--r-- | app/models/merge_request.rb | 3 | ||||
-rw-r--r-- | app/models/project.rb | 1 | ||||
-rw-r--r-- | app/views/admin/application_settings/_repository_storage.html.haml | 2 | ||||
-rw-r--r-- | app/views/admin/application_settings/_whats_new.html.haml | 2 | ||||
-rw-r--r-- | app/views/admin/identities/_identity.html.haml | 28 | ||||
-rw-r--r-- | app/views/admin/identities/index.html.haml | 26 | ||||
-rw-r--r-- | app/views/import/_githubish_status.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/diffs/_diffs.html.haml | 2 | ||||
-rw-r--r-- | app/workers/all_queues.yml | 18 | ||||
-rw-r--r-- | app/workers/archive_trace_worker.rb | 5 | ||||
-rw-r--r-- | app/workers/build_finished_worker.rb | 9 |
15 files changed, 75 insertions, 61 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 874eb8985fb..5cc0c8f3970 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -88,7 +88,7 @@ class Admin::UsersController < Admin::ApplicationController result = Users::RejectService.new(current_user).execute(user) if result[:status] == :success - redirect_to admin_users_path, status: :found, notice: _("You've rejected %{user}" % { user: user.name }) + redirect_back_or_admin_user(notice: _("You've rejected %{user}" % { user: user.name })) else redirect_back_or_admin_user(alert: result[:message]) end diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 13ebe57a4d9..ce5d0c45a1e 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -365,7 +365,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo end def rebase - @merge_request.rebase_async(current_user.id) + @merge_request.rebase_async(current_user.id, skip_ci: Gitlab::Utils.to_boolean(merge_params[:skip_ci], default: false)) head :ok rescue MergeRequest::RebaseLockTimeout => e diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index 93e051776df..84355390ea0 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -184,7 +184,7 @@ module Types end def ci_variables - return unless current_user.can_admin_all_resources? + return unless current_user&.can_admin_all_resources? ::Ci::InstanceVariable.all end diff --git a/app/helpers/admin/identities_helper.rb b/app/helpers/admin/identities_helper.rb new file mode 100644 index 00000000000..8557f322bff --- /dev/null +++ b/app/helpers/admin/identities_helper.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +module Admin + module IdentitiesHelper + def label_for_identity_provider(identity) + provider = identity.provider + "#{Gitlab::Auth::OAuth::Provider.label_for(provider)} (#{provider})" + end + + def provider_id_cell_testid(identity) + 'provider_id_blank' + end + + def provider_id(identity) + '-' + end + + def saml_group_cell_testid(identity) + 'saml_group_blank' + end + + def saml_group_link(identity) + '-' + end + end +end + +Admin::IdentitiesHelper.prepend_mod diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 32536b38895..b2dd2264046 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -123,7 +123,8 @@ class MergeRequest < ApplicationRecord :force_remove_source_branch, :commit_message, :squash_commit_message, - :sha + :sha, + :skip_ci ].freeze serialize :merge_params, Hash # rubocop:disable Cop/ActiveRecordSerialize diff --git a/app/models/project.rb b/app/models/project.rb index d18ef68fd80..6c99f929237 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -53,6 +53,7 @@ class Project < ApplicationRecord ignore_columns :mirror_last_update_at, :mirror_last_successful_update_at, remove_after: '2021-09-22', remove_with: '14.4' ignore_columns :pull_mirror_branch_prefix, remove_after: '2021-09-22', remove_with: '14.4' + ignore_columns :build_coverage_regex, remove_after: '2022-10-22', remove_with: '15.5' STATISTICS_ATTRIBUTE = 'repositories_count' UNKNOWN_IMPORT_URL = 'http://unknown.git' diff --git a/app/views/admin/application_settings/_repository_storage.html.haml b/app/views/admin/application_settings/_repository_storage.html.haml index 5dc2d322bb3..ff10e4a8f77 100644 --- a/app/views/admin/application_settings/_repository_storage.html.haml +++ b/app/views/admin/application_settings/_repository_storage.html.haml @@ -23,7 +23,7 @@ = link_to s_('Learn more.'), help_page_path('administration/repository_storage_paths.md'), target: '_blank', rel: 'noopener noreferrer' .form-check = f.fields_for :repository_storages_weighted, storage_weights do |storage_form| - - Gitlab.config.repositories.storages.keys.each do |storage| + - Gitlab.config.repositories.storages.each_key do |storage| = storage_form.text_field storage, class: 'form-text-input' = storage_form.label storage, storage, class: 'label-bold form-check-label' %br diff --git a/app/views/admin/application_settings/_whats_new.html.haml b/app/views/admin/application_settings/_whats_new.html.haml index 8ae912d24b7..d82bb1c94e4 100644 --- a/app/views/admin/application_settings/_whats_new.html.haml +++ b/app/views/admin/application_settings/_whats_new.html.haml @@ -1,7 +1,7 @@ = gitlab_ui_form_for @application_setting, url: preferences_admin_application_settings_path(anchor: 'js-whats-new-settings'), html: { class: 'fieldset-form whats-new-settings' } do |f| = form_errors(@application_setting, pajamas_alert: true) - - whats_new_variants.keys.each do |variant| + - whats_new_variants.each_key do |variant| .gl-mb-4 = f.gitlab_ui_radio_component :whats_new_variant, variant, whats_new_variants_label(variant), help_text: whats_new_variants_description(variant) diff --git a/app/views/admin/identities/_identity.html.haml b/app/views/admin/identities/_identity.html.haml index d852e4a2463..3121cd2ae59 100644 --- a/app/views/admin/identities/_identity.html.haml +++ b/app/views/admin/identities/_identity.html.haml @@ -1,12 +1,24 @@ %tr %td - #{Gitlab::Auth::OAuth::Provider.label_for(identity.provider)} (#{identity.provider}) #{identity.saml_provider_id.present? ? "for #{link_to identity.saml_provider.group.path, identity.saml_provider.group} ID: #{identity.saml_provider_id}".html_safe : ""} + = label_for_identity_provider(identity) + %td{ data: { testid: provider_id_cell_testid(identity) } } + = provider_id(identity) + %td{ data: { testid: saml_group_cell_testid(identity) } } + = saml_group_link(identity) %td = identity.extern_uid - %td - = link_to edit_admin_user_identity_path(@user, identity), class: 'gl-button btn btn-sm btn-grouped' do - = _("Edit") - = link_to [:admin, @user, identity], method: :delete, - class: 'gl-button btn btn-sm btn-danger', - data: { confirm: _("Are you sure you want to remove this identity?") } do - = _('Delete') + %td{ class: 'gl-py-0!' } + - button_classes = 'has-tooltip gl-my-3' + = render Pajamas::ButtonComponent.new(category: :tertiary, + href: edit_admin_user_identity_path(@user, identity), + icon: 'pencil', + button_options: { title: _('Edit'), + 'aria-label' => _('Edit'), + class: button_classes } ) + = render Pajamas::ButtonComponent.new(category: :tertiary, + href: url_for([:admin, @user, identity]), + icon: 'remove', + button_options: { title: _('Delete'), + 'aria-label' => _('Delete identity'), + class: button_classes, + data: { method: :delete, confirm: _("Are you sure you want to remove this identity?") } } ) diff --git a/app/views/admin/identities/index.html.haml b/app/views/admin/identities/index.html.haml index 2bab802b2c1..99d5e2a93c4 100644 --- a/app/views/admin/identities/index.html.haml +++ b/app/views/admin/identities/index.html.haml @@ -3,14 +3,18 @@ - page_title _("Identities"), @user.name, _("Users") = render 'admin/users/head' -- if @identities.present? - .table-holder - %table.table - %thead - %tr - %th= _('Provider') - %th= _('Identifier') - %th - = render @identities -- else - %h4= _('This user has no identities') +%table.table.gl-table + %thead + %tr + %th{ class: 'gl-border-t-0!' }= _('Provider') + %th{ class: 'gl-border-t-0!' }= s_('Identity|Provider ID') + %th{ class: 'gl-border-t-0!' }= _('Group') + %th{ class: 'gl-border-t-0!' }= _('Identifier') + %th{ class: 'gl-border-t-0!' }= _('Actions') + = render @identities + - if @identities.blank? + %tbody + %tr + %td{ colspan: '5' } + .text-center.my-2 + = _('This user has no identities') diff --git a/app/views/import/_githubish_status.html.haml b/app/views/import/_githubish_status.html.haml index 08f7cd57732..35fd5d6eda6 100644 --- a/app/views/import/_githubish_status.html.haml +++ b/app/views/import/_githubish_status.html.haml @@ -13,9 +13,9 @@ can_select_namespace: current_user.can_select_namespace?.to_s, ci_cd_only: has_ci_cd_only_params?.to_s, namespaces_path: import_available_namespaces_path, - repos_path: url_for([:status, :import, provider, format: :json]), - jobs_path: url_for([:realtime_changes, :import, provider, format: :json]), + repos_path: url_for([:status, :import, provider, { format: :json }]), + jobs_path: url_for([:realtime_changes, :import, provider, { format: :json }]), default_target_namespace: default_namespace_path, - import_path: url_for([:import, provider, format: :json]), + import_path: url_for([:import, provider, { format: :json }]), filterable: filterable.to_s, paginatable: paginatable.to_s }.merge(extra_data) } diff --git a/app/views/projects/diffs/_diffs.html.haml b/app/views/projects/diffs/_diffs.html.haml index d596199f816..11984a9d6f6 100644 --- a/app/views/projects/diffs/_diffs.html.haml +++ b/app/views/projects/diffs/_diffs.html.haml @@ -11,7 +11,7 @@ .content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed .files-changed-inner .inline-parallel-buttons.gl-display-none.gl-md-display-flex - - if !diffs_expanded? && diff_files.any? { |diff_file| diff_file.collapsed? } + - if !diffs_expanded? && diff_files.any?(&:collapsed?) = link_to _('Expand all'), url_for(safe_params.merge(expanded: 1, format: nil)), class: 'gl-button btn btn-default' - if show_whitespace_toggle - if current_controller?(:commit) diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index 1c58e94b2b3..bd15a2c10d6 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -1551,15 +1551,6 @@ :weight: 1 :idempotent: false :tags: [] -- :name: pipeline_background:archive_trace - :worker_name: ArchiveTraceWorker - :feature_category: :continuous_integration - :has_external_dependencies: false - :urgency: :low - :resource_boundary: :unknown - :weight: 1 - :idempotent: false - :tags: [] - :name: pipeline_background:ci_archive_trace :worker_name: Ci::ArchiveTraceWorker :feature_category: :continuous_integration @@ -1776,15 +1767,6 @@ :weight: 2 :idempotent: false :tags: [] -- :name: pipeline_processing:build_finished - :worker_name: BuildFinishedWorker - :feature_category: :continuous_integration - :has_external_dependencies: false - :urgency: :high - :resource_boundary: :cpu - :weight: 5 - :idempotent: false - :tags: [] - :name: pipeline_processing:build_queue :worker_name: BuildQueueWorker :feature_category: :continuous_integration diff --git a/app/workers/archive_trace_worker.rb b/app/workers/archive_trace_worker.rb deleted file mode 100644 index ecde05f94dc..00000000000 --- a/app/workers/archive_trace_worker.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -class ArchiveTraceWorker < ::Ci::ArchiveTraceWorker # rubocop:disable Scalability/IdempotentWorker - # DEPRECATED: Not triggered since https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64934/ -end diff --git a/app/workers/build_finished_worker.rb b/app/workers/build_finished_worker.rb deleted file mode 100644 index 0d41f7b9438..00000000000 --- a/app/workers/build_finished_worker.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class BuildFinishedWorker < ::Ci::BuildFinishedWorker # rubocop:disable Scalability/IdempotentWorker - # DEPRECATED: Not triggered since https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64934/ - - # We need to explicitly specify these settings. They aren't inheriting from the parent class. - urgency :high - worker_resource_boundary :cpu -end |