Found errors in your .gitlab-ci.yml but the file is valid via CI Lint

Summary

Hey 👋

I have this weird issue, CI lint tells me my config is valid. When I push the file, the pipeline tells me it's invalid and ask me to validate it with CI Lint 😕

Steps to reproduce

The file .gitlab-ci.yml:

default:
    image: node:lts

stages:
    - cache
    - build

create-cache-a:
    stage: cache
    only:
        - schedules
    script:
        - echo 'a' > log.txt
    artifacts:
        expire_in: 2 hours
        paths:
            - log.txt

create-cache-b:
    stage: cache
    except:
    only:
        - schedules
    script:
        - echo 'b' > log.txt
    artifacts:
        expire_in: 2 hours
        paths:
            - log.txt


build-a:
    stage: build
    needs: [create-cache-a]
    script:
        - echo 123


build-b:
    stage: build
    needs: [create-cache-b]
    script:
        - echo 123

I tested it also with this format but still ok only on CI Lint:

    needs:
        - job: create-cache-a
          artifacts: true

What is the current bug behavior?

CI Lint will validate this file.
The pipeline will tell you it's invalid.

What is the expected correct behavior?

The pipeline should validate the file as it's done by CI Lint
_or_
CI lint is wrong and it should validate the file as it's done inside the pipeline.

They should use the same validator.

Relevant logs and/or screenshots

Inside the pipeline:

Screenshot_from_2020-02-19_12-14-20

Inside CI Lint

Screenshot_from_2020-02-19_12-14-40

Output of checks

Tested with our gitlab and gitlab.com.

  • Our Gitlab GitLab Enterprise Edition 12.7.5-ee
  • Gitlab.com GitLab Enterprise Edition 12.7.0-pre 4033cb0e