Sudden config validation errors

On July 7, 2020 we rolled out the first of several changes to strengthen validation for 2.1 configuration, specifically step validation in jobs. Because this update contains stricter rules around validation, it will catch some configurations that were previously considered valid.

The specific changes we are making are:

  • The run step now requires either:
    • a string with the command
    • a map with the command key (the name key stays optional)
  • The when/unless steps now require:
    •  a condition key with a logic statement
    •  a steps key with zero or more valid steps

The most common causes for failure we see in user configurations include misspellings of keys as well as indentation errors.

For example, an incorrect configuration might read:

yaml

steps:

  - run:

    command: echo hi

parses to JSON as

json

{

  "steps": [

    {

      "run": null,

      "command": "echo hi"

    }

  ]

}

while the correct version would be:

yaml

steps:

  - run:

      command: echo hi

which parses to JSON as:

json

{

  "steps": [

    {

      "run": {

        "command": "echo hi"

      }

    }

  ]

}

Any failing builds caused by the change on July 7 are likely the result of of pre-existing syntax errors in configuration. Please note that we have also identified several orbs in current usage which may cause syntax errors once this change is released. In this case, please update to the latest orb version and/or contact the orb author and let them know about the issue.

If you believe that your configuration is failing to compile even though it is semantically valid, please contact us.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.