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

server: fix unexported-return lint issue #19052

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aladesawe
Copy link

@aladesawe aladesawe commented Dec 12, 2024

PR to fix unexported-return lint issues under the server folder as mentioned in Issue 18370.

This PR:

  • addresses the auth package, and uses the existing AuthStore interface as the type returned by NewAuthStore in the auth/store.go file
  • updates auth/store_test.go file to use the corresponding interface returned
  • updates adapters.go so that NewServerVersionAdapter returns serverversion.Server interface
  • creates an interface ApplierMembership for NewApplierMembership's return type
  • creates an interface StorageRecorder return type for NewStorageRecorder and NewStorageRecorderStream
  • disables unexported-return for the mvcc/kvstore.go NewStore function. It appears the function is used internally, opted to disable versus using type assertions in the mvcc package
  • moving WALVersion interface definition to the wal package, and using an alias in schema
  • and other interface updates

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aladesawe
Once this PR has been reviewed and has the lgtm label, please assign serathius for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot
Copy link

Hi @aladesawe. Thanks for your PR.

I'm waiting for a etcd-io 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.

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.

@ivanvc
Copy link
Member

ivanvc commented Dec 13, 2024

Hi, @aladesawe. Thanks for your pull request 🙇.

One of many PRs to fix unexported-return lint issues under the server folder as mentioned in #18370.

Do you know how many issues there are in server? If there are not too many, it may be better to open a single pull request. We ideally want to keep the PR under 100 or 200 lines.

Thanks, again.

@aladesawe
Copy link
Author

Hi, @aladesawe. Thanks for your pull request 🙇.

One of many PRs to fix unexported-return lint issues under the server folder as mentioned in #18370.

Do you know how many issues there are in server? If there are not too many, it may be better to open a single pull request. We ideally want to keep the PR under 100 or 200 lines.

Thanks, again.

Hello @ivanvc sure thing, I'll pull more updates into this PR. There are about 10 more files with the error under the server module.

@aladesawe aladesawe changed the title auth: fix unexported-return lint issue server: fix unexported-return lint issue Dec 15, 2024
@aladesawe aladesawe marked this pull request as ready for review December 16, 2024 22:08
@ivanvc
Copy link
Member

ivanvc commented Dec 18, 2024

/ok-to-test

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.70%. Comparing base (8f447cf) to head (b3143c5).
Report is 49 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
server/auth/store.go 83.79% <100.00%> (ø)
server/etcdserver/adapters.go 66.66% <100.00%> (ø)
server/etcdserver/apply/apply.go 78.02% <100.00%> (ø)
server/mock/mockstorage/storage_recorder.go 95.00% <100.00%> (ø)
server/storage/mvcc/kvstore.go 89.76% <ø> (ø)
server/storage/mvcc/watchable_store.go 93.91% <100.00%> (ø)
server/storage/schema/alarm.go 86.66% <100.00%> (ø)
server/storage/schema/auth.go 100.00% <100.00%> (ø)
server/storage/schema/membership.go 59.85% <100.00%> (ø)
server/storage/schema/schema.go 100.00% <ø> (ø)
... and 1 more

... and 23 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19052      +/-   ##
==========================================
- Coverage   68.80%   68.70%   -0.10%     
==========================================
  Files         420      420              
  Lines       35623    35626       +3     
==========================================
- Hits        24509    24477      -32     
- Misses       9694     9725      +31     
- Partials     1420     1424       +4     

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f447cf...b3143c5. Read the comment docs.

@ivanvc
Copy link
Member

ivanvc commented Dec 19, 2024

/test pull-etcd-govulncheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants