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

Revise log messages along with the coding guideline #504

Merged
merged 5 commits into from
Jul 2, 2020

Conversation

rinx
Copy link
Contributor

@rinx rinx commented Jun 23, 2020

Signed-off-by: Rintaro Okamura rintaro.okamura@gmail.com

Description:

Revise log messages and levels along with the coding guideline.

  • log levels
  • add messages
  • remove useless stacktraces

index managers now ignore precondition error from agents. (just printing debug logs)

also fixed several anti-patterns pointed by deepsource.

Related Issue:

nothing.

How Has This Been Tested?:

nothing.

Environment:

  • Go Version: 1.14.3
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.11.5

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@pull-assistant
Copy link

pull-assistant bot commented Jun 23, 2020

Score: 0.92

Best reviewed: commit by commit


Optimal code review plan (1 warning)

🔊 Revise log messages

...re/ngt/handler/grpc/handler.go 50% changes removed in 🥅 handling ...

...nager/index/service/indexer.go 62% changes removed in 🥅 handling ...

     🚨 Fix the problems pointed by deepsource go

     🥅 handling 'uncommitted index not found' error as failed prec...

     🔇 remove useless stacktraces

     Merge branch 'master' into refactor/internal-pkgs/revise-log-messages

Powered by Pull Assistant. Last update 8996242 ... 5cd8094. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 23, 2020

Codecov Report

Merging #504 into master will increase coverage by 0.02%.
The diff coverage is 8.16%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #504      +/-   ##
=========================================
+ Coverage    9.13%   9.15%   +0.02%     
=========================================
  Files         402     402              
  Lines       20852   20848       -4     
=========================================
+ Hits         1905    1909       +4     
+ Misses      18694   18686       -8     
  Partials      253     253              
Impacted Files Coverage Δ
internal/client/discoverer/discover.go 0.00% <0.00%> (ø)
internal/file/watch/watch.go 0.00% <0.00%> (ø)
internal/net/grpc/pool/pool.go 0.00% <0.00%> (ø)
internal/net/grpc/status/status.go 0.00% <0.00%> (ø)
internal/worker/worker.go 0.00% <0.00%> (ø)
pkg/agent/core/ngt/handler/grpc/handler.go 0.00% <0.00%> (ø)
pkg/agent/core/ngt/service/ngt.go 0.00% <0.00%> (ø)
pkg/agent/core/ngt/usecase/agentd.go 0.00% <ø> (ø)
pkg/agent/sidecar/service/observer/observer.go 0.00% <0.00%> (ø)
pkg/agent/sidecar/service/restorer/restorer.go 0.00% <0.00%> (ø)
... and 25 more

Continue to review full report at Codecov.

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

@github-actions github-actions bot added the team/set SET team label Jun 23, 2020
@rinx rinx force-pushed the refactor/internal-pkgs/revise-log-messages branch 2 times, most recently from e3d6d06 to 406d981 Compare June 30, 2020 02:17
@rinx rinx marked this pull request as ready for review June 30, 2020 07:33
@rinx rinx force-pushed the refactor/internal-pkgs/revise-log-messages branch from b2f6306 to 07a85f5 Compare June 30, 2020 07:34
@@ -187,7 +187,7 @@ func WithListenConfig(lc *net.ListenConfig) Option {
}
}

func WithServerMode(m mode) Option {
func WithServerMode(m ServerMode) Option {
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported function WithServerMode should have comment or be unexported (golint)

@@ -44,15 +44,15 @@ type Server interface {
Shutdown(context.Context) error
}

type mode uint8
type ServerMode uint8
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported type ServerMode should have comment or be unexported (golint)


const (
REST mode = 1 + iota
REST ServerMode = 1 + iota
Copy link
Contributor

Choose a reason for hiding this comment

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

[golangci] reported by reviewdog 🐶
exported const REST should have comment (or a comment on this block) or be unexported (golint)

@rinx
Copy link
Contributor Author

rinx commented Jul 1, 2020

/rebase
/format

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 1, 2020

[REBASE] Rebase triggered by rinx for branch: refactor/internal-pkgs/revise-log-messages

@vdaas-ci vdaas-ci force-pushed the refactor/internal-pkgs/revise-log-messages branch from 07a85f5 to 32b2024 Compare July 1, 2020 08:08
@rinx rinx requested a review from kpango July 1, 2020 08:09
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 1, 2020

[FORMAT] Updating license headers and formatting go codes triggered by rinx.

kpango
kpango previously approved these changes Jul 2, 2020
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

@kpango
Copy link
Collaborator

kpango commented Jul 2, 2020

/rebase
/format

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 2, 2020

[REBASE] Rebase triggered by kpango for branch: refactor/internal-pkgs/revise-log-messages

rinx added 4 commits July 2, 2020 03:23
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
… error

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
@vdaas-ci vdaas-ci force-pushed the refactor/internal-pkgs/revise-log-messages branch from 32b2024 to 4da515a Compare July 2, 2020 03:23
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 2, 2020

[FORMAT] Updating license headers and formatting go codes triggered by kpango.

@kpango kpango merged commit f38b72c into master Jul 2, 2020
@kpango kpango deleted the refactor/internal-pkgs/revise-log-messages branch July 2, 2020 03:33
kevindiu pushed a commit that referenced this pull request Jul 2, 2020
* 🔊 Revise log messages

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

* 🚨 Fix the problems pointed by deepsource go

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

* 🥅 handling 'uncommitted index not found' error as failed precondition error

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

* 🔇 remove useless stacktraces

Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>

Co-authored-by: Yusuke Kato <i.can.feel.gravity@gmail.com>
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.

3 participants