-
Notifications
You must be signed in to change notification settings - Fork 28
Add FF for custom states call (AST-80216) #1043
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ func NewResultsPredicatesCommand(resultsPredicatesWrapper wrappers.ResultsPredic | |
| } | ||
| triageShowCmd := triageShowSubCommand(resultsPredicatesWrapper) | ||
| triageUpdateCmd := triageUpdateSubCommand(resultsPredicatesWrapper, featureFlagsWrapper) | ||
| triageGetStatesCmd := triageGetStatesSubCommand(customStatesWrapper) | ||
| triageGetStatesCmd := triageGetStatesSubCommand(customStatesWrapper, featureFlagsWrapper ) | ||
|
|
||
|
|
||
| addFormatFlagToMultipleCommands( | ||
|
|
@@ -32,7 +32,7 @@ func NewResultsPredicatesCommand(resultsPredicatesWrapper wrappers.ResultsPredic | |
| return triageCmd | ||
| } | ||
|
|
||
| func triageGetStatesSubCommand(customStatesWrapper wrappers.CustomStatesWrapper) *cobra.Command { | ||
| func triageGetStatesSubCommand(customStatesWrapper wrappers.CustomStatesWrapper, featureFlagsWrapper wrappers.FeatureFlagsWrapper) *cobra.Command { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function signature for |
||
| triageGetStatesCmd := &cobra.Command{ | ||
| Use: "get-states", | ||
| Short: "Show the custom states that have been configured in your tenant", | ||
|
|
@@ -43,16 +43,21 @@ func triageGetStatesSubCommand(customStatesWrapper wrappers.CustomStatesWrapper) | |
| $ cx triage get-states --all | ||
| `, | ||
| ), | ||
| RunE: runTriageGetStates(customStatesWrapper), | ||
| RunE: runTriageGetStates(customStatesWrapper, featureFlagsWrapper), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| } | ||
|
|
||
| triageGetStatesCmd.PersistentFlags().Bool(params.AllStatesFlag, false, "Show all custom states, including the ones that have been deleted") | ||
|
|
||
| return triageGetStatesCmd | ||
| } | ||
|
|
||
| func runTriageGetStates(customStatesWrapper wrappers.CustomStatesWrapper) func(*cobra.Command, []string) error { | ||
| func runTriageGetStates(customStatesWrapper wrappers.CustomStatesWrapper, featureFlagsWrapper wrappers.FeatureFlagsWrapper,) func(*cobra.Command, []string) error { | ||
| return func(cmd *cobra.Command, _ []string) error { | ||
| flagResponse, _ := wrappers.GetSpecificFeatureFlag(featureFlagsWrapper, wrappers.CustomStatesFeatureFlag) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Error handling for |
||
| if !flagResponse.Status { | ||
| return errors.Errorf("%s", "Fetching custom states is not available for your tenant") | ||
| } | ||
|
|
||
| includeDeleted, _ := cmd.Flags().GetBool(params.AllStatesFlag) | ||
| states, err := customStatesWrapper.GetAllCustomStates(includeDeleted) | ||
| if err != nil { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra space before the closing parenthesis. Please remove it for consistency.