datree
datree copied to clipboard
Read test commands flags from ./config.yaml file
Describe the solution you'd like
Read all test commandās flags from both command and the config file(~/.datree/config.yaml
). The main feature is to allow users to set permanent yet custom flags in their config local settings.
āHow to implementationā Suggestion
-
Make sure all flags and options are in
TestCommandFlags
(wrapTestCommandFlags
inTestCommandOptions
as you see best). -
Change
localConfig.GetLocalConfiguration()
to return all the options from./config.yaml
file. -
Use
GetLocalConfiguration()
outside the scope of Cobraās commandRunE
and initiate flags with local config. Eventually, the outcome should be something like// get local config options from local.yaml file localConfig := context.LocalConfig.GetLocalConfiguration() // initiate flags with localConfig settings flags := NewTestCommandFlags(localConfig) testCommand := &cobra.Command{ ... RunE: func(cmd *cobra.Command, args []string) error {...}, } // overwrite flags with the command's execution flags testCommandFlags.AddFlags(testCommand) return testCommand
Requirements Golang basic level.
Do we have to just paste this code
Hey @noaabarki Iād be interested in taking this on
Hi @laneia! That's amazing, you got it :)
Will this cause us to override the flags without the ability to change it via the cli?
To be more specific, I will be able to manually add schema-version
flag to config.yaml
but will not have the ability to use the cli to override it using datree config set schema-version
Or even check what is set using datree config get schema-version
Will this cause us to override the flags without the ability to change it via the cli?
To be more specific, I will be able to manually add
schema-version
flag toconfig.yaml
but will not have the ability to use the cli to override it usingdatree config set schema-version
Or even check what is set usingdatree config get schema-version
As with most tools, I think we want the inline flags to merge & override the flags from config.yaml
@noaabarki I would like to work on this issue :)
You are the best! š„³ It's yours.
Hey @noaabarki, didn't have much time to work on this task in the past few weeks :(
Wanted to get it done within the day that I was assigned but got a bit stuck, will try to get it done this week.
@noaabarki is anyone working on this issue?
@amustaque97 Nope, feel free to give it a shot :)
@noaabarki is there anyone working on this issue? I would like to work on this : )
@Abhi-y2003 go for it!