Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read test commands flags from ./config.yaml file #385

Open
noaabarki opened this issue Jan 18, 2022 · 12 comments
Open

Read test commands flags from ./config.yaml file #385

noaabarki opened this issue Jan 18, 2022 · 12 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers up for grabs Looking for a contributor to take this task
Projects

Comments

@noaabarki
Copy link
Contributor

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(wrap TestCommandFlags in TestCommandOptions as you see best).

  • Change localConfig.GetLocalConfiguration() to return all the options from ./config.yaml file.

  • Use GetLocalConfiguration() outside the scope of Cobra’s command RunE 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.

@noaabarki noaabarki added enhancement New feature or request good first issue Good for newcomers up for grabs Looking for a contributor to take this task labels Jan 18, 2022
@github-actions github-actions bot added this to To Do in Datree Jan 18, 2022
@RishiKumarRay
Copy link

Do we have to just paste this code

@laneia
Copy link

laneia commented Feb 1, 2022

Hey @noaabarki I’d be interested in taking this on

@noaabarki
Copy link
Contributor Author

Hi @laneia! That's amazing, you got it :)

@adifayer adifayer moved this from To Do to Selected for development in Datree Feb 2, 2022
@dimabru
Copy link
Contributor

dimabru commented Feb 2, 2022

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

Datree automation moved this from Selected for development to Done Apr 7, 2022
@noaabarki noaabarki reopened this Apr 7, 2022
@royhadad
Copy link
Contributor

royhadad commented Apr 7, 2022

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

As with most tools, I think we want the inline flags to merge & override the flags from config.yaml

@naorpeled
Copy link
Contributor

@noaabarki I would like to work on this issue :)

@noaabarki
Copy link
Contributor Author

You are the best! 🥳 It's yours.

@naorpeled
Copy link
Contributor

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.

@niv1612 niv1612 moved this from Done to To Do in Datree Jul 6, 2022
@naorpeled naorpeled removed their assignment Jul 14, 2022
@amustaque97
Copy link
Contributor

@noaabarki is anyone working on this issue?

@royhadad
Copy link
Contributor

royhadad commented Nov 2, 2022

@amustaque97 Nope, feel free to give it a shot :)

@Abhi-y2003
Copy link

@noaabarki is there anyone working on this issue?
I would like to work on this : )

@eyarz
Copy link
Member

eyarz commented Jun 6, 2023

@Abhi-y2003 go for it!

@eyarz eyarz assigned Abhi-y2003 and unassigned noaabarki Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers up for grabs Looking for a contributor to take this task
Projects
Datree
To Do
Development

No branches or pull requests

9 participants