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

fix(commands): Require an argument name before the list of tracing filters when used without a subcommand #7056

Merged
merged 5 commits into from
Jul 5, 2023

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Jun 23, 2023

Motivation

Supplying an incorrect subcommand name should not run start.

This PR does not affect how tracing filters are parsed where the user provided the start subcommand.

Closes #7052

Solution

  • Adds long to filters field on EntryPoint (this field is ignored by the tracing component)
  • Appends start to the end when no subcommand is provided (instead of before the first filter)
  • Appends filters arg after the default subcommand

Related: I tried EnvFilter::try_new().expect(), but the format was too permissive, (this was noted in the issue as well.)

Review

Anyone can review.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

@arya2 arya2 added C-bug Category: This is a bug P-Medium ⚡ I-usability Zebra is hard to understand or use C-breaking Category: A breaking change for users labels Jun 23, 2023
@arya2 arya2 self-assigned this Jun 23, 2023
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Jun 26, 2023
@arya2 arya2 marked this pull request as ready for review June 26, 2023 19:07
@arya2 arya2 requested a review from a team as a code owner June 26, 2023 19:07
@arya2 arya2 requested review from oxarbitrage and removed request for a team June 26, 2023 19:07
@teor2345
Copy link
Contributor

This looks like a breaking change, does it need to wait for the 1.1.0 release?

(I don't mind either way, just checking as the person tagging the release.)

@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Merging #7056 (9df05f8) into main (5859fac) will increase coverage by 0.16%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7056      +/-   ##
==========================================
+ Coverage   77.24%   77.41%   +0.16%     
==========================================
  Files         310      310              
  Lines       41833    41830       -3     
==========================================
+ Hits        32315    32382      +67     
+ Misses       9518     9448      -70     

@teor2345 teor2345 added do-not-merge Tells Mergify not to merge this PR and removed do-not-merge Tells Mergify not to merge this PR C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG labels Jun 30, 2023
@arya2
Copy link
Contributor Author

arya2 commented Jul 3, 2023

This looks like a breaking change, does it need to wait for the 1.1.0 release?

I'd be okay with a patch update since it's a very small breaking change.

@teor2345
Copy link
Contributor

teor2345 commented Jul 3, 2023

This looks like a breaking change, does it need to wait for the 1.1.0 release?

I'd be okay with it okay in a patch update since it's a very small breaking change.

Seems ok, just as long as it has something in the changelog.

teor2345
teor2345 previously approved these changes Jul 3, 2023
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks good, some optional suggestions about the changelog and testing.

zebrad/src/commands/tests.rs Show resolved Hide resolved
zebrad/src/commands/entry_point.rs Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@github-actions github-actions bot added the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Jul 5, 2023
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Thanks for this fix!

@teor2345 teor2345 removed the C-trivial Category: A trivial change that is not worth mentioning in the CHANGELOG label Jul 5, 2023
mergify bot added a commit that referenced this pull request Jul 5, 2023
@mergify mergify bot merged commit 7e7ce2b into main Jul 5, 2023
@mergify mergify bot deleted the fix-default-subcmd-filters branch July 5, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-breaking Category: A breaking change for users C-bug Category: This is a bug I-usability Zebra is hard to understand or use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supplying an incorrect subcommand name runs zebrad start instead
3 participants