diff --git a/api/validator.js b/api/validator.js index 39b50a24..69973af9 100644 --- a/api/validator.js +++ b/api/validator.js @@ -23,6 +23,7 @@ const SCHEMA_JOB_PERMUTATION = Joi.object() .keys({ annotations: Annotations.annotations, commands: SCHEMA_JOB_COMMANDS, + description: Job.description, environment: Job.environment, image: Job.image, secrets: Job.secrets, diff --git a/config/job.js b/config/job.js index 9daccde3..659d7512 100644 --- a/config/job.js +++ b/config/job.js @@ -86,6 +86,7 @@ const SCHEMA_JOB = Joi.object() */ module.exports = { annotations: Annotations.annotations, + description: SCHEMA_DESCRIPTION, environment: SCHEMA_ENVIRONMENT, image: SCHEMA_IMAGE, job: SCHEMA_JOB, diff --git a/test/data/validator.input.yaml b/test/data/validator.input.yaml index f497a1b6..47b4d0d7 100644 --- a/test/data/validator.input.yaml +++ b/test/data/validator.input.yaml @@ -1,6 +1,9 @@ yaml: | jobs: main: + annotations: + beta.screwdriver.cd/auto_pr_builds: fork-only + description: "This is a description" image: node:{{NODE_VERSION}} matrix: NODE_VERSION: [4,5,6] diff --git a/test/data/validator.output.yaml b/test/data/validator.output.yaml index b9af0c95..6f3f38ba 100644 --- a/test/data/validator.output.yaml +++ b/test/data/validator.output.yaml @@ -8,6 +8,9 @@ jobs: command: npm test - name: build command: npm run build + annotations: + beta.screwdriver.cd/auto_pr_builds: fork-only + description: "This is a description" environment: NODE_VERSION: 4 settings: @@ -20,6 +23,9 @@ jobs: command: npm test - name: build command: npm run build + annotations: + beta.screwdriver.cd/auto_pr_builds: fork-only + description: "This is a description" environment: NODE_VERSION: 5 settings: @@ -32,6 +38,9 @@ jobs: command: npm test - name: build command: npm run build + annotations: + beta.screwdriver.cd/auto_pr_builds: fork-only + description: "This is a description" environment: NODE_VERSION: 6 settings: