Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7e575169
Commit
7e575169
authored
Oct 06, 2021
by
Mathieu Parent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow longer Helm channel names
Changelog: changed
parent
df0d2fe5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
5 deletions
+21
-5
app/models/packages/helm/file_metadatum.rb
app/models/packages/helm/file_metadatum.rb
+1
-1
db/migrate/20211006103122_change_helm_channel_length.rb
db/migrate/20211006103122_change_helm_channel_length.rb
+14
-0
db/schema_migrations/20211006103122
db/schema_migrations/20211006103122
+1
-0
db/structure.sql
db/structure.sql
+1
-1
lib/gitlab/regex.rb
lib/gitlab/regex.rb
+1
-1
spec/lib/gitlab/regex_spec.rb
spec/lib/gitlab/regex_spec.rb
+1
-0
spec/models/packages/helm/file_metadatum_spec.rb
spec/models/packages/helm/file_metadatum_spec.rb
+2
-2
No files found.
app/models/packages/helm/file_metadatum.rb
View file @
7e575169
...
...
@@ -12,7 +12,7 @@ module Packages
validates
:channel
,
presence:
true
,
length:
{
maximum:
63
},
length:
{
maximum:
255
},
format:
{
with:
Gitlab
::
Regex
.
helm_channel_regex
}
validates
:metadata
,
...
...
db/migrate/20211006103122_change_helm_channel_length.rb
0 → 100644
View file @
7e575169
# frozen_string_literal: true
class
ChangeHelmChannelLength
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
def
up
add_text_limit
:packages_helm_file_metadata
,
:channel
,
255
,
constraint_name:
check_constraint_name
(
:packages_helm_file_metadata
,
:channel
,
'max_length_v2'
)
remove_text_limit
:packages_helm_file_metadata
,
:channel
,
constraint_name:
check_constraint_name
(
:packages_helm_file_metadata
,
:channel
,
'max_length'
)
end
def
down
# no-op: Danger of failing if there are records with length(channel) > 63
end
end
db/schema_migrations/20211006103122
0 → 100644
View file @
7e575169
1e29e4712d81aacf1178996c2dd9e82593be5a2311273800d91640d8eccd38ed
\ No newline at end of file
db/structure.sql
View file @
7e575169
...
...
@@ -17062,7 +17062,7 @@ CREATE TABLE packages_helm_file_metadata (
package_file_id bigint NOT NULL,
channel text NOT NULL,
metadata jsonb,
CONSTRAINT check_
c34067922d CHECK ((char_length(channel) <= 63
))
CONSTRAINT check_
06e8d100af CHECK ((char_length(channel) <= 255
))
);
CREATE TABLE packages_maven_metadata (
lib/gitlab/regex.rb
View file @
7e575169
...
...
@@ -131,7 +131,7 @@ module Gitlab
end
def
helm_channel_regex
@helm_channel_regex
||=
%r{
\A
([a-zA-Z0-9](
\.
|-|_)?){1,
63
}(?<!
\.
|-|_)
\z
}
.
freeze
@helm_channel_regex
||=
%r{
\A
([a-zA-Z0-9](
\.
|-|_)?){1,
255
}(?<!
\.
|-|_)
\z
}
.
freeze
end
def
helm_package_regex
...
...
spec/lib/gitlab/regex_spec.rb
View file @
7e575169
...
...
@@ -657,6 +657,7 @@ RSpec.describe Gitlab::Regex do
it
{
is_expected
.
to
match
(
'my_repo42'
)
}
it
{
is_expected
.
to
match
(
'1.2.3'
)
}
it
{
is_expected
.
to
match
(
'v1.2.3-beta-12'
)
}
it
{
is_expected
.
to
match
(
'renovate_https-github.com-operator-framework-operator-lifecycle-manager.git-0.x'
)
}
# Do not allow empty
it
{
is_expected
.
not_to
match
(
''
)
}
...
...
spec/models/packages/helm/file_metadatum_spec.rb
View file @
7e575169
...
...
@@ -31,8 +31,8 @@ RSpec.describe Packages::Helm::FileMetadatum, type: :model do
it
'validates #channel'
,
:aggregate_failures
do
is_expected
.
to
validate_presence_of
(
:channel
)
is_expected
.
to
allow_value
(
'a'
*
63
).
for
(
:channel
)
is_expected
.
not_to
allow_value
(
'a'
*
64
).
for
(
:channel
)
is_expected
.
to
allow_value
(
'a'
*
255
).
for
(
:channel
)
is_expected
.
not_to
allow_value
(
'a'
*
256
).
for
(
:channel
)
is_expected
.
to
allow_value
(
'release'
).
for
(
:channel
)
is_expected
.
to
allow_value
(
'my-repo'
).
for
(
:channel
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment