YAML filters validation failure

Steps to reproduce:

  1. Create incorrectly nested filter in Workflow, e.g.:
      - notify_production:
          requires:
            - post_process
            - stop_redundant_versions
          filters:
            only:
              - master
  1. Run circleci config validate -c .circleci/config.yml
  2. Start Workflow

What happens: validator reports config file is valid, but it fails on CircleCI with:

We weren’t able to start this workflow.
Encountered errors trying to create workflows from this config: Config does not conform to schema: {:workflows {:build-and-deploy {:jobs [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil {:notify_production_complete {:filters {:only disallowed-key}}}]}}}
For more examples see the Workflows documentation.

What should happen: validation should fail

2 Likes

We agree it should fail validation. We are working on changes that should catch this and other schema errors. Thanks for the clear case!

I would like to add, if you use a code editor, such as VS Code, it is now possible to Lint your code very accurately. CircleCI Schema Validator (linter)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.