At the moment CLI assumes that when user is authenticated it should use remote config only. We want to change that to fallback to local config so that the user will get validation results in more cases and also to keep previous behavior (as now being authenticated but not having project configured will break validation).
How it should behave:
No flags passed, use Implicit Remote > Implicit Local > Default-and-never-fail;
--config ./monokle-custom.yaml for Explicit Local-or-fail;
--project ProjectIdentifier for Explicit remote-or-fail;
Passing both --config and --project, it should try to read both Explicit Remote > Explicit Local-or-fail`.
--framework use framework based config and ignore other flags;
--api-token behaves as user being authenticated, doesn't change config precedence (so it will work as described above depending on what other flags where passed).
While:
Explicit Remote - means remote policy fetched for specific project (based on user input, user passing project slug).
Implicit Remote - remote config fetched based on local repo data (git provider, github repo owner and name) matched with Monokle Cloud project.
Explicit Local - local config file specified by user input (as path to file).
Implicit Local - means local monokle.validation.yaml in the root of validated directory.
Default - default CLI config which is part of the package (monokle.validation.yaml in package root).
At the moment CLI assumes that when user is authenticated it should use remote config only. We want to change that to fallback to local config so that the user will get validation results in more cases and also to keep previous behavior (as now being authenticated but not having project configured will break validation).
How it should behave:
Implicit Remote > Implicit Local > Default
-and-never-fail;--config ./monokle-custom.yaml
forExplicit Local
-or-fail;--project ProjectIdentifier
forExplicit remote
-or-fail;--config
and--project
, it should try to read bothExplicit Remote > Explicit Local
-or-fail`.--framework
use framework based config and ignore other flags;--api-token
behaves as user being authenticated, doesn't change config precedence (so it will work as described above depending on what other flags where passed).While:
Explicit Remote
- means remote policy fetched for specific project (based on user input, user passing project slug).Implicit Remote
- remote config fetched based on local repo data (git provider, github repo owner and name) matched with Monokle Cloud project.Explicit Local
- local config file specified by user input (as path to file).Implicit Local
- means localmonokle.validation.yaml
in the root of validated directory.Default
- default CLI config which is part of the package (monokle.validation.yaml
in package root).