Skip to content

fix(throttler/demo): rename underscore flags to dash format, add manager tests#20033

Merged
mattlord merged 2 commits into
vitessio:mainfrom
ManthanNimodiya:fix/throttler-demo-flag-rename-and-tests
May 13, 2026
Merged

fix(throttler/demo): rename underscore flags to dash format, add manager tests#20033
mattlord merged 2 commits into
vitessio:mainfrom
ManthanNimodiya:fix/throttler-demo-flag-rename-and-tests

Conversation

@ManthanNimodiya
Copy link
Copy Markdown
Contributor

Description

Three flag names in the throttler demo binary (lag_update_interval, replica_degration_interval, replica_degration_duration) still used underscore separators, conflicting with the project-wide standard established in v25. This PR renames them and migrates all flag registrations in registerDemoFlags to utils.SetFlag* wrappers to match the pattern used across every other Vitess binary.

Also adds TestManager_Throttlers and TestManager_Log to manager_test.go — both methods existed without any dedicated test coverage.

Related Issue(s)

Fixes part of #17880 (flag renaming: replace underscores with dashes)
Related to #14931 (improve unit test coverage)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

No deployment impact. The throttler demo is a local diagnostic binary, not a production component. The flag rename is intentional — v25 removes underscore flag support.

AI Disclosure

Issue scope was analysed thoroughly before implementing this fix.

Copilot AI review requested due to automatic review settings May 5, 2026 18:47
@vitess-bot vitess-bot Bot added NeedsWebsiteDocsUpdate What it says NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels May 5, 2026
@github-actions github-actions Bot added this to the v25.0.0 milestone May 5, 2026
@vitess-bot
Copy link
Copy Markdown
Contributor

vitess-bot Bot commented May 5, 2026

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aligns the throttler demo binary with Vitess’ dash-separated flag naming standard for v25 and adds direct unit coverage for two manager helper methods in the throttler package.

Changes:

  • Renames the throttler demo’s remaining underscore-separated flags to dash-separated forms.
  • Switches registerDemoFlags to the shared utils.SetFlag* registration helpers used elsewhere in the codebase.
  • Adds unit tests for Manager.Throttlers() and managerImpl.log().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
go/vt/throttler/manager_test.go Adds focused tests for throttler name listing and log lookup error handling.
go/vt/throttler/demo/throttler_demo.go Renames demo CLI flags and uses the shared flag registration wrappers.

@ManthanNimodiya
Copy link
Copy Markdown
Contributor Author

@mattlord - please have a review when you get chance

@ManthanNimodiya
Copy link
Copy Markdown
Contributor Author

@mattlord - removed the entire demo directory as suggested, please have a review when you get chance

@mattlord mattlord added Type: Internal Cleanup Type: Testing and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels May 13, 2026
Copy link
Copy Markdown
Member

@mattlord mattlord left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you, @ManthanNimodiya ! But let's please not open new PRs that offer/cover so little. It adds load to the shared CI systems and the maintainers. The Manager stuff was not even something listed in the noted issue and I don't see much practical value in these unit tests TBH.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.22%. Comparing base (70c7a72) to head (75afe77).
⚠️ Report is 255 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20033      +/-   ##
==========================================
+ Coverage   69.67%   72.22%   +2.55%     
==========================================
  Files        1614     1346     -268     
  Lines      216793   204634   -12159     
==========================================
- Hits       151044   147794    -3250     
+ Misses      65749    56840    -8909     
Flag Coverage Δ
partial 72.22% <ø> (?)

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mattlord
Copy link
Copy Markdown
Member

@ManthanNimodiya And the DCO test is failing... I'm almost ready to close this as the review and CI overhead is IMO too much for a trivial change. But since we are already here, I will keep on with this one.

…ger tests

Signed-off-by: ManthanNimodiya <manthannimodiya989898@gmail.com>
Signed-off-by: ManthanNimodiya <manthannimodiya989898@gmail.com>
@ManthanNimodiya ManthanNimodiya force-pushed the fix/throttler-demo-flag-rename-and-tests branch from 2f5016f to 75afe77 Compare May 13, 2026 17:39
@ManthanNimodiya
Copy link
Copy Markdown
Contributor Author

@mattlord, sorry for the extra noise on CI and your time.
I'll make sure future PRs are more focused and scoped to what's actually needed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

go/vt/throttler/demo/throttler_demo.go:1

  • The PR description says this demo should keep existing functionality while renaming three flags, but this change deletes the entire throttler demo package. After the deletion, go/vt/throttler/demo no longer exists, so the local diagnostic binary and all of its behavior are removed rather than migrated to dash-form flag names.

@mattlord mattlord enabled auto-merge (squash) May 13, 2026 18:29
@mattlord mattlord merged commit 015021a into vitessio:main May 13, 2026
113 of 114 checks passed
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.

4 participants