Skip to content
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

slack-vitess-r14.0.5: backport vitessio/vitess#10619 pflag migration #120

Conversation

timvaillancourt
Copy link
Member

Description

This PR backports vitessio#10619 (from v15) in order to reduce friction backporting txthrottler and vtorc backports from v15+, where pflag is used for all command line flag parsing

Currently a significant amount of time backporting > v14 PRs is spent bridging the gap that vitessio#10619 causes. Backporting the pflag migration will help us reduce some backporting toil

cc @ejortegau

Related Issue(s)

vitessio#10619

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

Deployment Notes

* Switch to `pflag` for all parsing

This transparently swaps the cli parsing library used by `internal/flag`
from the standard library `flag` package to `spf13/pflag`.

It also introduces hook points for packages throughout the vitess codebase
to register their flags for either all commands using `servenv` or a
particular subset of commands. This allows these packages to continue to
define their flag variables in a package-private way, but without
polluting the global flagset.

Signed-off-by: Andrew Mason <[email protected]>

* Workaround exit code difference between stdlib `flag` and `pflag`

tl;dr stdlib `flag` has [this][1] and `pflag` does not

[1]: golang/go@dcf0929

Signed-off-by: Andrew Mason <[email protected]>

* adjust test data for difference in spacing between pflag/stdflag

Signed-off-by: Andrew Mason <[email protected]>

* update lingering legacy flag tests

Signed-off-by: Andrew Mason <[email protected]>

* Update vtgate/tabletgateway.go to use new interface to isolate flags, update test data

Signed-off-by: Andrew Mason <[email protected]>

* update flags in java test code

Signed-off-by: Andrew Mason <[email protected]>
@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @ajm188 to sign the Salesforce Inc. Contributor License Agreement.

@timvaillancourt timvaillancourt added v14 upstream-backport An upstream backport labels Aug 28, 2023
@timvaillancourt timvaillancourt marked this pull request as ready for review August 30, 2023 13:06
@timvaillancourt timvaillancourt requested a review from a team as a code owner August 30, 2023 13:06
@github-actions
Copy link

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

@github-actions github-actions bot added the Stale label Sep 30, 2023
@github-actions
Copy link

github-actions bot commented Oct 7, 2023

This PR was closed because it has been stale for 7 days with no activity.

@github-actions github-actions bot closed this Oct 7, 2023
@timvaillancourt timvaillancourt deleted the slackport-10619-slack-vitess-r14.0.5 branch October 9, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant