[cli] [servenv] migrate --service_map and pprof flags to pflag#11179
Merged
ajm188 merged 4 commits intovitessio:mainfrom Sep 7, 2022
Merged
[cli] [servenv] migrate --service_map and pprof flags to pflag#11179ajm188 merged 4 commits intovitessio:mainfrom
--service_map and pprof flags to pflag#11179ajm188 merged 4 commits intovitessio:mainfrom
Conversation
added 3 commits
September 7, 2022 09:10
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>
Contributor
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
| for _, tt := range tests { | ||
| t.Run(tt.arg, func(t *testing.T) { | ||
| got, err := parseProfileFlag(tt.arg) | ||
| got, err := parseProfileFlag(strings.Split(tt.arg, ",")) |
Member
There was a problem hiding this comment.
TestParseProfileFlag fails for the subtest with "" as profile now because len(strings.Split("", ",")) is 1 and not 0 ...
deepthi
approved these changes
Sep 7, 2022
| // 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: | ||
| // |
Contributor
Author
There was a problem hiding this comment.
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 🤷
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I unexported
CheckServiceMapbecause 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