Fix spec. Add PipelineScheduleVariable for import_export
This commit is contained in:
parent
5e7db4e36c
commit
324cfe0f9b
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -42,7 +42,8 @@ project_tree:
|
|||
- :stages
|
||||
- :statuses
|
||||
- :triggers
|
||||
- :pipeline_schedules
|
||||
- pipeline_schedules:
|
||||
- :variables
|
||||
- :services
|
||||
- :hooks
|
||||
- protected_branches:
|
||||
|
|
|
@ -130,9 +130,9 @@ pipeline_schedules:
|
|||
- owner
|
||||
- pipelines
|
||||
- last_pipeline
|
||||
- variables
|
||||
pipeline_schedule:
|
||||
- pipelines
|
||||
- pipeline_schedule_variables
|
||||
pipeline_schedule_variables:
|
||||
- pipeline_schedule
|
||||
deploy_keys:
|
||||
|
|
|
@ -1371,8 +1371,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
|
||||
|
||||
|
|
Loading…
Reference in New Issue