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

*: enable errcheck #8277

Merged
merged 11 commits into from
Jun 14, 2024
Merged

*: enable errcheck #8277

merged 11 commits into from
Jun 14, 2024

Conversation

okJiang
Copy link
Member

@okJiang okJiang commented Jun 12, 2024

What problem does this PR solve?

Issue Number: Ref #1919

What is changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

Signed-off-by: okJiang <[email protected]>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 12, 2024
Signed-off-by: okJiang <[email protected]>
Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 47.22222% with 19 lines in your changes missing coverage. Please review.

Project coverage is 77.28%. Comparing base (9dff6e6) to head (b2b5ab6).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8277      +/-   ##
==========================================
- Coverage   77.35%   77.28%   -0.08%     
==========================================
  Files         470      470              
  Lines       61376    61385       +9     
==========================================
- Hits        47478    47439      -39     
- Misses      10336    10388      +52     
+ Partials     3562     3558       -4     
Flag Coverage Δ
unittests 77.28% <47.22%> (-0.08%) ⬇️

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

client/pd_service_discovery.go Outdated Show resolved Hide resolved
client/resource_manager_client.go Outdated Show resolved Hide resolved
pkg/mcs/scheduling/server/cluster.go Outdated Show resolved Hide resolved
pkg/mcs/utils/util.go Outdated Show resolved Hide resolved
server/cluster/cluster.go Outdated Show resolved Hide resolved
pkg/replication/replication_mode.go Outdated Show resolved Hide resolved
- path: (pd-analysis|pd-api-bench|pd-backup|pd-ctl|pd-heartbeat-bench|pd-recover|pd-simulator|pd-tso-bench|pd-ut|regions-dump|stores-dump)
linters:
- errcheck
- path: (pkg/schedule/labeler/labeler.go|pkg/mcs/tso/server/config.go|pkg/tso/admin.go|pkg/mcs/tso/server/grpc_service.go|pkg/schedule/schedulers/split_bucket.go|server/api/plugin_disable.go|server/api/plugin_disable.go|server/api/operator.go|server/api/region.go|pkg/schedule/schedulers/balance_leader.go|pkg/mcs/resourcemanager/server/server.go|pkg/mcs/scheduling/server/grpc_service.go|pkg/mcs/resourcemanager/server/.*\.go|plugin/scheduler_example/evict_leader.go|server/api/.*\.go|pkg/replication/replication_mode.go|pkg/mcs/scheduling/server/server.go|pkg/storage/endpoint/gc_safe_point.go|server/.*\.go|pkg/schedule/schedulers/.*\.go|pkg/schedule/placement/rule.go|pkg/mcs/utils/util.go|pkg/keyspace/tso_keyspace_group.go|pkg/tso/allocator_manager.go|pkg/core/store_stats.go|pkg/autoscaling/handler.go|pkg/core/store_stats.go|pkg/keyspace/keyspace.go|pkg/storage/hot_region_storage.go|pkg/syncer/server.go)
Copy link
Member

Choose a reason for hiding this comment

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

Where did these paths come from, handwritten? 0 0
If a new folder is created, do I need to add it here manually?

Copy link
Member Author

@okJiang okJiang Jun 12, 2024

Choose a reason for hiding this comment

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

Where did these paths come from, handwritten? 0 0

yes, these files lack too much errcheck. I can't fix them in this one pr, so ignore them for now

If a new folder is created, do I need to add it here manually?

no, you need to fix the errcheck hint of your new file

@@ -118,7 +118,9 @@ func (c *tsoClient) getOption() *option { return c.option }
func (c *tsoClient) getServiceDiscovery() ServiceDiscovery { return c.svcDiscovery }

func (c *tsoClient) setup() {
c.svcDiscovery.CheckMemberChanged()
if err := c.svcDiscovery.CheckMemberChanged(); err != nil {
log.Warn("[tso] failed to check member changed", errs.ZapError(err))
Copy link
Member

Choose a reason for hiding this comment

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

using log.warn or log.error?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not very sure either, because this error was ignored before, so I used "warn"

Copy link
Member

Choose a reason for hiding this comment

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

It's ok to use warn because CheckMemberChanged will also output some error logs internally.

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 13, 2024
Copy link
Member

@rleungx rleungx left a comment

Choose a reason for hiding this comment

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

The rest LGTM

pkg/replication/replication_mode_test.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jun 13, 2024
@okJiang
Copy link
Member Author

okJiang commented Jun 13, 2024

/retest

@okJiang okJiang mentioned this pull request Jun 14, 2024
@JmPotato
Copy link
Member

/merge

Copy link
Contributor

ti-chi-bot bot commented Jun 14, 2024

@JmPotato: We have migrated to builtin LGTM and approve plugins for reviewing.

👉 Please use /approve when you want approve this pull request.

The changes announcement: Proposal: Strengthen configuration change approval.

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 ti-community-infra/tichi repository.

@JmPotato
Copy link
Member

/approve

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 14, 2024
Copy link
Contributor

ti-chi-bot bot commented Jun 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, rleungx

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

The pull request process is described here

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

Copy link
Contributor

ti-chi-bot bot commented Jun 14, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-13 08:11:51.827623148 +0000 UTC m=+625065.880935095: ☑️ agreed by rleungx.
  • 2024-06-14 06:33:08.722633628 +0000 UTC m=+705542.775945553: ☑️ agreed by JmPotato.

@rleungx
Copy link
Member

rleungx commented Jun 14, 2024

/merge

Copy link
Contributor

ti-chi-bot bot commented Jun 14, 2024

@rleungx: We have migrated to builtin LGTM and approve plugins for reviewing.

👉 Please use /approve when you want approve this pull request.

The changes announcement: Proposal: Strengthen configuration change approval.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot bot merged commit 13174b5 into tikv:master Jun 14, 2024
18 of 19 checks passed
@okJiang okJiang deleted the enable-errcheck branch June 14, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants