buildkite / pipeline-schema

A JSON schema for Buildkite’s pipeline file format
MIT License
31 stars 35 forks source link

Conditionals cause pipeline.yml to fail validation #7

Closed r6e closed 4 years ago

r6e commented 4 years ago

Problem

Using a conditional in a pipeline.yml file causes validation to fail with the following message: Property if is not allowed.. Shown here using the example from the Buildkite documentation, Using Conditionals:

Screen Shot 2020-01-08 at 14 44 22 Screen Shot 2020-01-08 at 14 56 53

Suspected Cause

It appears as though the schema does not currently support the if property. The schema.json does not have any attribute "if" within the commandStep.

Conditional properties were introduced approximately three months ago, so it seems likely that the schema simply has not yet been updated.

Suggested Fix

It seems likely that the fix will be similar to that in #4. This case may be simpler, as the documentation indicates only strings are supported by this property.

nchlswhttkr commented 4 years ago

Any chance this might have been fixed by #6? It was just merged this morning.

r6e commented 4 years ago

@nchlswhttkr Looks like the actual merge took place almost exactly 5 minutes after I submitted this. Fastest turnaround on an issue ever 😄 Thanks for handling; much appreciated.