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
f1ed052f
Commit
f1ed052f
authored
May 04, 2021
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up validate_release_description_length feature flag
This commit cleans up the feature flag.
parent
694ce654
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
26 deletions
+6
-26
app/models/release.rb
app/models/release.rb
+1
-6
changelogs/unreleased/cleanup-validate_release_description_length-feature-flag.yml
...anup-validate_release_description_length-feature-flag.yml
+5
-0
config/feature_flags/development/validate_release_description_length.yml
...flags/development/validate_release_description_length.yml
+0
-8
spec/models/release_spec.rb
spec/models/release_spec.rb
+0
-12
No files found.
app/models/release.rb
View file @
f1ed052f
...
...
@@ -24,7 +24,7 @@ class Release < ApplicationRecord
before_create
:set_released_at
validates
:project
,
:tag
,
presence:
true
validates
:description
,
length:
{
maximum:
Gitlab
::
Database
::
MAX_TEXT_SIZE_LIMIT
},
if: :
should_validate_description_length
?
validates
:description
,
length:
{
maximum:
Gitlab
::
Database
::
MAX_TEXT_SIZE_LIMIT
},
if: :
description_changed
?
validates_associated
:milestone_releases
,
message:
->
(
_
,
obj
)
{
obj
[
:value
].
map
(
&
:errors
).
map
(
&
:full_messages
).
join
(
","
)
}
validates
:links
,
nested_attributes_duplicates:
{
scope: :release
,
child_attributes:
%i[name url filepath]
}
...
...
@@ -102,11 +102,6 @@ class Release < ApplicationRecord
private
def
should_validate_description_length?
description_changed?
&&
::
Feature
.
enabled?
(
:validate_release_description_length
,
project
,
default_enabled: :yaml
)
end
def
actual_sha
sha
||
actual_tag
&
.
dereferenced_target
end
...
...
changelogs/unreleased/cleanup-validate_release_description_length-feature-flag.yml
0 → 100644
View file @
f1ed052f
---
title
:
Validate release description length
merge_request
:
60892
author
:
type
:
changed
config/feature_flags/development/validate_release_description_length.yml
deleted
100644 → 0
View file @
694ce654
---
name
:
validate_release_description_length
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60380
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/329192
milestone
:
'
13.12'
type
:
development
group
:
group::release
default_enabled
:
false
spec/models/release_spec.rb
View file @
f1ed052f
...
...
@@ -48,18 +48,6 @@ RSpec.describe Release do
expect
(
release
.
errors
.
full_messages
)
.
to
include
(
"Description is too long (maximum is
#{
Gitlab
::
Database
::
MAX_TEXT_SIZE_LIMIT
}
characters)"
)
end
context
'when validate_release_description_length feature flag is disabled'
do
before
do
stub_feature_flags
(
validate_release_description_length:
false
)
end
it
'does not create a validation error'
do
release
.
validate
expect
(
release
.
errors
.
full_messages
).
to
be_empty
end
end
end
context
'when a release is tied to a milestone for another project'
do
...
...
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