Commit 162fdefe authored by ggelatti's avatar ggelatti

Allow semver versions for composer

parent 451fbf0c
...@@ -9,7 +9,7 @@ module Packages ...@@ -9,7 +9,7 @@ module Packages
def execute def execute
if @tag_name.present? if @tag_name.present?
@tag_name.match(Gitlab::Regex.composer_package_version_regex).captures[0] @tag_name[0] == 'v' ? @tag_name[1..-1] : @tag_name
elsif @branch_name.present? elsif @branch_name.present?
branch_sufix_or_prefix(@branch_name.match(Gitlab::Regex.composer_package_version_regex)) branch_sufix_or_prefix(@branch_name.match(Gitlab::Regex.composer_package_version_regex))
end end
......
---
title: Allow semver versions in composer packages
merge_request: 46301
author:
type: fixed
...@@ -19,9 +19,11 @@ RSpec.describe Packages::Composer::VersionParserService do ...@@ -19,9 +19,11 @@ RSpec.describe Packages::Composer::VersionParserService do
nil | '1.7.x' | '1.7.x-dev' nil | '1.7.x' | '1.7.x-dev'
'v1.0.0' | nil | '1.0.0' 'v1.0.0' | nil | '1.0.0'
'v1.0' | nil | '1.0' 'v1.0' | nil | '1.0'
'v1.0.1+meta' | nil | '1.0.1+meta'
'1.0' | nil | '1.0' '1.0' | nil | '1.0'
'1.0.2' | nil | '1.0.2' '1.0.2' | nil | '1.0.2'
'1.0.2-beta2' | nil | '1.0.2-beta2' '1.0.2-beta2' | nil | '1.0.2-beta2'
'1.0.1+meta' | nil | '1.0.1+meta'
end end
with_them do with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment