diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-28 09:15:16 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-28 09:15:16 +0000 |
commit | 3d100bb7e6a44443b6cbaa94a55755fcd0121266 (patch) | |
tree | 77598f896d1257ef40ea0f228d806db106a127d8 | |
parent | 203b3660158829b85a49e045bf53d62da62aa88d (diff) | |
download | gitlab-ce-3d100bb7e6a44443b6cbaa94a55755fcd0121266.tar.gz |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | .rubocop_todo/gitlab/namespaced_class.yml | 1 | ||||
-rw-r--r-- | app/controllers/concerns/membership_actions.rb | 4 | ||||
-rw-r--r-- | app/serializers/cluster_entity.rb | 2 | ||||
-rw-r--r-- | app/serializers/cluster_error_entity.rb | 7 | ||||
-rw-r--r-- | app/serializers/clusters/kubernetes_error_entity.rb | 9 | ||||
-rw-r--r-- | app/views/admin/hooks/_form.html.haml | 2 | ||||
-rw-r--r-- | doc/development/secure_coding_guidelines.md | 2 | ||||
-rw-r--r-- | doc/user/project/description_templates.md | 10 | ||||
-rw-r--r-- | lib/gitlab/metrics/dashboard/stages/cluster_endpoint_inserter.rb | 2 | ||||
-rw-r--r-- | locale/gitlab.pot | 6 | ||||
-rw-r--r-- | spec/serializers/clusters/kubernetes_error_entity_spec.rb (renamed from spec/serializers/cluster_error_entity_spec.rb) | 2 | ||||
-rw-r--r-- | spec/services/projects/import_service_spec.rb | 22 |
12 files changed, 28 insertions, 41 deletions
diff --git a/.rubocop_todo/gitlab/namespaced_class.yml b/.rubocop_todo/gitlab/namespaced_class.yml index 7d0f69c9300..73f4a5deec0 100644 --- a/.rubocop_todo/gitlab/namespaced_class.yml +++ b/.rubocop_todo/gitlab/namespaced_class.yml @@ -496,7 +496,6 @@ Gitlab/NamespacedClass: - app/serializers/build_trace_serializer.rb - app/serializers/cluster_application_entity.rb - app/serializers/cluster_entity.rb - - app/serializers/cluster_error_entity.rb - app/serializers/cluster_serializer.rb - app/serializers/codequality_degradation_entity.rb - app/serializers/codequality_reports_comparer_entity.rb diff --git a/app/controllers/concerns/membership_actions.rb b/app/controllers/concerns/membership_actions.rb index f716c1f6c2f..37a59d7f39d 100644 --- a/app/controllers/concerns/membership_actions.rb +++ b/app/controllers/concerns/membership_actions.rb @@ -79,8 +79,8 @@ module MembershipActions notice: _('Your request for access has been queued for review.') else redirect_to polymorphic_path(membershipable), - alert: _("Your request for access could not be processed: %{error_meesage}") % - { error_meesage: access_requester.errors.full_messages.to_sentence } + alert: _("Your request for access could not be processed: %{error_message}") % + { error_message: access_requester.errors.full_messages.to_sentence } end end diff --git a/app/serializers/cluster_entity.rb b/app/serializers/cluster_entity.rb index ba42e14be22..e2d24e74b29 100644 --- a/app/serializers/cluster_entity.rb +++ b/app/serializers/cluster_entity.rb @@ -24,7 +24,7 @@ class ClusterEntity < Grape::Entity end expose :kubernetes_errors do |cluster| - ClusterErrorEntity.new(cluster) + Clusters::KubernetesErrorEntity.new(cluster) end expose :enable_advanced_logs_querying do |cluster| diff --git a/app/serializers/cluster_error_entity.rb b/app/serializers/cluster_error_entity.rb deleted file mode 100644 index c749537cb94..00000000000 --- a/app/serializers/cluster_error_entity.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class ClusterErrorEntity < Grape::Entity - expose :connection_error - expose :metrics_connection_error - expose :node_connection_error -end diff --git a/app/serializers/clusters/kubernetes_error_entity.rb b/app/serializers/clusters/kubernetes_error_entity.rb new file mode 100644 index 00000000000..ceab10f232e --- /dev/null +++ b/app/serializers/clusters/kubernetes_error_entity.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Clusters + class KubernetesErrorEntity < Grape::Entity + expose :connection_error + expose :metrics_connection_error + expose :node_connection_error + end +end diff --git a/app/views/admin/hooks/_form.html.haml b/app/views/admin/hooks/_form.html.haml index 459df5c8d85..bd63172a0ee 100644 --- a/app/views/admin/hooks/_form.html.haml +++ b/app/views/admin/hooks/_form.html.haml @@ -3,7 +3,7 @@ .form-group = form.label :url, _('URL'), class: 'label-bold' = form.text_field :url, class: 'form-control gl-form-input' - %p.form-text.text-muted= _('URL must be percent-encoded if neccessary.') + %p.form-text.text-muted= _('URL must be percent-encoded if necessary.') .form-group = form.label :token, _('Secret token'), class: 'label-bold' = form.text_field :token, class: 'form-control gl-form-input' diff --git a/doc/development/secure_coding_guidelines.md b/doc/development/secure_coding_guidelines.md index 5535f1ac4c0..8d77467d1b5 100644 --- a/doc/development/secure_coding_guidelines.md +++ b/doc/development/secure_coding_guidelines.md @@ -1157,7 +1157,7 @@ Here's some pseudocode showing an example of a potential TOCTOU bug: ```ruby def upvote(comment, user) # The time between calling .exists? and .create can lead to TOCTOU, - # particulary if .create is a slow method, or runs in a background job + # particularly if .create is a slow method, or runs in a background job if Upvote.exists?(comment: comment, user: user) return else diff --git a/doc/user/project/description_templates.md b/doc/user/project/description_templates.md index 539f5230063..4f8cfad1444 100644 --- a/doc/user/project/description_templates.md +++ b/doc/user/project/description_templates.md @@ -129,8 +129,9 @@ Prerequisites: To set a default description template for merge requests, either: -- [Create a merge request template](#create-a-merge-request-template) named `Default.md` and save it in `.gitlab/merge_request_templates/`. - This will not overwrite the default template if one has been set in the project settings. +- [Create a merge request template](#create-a-merge-request-template) named `Default.md` or `default.md` + and save it in `.gitlab/merge_request_templates/`. + This doesn't overwrite the default template if one has been set in the project settings. - Users on GitLab Premium and higher: set the default template in project settings: 1. On the top bar, select **Menu > Projects** and find your project. @@ -141,8 +142,9 @@ To set a default description template for merge requests, either: To set a default description template for issues, either: -- [Create an issue template](#create-an-issue-template) named `Default.md` and save it in `.gitlab/issue_templates/`. - This will not overwrite the default template if one has been set in the project settings. +- [Create an issue template](#create-an-issue-template) named `Default.md` or `default.md` + and save it in `.gitlab/issue_templates/`. + This doesn't overwrite the default template if one has been set in the project settings. - Users on GitLab Premium and higher: set the default template in project settings: 1. On the top bar, select **Menu > Projects** and find your project. diff --git a/lib/gitlab/metrics/dashboard/stages/cluster_endpoint_inserter.rb b/lib/gitlab/metrics/dashboard/stages/cluster_endpoint_inserter.rb index 2c17982d299..31d75225972 100644 --- a/lib/gitlab/metrics/dashboard/stages/cluster_endpoint_inserter.rb +++ b/lib/gitlab/metrics/dashboard/stages/cluster_endpoint_inserter.rb @@ -74,7 +74,7 @@ module Gitlab def verify_params raise Errors::DashboardProcessingError, _('Cluster is required for Stages::ClusterEndpointInserter') unless params[:cluster] - raise Errors::DashboardProcessingError, _('Cluster type must be specificed for Stages::ClusterEndpointInserter') unless params[:cluster_type] + raise Errors::DashboardProcessingError, _('Cluster type must be specified for Stages::ClusterEndpointInserter') unless params[:cluster_type] end end end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 689cc7e367e..8b454b293fa 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -7612,7 +7612,7 @@ msgstr "" msgid "Cluster level" msgstr "" -msgid "Cluster type must be specificed for Stages::ClusterEndpointInserter" +msgid "Cluster type must be specified for Stages::ClusterEndpointInserter" msgstr "" msgid "ClusterAgents|%{name} successfully deleted" @@ -38932,7 +38932,7 @@ msgstr "" msgid "URL is triggered when repository is updated" msgstr "" -msgid "URL must be percent-encoded if neccessary." +msgid "URL must be percent-encoded if necessary." msgstr "" msgid "URL must start with %{codeStart}http://%{codeEnd}, %{codeStart}https://%{codeEnd}, or %{codeStart}ftp://%{codeEnd}" @@ -42611,7 +42611,7 @@ msgstr "" msgid "Your public email will be displayed on your public profile." msgstr "" -msgid "Your request for access could not be processed: %{error_meesage}" +msgid "Your request for access could not be processed: %{error_message}" msgstr "" msgid "Your request for access has been queued for review." diff --git a/spec/serializers/cluster_error_entity_spec.rb b/spec/serializers/clusters/kubernetes_error_entity_spec.rb index 43ec41adf14..1464e696c48 100644 --- a/spec/serializers/cluster_error_entity_spec.rb +++ b/spec/serializers/clusters/kubernetes_error_entity_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe ClusterErrorEntity do +RSpec.describe Clusters::KubernetesErrorEntity do describe '#as_json' do let(:cluster) { create(:cluster, :provided_by_user, :group) } diff --git a/spec/services/projects/import_service_spec.rb b/spec/services/projects/import_service_spec.rb index ccfd119b55b..ab9f99f893d 100644 --- a/spec/services/projects/import_service_spec.rb +++ b/spec/services/projects/import_service_spec.rb @@ -199,12 +199,13 @@ RSpec.describe Projects::ImportService do context 'with valid importer' do before do - stub_github_omniauth_provider + provider = double(:provider).as_null_object + stub_omniauth_setting(providers: [provider]) project.import_url = 'https://github.com/vim/vim.git' project.import_type = 'github' - allow(project).to receive(:import_data).and_return(double.as_null_object) + allow(project).to receive(:import_data).and_return(double(:import_data).as_null_object) end it 'succeeds if importer succeeds' do @@ -296,22 +297,5 @@ RSpec.describe Projects::ImportService do subject.execute end end - - def stub_github_omniauth_provider - provider = ActiveSupport::InheritableOptions.new( - 'name' => 'github', - 'app_id' => 'asd123', - 'app_secret' => 'asd123', - 'args' => { - 'client_options' => { - 'site' => 'https://github.com/api/v3', - 'authorize_url' => 'https://github.com/login/oauth/authorize', - 'token_url' => 'https://github.com/login/oauth/access_token' - } - } - ) - - stub_omniauth_setting(providers: [provider]) - end end end |