Skip to content

pkg/domain: remove duplicate EtcdClient() method#64328

Merged
ti-chi-bot[bot] merged 2 commits into
masterfrom
copilot/remove-duplicate-etcd-client-methods
Nov 13, 2025
Merged

pkg/domain: remove duplicate EtcdClient() method#64328
ti-chi-bot[bot] merged 2 commits into
masterfrom
copilot/remove-duplicate-etcd-client-methods

Conversation

Copilot AI commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #64313

Problem Summary: (*Domain).EtcdClient() and (*Domain).GetEtcdClient() are duplicates serving identical purposes.

What changed and how does it work?

Removed EtcdClient() method and migrated all call sites to GetEtcdClient():

  • pkg/domain/domain.go: Removed duplicate EtcdClient() method definition
  • Updated 4 call sites in pkg/ddl/schema_test.go, pkg/session/sync_upgrade.go, pkg/session/bootstrap_test.go, and tests/realtikvtest/brietest/pitr_test.go

GetEtcdClient() chosen as standard (14 existing usages vs 4 for EtcdClient()).

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@ti-chi-bot ti-chi-bot Bot added do-not-merge/invalid-title do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 6, 2025
@ti-chi-bot

ti-chi-bot Bot commented Nov 6, 2025

Copy link
Copy Markdown

Hi @Copilot. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Nov 6, 2025
@tiprow

tiprow Bot commented Nov 6, 2025

Copy link
Copy Markdown

Hi @Copilot. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Co-authored-by: lance6716 <1689766+lance6716@users.noreply.github.com>
@ti-chi-bot ti-chi-bot Bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 6, 2025
Copilot AI changed the title [WIP] Remove duplicate EtcdClient method in Domain package pkg/domain: remove duplicate EtcdClient() method Nov 6, 2025
@ti-chi-bot ti-chi-bot Bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/invalid-title do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 6, 2025
Copilot AI requested a review from lance6716 November 6, 2025 14:03
@lance6716

Copy link
Copy Markdown
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot Bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels Nov 6, 2025
@lance6716
lance6716 marked this pull request as ready for review November 6, 2025 14:04
@ti-chi-bot ti-chi-bot Bot removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/needs-linked-issue do-not-merge/needs-triage-completed labels Nov 6, 2025
@codecov

codecov Bot commented Nov 6, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.9426%. Comparing base (5541db5) to head (c3dc20f).
⚠️ Report is 34 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #64328        +/-   ##
================================================
+ Coverage   72.7218%   75.9426%   +3.2208%     
================================================
  Files          1861       1889        +28     
  Lines        504726     525627     +20901     
================================================
+ Hits         367046     399175     +32129     
+ Misses       115367     103056     -12311     
- Partials      22313      23396      +1083     
Flag Coverage Δ
integration 49.2480% <0.0000%> (?)
unit 73.6868% <100.0000%> (+1.3983%) ⬆️

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

Components Coverage Δ
dumpling 52.8700% <ø> (ø)
parser ∅ <ø> (∅)
br 63.3857% <ø> (+17.1968%) ⬆️
🚀 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.

@ti-chi-bot ti-chi-bot Bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 7, 2025
@lance6716

Copy link
Copy Markdown
Contributor

/retest

@wuhuizuo

wuhuizuo commented Nov 7, 2025

Copy link
Copy Markdown
Contributor

@copilot please keep html comment elements in pull request description according to the pull request template!.

Copilot AI commented Nov 7, 2025

Copy link
Copy Markdown
Contributor Author

@copilot please keep html comment elements in pull request description according to the pull request template!.

Updated the PR description to preserve all HTML comment elements from the template.

Copilot AI requested a review from wuhuizuo November 7, 2025 03:00
@lance6716

Copy link
Copy Markdown
Contributor

/cc @D3Hunter

@ti-chi-bot
ti-chi-bot Bot requested a review from D3Hunter November 7, 2025 03:00
@lance6716

Copy link
Copy Markdown
Contributor

/cc @yudongusa

@ti-chi-bot

ti-chi-bot Bot commented Nov 7, 2025

Copy link
Copy Markdown

@lance6716: GitHub didn't allow me to request PR reviews from the following users: yudongusa.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc @yudongusa

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 7, 2025
@ti-chi-bot

ti-chi-bot Bot commented Nov 7, 2025

Copy link
Copy Markdown

[LGTM Timeline notifier]

Timeline:

  • 2025-11-07 02:30:51.083623867 +0000 UTC m=+410100.526653746: ☑️ agreed by zimulala.
  • 2025-11-07 07:58:46.183286531 +0000 UTC m=+429775.626316409: ☑️ agreed by D3Hunter.

@lance6716

Copy link
Copy Markdown
Contributor

ptal @yudongusa @benmeadowcroft

@yudongusa yudongusa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How can we ensure no more further calls to EtcdClient()?

@ti-chi-bot

ti-chi-bot Bot commented Nov 13, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: D3Hunter, yudongusa, zimulala

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added the approved label Nov 13, 2025
@lance6716

lance6716 commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

How can we ensure no more further calls to EtcdClient()?

Not quite clear about your question 🤔 In this PR because it can compile, all callers should be switched to GetEtcdClient. And in future when developers still want to use EtcdClient as they did in the past, their IDE code completion should notice them there's only GetEtcdClient.

/retest

@ti-chi-bot
ti-chi-bot Bot merged commit a217eb8 into master Nov 13, 2025
33 checks passed
@ti-chi-bot
ti-chi-bot Bot deleted the copilot/remove-duplicate-etcd-client-methods branch November 13, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(*Domain).EtcdClient() is duplicated with (*Domain).GetEtcdClient()

6 participants