Better error messages from pipeline parsing

Currently the pipeline parsing problems are disconnected from the actual source. For example on a problem with a condition I can get:

fatal: Failed to upload and process pipeline: Pipeline upload rejected: One of the steps you provided was invalid: Error parsing `if` expression: Unexpected type: expected boolean but found string (line 1, column 111-142)

This has two problems:

  • There is no condition on line 1 in the pipeline, so the context got lost.
  • I don’t know which expression is a string and whether the columns include indentation and the if: . This would be especially bad with dynamically generated pipelines.

A compiler-style message with the affected line and the issue underlined would help.

Hey @viraptor :wave: !

Welcome to buildkite community!

That’s an intresting suggestion :thinking:! Would you be able to share the link to the pipeline to support@buildkite.com in order for us to look into this further to evaluate what was causing this?

In this case specifically the problem was a condition like:

if: ... build.branch != "main" && "build.env('DR_STATE') == 'OFF'"

so the accidental quotes made the last value a string. But the condition was on line 138, so it was hard to find which if was affected. (and whether the column included the indentation and if: or not)

Hey @viraptor! :wave:

I’m assuming this was caused by the upload command and the error nor bubbling up from the line in the targeted pipeline YAML, rather associating the error with the command in the steps of the pipeline.

As you able to email us with a link to the pipeline/a build where this error occurred? It’ll help us get the context needed for raising this request with the team so that we can correctly associate the line number with the parsing error.

Cheers!