-
Notifications
You must be signed in to change notification settings - Fork 702
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
[WIP] [FlyteCTL] enable kubectl-like configuration from multiple files #6292
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
…like-config Signed-off-by: machichima <[email protected]>
Code Review Agent Run #38bf67Actionable Suggestions - 1
Review Details
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6292 +/- ##
===========================================
+ Coverage 33.82% 58.42% +24.60%
===========================================
Files 1329 938 -391
Lines 147808 71150 -76658
===========================================
- Hits 49992 41571 -8421
+ Misses 92974 26427 -66547
+ Partials 4842 3152 -1690
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changelist by BitoThis pull request implements the following key changes.
|
@@ -50,7 +50,7 @@ func (AttrUpdateConfig) mustMarshalJSON(v json.Marshaler) string { | |||
// flags is json-name.json-sub-name... etc. | |||
func (cfg AttrUpdateConfig) GetPFlagSet(prefix string) *pflag.FlagSet { | |||
cmdFlags := pflag.NewFlagSet("AttrUpdateConfig", pflag.ExitOnError) | |||
cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") | |||
cmdFlags.StringSliceVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") |
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.
The type of AttrFile
is being changed from string
to []string
(via StringSliceVar
), but the struct definition in the related files still defines it as string
. This will cause type mismatch issues when accessing this field.
Code suggestion
Check the AI-generated fix before applying
cmdFlags.StringSliceVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") | |
cmdFlags.StringVar(&DefaultUpdateConfig.AttrFile, fmt.Sprintf("%v%v", prefix, "attrFile"), DefaultUpdateConfig.AttrFile, "attribute file name to be used for updating attribute for the resource type.") |
Code Review Run #38bf67
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
Signed-off-by: machichima <[email protected]>
Code Review Agent Run #7699d3Actionable Suggestions - 0Review Details
|
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Signed-off-by: machichima <[email protected]>
Code Review Agent Run #988f93Actionable Suggestions - 1
Review Details
|
if reflect.ValueOf(v).IsNil() { | ||
return reflect.Zero(t.Elem()).Interface() | ||
} else { | ||
return reflect.ValueOf(v).Interface() |
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.
The else
branch in elemValueOrNil
returns reflect.ValueOf(v).Interface()
which doesn't dereference the pointer. This will return the pointer itself rather than the value it points to. Consider using reflect.ValueOf(v).Elem().Interface()
to properly dereference the pointer.
Code suggestion
Check the AI-generated fix before applying
return reflect.ValueOf(v).Interface() | |
return reflect.ValueOf(v).Elem().Interface() |
Code Review Run #988f93
Should Bito avoid suggestions like this for future reviews? (Manage Rules)
- Yes, avoid them
Tracking issue
#6237
Why are the changes needed?
flytectl update workflow-execution-config
can only accept one--attrFile
at a time now, which is not convenient especially over multiple projects / domains.What changes were proposed in this pull request?
Three different configuration ways are added (analogous to how
kubectl
works):--attrFile
(e.g.flytectl update workflow-execution-config --attrFile file1.yaml --attrFile file2.yaml
--attrFile
(e.g.flytectl update workflow-execution-config --attrFile folder/
How was this patch tested?
Labels
Please add one or more of the following labels to categorize your PR:
This is important to improve the readability of release notes.
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This PR enhances flytectl's workflow execution configuration by enabling multiple attribute file configurations, similar to kubectl. It refactors the configuration structure and command logic to handle file lists instead of single files, simplifies the update process, and improves error messaging. The changes include revised flag definitions, updated data types, and improved test cases.Unit tests added: True
Estimated effort to review (1-5, lower is better): 4