-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
roachtest: clean up command-line flags #112078
Conversation
This isn't urgent and I will be out next week in case there is any fallout; I will pick it back up when I come back. |
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Updated, ready for review. |
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.
Thanks for the refactor!
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @DarrylWong and @herkolategan)
The code around command-line flags is pretty messy: they're defined in many places; the name and description of a flag are far away from the variable; the variable names look like local variables and in many cases it's not obvious we're accessing a global. This commit moves all flags to a separate subpackage, `roachtestflags`, making all uses of global flags obvious. We also add a bit of infrastructure to allow defining all information about a flag right next to where the variable is declared. We also provide a `Changed()` function that determines if a flag value was changed (without the caller having to use the Command or even the flag name). There should be no functional changes (just some cosmetic improvements to the flag usage texts). Epic: none Release note: None
Build succeeded: |
This PR is only for the last commit. The rest are #111811
roachtest: clean up command-line flags
The code around command-line flags is pretty messy: they're defined in
many places; the name and description of a flag are far away from
the variable; the variable names look like local variables and in many
cases it's not obvious we're accessing a global.
This commit moves all flags to a separate subpackage,
roachtestflags
, making all uses of global flags obvious. We also adda bit of infrastructure to allow defining all information about a flag
right next to where the variable is declared.
We also provide a
Changed()
function that determines if a flag valuewas changed (without the caller having to use the Command or even the
flag name).
There should be no functional changes (just some cosmetic improvements
to the flag usage texts).
Epic: none
Release note: None