CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
411 stars 232 forks source link

`circleci config process` removes jobs from workflows with `only`-branch filters #907

Closed jeppeman closed 1 year ago

jeppeman commented 1 year ago

Meta:

CircleCI CLI Version:

I've tried with 0.1.16192 and 0.1.25725.

Operating System:

Mac OSX and Ubuntu.

CircleCI CLI Diagnostic:

diag

Current behavior:

Jobs in workflows that have only-branch filters are removed when running circleci config process on a packed config. Note that this does not happen if the branch filter is ignore.

Expected behavior:

The jobs should not be removed from the output of process.

When did this begin / Was this previously working?:

It started happening yesterday (Apr. 10).

Additional Information:

Here is a minimal reproducible example: https://github.com/jeppeman/circle-ci-config-error-repro

kriim commented 1 year ago

We are also seeing this since week.

We tried a few things, and one thing that worked was replacing only with ignore, then running circleci config pack, and afterwards replacing ignore with only everywhere.


I don't know in how far this might be related, but since today we also see other issues with the config packing.

It introduces random differences in indents, making the configuration invalid.

It swaps order of entries in a way that makes the configuration invalid.

For example it converts this:

docker:
  - image: cimg/openjdk:11.0.9
    environment:
      GRADLE_OPTS: "-Dorg.gradle.daemon=false"

to this

docker:
- environment:
    GRADLE_OPTS: -Dorg.gradle.daemon=false
  image: cimg/openjdk:11.0.9
jeppeman commented 1 year ago

Since no one from CircleCI seems inclined to answer here, I'll go ahead and say that this has been fixed now. @kriim, can you verify this on you end as well?

kriim commented 1 year ago

@jeppeman I just tried once more and now it produces a valid config.yml again.