Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

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

Open
@noaabarki

Description

@noaabarki

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgood first issueGood for newcomersup for grabsLooking for a contributor to take this task

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions