CircleCI-Public / CircleCI-Public/circleci-cli

`config validate` does not pick up keyword typo(s) in condition stanzas

Open
#659 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Go
Stars
459
Forks
255
Avg merge
1d 4h
Merged PRs (30d)
59

Description

## Meta:

**CircleCI CLI Version:**

```console
$ circleci version

0.1.16122+a170bd3 (homebrew)
```

**Operating System:**
MacOS 11.6 (Apple M1)

**CircleCI CLI Diagnostic:**

```console
$ circleci diagnostic

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /Users/kelvin/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
OK, got a token.
Trying an introspection query on API...
Ok.
Hello, ktwl 41.
```

---

## Current behavior:

I had a config file where there was a typo (using `equals` instead of `equal` in a condition setup).

```console
$ cat test.yml

version: 2.1

jobs:
foo:
docker:
- image: cimg/base:stable
steps:
- checkout

workflows:
version: 2
master:
when:
equals: [ master, master ]
jobs:
- foo

$ circleci config validate test.yml

Config file at test.yml is valid.
```

However, when running `circleci config validate`, the validator deems it is valid, without raising an error about the `equals` keyword being incorrect or unrecognized.

## Expected behavior:

I was expecting that the validator would exit 1 and inform the user that there was a typo in `equal` for example.

## When did this begin / Was this previously working?:

this is my first time noticing this.

## Additional Information:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.