summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2019-09-10 11:23:50 +0200
committerAlessio Caiazza <acaiazza@gitlab.com>2019-09-10 11:23:50 +0200
commit589071dc0227bc3761efc73380c9e2f422abf278 (patch)
tree3d30c79b32b19bc6dd5f5bdd3e55c959815cecd6
parent685f16a7092058477120d73453babc67a794c6aa (diff)
downloadgitlab-ce-ac-cop-scalability-api-files-fixes.tar.gz
Temporary disable Scalability/FileUploads copac-cop-scalability-api-files-fixes
Fixing those offenses requires also a workhorse MR. This will be tracked in https://gitlab.com/gitlab-org/gitlab-ee/issues/14960
-rw-r--r--lib/api/helpers/projects_helpers.rb3
-rw-r--r--lib/api/pages_domains.rb6
-rw-r--r--lib/api/project_import.rb3
-rw-r--r--lib/api/projects.rb3
-rw-r--r--lib/api/users.rb3
5 files changed, 14 insertions, 4 deletions
diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb
index 51b7cf05c8f..c1e7af33235 100644
--- a/lib/api/helpers/projects_helpers.rb
+++ b/lib/api/helpers/projects_helpers.rb
@@ -38,7 +38,8 @@ module API
optional :only_allow_merge_if_pipeline_succeeds, type: Boolean, desc: 'Only allow to merge if builds succeed'
optional :only_allow_merge_if_all_discussions_are_resolved, type: Boolean, desc: 'Only allow to merge if all discussions are resolved'
optional :tag_list, type: Array[String], desc: 'The list of tags for a project'
- optional :avatar, type: File, desc: 'Avatar image for project'
+ # TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab-ee/issues/14960
+ optional :avatar, type: File, desc: 'Avatar image for project' # rubocop:disable Scalability/FileUploads
optional :printing_merge_request_link_enabled, type: Boolean, desc: 'Show link to create/view merge request when pushing from the command line'
optional :merge_method, type: String, values: %w(ff rebase_merge merge), desc: 'The merge method used when merging merge requests'
optional :initialize_with_readme, type: Boolean, desc: "Initialize a project with a README.md"
diff --git a/lib/api/pages_domains.rb b/lib/api/pages_domains.rb
index 4227a106a95..40b133e8959 100644
--- a/lib/api/pages_domains.rb
+++ b/lib/api/pages_domains.rb
@@ -90,8 +90,11 @@ module API
end
params do
requires :domain, type: String, desc: 'The domain'
+ # rubocop:disable Scalability/FileUploads
+ # TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab-ee/issues/14960
optional :certificate, allow_blank: false, types: [File, String], desc: 'The certificate', as: :user_provided_certificate
optional :key, allow_blank: false, types: [File, String], desc: 'The key', as: :user_provided_key
+ # rubocop:enable Scalability/FileUploads
all_or_none_of :user_provided_certificate, :user_provided_key
end
post ":id/pages/domains" do
@@ -111,8 +114,11 @@ module API
desc 'Updates a pages domain'
params do
requires :domain, type: String, desc: 'The domain'
+ # rubocop:disable Scalability/FileUploads
+ # TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab-ee/issues/14960
optional :certificate, allow_blank: false, types: [File, String], desc: 'The certificate', as: :user_provided_certificate
optional :key, allow_blank: false, types: [File, String], desc: 'The key', as: :user_provided_key
+ # rubocop:enable Scalability/FileUploads
end
put ":id/pages/domains/:domain", requirements: PAGES_DOMAINS_ENDPOINT_REQUIREMENTS do
authorize! :update_pages, user_project
diff --git a/lib/api/project_import.rb b/lib/api/project_import.rb
index bb1b037c08f..9b5e0727184 100644
--- a/lib/api/project_import.rb
+++ b/lib/api/project_import.rb
@@ -27,7 +27,8 @@ module API
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
params do
requires :path, type: String, desc: 'The new project path and name'
- requires :file, type: File, desc: 'The project export file to be imported'
+ # TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab-ee/issues/14960
+ requires :file, type: File, desc: 'The project export file to be imported' # rubocop:disable Scalability/FileUploads
optional :namespace, type: String, desc: "The ID or name of the namespace that the project will be imported into. Defaults to the current user's namespace."
optional :overwrite, type: Boolean, default: false, desc: 'If there is a project in the same namespace and with the same name overwrite it'
optional :override_params,
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 3073c14b341..63bfa8db61c 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -478,7 +478,8 @@ module API
desc 'Upload a file'
params do
- requires :file, type: File, desc: 'The file to be uploaded'
+ # TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab-ee/issues/14960
+ requires :file, type: File, desc: 'The file to be uploaded' # rubocop:disable Scalability/FileUploads
end
post ":id/uploads" do
UploadService.new(user_project, params[:file]).execute.to_h
diff --git a/lib/api/users.rb b/lib/api/users.rb
index a4ac5b629b8..99295888c8c 100644
--- a/lib/api/users.rb
+++ b/lib/api/users.rb
@@ -50,7 +50,8 @@ module API
optional :admin, type: Boolean, desc: 'Flag indicating the user is an administrator'
optional :can_create_group, type: Boolean, desc: 'Flag indicating the user can create groups'
optional :external, type: Boolean, desc: 'Flag indicating the user is an external user'
- optional :avatar, type: File, desc: 'Avatar image for user'
+ # TODO: remove rubocop disable - https://gitlab.com/gitlab-org/gitlab-ee/issues/14960
+ optional :avatar, type: File, desc: 'Avatar image for user' # rubocop:disable Scalability/FileUploads
optional :private_profile, type: Boolean, default: false, desc: 'Flag indicating the user has a private profile'
all_or_none_of :extern_uid, :provider