diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-29 00:06:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-29 00:06:24 +0300 |
commit | ef326e805ac99222c55e1efd9867045800f01a4b (patch) | |
tree | 201d39fb90a1422cc1f523d95b30b93e95f973f5 /lib | |
parent | 7515ec41c527c62bfd56f46e388cf6d9fe06479f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/banzai/pipeline/ascii_doc_pipeline.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/task_helpers.rb | 18 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/banzai/pipeline/ascii_doc_pipeline.rb b/lib/banzai/pipeline/ascii_doc_pipeline.rb index 2e8d2bd23b0..90edc7010f4 100644 --- a/lib/banzai/pipeline/ascii_doc_pipeline.rb +++ b/lib/banzai/pipeline/ascii_doc_pipeline.rb @@ -11,6 +11,8 @@ module Banzai Filter::ExternalLinkFilter, Filter::PlantumlFilter, Filter::ColorFilter, + Filter::ImageLazyLoadFilter, + Filter::ImageLinkFilter, Filter::AsciiDocPostProcessingFilter ] end diff --git a/lib/gitlab/task_helpers.rb b/lib/gitlab/task_helpers.rb index 8532845f3cb..ac02ec635e4 100644 --- a/lib/gitlab/task_helpers.rb +++ b/lib/gitlab/task_helpers.rb @@ -158,15 +158,17 @@ module Gitlab end def checkout_or_clone_version(version:, repo:, target_dir:) - version = - if version.starts_with?("=") - version.sub(/\A=/, '') # tag or branch - else - "v#{version}" # tag - end - clone_repo(repo, target_dir) unless Dir.exist?(target_dir) - checkout_version(version, target_dir) + checkout_version(get_version(version), target_dir) + end + + # this function implements the same logic we have in omnibus for dealing with components version + def get_version(component_version) + # If not a valid version string following SemVer it is probably a branch name or a SHA + # commit of one of our own component so it doesn't need `v` prepended + return component_version unless /^\d+\.\d+\.\d+(-rc\d+)?$/.match?(component_version) + + "v#{component_version}" end def clone_repo(repo, target_dir) |