diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 18:07:48 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 18:07:48 +0000 |
commit | e72386771751fb22245bc6604fef236a2ee130cb (patch) | |
tree | 7cf54bca933159cb177d3caa2f139f87d6d30391 /lib | |
parent | c2b98d3dbd47ab92c79c702276fe9130d9a28036 (diff) | |
download | gitlab-ce-e72386771751fb22245bc6604fef236a2ee130cb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/filter/relative_link_filter.rb | 9 | ||||
-rw-r--r-- | lib/gitlab/dependency_linker/godeps_json_linker.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/import_export/import_export.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/middleware/go.rb | 2 | ||||
-rw-r--r-- | lib/quality/test_level.rb | 9 |
5 files changed, 19 insertions, 9 deletions
diff --git a/lib/banzai/filter/relative_link_filter.rb b/lib/banzai/filter/relative_link_filter.rb index 583b0081319..2581a179c79 100644 --- a/lib/banzai/filter/relative_link_filter.rb +++ b/lib/banzai/filter/relative_link_filter.rb @@ -152,11 +152,18 @@ module Banzai def rebuild_relative_uri(uri) file_path = nested_file_path_if_exists(uri) + resource_type = uri_type(file_path) + + # Repository routes are under /-/ scope now. + # Since we craft a path without using route helpers we must + # ensure - is added here. + prefix = '-' if %w(tree blob raw commits).include?(resource_type.to_s) uri.path = [ relative_url_root, project.full_path, - uri_type(file_path), + prefix, + resource_type, Addressable::URI.escape(ref).gsub('#', '%23'), Addressable::URI.escape(file_path) ].compact.join('/').squeeze('/').chomp('/') diff --git a/lib/gitlab/dependency_linker/godeps_json_linker.rb b/lib/gitlab/dependency_linker/godeps_json_linker.rb index d24c137793e..9166e9091ac 100644 --- a/lib/gitlab/dependency_linker/godeps_json_linker.rb +++ b/lib/gitlab/dependency_linker/godeps_json_linker.rb @@ -12,10 +12,12 @@ module Gitlab def link_dependencies link_json('ImportPath') do |path| case path + when %r{\A(?<repo>github\.com/#{REPO_REGEX})/(?<path>.+)\z} + "https://#{$~[:repo]}/tree/master/#{$~[:path]}" when %r{\A(?<repo>gitlab\.com/#{NESTED_REPO_REGEX})\.git/(?<path>.+)\z}, - %r{\A(?<repo>git(lab|hub)\.com/#{REPO_REGEX})/(?<path>.+)\z} + %r{\A(?<repo>gitlab\.com/#{REPO_REGEX})/(?<path>.+)\z} - "https://#{$~[:repo]}/tree/master/#{$~[:path]}" + "https://#{$~[:repo]}/-/tree/master/#{$~[:path]}" when /\Agolang\.org/ "https://godoc.org/#{path}" else diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index bf92de73b48..ba1ccd77604 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -220,6 +220,8 @@ excluded_attributes: - :encrypted_token - :encrypted_token_iv - :enabled + service_desk_setting: + - :outgoing_name methods: notes: diff --git a/lib/gitlab/middleware/go.rb b/lib/gitlab/middleware/go.rb index f207d91235f..53508938c49 100644 --- a/lib/gitlab/middleware/go.rb +++ b/lib/gitlab/middleware/go.rb @@ -60,7 +60,7 @@ module Gitlab end meta_import_tag = tag :meta, name: 'go-import', content: "#{import_prefix} git #{repository_url}" - meta_source_tag = tag :meta, name: 'go-source', content: "#{import_prefix} #{project_url} #{project_url}/tree/#{branch}{/dir} #{project_url}/blob/#{branch}{/dir}/{file}#L{line}" + meta_source_tag = tag :meta, name: 'go-source', content: "#{import_prefix} #{project_url} #{project_url}/-/tree/#{branch}{/dir} #{project_url}/-/blob/#{branch}{/dir}/{file}#L{line}" head_tag = content_tag :head, meta_import_tag + meta_source_tag html_tag = content_tag :html, head_tag + body_tag [html_tag, 200] diff --git a/lib/quality/test_level.rb b/lib/quality/test_level.rb index 90a8096cc2b..84470a73b1b 100644 --- a/lib/quality/test_level.rb +++ b/lib/quality/test_level.rb @@ -5,6 +5,10 @@ module Quality UnknownTestLevelError = Class.new(StandardError) TEST_LEVEL_FOLDERS = { + migration: %w[ + migrations + lib/gitlab/background_migration + ], unit: %w[ bin config @@ -19,7 +23,6 @@ module Quality initializers javascripts lib - migrations models policies presenters @@ -36,10 +39,6 @@ module Quality workers elastic_integration ], - migration: %w[ - migrations - lib/gitlab/background_migration - ], integration: %w[ controllers mailers |