summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab/CODEOWNERS7
-rw-r--r--app/controllers/projects/git_http_controller.rb16
-rw-r--r--app/helpers/diff_helper.rb11
-rw-r--r--app/models/namespace.rb6
-rw-r--r--app/models/project.rb15
-rw-r--r--lib/api/helpers.rb2
-rw-r--r--lib/api/helpers/runner.rb5
-rw-r--r--lib/api/runner.rb8
-rw-r--r--spec/config/smime_signature_settings_spec.rb2
-rw-r--r--spec/controllers/projects/git_http_controller_spec.rb25
-rw-r--r--spec/helpers/diff_helper_spec.rb2
-rw-r--r--spec/models/namespace_spec.rb48
-rw-r--r--spec/models/project_spec.rb47
-rw-r--r--spec/requests/api/runner_spec.rb54
-rw-r--r--spec/views/admin/dashboard/index.html.haml_spec.rb2
-rw-r--r--spec/views/admin/sessions/new.html.haml_spec.rb2
-rw-r--r--spec/views/ci/status/_badge.html.haml_spec.rb2
-rw-r--r--spec/views/dashboard/projects/_blank_state_admin_welcome.haml_spec.rb2
-rw-r--r--spec/views/dashboard/projects/_nav.html.haml_spec.rb2
-rw-r--r--spec/views/devise/shared/_signin_box.html.haml_spec.rb2
-rw-r--r--spec/views/errors/access_denied.html.haml_spec.rb2
-rw-r--r--spec/views/events/event/_push.html.haml_spec.rb2
-rw-r--r--spec/views/groups/_home_panel.html.haml_spec.rb2
-rw-r--r--spec/views/groups/edit.html.haml_spec.rb2
-rw-r--r--spec/views/help/instance_configuration.html.haml_spec.rb2
-rw-r--r--spec/views/layouts/_head.html.haml_spec.rb2
-rw-r--r--spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb2
-rw-r--r--spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb2
-rw-r--r--spec/views/notify/pipeline_failed_email.html.haml_spec.rb2
-rw-r--r--spec/views/notify/pipeline_success_email.html.haml_spec.rb2
-rw-r--r--spec/views/profiles/show.html.haml_spec.rb2
-rw-r--r--spec/views/projects/_home_panel.html.haml_spec.rb2
-rw-r--r--spec/views/projects/blob/_viewer.html.haml_spec.rb2
-rw-r--r--spec/views/projects/buttons/_dropdown.html.haml_spec.rb2
-rw-r--r--spec/views/projects/ci/lints/show.html.haml_spec.rb2
-rw-r--r--spec/views/projects/commit/_commit_box.html.haml_spec.rb2
-rw-r--r--spec/views/projects/commit/branches.html.haml_spec.rb2
-rw-r--r--spec/views/projects/commit/show.html.haml_spec.rb2
-rw-r--r--spec/views/projects/commits/_commit.html.haml_spec.rb2
-rw-r--r--spec/views/projects/diffs/_stats.html.haml_spec.rb2
-rw-r--r--spec/views/projects/diffs/_viewer.html.haml_spec.rb2
-rw-r--r--spec/views/projects/edit.html.haml_spec.rb2
-rw-r--r--spec/views/projects/environments/terminal.html.haml_spec.rb2
-rw-r--r--spec/views/projects/imports/new.html.haml_spec.rb2
-rw-r--r--spec/views/projects/issues/_related_branches.html.haml_spec.rb2
-rw-r--r--spec/views/projects/jobs/_build.html.haml_spec.rb2
-rw-r--r--spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb2
-rw-r--r--spec/views/projects/jobs/show.html.haml_spec.rb2
-rw-r--r--spec/views/projects/merge_requests/_commits.html.haml_spec.rb2
-rw-r--r--spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb2
-rw-r--r--spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb2
-rw-r--r--spec/views/projects/merge_requests/edit.html.haml_spec.rb2
-rw-r--r--spec/views/projects/merge_requests/show.html.haml_spec.rb2
-rw-r--r--spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb2
-rw-r--r--spec/views/projects/pages_domains/show.html.haml_spec.rb2
-rw-r--r--spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb2
-rw-r--r--spec/views/projects/pipelines/_stage.html.haml_spec.rb2
-rw-r--r--spec/views/projects/services/_form.haml_spec.rb2
-rw-r--r--spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb2
-rw-r--r--spec/views/projects/tags/index.html.haml_spec.rb2
-rw-r--r--spec/views/projects/tree/_tree_row.html.haml_spec.rb2
-rw-r--r--spec/views/projects/tree/show.html.haml_spec.rb2
-rw-r--r--spec/views/shared/milestones/_issuable.html.haml_spec.rb2
-rw-r--r--spec/views/shared/milestones/_issuables.html.haml_spec.rb2
-rw-r--r--spec/views/shared/milestones/_top.html.haml_spec.rb2
-rw-r--r--spec/views/shared/notes/_form.html.haml_spec.rb2
-rw-r--r--spec/views/shared/projects/_project.html.haml_spec.rb2
-rw-r--r--spec/workers/update_project_statistics_worker_spec.rb2
68 files changed, 334 insertions, 22 deletions
diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS
index 527454dd3f9..6be92710ad9 100644
--- a/.gitlab/CODEOWNERS
+++ b/.gitlab/CODEOWNERS
@@ -26,3 +26,10 @@ lib/gitlab/github_import/ @gitlab-org/maintainers/database
/lib/gitlab/ci/templates/Security/ @plafoucriere @gonzoyumo @twoodham @sethgitlab
/ee/app/models/project_alias.rb @patrickbajao
/ee/lib/api/project_aliases.rb @patrickbajao
+
+# Engineering Productivity owned files
+/.gitlab-ci.yml @gl-quality/eng-prod
+/.gitlab/ci/ @gl-quality/eng-prod
+Dangerfile @gl-quality/eng-prod
+/danger/ @gl-quality/eng-prod
+/scripts/ @gl-quality/eng-prod
diff --git a/app/controllers/projects/git_http_controller.rb b/app/controllers/projects/git_http_controller.rb
index 0c8c03cb16a..93f7ce73a51 100644
--- a/app/controllers/projects/git_http_controller.rb
+++ b/app/controllers/projects/git_http_controller.rb
@@ -6,10 +6,10 @@ class Projects::GitHttpController < Projects::GitHttpClientController
before_action :access_check
prepend_before_action :deny_head_requests, only: [:info_refs]
- rescue_from Gitlab::GitAccess::UnauthorizedError, with: :render_403
- rescue_from Gitlab::GitAccess::NotFoundError, with: :render_404
- rescue_from Gitlab::GitAccess::ProjectCreationError, with: :render_422
- rescue_from Gitlab::GitAccess::TimeoutError, with: :render_503
+ rescue_from Gitlab::GitAccess::UnauthorizedError, with: :render_403_with_exception
+ rescue_from Gitlab::GitAccess::NotFoundError, with: :render_404_with_exception
+ rescue_from Gitlab::GitAccess::ProjectCreationError, with: :render_422_with_exception
+ rescue_from Gitlab::GitAccess::TimeoutError, with: :render_503_with_exception
# GET /foo/bar.git/info/refs?service=git-upload-pack (git pull)
# GET /foo/bar.git/info/refs?service=git-receive-pack (git push)
@@ -58,19 +58,19 @@ class Projects::GitHttpController < Projects::GitHttpClientController
render json: Gitlab::Workhorse.git_http_ok(repository, repo_type, user, action_name)
end
- def render_403(exception)
+ def render_403_with_exception(exception)
render plain: exception.message, status: :forbidden
end
- def render_404(exception)
+ def render_404_with_exception(exception)
render plain: exception.message, status: :not_found
end
- def render_422(exception)
+ def render_422_with_exception(exception)
render plain: exception.message, status: :unprocessable_entity
end
- def render_503(exception)
+ def render_503_with_exception(exception)
render plain: exception.message, status: :service_unavailable
end
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index 7f3e78f3a81..6aafd856423 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -60,9 +60,14 @@ module DiffHelper
if line.blank?
"&nbsp;".html_safe
else
- # We can't use `sub` because the HTML-safeness of `line` will not survive.
- line[0] = '' if line.start_with?('+', '-', ' ')
- line
+ # `sub` and substring-ing would destroy HTML-safeness of `line`
+ if line.start_with?('+', '-', ' ')
+ line.dup.tap do |line|
+ line[0] = ''
+ end
+ else
+ line
+ end
end
end
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 7c0220a705a..5663ebf8ba1 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -316,6 +316,12 @@ class Namespace < ApplicationRecord
Pages::VirtualDomain.new(all_projects_with_pages, trim_prefix: full_path)
end
+ def closest_setting(name)
+ self_and_ancestors(hierarchy_order: :asc)
+ .find { |n| !n.read_attribute(name).nil? }
+ .try(name)
+ end
+
private
def all_projects_with_pages
diff --git a/app/models/project.rb b/app/models/project.rb
index 6b8067ddd7d..29fe9aad62a 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -2250,8 +2250,23 @@ class Project < ApplicationRecord
Pages::LookupPath.new(self, trim_prefix: trim_prefix, domain: domain)
end
+ def closest_setting(name)
+ setting = read_attribute(name)
+ setting = closest_namespace_setting(name) if setting.nil?
+ setting = app_settings_for(name) if setting.nil?
+ setting
+ end
+
private
+ def closest_namespace_setting(name)
+ namespace.closest_setting(name)
+ end
+
+ def app_settings_for(name)
+ Gitlab::CurrentSettings.send(name) # rubocop:disable GitlabSecurity/PublicSend
+ end
+
def merge_requests_allowing_collaboration(source_branch = nil)
relation = source_of_merge_requests.opened.where(allow_collaboration: true)
relation = relation.where(source_branch: source_branch) if source_branch
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index fad8bb13150..19c29847ce3 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -350,7 +350,7 @@ module API
render_api_error!(message || '409 Conflict', 409)
end
- def file_to_large!
+ def file_too_large!
render_api_error!('413 Request Entity Too Large', 413)
end
diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb
index 11631378137..fa8b9ad79bd 100644
--- a/lib/api/helpers/runner.rb
+++ b/lib/api/helpers/runner.rb
@@ -59,8 +59,9 @@ module API
token && job.valid_token?(token)
end
- def max_artifacts_size
- Gitlab::CurrentSettings.max_artifacts_size.megabytes.to_i
+ def max_artifacts_size(job)
+ max_size = job.project.closest_setting(:max_artifacts_size)
+ max_size.megabytes.to_i
end
def job_forbidden!(job, reason)
diff --git a/lib/api/runner.rb b/lib/api/runner.rb
index fdf4904e9f5..f383c541f8a 100644
--- a/lib/api/runner.rb
+++ b/lib/api/runner.rb
@@ -221,14 +221,16 @@ module API
job = authenticate_job!
forbidden!('Job is not running') unless job.running?
+ max_size = max_artifacts_size(job)
+
if params[:filesize]
file_size = params[:filesize].to_i
- file_to_large! unless file_size < max_artifacts_size
+ file_too_large! unless file_size < max_size
end
status 200
content_type Gitlab::Workhorse::INTERNAL_API_CONTENT_TYPE
- JobArtifactUploader.workhorse_authorize(has_length: false, maximum_size: max_artifacts_size)
+ JobArtifactUploader.workhorse_authorize(has_length: false, maximum_size: max_size)
end
desc 'Upload artifacts for job' do
@@ -268,7 +270,7 @@ module API
metadata = UploadedFile.from_params(params, :metadata, JobArtifactUploader.workhorse_local_upload_path)
bad_request!('Missing artifacts file!') unless artifacts
- file_to_large! unless artifacts.size < max_artifacts_size
+ file_too_large! unless artifacts.size < max_artifacts_size(job)
expire_in = params['expire_in'] ||
Gitlab::CurrentSettings.current_application_settings.default_artifacts_expire_in
diff --git a/spec/config/smime_signature_settings_spec.rb b/spec/config/smime_signature_settings_spec.rb
index 38f96e9b330..4f076a92b16 100644
--- a/spec/config/smime_signature_settings_spec.rb
+++ b/spec/config/smime_signature_settings_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe SmimeSignatureSettings do
diff --git a/spec/controllers/projects/git_http_controller_spec.rb b/spec/controllers/projects/git_http_controller_spec.rb
index 88fa2236e33..b756dd5662d 100644
--- a/spec/controllers/projects/git_http_controller_spec.rb
+++ b/spec/controllers/projects/git_http_controller_spec.rb
@@ -22,5 +22,30 @@ describe Projects::GitHttpController do
expect(response.status).to eq(401)
end
+
+ context 'with exceptions' do
+ let(:project) { create(:project, :public, :repository) }
+
+ before do
+ allow(controller).to receive(:verify_workhorse_api!).and_return(true)
+ end
+
+ it 'returns 503 with GRPC Unavailable' do
+ allow(controller).to receive(:access_check).and_raise(GRPC::Unavailable)
+
+ get :info_refs, params: { service: 'git-upload-pack', namespace_id: project.namespace.to_param, project_id: project.path + '.git' }
+
+ expect(response.status).to eq(503)
+ end
+
+ it 'returns 503 with timeout error' do
+ allow(controller).to receive(:access_check).and_raise(Gitlab::GitAccess::TimeoutError)
+
+ get :info_refs, params: { service: 'git-upload-pack', namespace_id: project.namespace.to_param, project_id: project.path + '.git' }
+
+ expect(response.status).to eq(503)
+ expect(response.body).to eq 'Gitlab::GitAccess::TimeoutError'
+ end
+ end
end
end
diff --git a/spec/helpers/diff_helper_spec.rb b/spec/helpers/diff_helper_spec.rb
index 5396243f44d..47c076e3322 100644
--- a/spec/helpers/diff_helper_spec.rb
+++ b/spec/helpers/diff_helper_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe DiffHelper do
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index 60f0dd49ff3..93ad6008aec 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -954,4 +954,52 @@ describe Namespace do
expect(group.has_parent?).to be_falsy
end
end
+
+ describe '#closest_setting' do
+ using RSpec::Parameterized::TableSyntax
+
+ shared_examples_for 'fetching closest setting' do
+ let!(:root_namespace) { create(:namespace) }
+ let!(:namespace) { create(:namespace, parent: root_namespace) }
+
+ let(:setting) { namespace.closest_setting(setting_name) }
+
+ before do
+ root_namespace.update_attribute(setting_name, root_setting)
+ namespace.update_attribute(setting_name, child_setting)
+ end
+
+ it 'returns closest non-nil value' do
+ expect(setting).to eq(result)
+ end
+ end
+
+ context 'when setting is of non-boolean type' do
+ where(:root_setting, :child_setting, :result) do
+ 100 | 200 | 200
+ 100 | nil | 100
+ nil | nil | nil
+ end
+
+ with_them do
+ let(:setting_name) { :max_artifacts_size }
+
+ it_behaves_like 'fetching closest setting'
+ end
+ end
+
+ context 'when setting is of boolean type' do
+ where(:root_setting, :child_setting, :result) do
+ true | false | false
+ true | nil | true
+ nil | nil | nil
+ end
+
+ with_them do
+ let(:setting_name) { :lfs_enabled }
+
+ it_behaves_like 'fetching closest setting'
+ end
+ end
+ end
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index c6d1a17c6cb..d9936a62191 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -5121,6 +5121,53 @@ describe Project do
end
end
+ describe '#closest_setting' do
+ using RSpec::Parameterized::TableSyntax
+
+ shared_examples_for 'fetching closest setting' do
+ let!(:namespace) { create(:namespace) }
+ let!(:project) { create(:project, namespace: namespace) }
+
+ let(:setting_name) { :some_setting }
+ let(:setting) { project.closest_setting(setting_name) }
+
+ before do
+ allow(project).to receive(:read_attribute).with(setting_name).and_return(project_setting)
+ allow(namespace).to receive(:closest_setting).with(setting_name).and_return(group_setting)
+ allow(Gitlab::CurrentSettings).to receive(setting_name).and_return(global_setting)
+ end
+
+ it 'returns closest non-nil value' do
+ expect(setting).to eq(result)
+ end
+ end
+
+ context 'when setting is of non-boolean type' do
+ where(:global_setting, :group_setting, :project_setting, :result) do
+ 100 | 200 | 300 | 300
+ 100 | 200 | nil | 200
+ 100 | nil | nil | 100
+ nil | nil | nil | nil
+ end
+
+ with_them do
+ it_behaves_like 'fetching closest setting'
+ end
+ end
+
+ context 'when setting is of boolean type' do
+ where(:global_setting, :group_setting, :project_setting, :result) do
+ true | true | false | false
+ true | false | nil | false
+ true | nil | nil | true
+ end
+
+ with_them do
+ it_behaves_like 'fetching closest setting'
+ end
+ end
+ end
+
def rugged_config
rugged_repo(project.repository).config
end
diff --git a/spec/requests/api/runner_spec.rb b/spec/requests/api/runner_spec.rb
index d9ef5edb848..bc3a04420f9 100644
--- a/spec/requests/api/runner_spec.rb
+++ b/spec/requests/api/runner_spec.rb
@@ -308,7 +308,9 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
end
describe '/api/v4/jobs' do
- let(:project) { create(:project, shared_runners_enabled: false) }
+ let(:root_namespace) { create(:namespace) }
+ let(:namespace) { create(:namespace, parent: root_namespace) }
+ let(:project) { create(:project, namespace: namespace, shared_runners_enabled: false) }
let(:pipeline) { create(:ci_pipeline_without_jobs, project: project, ref: 'master') }
let(:runner) { create(:ci_runner, :project, projects: [project]) }
let(:job) do
@@ -1412,12 +1414,54 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
end
end
- it 'fails to post too large artifact' do
- stub_application_setting(max_artifacts_size: 0)
+ context 'when artifact is too large' do
+ let(:sample_max_size) { 100 }
- authorize_artifacts_with_token_in_params(filesize: 100)
+ shared_examples_for 'rejecting too large artifacts' do
+ it 'fails to post' do
+ authorize_artifacts_with_token_in_params(filesize: sample_max_size.megabytes.to_i)
- expect(response).to have_gitlab_http_status(413)
+ expect(response).to have_gitlab_http_status(413)
+ end
+ end
+
+ context 'based on application setting' do
+ before do
+ stub_application_setting(max_artifacts_size: sample_max_size)
+ end
+
+ it_behaves_like 'rejecting too large artifacts'
+ end
+
+ context 'based on root namespace setting' do
+ before do
+ stub_application_setting(max_artifacts_size: 200)
+ root_namespace.update!(max_artifacts_size: sample_max_size)
+ end
+
+ it_behaves_like 'rejecting too large artifacts'
+ end
+
+ context 'based on child namespace setting' do
+ before do
+ stub_application_setting(max_artifacts_size: 200)
+ root_namespace.update!(max_artifacts_size: 200)
+ namespace.update!(max_artifacts_size: sample_max_size)
+ end
+
+ it_behaves_like 'rejecting too large artifacts'
+ end
+
+ context 'based on project setting' do
+ before do
+ stub_application_setting(max_artifacts_size: 200)
+ root_namespace.update!(max_artifacts_size: 200)
+ namespace.update!(max_artifacts_size: 200)
+ project.update!(max_artifacts_size: sample_max_size)
+ end
+
+ it_behaves_like 'rejecting too large artifacts'
+ end
end
end
diff --git a/spec/views/admin/dashboard/index.html.haml_spec.rb b/spec/views/admin/dashboard/index.html.haml_spec.rb
index 0e8b7c82d3a..3aaaabe4629 100644
--- a/spec/views/admin/dashboard/index.html.haml_spec.rb
+++ b/spec/views/admin/dashboard/index.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'admin/dashboard/index.html.haml' do
diff --git a/spec/views/admin/sessions/new.html.haml_spec.rb b/spec/views/admin/sessions/new.html.haml_spec.rb
index eb431a0b6de..57255748988 100644
--- a/spec/views/admin/sessions/new.html.haml_spec.rb
+++ b/spec/views/admin/sessions/new.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'admin/sessions/new.html.haml' do
diff --git a/spec/views/ci/status/_badge.html.haml_spec.rb b/spec/views/ci/status/_badge.html.haml_spec.rb
index 49f57969239..59db828a0c7 100644
--- a/spec/views/ci/status/_badge.html.haml_spec.rb
+++ b/spec/views/ci/status/_badge.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'ci/status/_badge' do
diff --git a/spec/views/dashboard/projects/_blank_state_admin_welcome.haml_spec.rb b/spec/views/dashboard/projects/_blank_state_admin_welcome.haml_spec.rb
index 2f58eec86dc..bc92278bb22 100644
--- a/spec/views/dashboard/projects/_blank_state_admin_welcome.haml_spec.rb
+++ b/spec/views/dashboard/projects/_blank_state_admin_welcome.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'dashboard/projects/_blank_state_admin_welcome.html.haml' do
diff --git a/spec/views/dashboard/projects/_nav.html.haml_spec.rb b/spec/views/dashboard/projects/_nav.html.haml_spec.rb
index cbdd3c0acc3..61b6bfef120 100644
--- a/spec/views/dashboard/projects/_nav.html.haml_spec.rb
+++ b/spec/views/dashboard/projects/_nav.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'dashboard/projects/_nav.html.haml' do
diff --git a/spec/views/devise/shared/_signin_box.html.haml_spec.rb b/spec/views/devise/shared/_signin_box.html.haml_spec.rb
index 0563984a03c..6d640686337 100644
--- a/spec/views/devise/shared/_signin_box.html.haml_spec.rb
+++ b/spec/views/devise/shared/_signin_box.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'devise/shared/_signin_box' do
diff --git a/spec/views/errors/access_denied.html.haml_spec.rb b/spec/views/errors/access_denied.html.haml_spec.rb
index bde2f6f0169..b2e82847ab9 100644
--- a/spec/views/errors/access_denied.html.haml_spec.rb
+++ b/spec/views/errors/access_denied.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'errors/access_denied' do
diff --git a/spec/views/events/event/_push.html.haml_spec.rb b/spec/views/events/event/_push.html.haml_spec.rb
index f5634de4916..e43e37188a3 100644
--- a/spec/views/events/event/_push.html.haml_spec.rb
+++ b/spec/views/events/event/_push.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'events/event/_push.html.haml' do
diff --git a/spec/views/groups/_home_panel.html.haml_spec.rb b/spec/views/groups/_home_panel.html.haml_spec.rb
index 91c5ca261b9..8960dfa67db 100644
--- a/spec/views/groups/_home_panel.html.haml_spec.rb
+++ b/spec/views/groups/_home_panel.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'groups/_home_panel' do
diff --git a/spec/views/groups/edit.html.haml_spec.rb b/spec/views/groups/edit.html.haml_spec.rb
index 0da3470433c..9fc850841ee 100644
--- a/spec/views/groups/edit.html.haml_spec.rb
+++ b/spec/views/groups/edit.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'groups/edit.html.haml' do
diff --git a/spec/views/help/instance_configuration.html.haml_spec.rb b/spec/views/help/instance_configuration.html.haml_spec.rb
index 18628ddebf7..81d569b5cf4 100644
--- a/spec/views/help/instance_configuration.html.haml_spec.rb
+++ b/spec/views/help/instance_configuration.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'help/instance_configuration' do
diff --git a/spec/views/layouts/_head.html.haml_spec.rb b/spec/views/layouts/_head.html.haml_spec.rb
index d7f24950e6f..bea0b0edf4d 100644
--- a/spec/views/layouts/_head.html.haml_spec.rb
+++ b/spec/views/layouts/_head.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'layouts/_head' do
diff --git a/spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
index bf63021a7fa..9ec65dba586 100644
--- a/spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
+++ b/spec/views/layouts/nav/sidebar/_admin.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'layouts/nav/sidebar/_admin' do
diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
index b627b9dba59..7decfa58153 100644
--- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+++ b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'layouts/nav/sidebar/_project' do
diff --git a/spec/views/notify/pipeline_failed_email.html.haml_spec.rb b/spec/views/notify/pipeline_failed_email.html.haml_spec.rb
index 28f8203fd8f..b821b015c97 100644
--- a/spec/views/notify/pipeline_failed_email.html.haml_spec.rb
+++ b/spec/views/notify/pipeline_failed_email.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'notify/pipeline_failed_email.html.haml' do
diff --git a/spec/views/notify/pipeline_success_email.html.haml_spec.rb b/spec/views/notify/pipeline_success_email.html.haml_spec.rb
index 79beca79724..fbf33b7ec35 100644
--- a/spec/views/notify/pipeline_success_email.html.haml_spec.rb
+++ b/spec/views/notify/pipeline_success_email.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'notify/pipeline_success_email.html.haml' do
diff --git a/spec/views/profiles/show.html.haml_spec.rb b/spec/views/profiles/show.html.haml_spec.rb
index 9e7ac0b84fa..592b3a56ba3 100644
--- a/spec/views/profiles/show.html.haml_spec.rb
+++ b/spec/views/profiles/show.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'profiles/show' do
diff --git a/spec/views/projects/_home_panel.html.haml_spec.rb b/spec/views/projects/_home_panel.html.haml_spec.rb
index 12925a5ab07..4d5b369e88e 100644
--- a/spec/views/projects/_home_panel.html.haml_spec.rb
+++ b/spec/views/projects/_home_panel.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/_home_panel' do
diff --git a/spec/views/projects/blob/_viewer.html.haml_spec.rb b/spec/views/projects/blob/_viewer.html.haml_spec.rb
index 95f7f87d37b..a798a72fa76 100644
--- a/spec/views/projects/blob/_viewer.html.haml_spec.rb
+++ b/spec/views/projects/blob/_viewer.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/blob/_viewer.html.haml' do
diff --git a/spec/views/projects/buttons/_dropdown.html.haml_spec.rb b/spec/views/projects/buttons/_dropdown.html.haml_spec.rb
index 8b9aab30286..2bc1de040d5 100644
--- a/spec/views/projects/buttons/_dropdown.html.haml_spec.rb
+++ b/spec/views/projects/buttons/_dropdown.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/buttons/_dropdown' do
diff --git a/spec/views/projects/ci/lints/show.html.haml_spec.rb b/spec/views/projects/ci/lints/show.html.haml_spec.rb
index 2f0cd38c14a..ea67478ff98 100644
--- a/spec/views/projects/ci/lints/show.html.haml_spec.rb
+++ b/spec/views/projects/ci/lints/show.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/ci/lints/show' do
diff --git a/spec/views/projects/commit/_commit_box.html.haml_spec.rb b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
index 1086546c10d..07c530670d2 100644
--- a/spec/views/projects/commit/_commit_box.html.haml_spec.rb
+++ b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/commit/_commit_box.html.haml' do
diff --git a/spec/views/projects/commit/branches.html.haml_spec.rb b/spec/views/projects/commit/branches.html.haml_spec.rb
index b9d4dc80fe0..36da489a84f 100644
--- a/spec/views/projects/commit/branches.html.haml_spec.rb
+++ b/spec/views/projects/commit/branches.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/commit/branches.html.haml' do
diff --git a/spec/views/projects/commit/show.html.haml_spec.rb b/spec/views/projects/commit/show.html.haml_spec.rb
index d07099489e5..af28a8f9193 100644
--- a/spec/views/projects/commit/show.html.haml_spec.rb
+++ b/spec/views/projects/commit/show.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/commit/show.html.haml' do
diff --git a/spec/views/projects/commits/_commit.html.haml_spec.rb b/spec/views/projects/commits/_commit.html.haml_spec.rb
index 6bf1b5fd2d0..669bb596de5 100644
--- a/spec/views/projects/commits/_commit.html.haml_spec.rb
+++ b/spec/views/projects/commits/_commit.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/commits/_commit.html.haml' do
diff --git a/spec/views/projects/diffs/_stats.html.haml_spec.rb b/spec/views/projects/diffs/_stats.html.haml_spec.rb
index c7d2f85747c..eb853596f98 100644
--- a/spec/views/projects/diffs/_stats.html.haml_spec.rb
+++ b/spec/views/projects/diffs/_stats.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/diffs/_stats.html.haml' do
diff --git a/spec/views/projects/diffs/_viewer.html.haml_spec.rb b/spec/views/projects/diffs/_viewer.html.haml_spec.rb
index 8ac32db5585..1d5d6e1e78d 100644
--- a/spec/views/projects/diffs/_viewer.html.haml_spec.rb
+++ b/spec/views/projects/diffs/_viewer.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/diffs/_viewer.html.haml' do
diff --git a/spec/views/projects/edit.html.haml_spec.rb b/spec/views/projects/edit.html.haml_spec.rb
index 5c6b2e4b042..f576093ab45 100644
--- a/spec/views/projects/edit.html.haml_spec.rb
+++ b/spec/views/projects/edit.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/edit' do
diff --git a/spec/views/projects/environments/terminal.html.haml_spec.rb b/spec/views/projects/environments/terminal.html.haml_spec.rb
index d2e47225226..b0b08a84f8d 100644
--- a/spec/views/projects/environments/terminal.html.haml_spec.rb
+++ b/spec/views/projects/environments/terminal.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/environments/terminal' do
diff --git a/spec/views/projects/imports/new.html.haml_spec.rb b/spec/views/projects/imports/new.html.haml_spec.rb
index 11fe144d1d2..6cca369b9f6 100644
--- a/spec/views/projects/imports/new.html.haml_spec.rb
+++ b/spec/views/projects/imports/new.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require "spec_helper"
describe "projects/imports/new.html.haml" do
diff --git a/spec/views/projects/issues/_related_branches.html.haml_spec.rb b/spec/views/projects/issues/_related_branches.html.haml_spec.rb
index 5cff7694029..a6817e3fdbf 100644
--- a/spec/views/projects/issues/_related_branches.html.haml_spec.rb
+++ b/spec/views/projects/issues/_related_branches.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/issues/_related_branches' do
diff --git a/spec/views/projects/jobs/_build.html.haml_spec.rb b/spec/views/projects/jobs/_build.html.haml_spec.rb
index 1d58891036e..681df77ea99 100644
--- a/spec/views/projects/jobs/_build.html.haml_spec.rb
+++ b/spec/views/projects/jobs/_build.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/ci/jobs/_build' do
diff --git a/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb b/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb
index dc2ffc9dc47..f193ce0a552 100644
--- a/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb
+++ b/spec/views/projects/jobs/_generic_commit_status.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/generic_commit_statuses/_generic_commit_status.html.haml' do
diff --git a/spec/views/projects/jobs/show.html.haml_spec.rb b/spec/views/projects/jobs/show.html.haml_spec.rb
index e06a9ecb98b..903a16d9e53 100644
--- a/spec/views/projects/jobs/show.html.haml_spec.rb
+++ b/spec/views/projects/jobs/show.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/jobs/show' do
diff --git a/spec/views/projects/merge_requests/_commits.html.haml_spec.rb b/spec/views/projects/merge_requests/_commits.html.haml_spec.rb
index a7628548de6..71d74b06f85 100644
--- a/spec/views/projects/merge_requests/_commits.html.haml_spec.rb
+++ b/spec/views/projects/merge_requests/_commits.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/merge_requests/_commits.html.haml' do
diff --git a/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb b/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb
index 88c4b52b3a6..f7db4a4d614 100644
--- a/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb
+++ b/spec/views/projects/merge_requests/creations/_new_submit.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/merge_requests/creations/_new_submit.html.haml' do
diff --git a/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb b/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb
index e7c40421f1f..a82ef3c04b5 100644
--- a/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb
+++ b/spec/views/projects/merge_requests/diffs/_diffs.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/merge_requests/diffs/_diffs.html.haml' do
diff --git a/spec/views/projects/merge_requests/edit.html.haml_spec.rb b/spec/views/projects/merge_requests/edit.html.haml_spec.rb
index 0a3a46210ed..74d9067076c 100644
--- a/spec/views/projects/merge_requests/edit.html.haml_spec.rb
+++ b/spec/views/projects/merge_requests/edit.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/merge_requests/edit.html.haml' do
diff --git a/spec/views/projects/merge_requests/show.html.haml_spec.rb b/spec/views/projects/merge_requests/show.html.haml_spec.rb
index 23cb319a202..6023527cb28 100644
--- a/spec/views/projects/merge_requests/show.html.haml_spec.rb
+++ b/spec/views/projects/merge_requests/show.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/merge_requests/show.html.haml' do
diff --git a/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb b/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb
index ae47f364296..a07523a4423 100644
--- a/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb
+++ b/spec/views/projects/notes/_more_actions_dropdown.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/notes/_more_actions_dropdown' do
diff --git a/spec/views/projects/pages_domains/show.html.haml_spec.rb b/spec/views/projects/pages_domains/show.html.haml_spec.rb
index da27a04bfe9..ba0544a49b0 100644
--- a/spec/views/projects/pages_domains/show.html.haml_spec.rb
+++ b/spec/views/projects/pages_domains/show.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/pages_domains/show' do
diff --git a/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb b/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb
index 5d60d6bc5e7..daf799ec13f 100644
--- a/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb
+++ b/spec/views/projects/pipeline_schedules/_pipeline_schedule.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/pipeline_schedules/_pipeline_schedule' do
diff --git a/spec/views/projects/pipelines/_stage.html.haml_spec.rb b/spec/views/projects/pipelines/_stage.html.haml_spec.rb
index e40e16e742b..591602859c3 100644
--- a/spec/views/projects/pipelines/_stage.html.haml_spec.rb
+++ b/spec/views/projects/pipelines/_stage.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/pipelines/_stage' do
diff --git a/spec/views/projects/services/_form.haml_spec.rb b/spec/views/projects/services/_form.haml_spec.rb
index 06e159f103b..272ac97604a 100644
--- a/spec/views/projects/services/_form.haml_spec.rb
+++ b/spec/views/projects/services/_form.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/services/_form' do
diff --git a/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb
index 697e44be065..94a85486cfa 100644
--- a/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb
+++ b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/settings/ci_cd/_autodevops_form' do
diff --git a/spec/views/projects/tags/index.html.haml_spec.rb b/spec/views/projects/tags/index.html.haml_spec.rb
index 7e372ae8d6d..66be085c290 100644
--- a/spec/views/projects/tags/index.html.haml_spec.rb
+++ b/spec/views/projects/tags/index.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/tags/index' do
diff --git a/spec/views/projects/tree/_tree_row.html.haml_spec.rb b/spec/views/projects/tree/_tree_row.html.haml_spec.rb
index 3353b7665e2..ff2fe8aeb6c 100644
--- a/spec/views/projects/tree/_tree_row.html.haml_spec.rb
+++ b/spec/views/projects/tree/_tree_row.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/tree/_tree_row' do
diff --git a/spec/views/projects/tree/show.html.haml_spec.rb b/spec/views/projects/tree/show.html.haml_spec.rb
index 5bb0173ab89..960cf42a793 100644
--- a/spec/views/projects/tree/show.html.haml_spec.rb
+++ b/spec/views/projects/tree/show.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'projects/tree/show' do
diff --git a/spec/views/shared/milestones/_issuable.html.haml_spec.rb b/spec/views/shared/milestones/_issuable.html.haml_spec.rb
index 0a3f877cae0..3c2b7c6305a 100644
--- a/spec/views/shared/milestones/_issuable.html.haml_spec.rb
+++ b/spec/views/shared/milestones/_issuable.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'shared/milestones/_issuable.html.haml' do
diff --git a/spec/views/shared/milestones/_issuables.html.haml_spec.rb b/spec/views/shared/milestones/_issuables.html.haml_spec.rb
index 24b55338db3..f77c14a687b 100644
--- a/spec/views/shared/milestones/_issuables.html.haml_spec.rb
+++ b/spec/views/shared/milestones/_issuables.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'shared/milestones/_issuables.html.haml' do
diff --git a/spec/views/shared/milestones/_top.html.haml_spec.rb b/spec/views/shared/milestones/_top.html.haml_spec.rb
index f2ee8be5857..944dfc8a27b 100644
--- a/spec/views/shared/milestones/_top.html.haml_spec.rb
+++ b/spec/views/shared/milestones/_top.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'shared/milestones/_top.html.haml' do
diff --git a/spec/views/shared/notes/_form.html.haml_spec.rb b/spec/views/shared/notes/_form.html.haml_spec.rb
index 0189f926a5f..d354c2f0100 100644
--- a/spec/views/shared/notes/_form.html.haml_spec.rb
+++ b/spec/views/shared/notes/_form.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'shared/notes/_form' do
diff --git a/spec/views/shared/projects/_project.html.haml_spec.rb b/spec/views/shared/projects/_project.html.haml_spec.rb
index dc223861037..b123be42074 100644
--- a/spec/views/shared/projects/_project.html.haml_spec.rb
+++ b/spec/views/shared/projects/_project.html.haml_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'shared/projects/_project.html.haml' do
diff --git a/spec/workers/update_project_statistics_worker_spec.rb b/spec/workers/update_project_statistics_worker_spec.rb
index a268fd2e4ba..191075f1a52 100644
--- a/spec/workers/update_project_statistics_worker_spec.rb
+++ b/spec/workers/update_project_statistics_worker_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe UpdateProjectStatisticsWorker do