gitlab-ci-local
gitlab-ci-local copied to clipboard
Add --ensure-needs option
Is your feature request related to a problem? Please describe.
Hello, is it possible, when I specify the --needs
option, to run needed job only the first time and skip them after ?
Describe the solution you'd like
Something like gitlab-ci-local MyJob --needs-if-missing
Additional context I have a pipeline, with a Lint job that need to install dependencies, but I don't want to download them each time, because this lasts for 1 minute
thank you
Well, it's possible I would consider it extremely nice-to-have, though 😁
In general, you want your deps install job to be smart about reinstallation via caches n' other techniques.
Yes but in a classic pipeline when we need to run a job again it just use what was exported by previous job, we don't need to run all needs in my case, I want to add the lint job in the pre-commit hook of my repo but I don't want users lost 1 minute for each commit, without asking them to run needs before the first commit
Won't if [ -f "node_modules"]; then gitlab-ci-local eslint; fi
do just that?
But yeah, I get your point.
What could be a good name for such a cli option?
--ensure-needs
?
yes I could check if .gitlab-ci-local/artifacts/my_needed_job
exists, it will ask a custom command in the pre-commit config but I can do that
otherwise --ensure-needs
is a good name :+1:
Hello! Still interested by the feature 😄 Thank you
Hello @firecow Do you think the feature can be added in a near future ?
I can't give any estimates. I only work on this project when i got time.
I understand, thank you
We should call the option --ensure-artifacts
shouldn't we?
Because dependencies
can also make a job "want" artifacts.
as long as needed jobs are included it's good for me