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

Simple leader selection utility #7160

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jordanschalm
Copy link
Member

A basic utility for reading leader selection for a view range from a snapshot input. Made this last week while debugging networking issues.

@jordanschalm jordanschalm requested a review from a team as a code owner March 18, 2025 00:18
@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2025

Codecov Report

Attention: Patch coverage is 0% with 44 lines in your changes missing coverage. Please review.

Project coverage is 41.25%. Comparing base (22768aa) to head (5e8ae24).
Report is 27 commits behind head on master.

Files with missing lines Patch % Lines
cmd/util/cmd/leaders/cmd.go 0.00% 43 Missing ⚠️
cmd/util/cmd/root.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7160      +/-   ##
==========================================
+ Coverage   41.24%   41.25%   +0.01%     
==========================================
  Files        2171     2171              
  Lines      190064   190091      +27     
==========================================
+ Hits        78385    78431      +46     
+ Misses     105129   105121       -8     
+ Partials     6550     6539      -11     
Flag Coverage Δ
unittests 41.25% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

func run(*cobra.Command, []string) {

var snapshot inmem.EncodableSnapshot
err := json.NewDecoder(os.Stdin).Decode(&snapshot)
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the usage? something like

cat snapshot.json | util ...

would it make sense to accept a path to the snapshot file as an argument instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is the usage. We were starting from some jq queries so the shortest path was something with the same input scheme. I don't mind adding the file IO in the command -- that is probably more consistent with the rest of the util commands.

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