From 5b45cd246373f18bf678dbdecad589733cfec8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Mon, 12 Nov 2018 16:27:28 +0100 Subject: Implement MVC for Pipeline deletion API --- lib/api/pipelines.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index 1cfb982c04b..d4bd4e71343 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -81,6 +81,21 @@ module API present pipeline, with: Entities::Pipeline end + desc 'Deletes a pipeline' do + detail 'This feature was introduced in GitLab 11.6' + http_codes [[204, 'Pipeline was deleted'], [403, 'Forbidden']] + end + params do + requires :pipeline_id, type: Integer, desc: 'The pipeline ID' + end + delete ':id/pipelines/:pipeline_id' do + authorize! :admin_pipeline, user_project + + AuditEventService.new(current_user, user_project).security_event + + destroy_conditionally!(pipeline) + end + desc 'Retry builds in the pipeline' do detail 'This feature was introduced in GitLab 8.11.' success Entities::Pipeline -- cgit v1.2.1 From 99203bfe23975b8dbbaa5daa613fbc90fd39178f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Mon, 12 Nov 2018 19:18:57 +0100 Subject: Destroy pipeline in service Move all logic for destroying a Pipeline into a service so it's easily reusable. --- lib/api/pipelines.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index d4bd4e71343..39d693bb9e9 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -89,11 +89,11 @@ module API requires :pipeline_id, type: Integer, desc: 'The pipeline ID' end delete ':id/pipelines/:pipeline_id' do - authorize! :admin_pipeline, user_project + authorize! :destroy_pipeline, user_project - AuditEventService.new(current_user, user_project).security_event - - destroy_conditionally!(pipeline) + destroy_conditionally!(pipeline) do + ::Ci::DestroyPipelineService.new(user_project, current_user).execute(pipeline) + end end desc 'Retry builds in the pipeline' do -- cgit v1.2.1 From 0bc14b452218277a55f71ab22bed724b696ecf28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20=C4=8Cupi=C4=87?= Date: Tue, 13 Nov 2018 17:17:01 +0100 Subject: Authorize DestroyPipelineService against pipeline --- lib/api/pipelines.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index 39d693bb9e9..cba1e3a6684 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -89,7 +89,7 @@ module API requires :pipeline_id, type: Integer, desc: 'The pipeline ID' end delete ':id/pipelines/:pipeline_id' do - authorize! :destroy_pipeline, user_project + authorize! :destroy_pipeline, pipeline destroy_conditionally!(pipeline) do ::Ci::DestroyPipelineService.new(user_project, current_user).execute(pipeline) -- cgit v1.2.1 From 3797cfbd392df9a73f709126c837725622116f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Javier=20L=C3=B3pez?= Date: Wed, 14 Nov 2018 09:55:57 +0100 Subject: Fix bug in CommitCheck --- lib/gitlab/checks/commit_check.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/checks/commit_check.rb b/lib/gitlab/checks/commit_check.rb index 6dd74e8fb74..58267b6752f 100644 --- a/lib/gitlab/checks/commit_check.rb +++ b/lib/gitlab/checks/commit_check.rb @@ -10,8 +10,8 @@ module Gitlab def initialize(project, user, newrev, oldrev) @project = project @user = user - @newrev = user - @oldrev = user + @newrev = newrev + @oldrev = oldrev @file_paths = [] end -- cgit v1.2.1 From f1f038956a3afa7ae77c7155f5302f1dc63884a4 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 14 Nov 2018 15:00:23 +0100 Subject: Revert API is going into 11.5, not 11.6. --- lib/api/commits.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 3b8f3fedccf..337b92a6183 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -207,7 +207,7 @@ module API end desc 'Revert a commit in a branch' do - detail 'This feature was introduced in GitLab 11.6' + detail 'This feature was introduced in GitLab 11.5' success Entities::Commit end params do -- cgit v1.2.1 From 3cd538c2e9e18f31cee008d9b9e13df4dfd40b1d Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 14 Nov 2018 15:37:30 +0100 Subject: Fix text rendering of readme/index --- lib/gitlab/file_detector.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb index d6338b09e3d..4e749068f93 100644 --- a/lib/gitlab/file_detector.rb +++ b/lib/gitlab/file_detector.rb @@ -8,7 +8,7 @@ module Gitlab module FileDetector PATTERNS = { # Project files - readme: %r{\A(readme|index)[^/]*\z}i, + readme: %r{\A(readme|index)(|\.#{Gitlab::MarkupHelper::EXTENSIONS.join('|\.')})$[^\/]*\z}i, changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i, license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i, contributing: %r{\Acontributing[^/]*\z}i, -- cgit v1.2.1 From 566ba126f5d8090edc760fe0c20215da73452e47 Mon Sep 17 00:00:00 2001 From: George Tsiolis Date: Thu, 15 Nov 2018 12:13:50 +0200 Subject: Fix typos in lib --- lib/gitlab/gitaly_client.rb | 2 +- lib/gitlab/http_io.rb | 12 ++++++------ lib/gitlab/view/presenter/base.rb | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index d99a9f15371..8b455dc7696 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -139,7 +139,7 @@ module Gitlab ensure duration = Gitlab::Metrics::System.monotonic_time - start - # Keep track, seperately, for the performance bar + # Keep track, separately, for the performance bar self.query_time += duration gitaly_controller_action_duration_seconds.observe( current_transaction_labels.merge(gitaly_service: service.to_s, rpc: rpc.to_s), diff --git a/lib/gitlab/http_io.rb b/lib/gitlab/http_io.rb index 9d7763fc5ac..e768b8adb12 100644 --- a/lib/gitlab/http_io.rb +++ b/lib/gitlab/http_io.rb @@ -161,14 +161,14 @@ module Gitlab ## # Note: If provider does not return content_range, then we set it as we requested # Provider: minio - # - When the file size is larger than requested Content-range, the Content-range is included in responces with Net::HTTPPartialContent 206 - # - When the file size is smaller than requested Content-range, the Content-range is included in responces with Net::HTTPPartialContent 206 + # - When the file size is larger than requested Content-range, the Content-range is included in responses with Net::HTTPPartialContent 206 + # - When the file size is smaller than requested Content-range, the Content-range is included in responses with Net::HTTPPartialContent 206 # Provider: AWS - # - When the file size is larger than requested Content-range, the Content-range is included in responces with Net::HTTPPartialContent 206 - # - When the file size is smaller than requested Content-range, the Content-range is included in responces with Net::HTTPPartialContent 206 + # - When the file size is larger than requested Content-range, the Content-range is included in responses with Net::HTTPPartialContent 206 + # - When the file size is smaller than requested Content-range, the Content-range is included in responses with Net::HTTPPartialContent 206 # Provider: GCS - # - When the file size is larger than requested Content-range, the Content-range is included in responces with Net::HTTPPartialContent 206 - # - When the file size is smaller than requested Content-range, the Content-range is included in responces with Net::HTTPOK 200 + # - When the file size is larger than requested Content-range, the Content-range is included in responses with Net::HTTPPartialContent 206 + # - When the file size is smaller than requested Content-range, the Content-range is included in responses with Net::HTTPOK 200 @chunk_range ||= (chunk_start...(chunk_start + @chunk.bytesize)) end diff --git a/lib/gitlab/view/presenter/base.rb b/lib/gitlab/view/presenter/base.rb index 36162faa1eb..c3fd6d317aa 100644 --- a/lib/gitlab/view/presenter/base.rb +++ b/lib/gitlab/view/presenter/base.rb @@ -11,8 +11,8 @@ module Gitlab attr_reader :subject - def can?(user, action, overriden_subject = nil) - super(user, action, overriden_subject || subject) + def can?(user, action, overridden_subject = nil) + super(user, action, overridden_subject || subject) end # delegate all #can? queries to the subject -- cgit v1.2.1 From 9bea3c0fbb6c16adcdccf7044583415bda8234c1 Mon Sep 17 00:00:00 2001 From: Kirill Zaitsev Date: Thu, 15 Nov 2018 21:42:10 +0200 Subject: Add glob for CI changes detection --- lib/gitlab/ci/build/policy/changes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/ci/build/policy/changes.rb b/lib/gitlab/ci/build/policy/changes.rb index 7bf51519752..1663c875426 100644 --- a/lib/gitlab/ci/build/policy/changes.rb +++ b/lib/gitlab/ci/build/policy/changes.rb @@ -14,7 +14,7 @@ module Gitlab pipeline.modified_paths.any? do |path| @globs.any? do |glob| - File.fnmatch?(glob, path, File::FNM_PATHNAME | File::FNM_DOTMATCH) + File.fnmatch?(glob, path, File::FNM_PATHNAME | File::FNM_DOTMATCH | File::FNM_EXTGLOB) end end end -- cgit v1.2.1 From 198f2a0b6149a2e7c069ad3aaad6ced9f5bb3ea1 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 15 Nov 2018 22:49:48 -0800 Subject: Use Nokogiri as the ActiveSupport XML backend This significantly improves performance and reduces memory consumption when parsing XML files. On a test with 124 JUnit files from a CE build, there was about a 4x reduction in processing time. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54068 --- lib/gitlab/ci/parsers/test/junit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/ci/parsers/test/junit.rb b/lib/gitlab/ci/parsers/test/junit.rb index ed5a79d9b9b..2791730fd26 100644 --- a/lib/gitlab/ci/parsers/test/junit.rb +++ b/lib/gitlab/ci/parsers/test/junit.rb @@ -14,7 +14,7 @@ module Gitlab test_case = create_test_case(test_case) test_suite.add_test_case(test_case) end - rescue REXML::ParseException + rescue Nokogiri::XML::SyntaxError raise JunitParserError, "XML parsing failed" rescue raise JunitParserError, "JUnit parsing failed" -- cgit v1.2.1 From f837281ff6f2e27a838eaa40a908ca6b9b47d2a0 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 16 Nov 2018 11:03:45 +0100 Subject: Update regex to use union --- lib/gitlab/file_detector.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb index 4e749068f93..2e78fc0e9c5 100644 --- a/lib/gitlab/file_detector.rb +++ b/lib/gitlab/file_detector.rb @@ -8,7 +8,7 @@ module Gitlab module FileDetector PATTERNS = { # Project files - readme: %r{\A(readme|index)(|\.#{Gitlab::MarkupHelper::EXTENSIONS.join('|\.')})$[^\/]*\z}i, + readme: %r{\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?$[^\/]*\z}i, changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i, license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i, contributing: %r{\Acontributing[^/]*\z}i, -- cgit v1.2.1 From fe1469e12f7a1895cbf534f9ab17fd32af0e954c Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Wed, 14 Nov 2018 12:38:08 +0000 Subject: Upgrade helm to 2.11.0 and upgrade on every install --- lib/gitlab/kubernetes/helm.rb | 2 +- lib/gitlab/kubernetes/helm/install_command.rb | 10 +++++++++- lib/gitlab/kubernetes/helm/upgrade_command.rb | 10 +++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/kubernetes/helm.rb b/lib/gitlab/kubernetes/helm.rb index 1cd4f9e17b7..5a22b5e3364 100644 --- a/lib/gitlab/kubernetes/helm.rb +++ b/lib/gitlab/kubernetes/helm.rb @@ -1,7 +1,7 @@ module Gitlab module Kubernetes module Helm - HELM_VERSION = '2.7.2'.freeze + HELM_VERSION = '2.11.0'.freeze KUBECTL_VERSION = '1.11.0'.freeze NAMESPACE = 'gitlab-managed-apps'.freeze SERVICE_ACCOUNT = 'tiller'.freeze diff --git a/lib/gitlab/kubernetes/helm/install_command.rb b/lib/gitlab/kubernetes/helm/install_command.rb index ff1c1657b98..5c7b6d6cb75 100644 --- a/lib/gitlab/kubernetes/helm/install_command.rb +++ b/lib/gitlab/kubernetes/helm/install_command.rb @@ -20,6 +20,10 @@ module Gitlab def generate_script super + [ init_command, + # Sleep is necessary to give Tiller time to restart after upgrade. + # Ideally we'd be able to use --wait but cannot because of + # https://github.com/helm/helm/issues/4855 + sleep_command, repository_command, repository_update_command, preinstall_command, @@ -35,7 +39,11 @@ module Gitlab private def init_command - 'helm init --client-only' + 'helm init --upgrade --tiller-namespace gitlab-managed-apps' + end + + def sleep_command + 'sleep 30' end def repository_command diff --git a/lib/gitlab/kubernetes/helm/upgrade_command.rb b/lib/gitlab/kubernetes/helm/upgrade_command.rb index b36315f7a82..5b47944e5e6 100644 --- a/lib/gitlab/kubernetes/helm/upgrade_command.rb +++ b/lib/gitlab/kubernetes/helm/upgrade_command.rb @@ -20,6 +20,10 @@ module Gitlab def generate_script super + [ init_command, + # Sleep is necessary to give Tiller time to restart after upgrade. + # Ideally we'd be able to use --wait but cannot because of + # https://github.com/helm/helm/issues/4855 + sleep_command, repository_command, script_command ].compact.join("\n") @@ -36,7 +40,11 @@ module Gitlab private def init_command - 'helm init --client-only' + 'helm init --upgrade --tiller-namespace gitlab-managed-apps' + end + + def sleep_command + 'sleep 30' end def repository_command -- cgit v1.2.1 From 53b2c3011e01b7f0174a0863e2597d3b4a251321 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 16 Nov 2018 11:27:47 +0100 Subject: Remove redundant end anchors --- lib/gitlab/file_detector.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb index 2e78fc0e9c5..48025f6ad5a 100644 --- a/lib/gitlab/file_detector.rb +++ b/lib/gitlab/file_detector.rb @@ -8,7 +8,7 @@ module Gitlab module FileDetector PATTERNS = { # Project files - readme: %r{\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?$[^\/]*\z}i, + readme: %r{\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?\z}i, changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i, license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i, contributing: %r{\Acontributing[^/]*\z}i, -- cgit v1.2.1 From a71b3f6a7c13fdc0978a1e9d0151fe15399b8b59 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 15 Nov 2018 14:13:32 +0000 Subject: Extract Helm::ClientCommand for shared commands --- lib/gitlab/kubernetes/helm/client_command.rb | 26 ++++++++++++++++++++++++++ lib/gitlab/kubernetes/helm/install_command.rb | 18 ++---------------- lib/gitlab/kubernetes/helm/upgrade_command.rb | 18 ++---------------- 3 files changed, 30 insertions(+), 32 deletions(-) create mode 100644 lib/gitlab/kubernetes/helm/client_command.rb (limited to 'lib') diff --git a/lib/gitlab/kubernetes/helm/client_command.rb b/lib/gitlab/kubernetes/helm/client_command.rb new file mode 100644 index 00000000000..0ff0169b61d --- /dev/null +++ b/lib/gitlab/kubernetes/helm/client_command.rb @@ -0,0 +1,26 @@ +module Gitlab + module Kubernetes + module Helm + module ClientCommand + def init_command + # Here we are always upgrading to the latest version of Tiller when + # installing an app. We ensure the helm version stored in the + # database is correct by also updating this after transition to + # :installed,:updated in Clusters::Concerns::ApplicationStatus + 'helm init --upgrade --tiller-namespace gitlab-managed-apps' + end + + def wait_for_tiller_command + # This is necessary to give Tiller time to restart after upgrade. + # Ideally we'd be able to use --wait but cannot because of + # https://github.com/helm/helm/issues/4855 + 'sleep 30' + end + + def repository_command + ['helm', 'repo', 'add', name, repository].shelljoin if repository + end + end + end + end +end diff --git a/lib/gitlab/kubernetes/helm/install_command.rb b/lib/gitlab/kubernetes/helm/install_command.rb index 5c7b6d6cb75..52700b5dc09 100644 --- a/lib/gitlab/kubernetes/helm/install_command.rb +++ b/lib/gitlab/kubernetes/helm/install_command.rb @@ -3,6 +3,7 @@ module Gitlab module Helm class InstallCommand include BaseCommand + include ClientCommand attr_reader :name, :files, :chart, :version, :repository, :preinstall, :postinstall @@ -20,10 +21,7 @@ module Gitlab def generate_script super + [ init_command, - # Sleep is necessary to give Tiller time to restart after upgrade. - # Ideally we'd be able to use --wait but cannot because of - # https://github.com/helm/helm/issues/4855 - sleep_command, + wait_for_tiller_command, repository_command, repository_update_command, preinstall_command, @@ -38,18 +36,6 @@ module Gitlab private - def init_command - 'helm init --upgrade --tiller-namespace gitlab-managed-apps' - end - - def sleep_command - 'sleep 30' - end - - def repository_command - ['helm', 'repo', 'add', name, repository].shelljoin if repository - end - def repository_update_command 'helm repo update' if repository end diff --git a/lib/gitlab/kubernetes/helm/upgrade_command.rb b/lib/gitlab/kubernetes/helm/upgrade_command.rb index 5b47944e5e6..9daffc138b5 100644 --- a/lib/gitlab/kubernetes/helm/upgrade_command.rb +++ b/lib/gitlab/kubernetes/helm/upgrade_command.rb @@ -5,6 +5,7 @@ module Gitlab module Helm class UpgradeCommand include BaseCommand + include ClientCommand attr_reader :name, :chart, :version, :repository, :files @@ -20,10 +21,7 @@ module Gitlab def generate_script super + [ init_command, - # Sleep is necessary to give Tiller time to restart after upgrade. - # Ideally we'd be able to use --wait but cannot because of - # https://github.com/helm/helm/issues/4855 - sleep_command, + wait_for_tiller_command, repository_command, script_command ].compact.join("\n") @@ -39,18 +37,6 @@ module Gitlab private - def init_command - 'helm init --upgrade --tiller-namespace gitlab-managed-apps' - end - - def sleep_command - 'sleep 30' - end - - def repository_command - "helm repo add #{name} #{repository}" if repository - end - def script_command upgrade_flags = "#{optional_version_flag}#{optional_tls_flags}" \ " --reset-values" \ -- cgit v1.2.1 From 9b1a99b03d114e88e2512c75f9711cb38b34bc0c Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 15 Nov 2018 14:21:32 +0000 Subject: Use helm version loop instead of sleep in ClientCommand --- lib/gitlab/kubernetes/helm/client_command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/kubernetes/helm/client_command.rb b/lib/gitlab/kubernetes/helm/client_command.rb index 0ff0169b61d..bc554684fc7 100644 --- a/lib/gitlab/kubernetes/helm/client_command.rb +++ b/lib/gitlab/kubernetes/helm/client_command.rb @@ -14,7 +14,7 @@ module Gitlab # This is necessary to give Tiller time to restart after upgrade. # Ideally we'd be able to use --wait but cannot because of # https://github.com/helm/helm/issues/4855 - 'sleep 30' + 'for i in $(seq 1 30); do helm version && break; sleep 1s; echo "Retrying ($i)..."; done' end def repository_command -- cgit v1.2.1 From 1244533b770ea0baf97fc0693a208394b162ead6 Mon Sep 17 00:00:00 2001 From: Dylan Griffith Date: Thu, 15 Nov 2018 14:23:36 +0000 Subject: Remove unnecessary --tiller-namespace --- lib/gitlab/kubernetes/helm/client_command.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/kubernetes/helm/client_command.rb b/lib/gitlab/kubernetes/helm/client_command.rb index bc554684fc7..72bafc07bf0 100644 --- a/lib/gitlab/kubernetes/helm/client_command.rb +++ b/lib/gitlab/kubernetes/helm/client_command.rb @@ -7,7 +7,7 @@ module Gitlab # installing an app. We ensure the helm version stored in the # database is correct by also updating this after transition to # :installed,:updated in Clusters::Concerns::ApplicationStatus - 'helm init --upgrade --tiller-namespace gitlab-managed-apps' + 'helm init --upgrade' end def wait_for_tiller_command -- cgit v1.2.1 From a4ae5411f5e75ca90f6172d8d03c6524f8efb8cb Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 16 Nov 2018 12:09:18 +0100 Subject: Fix rubocop warning --- lib/gitlab/file_detector.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb index 48025f6ad5a..2770469ca9f 100644 --- a/lib/gitlab/file_detector.rb +++ b/lib/gitlab/file_detector.rb @@ -8,7 +8,7 @@ module Gitlab module FileDetector PATTERNS = { # Project files - readme: %r{\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?\z}i, + readme: /\A(#{Regexp.union(*Gitlab::MarkupHelper::PLAIN_FILENAMES).source})(\.(#{Regexp.union(*Gitlab::MarkupHelper::EXTENSIONS).source}))?\z/i, changelog: %r{\A(changelog|history|changes|news)[^/]*\z}i, license: %r{\A((un)?licen[sc]e|copying)(\.[^/]+)?\z}i, contributing: %r{\Acontributing[^/]*\z}i, -- cgit v1.2.1