Commit 162c9c1b authored by Sean Arnold's avatar Sean Arnold

Remove pipeline variable unique validation

This causes unnecessary SQL queries, and is already checked in
`Gitlab::Ci::Pipeline::Chain::Build::Associations`.

Changelog: performance
parent 81826be8
...@@ -8,7 +8,7 @@ module Ci ...@@ -8,7 +8,7 @@ module Ci
alias_attribute :secret_value, :value alias_attribute :secret_value, :value
validates :key, uniqueness: { scope: :pipeline_id } validates :key, presence: true
def hook_attrs def hook_attrs
{ key: key, value: value } { key: key, value: value }
......
...@@ -7,7 +7,7 @@ RSpec.describe Ci::PipelineVariable do ...@@ -7,7 +7,7 @@ RSpec.describe Ci::PipelineVariable do
it_behaves_like "CI variable" it_behaves_like "CI variable"
it { is_expected.to validate_uniqueness_of(:key).scoped_to(:pipeline_id) } it { is_expected.to validate_presence_of(:key) }
describe '#hook_attrs' do describe '#hook_attrs' do
let(:variable) { create(:ci_pipeline_variable, key: 'foo', value: 'bar') } let(:variable) { create(:ci_pipeline_variable, key: 'foo', value: 'bar') }
......
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