Closed haikusw closed 4 years ago
It seems like there must be some validation code in the hosted CircleCI repo that verifies against a schema and that the command line tool isn't but could potentially benefit from sharing that code.
Hi @haikusw – the underlying problem here is that the 2.0 config format has schema problems that we addressed in config 2.1 - this post explains a little more. If you upgrade to config version: 2.1
you will get far more robust schema checking. If you upgrade to version 2.1 does the tool behave as expected?
Description
The
circleci
command line toolconfig verify
command doesn't seem to do a very thorough job or actually validate against the configuration file schema in the way that the actual build system does.For example, the following config file passes verification:
config file:
however "version" is misspelled as "vesion" and gets a warning in the "Configuration" section of the CircleCI dashboard:
It seems like the
circleci config validate
command should emit these same warnings.More importantly though, a config file which will cause a build failure also passes
circleci config validate
:-/If you put fewer spaces in your indentation for the
- run
entry like this:it again passes validation:
but the build will fail with a ton of issues in the output:
Configuration files which cause the build system to fail like this don't seem like they should bass a
circleci config validate
It also seems like the indentation after a
- run:
of two spaces -- like it is everywhere else -- would be a reasonable and more consistent requirement rather than the 4 spaces it seems to be requiring now (?).Checked the version of the circleci CLI I installed via homebrew:
and does appear that Homebrew doesn't is behind by a minor version. However, the only commits between that version (1.5810) and the current version (1.5830) is a contributor added to CONTRIBUTORS.md and the merge of that PR).
Checked the diagnostics to make sure
circleci
cli was working properly:and it appears to be.