firecow / gitlab-ci-local

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

Implement plain `parallel:` keyword #1229

Closed PigeonF closed 1 month ago

PigeonF commented 1 month ago

See https://docs.gitlab.com/ee/ci/yaml/#parallel.

When writing the test I saw that there was some verification of the schema (e.g. I could not set parallel: 1), but when running gitlab-ci-local directly it works fine. Is this intended behaviour? There is now an edge case here, which I cannot test for at the moment: Setting parallel: 1 works on https://gitlab.com, but I cannot write a test for it because it does not match the official schema (which is apparently wrong, I have filed https://gitlab.com/gitlab-org/gitlab/-/issues/462979).

This fixes #1227 .

ANGkeith commented 1 month ago

When writing the test I saw that there was some verification of the schema (e.g. I could not set parallel: 1), but when running gitlab-ci-local directly it works fine. Is this intended behaviour?

~Currently, the schema validation is disabled by default~

~If you enable it, ie.~ ~export GCL_ENABLE_JSON_SCHEMA_VALIDATION=true~

~gitlab-ci-local should fail~

EDIT: After reviewing the mr, i realize I have misunderstood what you're saying. Yes, this (json schema validation enabled by default in test env but disabled by default in cli env) is intended behavior. https://github.com/firecow/gitlab-ci-local/pull/1167#discussion_r1558871053

ANGkeith commented 1 month ago

on a side note, @PigeonF i think you're a collaborator right?

do you mind pushing directly into github.com/firecow ?

ANGkeith commented 1 month ago

Setting parallel: 1 works on https://gitlab.com/, but I cannot write a test for it because it does not match the official schema

we've copied the json schema instead of pulling from gitlab.com (maybe we should ?),

but for now i think you can fix the schema @ https://github.com/firecow/gitlab-ci-local/blob/master/src/schema/schema.json#L1275

and your test should be good to go

PigeonF commented 1 month ago

on a side note, @PigeonF i think you're a collaborator right?

do you mind pushing directly into github.com/firecow ?

Is there some way to change the source branch of the PR directly? Or do I close this one and create a new one from the new branch?

ANGkeith commented 1 month ago

on a side note, @PigeonF i think you're a collaborator right? do you mind pushing directly into github.com/firecow ?

Is there some way to change the source branch of the PR directly? Or do I close this one and create a new one from the new branch?

for this PR it's fine, but for future PR, will be nice if you push directly to github.com/firecow

ANGkeith commented 1 month ago

final small refactoring https://github.com/PigeonF/gitlab-ci-local/pull/1 to remove all the ??