From 8611862ae0dd34f34775c02acefa03a63c3797dd Mon Sep 17 00:00:00 2001 From: Tiffany K Date: Wed, 1 May 2024 12:05:02 -0700 Subject: [PATCH] fix(3103): Add stages to config-parser schema for pipeline template (#564) --- config/base.js | 2 +- test/data/config.base.pipelineTemplate.yaml | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config/base.js b/config/base.js index 71ea960a..4966c847 100644 --- a/config/base.js +++ b/config/base.js @@ -80,7 +80,7 @@ const SCHEMA_CONFIG_PRE_TEMPLATE_MERGE = Joi.object() }), cache: SCHEMA_CACHE, childPipelines: SCHEMA_CHILD_PIPELINES, - stages: SCHEMA_STAGES.when('template', { is: Joi.exist(), then: Joi.forbidden() }), + stages: SCHEMA_STAGES, subscribe: SCHEMA_SUBSCRIBE, parameters: Parameters.parameters.default({}) }) diff --git a/test/data/config.base.pipelineTemplate.yaml b/test/data/config.base.pipelineTemplate.yaml index 679dc60a..9da863a6 100644 --- a/test/data/config.base.pipelineTemplate.yaml +++ b/test/data/config.base.pipelineTemplate.yaml @@ -12,7 +12,7 @@ cache: build: ["target/some-artifact.zip"] publish-preview: ["target/some-artifact.zip"] test: [] -subscribe: +subscribe: scmUrls: - git@github.com:foo/bar.git#master: [~commit, ~tags, ~release] annotations: @@ -24,4 +24,15 @@ childPipelines: scmUrls: - git@github.com:org/repo.git - https://github.com:org/repo2.git - startAll: true \ No newline at end of file + startAll: true +stages: + canary: + jobs: + - first + - second + description: "Canary jobs for testing" + prod: + jobs: + - deploy-west + - deploy-east + description: "Prod deploy jobs"