-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[cli] [servenv] migrate --service_map
and pprof
flags to pflag
#11179
[cli] [servenv] migrate --service_map
and pprof
flags to pflag
#11179
Conversation
Signed-off-by: Andrew Mason <andrew@planetscale.com>
Relates to vitessio#11144. Also converts the flag from our custom `StringListValue` to pflag-native `StringSlice`. Signed-off-by: Andrew Mason <andrew@planetscale.com>
Relates to vitessio#11144. Signed-off-by: Andrew Mason <andrew@planetscale.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
go/vt/servenv/pprof_test.go
Outdated
@@ -45,7 +45,7 @@ func TestParseProfileFlag(t *testing.T) { | |||
} | |||
for _, tt := range tests { | |||
t.Run(tt.arg, func(t *testing.T) { | |||
got, err := parseProfileFlag(tt.arg) | |||
got, err := parseProfileFlag(strings.Split(tt.arg, ",")) |
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.
TestParseProfileFlag
fails for the subtest with ""
as profile now because len(strings.Split("", ","))
is 1 and not 0 ...
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.
💯
@@ -205,6 +205,7 @@ func (t *topoFlags) buildTopology() (*vttestpb.VTTestTopology, error) { | |||
// Annoying, but in unit tests, parseFlags gets called multiple times per process | |||
// (anytime startCluster is called), so we need to guard against the second test | |||
// to run failing with, for example: | |||
// |
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.
nit: why the new newline?
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's something in the updated linter/golang stack that's saying there should be a line break here. this came up in #10946 as well 🤷
Description
I unexported
CheckServiceMap
because no one called it exceptservenv.GRPCCheckServiceMap
. We can re-export it later if anyone ends up needing it, but this is not a breaking change or anything.Part of this involved auditing all the paths that can call
GRPCCheckServiceMap
, which I detail ...here!
We also get to switch away from manually splitting CSVs to using
pflag.StringSliceVar
, which is nice.Related Issue(s)
package go/vt/servenv
#11144Checklist
Deployment Notes