Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleCI schema does not allow a "machine" key in a "job" - disagrees with CircleCI docs #3768

Open
jclerman opened this issue May 7, 2024 · 4 comments
Labels
help wanted issue:bug Report errors or unexpected behavior (auto-generated by issue forms)

Comments

@jclerman
Copy link

jclerman commented May 7, 2024

Area with issue?

JSON Schema

✔️ Expected Behavior

I have a CircleCI config file in which I have jobs defined (in part) like:

jobs:
  my_job:
    machine:
      image: ubuntu-2004:2024.01.2
      docker_layer_caching: true

The current version of the CircleCI schema served at:
https://json.schemastore.org/circleciconfig.json

Does not allow that though - instead it wants a pre-defined (via an "exectors:" stanza) executor, and no longer allows the "machine:" key directly under a job definition.

This is in conflict with the current CircleCI docs, specifically the example shown here: https://circleci.com/docs/executor-intro/#linux-vm
and copied here:

jobs:
  build: # name of your job
    machine: # executor type
      image: ubuntu-2004:202010-01 # # recommended linux image - includes Ubuntu 20.04, docker 19.03.13, docker-compose 1.27.4

    steps:
        # Commands run in a Linux virtual machine environment

Consequently, I'm getting complaints from PyCharm, which is following the schema defined in this repo.

❌ Actual Behavior

PyCharm is flagging my CircleCI config as invalid, but it's working just fine at CircleCI.

YAML or JSON file that does not work.

Minimal example .circleci/config.yaml illustrating the problem:

version: 2.1

jobs:
  build:
    machine:
      image: ubuntu-2004:2024.01.2
      docker_layer_caching: true
    steps:
      - checkout
      - run: sudo apt-get update

 
workflows:
  build_and_deploy:
    jobs:
      - build:
          filters:
            tags:
              only: /.*/

IDE or code editor.

IntelliJ and it's derivatives

Are you making a PR for this?

No, someone else must create the PR.

@jclerman jclerman added the issue:bug Report errors or unexpected behavior (auto-generated by issue forms) label May 7, 2024
@pieterocp
Copy link
Contributor

Hey @jclerman from going through the changes from #3810 , I think that your scenario is covered and should now be marked as valid.

@jclerman
Copy link
Author

@pieterocp agreed - my examples are validating now, as expected. Marking this issue closed.

@st11x
Copy link

st11x commented Sep 1, 2024

@pieterocp agreed - my examples are validating now, as expected. Marking this issue closed.

@jclerman I'm using VSCode and this is still an issue for me. How do you get it to validate? Thanks.

@jclerman
Copy link
Author

jclerman commented Sep 1, 2024

Actually this started failing for me again at some point after the issue was closed. I haven't tracked down the offending change. I'm using Pycharm, but I suspect that the IDE doesn't matter, it's the schema that has regressed.

@hyperupcall hyperupcall reopened this Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted issue:bug Report errors or unexpected behavior (auto-generated by issue forms)
Projects
None yet
Development

No branches or pull requests

4 participants