-
Notifications
You must be signed in to change notification settings - Fork 40k
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
bind filenames var instead of looking up #12743
Conversation
GCE e2e build/test passed for commit f7c78bd1d0529b5f1ce7e74fbfd0682af96b8261. |
34318fa
to
1036902
Compare
GCE e2e build/test passed for commit 34318fa4991ba16dbc3cee65dc7a91582918280b. |
GCE e2e build/test passed for commit 1036902576a900d041cb098a73064af1cbafb7ec. |
GCE e2e build/test passed for commit b99bf30b9858f753e71751273d7cba1dbc75b6c3. |
I say NAK. We use this syntax for everything. See all of the other calls to GetFlag*
And this is AFTER you removed filename.... |
Looking up via name as opposed to binding a variable to flag is causing various parts of our system to start depending on having flagsets (and particular flagsets at that) deeper into the stack that they should. The data is important, but the particular flag used to set is not. This is producing instability downstream as the data dependency chain is unclear due to the magic container properties of certain flagsets. You can see the effect of this in flags like Given an intent to have composable commands, we cannot continue to depend upon locating particular flags by name in particular flagsets propagated through the stack. |
@smarterclayton Anything to add? This contributes to rebase pain as we see failures depending on exactly which branches we take through certain codepaths that rely on finding the correct flagset containing flags with particular names. |
See also #7311 for the intent to have composable units that decoupled from flags. Binding to variables to makes this transition easier because it forces the data flow to be explicit. |
Making 'filename' a special case is not the answer. I'm sticking with my NAK, Having an options structure seems much more reasonable and I'd be a fan/fine with that. We already do it with config, attach, exec... I'd say expand that concept not this one off.... |
moving the binding to a local var is a step in the direction of an options struct... I agree this isn't where we want to end up, but I think this is a contained change in the right direction |
@liggitt it's not though, it's a hack. Create an options struct with a single option, then I'd call it a step in the right direction. |
Are you demanding options structs for everything before accepting this? Would a "get no worse" approach be ok? Such an approach would require the |
My take:
Seems like it will be small addition to this patch... |
Labelling this PR as size/L |
@eparis refactored to have a stub |
GCE e2e build/test passed for commit f1b81ff. |
GCE e2e build/test passed for commit d54639b5fcbee4e4ae74c524ae58be913ee24d18. |
thank you @deads2k do you think it is a (minor) improvement? |
I do. It makes gathering the low hanging fruit more obvious. I may do the obvious flags for a few commands in followups. |
@k8s-bot test this [testing build queue, sorry for the noise] |
GCE e2e build/test passed for commit f1b81ff. |
Automatic merge from SubmitQueue |
Auto commit by PR queue bot
The elimination of
util.StringList
here 7cbb52c#diff-4b43cea33f490ce3393439029e5712ee, removed the variable binding as side effect. This restores that binding.Binding flags to variables makes it easier for the implementation of commands to avoid coupling to the particular flagsets that originate them. Decoupling that connection makes composing commands as helpers functions much easier.