[FLI-938] Allow passing a starting dir `flipt validate`
markphelps opened this issue · comments
Problem
Currently, the validate cli command always scans from the current directory, looking for features.yml
/ .flipt.yml
files
Ideal Solution
It would be nice if we could take in an optional path (ie:flipt validate /tmp
) to use as starting point so that you first don't have to cd
into the target directory before running flipt validate
Search
- I searched for other open and closed issues before opening this
Additional Context
No response
Currently flipt validate
allows to specify the files relatively currently directory. You could run it like flipt validate production.yml extra/feature.yml
.
Lines 71 to 75 in cc9c0ec
There is no documentation about this use case. @GeorgeMac could you please bring some light on it?
@erka When flipt validate
was initially implemented it only supported taking explicit paths in this way.
This was back when it was a prototype for the GitHub action.
We quickly updated it to make the zero argument form index aware, so that it was inline with how the backends worked, but still backwards compatible. So that flipt validate
was a simple catch all, that worked exactly how running git or local over the same directory does.
However, there was a user already taking advantage of the original form, so we left the explicit paths in.
You're right we don't have the old form (explicit paths) document here https://www.flipt.io/docs/cli/commands/validate#behavior on in the CLI help text.
My suggestion here would be to add a flag --workdir
or -w
instead for this behaviour.
@markphelps are you fine with George's suggestion?
@markphelps are you fine with George's suggestion?
Yes I think that makes sense!