CircleCI-Public / CircleCI-Public/circleci-cli

`circleci config validate` misses invalid job name in workflow if workflow is skipped by default

Open
#844 1 comment 0 reactions 1 assignee Claimed by @JulesFaucherre View on GitHub
bug
Dominant language
Go
Stars
459
Forks
255
Avg merge
1d 4h
Merged PRs (30d)
59

Description

## Meta:

**CircleCI CLI Version:**

`0.1.23391+5cbf90e (homebrew)` (Mac) and `0.1.23241` (Linux)

**Operating System:**

MacOS and Linux

---

## Current behavior:

If you have config like this:
```yaml
version: 2.1

jobs:
job1:
docker:
- image: cimg/base
steps:
- run: echo hello
job2:
docker:
- image: cimg/base
steps:
- run: echo world

parameters:
run_invalid:
type: boolean
default: false

workflows:
invalid:
when: << pipeline.parameters.run_invalid >>
jobs:
- job1:
name: job_renamed
- job2:
requires:
- job1 # Error is here, should be `job_renamed`
```

`circleci config validate` says the config is valid, even though it's not.

A real-world failure: https://app.circleci.com/pipelines/github/color/color/275733

## Expected behavior:

`circleci config validate` should flag the invalid job name in the `requires`.

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

Unsure

## Additional Information:

The config is properly flagged as invalid if I flip the default value of `run_invalid` from `false` to `true`

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.