diff options
-rw-r--r-- | app/models/ci/pipeline_schedule_variable.rb | 2 | ||||
-rw-r--r-- | doc/ci/variables/README.md | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/import_export.yml | 3 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/all_models.yml | 3 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 4 |
5 files changed, 10 insertions, 4 deletions
diff --git a/app/models/ci/pipeline_schedule_variable.rb b/app/models/ci/pipeline_schedule_variable.rb index ee5b8733fac..6c9c8d990f9 100644 --- a/app/models/ci/pipeline_schedule_variable.rb +++ b/app/models/ci/pipeline_schedule_variable.rb @@ -5,6 +5,6 @@ module Ci belongs_to :pipeline_schedule - validates :key, uniqueness: { scope: :pipeline_schedule_id } + validates :key, uniqueness: { scope: :pipeline_schedule_id }, presence: { unless: :importing? } end end diff --git a/doc/ci/variables/README.md b/doc/ci/variables/README.md index f1c35700d15..3bdcdba7a2d 100644 --- a/doc/ci/variables/README.md +++ b/doc/ci/variables/README.md @@ -9,7 +9,7 @@ and a list of **user-defined variables**. The variables can be overwritten and they take precedence over each other in this order: -1. [Trigger variables][triggers] or [scheduled pipeline variables](../../user/project/pipelines/schedules#making-use-of-scheduled-pipeline-variables) (take precedence over all) +1. [Trigger variables][triggers] or [scheduled pipeline variables](../../user/project/pipelines/schedules.md#making-use-of-scheduled-pipeline-variables) (take precedence over all) 1. [Secret variables](#secret-variables) or [protected secret variables](#protected-secret-variables) 1. YAML-defined [job-level variables](../yaml/README.md#job-variables) 1. YAML-defined [global variables](../yaml/README.md#variables) diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index 1860352c96d..2d443aa731f 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -42,7 +42,8 @@ project_tree: - :stages - :statuses - :triggers - - :pipeline_schedules + - pipeline_schedules: + - :variables - :services - :hooks - protected_branches: diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index a5f09f1856e..40ae0a1846b 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -132,6 +132,9 @@ pipeline_schedules: - last_pipeline pipeline_schedule: - pipelines +- pipeline_schedule_variables +pipeline_schedule_variables: +- pipeline_schedule deploy_keys: - user - deploy_keys_projects diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 4ed2635fb07..66784607835 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1375,8 +1375,10 @@ describe Ci::Build, :models do context 'when a job was triggered by a pipeline schedule' do let(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) } + let!(:pipeline_schedule_variable) do - create(:ci_pipeline_schedule_variable, key: 'SCHEDULE_VARIABLE_KEY', + create(:ci_pipeline_schedule_variable, + key: 'SCHEDULE_VARIABLE_KEY', pipeline_schedule: pipeline_schedule) end |