Commit 823a9d35 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch...

Merge branch 'fix/sm/37299-environments-validate-uniqueness-on-url-and-can-cause-silent-deployment-failures' into 'master'

Remove unique validation from external_url in Environment

Closes #37299

See merge request gitlab-org/gitlab-ce!15202
parents ff996108 c1f064cb
...@@ -30,7 +30,6 @@ class Environment < ActiveRecord::Base ...@@ -30,7 +30,6 @@ class Environment < ActiveRecord::Base
message: Gitlab::Regex.environment_slug_regex_message } message: Gitlab::Regex.environment_slug_regex_message }
validates :external_url, validates :external_url,
uniqueness: { scope: :project_id },
length: { maximum: 255 }, length: { maximum: 255 },
allow_nil: true, allow_nil: true,
addressable_url: true addressable_url: true
......
...@@ -18,7 +18,6 @@ describe Environment do ...@@ -18,7 +18,6 @@ describe Environment do
it { is_expected.to validate_length_of(:slug).is_at_most(24) } it { is_expected.to validate_length_of(:slug).is_at_most(24) }
it { is_expected.to validate_length_of(:external_url).is_at_most(255) } it { is_expected.to validate_length_of(:external_url).is_at_most(255) }
it { is_expected.to validate_uniqueness_of(:external_url).scoped_to(:project_id) }
describe '.order_by_last_deployed_at' do describe '.order_by_last_deployed_at' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
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