diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers/internal_helpers.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/bitbucket_server_import/importer.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/gl_repository/repo_type.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/regex.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/workhorse.rb | 2 |
5 files changed, 10 insertions, 6 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index cc4a0d348a0..c8e96c7c5db 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -118,7 +118,7 @@ module API # Project id to pass between components that don't share/don't have # access to the same filesystem mounts def gl_repository - repo_type.identifier_for_subject(project) + repo_type.identifier_for_repositorable(project) end def gl_project_path diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb index 886fbaaff48..16fe5b46b1f 100644 --- a/lib/gitlab/bitbucket_server_import/importer.rb +++ b/lib/gitlab/bitbucket_server_import/importer.rb @@ -172,6 +172,7 @@ module Gitlab stage: 'import_pull_requests', iid: pull_request.iid, error: e.message ) + backtrace = Gitlab::BacktraceCleaner.clean_backtrace(e.backtrace) errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, backtrace: backtrace.join("\n"), raw_response: pull_request.raw } end end diff --git a/lib/gitlab/gl_repository/repo_type.rb b/lib/gitlab/gl_repository/repo_type.rb index 01bc27f963b..6918344aa40 100644 --- a/lib/gitlab/gl_repository/repo_type.rb +++ b/lib/gitlab/gl_repository/repo_type.rb @@ -13,8 +13,8 @@ module Gitlab @repository_accessor = repository_accessor end - def identifier_for_subject(subject) - "#{name}-#{subject.id}" + def identifier_for_repositorable(repositorable) + "#{name}-#{repositorable.id}" end def fetch_id(identifier) @@ -34,8 +34,8 @@ module Gitlab project? ? "" : ".#{name}" end - def repository_for(subject) - repository_accessor.call(subject) + def repository_for(repositorable) + repository_accessor.call(repositorable) end end end diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb index 48eaf073e8a..fd6e24a96d8 100644 --- a/lib/gitlab/regex.rb +++ b/lib/gitlab/regex.rb @@ -5,6 +5,9 @@ module Gitlab extend self def project_name_regex + # The character range \p{Alnum} overlaps with \u{00A9}-\u{1f9ff} + # hence the Ruby warning. + # https://gitlab.com/gitlab-org/gitlab/merge_requests/23165#not-easy-fixable @project_name_regex ||= /\A[\p{Alnum}\u{00A9}-\u{1f9ff}_][\p{Alnum}\p{Pd}\u{00A9}-\u{1f9ff}_\. ]*\z/.freeze end diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb index 29450a33289..e377c690d51 100644 --- a/lib/gitlab/workhorse.rb +++ b/lib/gitlab/workhorse.rb @@ -24,7 +24,7 @@ module Gitlab attrs = { GL_ID: Gitlab::GlId.gl_id(user), - GL_REPOSITORY: repo_type.identifier_for_subject(repository.project), + GL_REPOSITORY: repo_type.identifier_for_repositorable(repository.project), GL_USERNAME: user&.username, ShowAllRefs: show_all_refs, Repository: repository.gitaly_repository.to_h, |