Comments (5)
@felicianotech I think because we aren't performing config schema checks.
The build-agent CLI has the original schema and when you run config validate
it will check it against that schema producing these errors:
Error: 1 error occurred:
* Config file is invalid:
at jobs: docker:jj: Additional property docker:jj is not allowed
However, unless I bump the config version to 2.1, I just get back the same config as "valid", as you saw.
from circleci-cli.
This seems to be valid YAML:
marc@blaster ~/tmp $ pbpaste > felicianotech.yml
marc@blaster ~/tmp $ irb
irb(main):001:0> require 'yaml'
=> true
irb(main):002:0> pp YAML.load(File.read('foo.yml'))
{"version"=>2,
"jobs"=>
{"build"=>
{"docker"=>[{"image"=>"cibuilds/hugo:0.46"}],
"docker:jj"=>nil,
"steps"=>
["checkout",
{"run"=>
{"name"=>"Build Website With Hugo", "command"=>"echo \"Hi\""}}]}}}
from circleci-cli.
This is valid yaml and valid schema.
Yaml doesn't dictate minimum or maximum amount of whitespace for separating different levels, so 1-space indentation is the same as 2 or 3 space indentation. You can mix tabs and spaces as well, for better or for worse.
We allow for unexpected keys. We have to balance two things with unexpected keys
- a key like
docker:jj:
is most likely a typo when I glance at this config - We've allowed and encouraged use of yaml anchors. If we disallow for arbitrary keys under
build:
, that could break currently valid builds where they use a meaningless* section likedocker_shared:
at the same level asdocker
.
- meaningless as in that section carries no meaning to our execution environment
from circleci-cli.
This also passes for having a docker:
key with no image specified.
I understand what you're saying, but these would be clear mistakes that will fail when we try to run the config. The whole point of the validator is to prevent having to take a config all the way to execution to find a mistake.
How I see it, if a CircleCI config, when run by the executor, fails with an error. It should fail in the validator. Specifically being syntax and scheme.
I don't think the validator should go as far as verifying Docker images exists for example.
from circleci-cli.
That's a good point and I agree: the schema should check for all decidable errors given compilation-time information. I've added this to the teams backlog.
from circleci-cli.
Related Issues (20)
- Change `.circleci` home directory location with an Environment variable HOT 3
- Allow configuring http client timeout HOT 2
- [Feature Request] Add number of Active tasks in "runner instance list" command
- Wrong version of circleci inside local execution env HOT 2
- CircleCI Orb Init Error Misleading HOT 2
- Unable to start job with private images using `circleci local execute`
- docker: Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /tmp/3966974312_circleci_config.yml. HOT 1
- IN1-GOLANG-GITHUBCOMCLOUDFLARECIRCLPKEKYBERINTERNALCOMMON-6150686 - github.com/cloudflare/circl
- CircleCI CLI policy test command missing timestamp in JUnit output HOT 2
- Set "maintainer" label for Docker image HOT 2
- Json unmarshall error HOT 2
- Error: Unable to validate config HOT 4
- Clarify `orb validate` and `config validate` scope of validation HOT 1
- Infinite install bug HOT 2
- Provide mac arm64 release asset
- unable to execute local job on mac m1 pro HOT 2
- invalid character 'I' looking for beginning of value HOT 13
- ` local execute build` command fails when sidecar is present and using the latest docker version
- circleci config pack command is not working with latest version (v0.1.28363) HOT 2
- Orb validation fails HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circleci-cli.