Commit 324cfe0f authored by Shinya Maeda's avatar Shinya Maeda

Fix spec. Add PipelineScheduleVariable for import_export

parent 5e7db4e3
...@@ -5,6 +5,6 @@ module Ci ...@@ -5,6 +5,6 @@ module Ci
belongs_to :pipeline_schedule belongs_to :pipeline_schedule
validates :key, uniqueness: { scope: :pipeline_schedule_id } validates :key, uniqueness: { scope: :pipeline_schedule_id }, presence: { unless: :importing? }
end end
end end
...@@ -9,7 +9,7 @@ and a list of **user-defined variables**. ...@@ -9,7 +9,7 @@ and a list of **user-defined variables**.
The variables can be overwritten and they take precedence over each other in The variables can be overwritten and they take precedence over each other in
this order: 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. [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 [job-level variables](../yaml/README.md#job-variables)
1. YAML-defined [global variables](../yaml/README.md#variables) 1. YAML-defined [global variables](../yaml/README.md#variables)
......
...@@ -42,7 +42,8 @@ project_tree: ...@@ -42,7 +42,8 @@ project_tree:
- :stages - :stages
- :statuses - :statuses
- :triggers - :triggers
- :pipeline_schedules - pipeline_schedules:
- :variables
- :services - :services
- :hooks - :hooks
- protected_branches: - protected_branches:
......
...@@ -130,9 +130,9 @@ pipeline_schedules: ...@@ -130,9 +130,9 @@ pipeline_schedules:
- owner - owner
- pipelines - pipelines
- last_pipeline - last_pipeline
- variables
pipeline_schedule: pipeline_schedule:
- pipelines - pipelines
- pipeline_schedule_variables
pipeline_schedule_variables: pipeline_schedule_variables:
- pipeline_schedule - pipeline_schedule
deploy_keys: deploy_keys:
......
...@@ -1371,8 +1371,10 @@ describe Ci::Build, :models do ...@@ -1371,8 +1371,10 @@ describe Ci::Build, :models do
context 'when a job was triggered by a pipeline schedule' do context 'when a job was triggered by a pipeline schedule' do
let(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) } let(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) }
let!(:pipeline_schedule_variable) do 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) pipeline_schedule: pipeline_schedule)
end end
......
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