firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.03k stars 115 forks source link

Revisit if `types` is indeed an illegal name #1263

Closed hverlin closed 1 week ago

hverlin commented 3 weeks ago

Minimal .gitlab-ci.yml illustrating the issue

---
types:
  script:
    - echo "test"

test:
  needs: [types]
  script:
    - echo "test"

Expected behavior According to the documentation, it should not work. https://docs.gitlab.com/ee/ci/jobs/#job-name-limitations

However, it does work: https://gitlab.com/hverlin/gitlab-ci-local-tests/-/pipelines/1324968259

Probably this is a limitation that they forgot to remove from the documentation?

> gitlab-ci-local
needs: [types] for test could not be found

Two solutions:

ANGkeith commented 3 weeks ago

hmm,

(personally i would prefer the 2nd solution, because can't really tell if gitlab.com forget to remove or are they reserving those word for future use

ANGkeith commented 3 weeks ago

speaking of which, gitlab-ci-local/src/job.ts

our list seemed to deviate a little from https://docs.gitlab.com/ee/ci/jobs/#job-name-limitations

ANGkeith commented 3 weeks ago

The following all works too eventhough the docs says it's illegal lols..

---
"true":
  script:
    - echo "test"

"false":
  script:
    - echo "test"

"nil":
  script:
    - echo "test"
hverlin commented 3 weeks ago

Filed an issue https://gitlab.com/gitlab-org/gitlab/-/issues/467170