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

roachtest: clean up command-line flags #112078

Merged
merged 1 commit into from
Nov 6, 2023
Merged

Conversation

RaduBerinde
Copy link
Member

@RaduBerinde RaduBerinde commented Oct 10, 2023

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 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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde RaduBerinde changed the title Rtflags roachtest: clean up command-line flags Oct 10, 2023
@RaduBerinde RaduBerinde marked this pull request as ready for review October 10, 2023 14:12
@RaduBerinde RaduBerinde requested a review from a team as a code owner October 10, 2023 14:12
@RaduBerinde RaduBerinde requested review from herkolategan and DarrylWong and removed request for a team October 10, 2023 14:12
@RaduBerinde RaduBerinde requested review from srosenberg and renatolabs and removed request for healthy-pod October 12, 2023 15:54
@RaduBerinde RaduBerinde added the do-not-merge bors won't merge a PR with this label. label Oct 17, 2023
@RaduBerinde
Copy link
Member Author

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.

@blathers-crl
Copy link

blathers-crl bot commented Oct 31, 2023

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.

@RaduBerinde RaduBerinde removed the do-not-merge bors won't merge a PR with this label. label Oct 31, 2023
@RaduBerinde RaduBerinde removed the request for review from srosenberg October 31, 2023 02:56
@RaduBerinde
Copy link
Member Author

Updated, ready for review.

Copy link
Contributor

@renatolabs renatolabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Thanks for the refactor!

Reviewable status: :shipit: 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
@RaduBerinde
Copy link
Member Author

@craig
Copy link
Contributor

craig bot commented Nov 6, 2023

Build succeeded:

@craig craig bot merged commit 4a53d0b into cockroachdb:master Nov 6, 2023
3 checks passed
@RaduBerinde RaduBerinde deleted the rtflags branch November 9, 2023 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants