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

Refactor: rename doXXX() #1878

Merged
merged 7 commits into from
Dec 5, 2022
Merged

Conversation

kevindiu
Copy link
Contributor

@kevindiu kevindiu commented Nov 28, 2022

Description:

This PR rename doXXX() worked in these 2 PRs.

Here is the summary of this PR:

  • hack/benchmark/assets/x1b/loader.go
    • doOpen() -> openFile()
  • internal/file/file.go
    • doExists() merged to ExistsWithDetail()
    • doWriteFile() -> writeFileSync()
    • doJoin() -> joinFilePaths()
  • internal/net/grpc/client.go
    • doConnect() -> connectWithBackoff()
  • internal/net/grpc/pool/pool.go
    • doConnect() -> reconnectUnhealthy()
    • doGet() -> getHelthyConn()
  • internal/test/data/vector/gen.go
    • doGenFloat32Vec() -> genF32Slice()
    • doGenUint8Vec() -> genUint8Slice()
  • doXXX() not refactored:
    • internal/file/file.go doMove()
    • internal/net/http/transport/roundtrip.go doRoundTrip()
    • pkg/gateway/lb/handler/grpc/handler.go doSearch()

Related Issue:

Versions:

  • Go Version: 1.19.2
  • Docker Version: 20.10.8
  • Kubernetes Version: 1.22.0
  • NGT Version: 1.14.8

Checklist:

Special notes for your reviewer:

Signed-off-by: kevindiu <kevindiujp@gmail.com>
Signed-off-by: kevindiu <kevindiujp@gmail.com>
@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - replace the PR body by changelog details
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase main
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@@ -447,24 +457,9 @@ func CreateTemp(baseDir string) (f *os.File, err error) {
return nil, errors.ErrFailedToCreateFile(err, path, nil)
}

// doExists returns file existence with detailed information
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is merged to the ExistsWithDetail()

@kevindiu kevindiu changed the title Refactor: rename doXXX() [WIP] Refactor: rename doXXX() Nov 28, 2022
@codecov
Copy link

codecov bot commented Nov 28, 2022

Codecov Report

Base: 30.43% // Head: 30.41% // Decreases project coverage by -0.02% ⚠️

Coverage data is based on head (b98e8bf) compared to base (9bb7508).
Patch coverage: 28.57% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1878      +/-   ##
==========================================
- Coverage   30.43%   30.41%   -0.03%     
==========================================
  Files         365      365              
  Lines       33763    33761       -2     
==========================================
- Hits        10277    10268       -9     
- Misses      23077    23081       +4     
- Partials      409      412       +3     
Impacted Files Coverage Δ
hack/benchmark/assets/x1b/loader.go 0.00% <0.00%> (ø)
internal/net/grpc/client.go 0.00% <0.00%> (ø)
internal/net/grpc/pool/pool.go 0.00% <0.00%> (ø)
internal/file/file.go 12.00% <32.00%> (+0.06%) ⬆️
internal/test/data/vector/gen.go 92.85% <100.00%> (ø)
...nt/core/ngt/service/vqueue/uninserted_index_map.go 73.65% <0.00%> (-5.38%) ⬇️
internal/net/http/middleware/timeout.go 91.11% <0.00%> (-2.23%) ⬇️
internal/errgroup/group.go 95.00% <0.00%> (+2.00%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@kevindiu kevindiu changed the title [WIP] Refactor: rename doXXX() Refactor: rename doXXX() Nov 28, 2022
@kevindiu
Copy link
Contributor Author

I think it is fine to remain some of doXXX() , please let me know if you have any comment on it :)
Please see PR description.

@kevindiu kevindiu marked this pull request as ready for review November 28, 2022 06:21
@kevindiu kevindiu requested a review from kpango November 28, 2022 06:50
vankichi
vankichi previously approved these changes Nov 28, 2022
}

func doWriteFile(ctx context.Context, target string, r io.Reader, flg int, perm fs.FileMode) (n int64, err error) {
func writeFileSync(ctx context.Context, target string, r io.Reader, flg int, perm fs.FileMode) (n int64, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func writeFileSync(ctx context.Context, target string, r io.Reader, flg int, perm fs.FileMode) (n int64, err error) {
func writeFile(ctx context.Context, target string, r io.Reader, flg int, perm fs.FileMode) (n int64, err error) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed this function because of it is warned by deepsource which has confusing name function WriteFile() exists in this package. (line 260)
If I rename it to writeFile() the warning will occur again.
What do you think about it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. thank you for your explanation.
I will close this comment, thank you.

hlts2
hlts2 previously approved these changes Nov 29, 2022
@cloudflare-pages
Copy link

cloudflare-pages bot commented Nov 29, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: b98e8bf
Status: ✅  Deploy successful!
Preview URL: https://e7136b05.vald.pages.dev
Branch Preview URL: https://refactor-internal-rename-dox.vald.pages.dev

View logs

Signed-off-by: kevindiu <kevindiujp@gmail.com>
@kevindiu kevindiu dismissed stale reviews from hlts2 and vankichi via e2ed8af December 1, 2022 05:47
internal/file/file.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@kpango kpango left a comment

Choose a reason for hiding this comment

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

LGTM

@kevindiu kevindiu merged commit 92682d6 into main Dec 5, 2022
@kevindiu kevindiu deleted the refactor/internal/rename-doXXX-func branch December 5, 2022 08:14
@kpango kpango mentioned this pull request Jan 19, 2023
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.

None yet

5 participants