Commit 6ad3569d authored by Matthias Käppler's avatar Matthias Käppler

Merge branch 'cleanup-validate_release_description_length-feature-flag' into 'master'

Clean up `validate_release_description_length` feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!60892
parents 8322da8e 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
......
---
title: Validate release description length
merge_request: 60892
author:
type: changed
---
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
......@@ -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
......
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