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

chore: Improve application logs adding message context #9435

Merged
merged 8 commits into from
May 20, 2022

Conversation

leoluz
Copy link
Collaborator

@leoluz leoluz commented May 17, 2022

Signed-off-by: Leonardo Luz Almeida leonardo_almeida@intuit.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM.

Just a very opinionated nit, feel free to merge though :)

server/application/application.go Outdated Show resolved Hide resolved
@leoluz leoluz requested a review from jannfis May 19, 2022 18:35
@leoluz
Copy link
Collaborator Author

leoluz commented May 19, 2022

After analysing failing unit-tests I realized that this PR could potentially introduce an API breaking change by returning wrapped errors. It seems grpc library doesn't play nicely with wrapped errors:
grpc/grpc-go#2934

Improved the code to avoid introducing API breaking change.
Can you pls take another look @jannfis ?

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #9435 (ea63864) into master (4a51875) will increase coverage by 0.00%.
The diff coverage is 15.82%.

@@           Coverage Diff           @@
##           master    #9435   +/-   ##
=======================================
  Coverage   45.71%   45.71%           
=======================================
  Files         221      221           
  Lines       26271    26289   +18     
=======================================
+ Hits        12009    12019   +10     
- Misses      12606    12610    +4     
- Partials     1656     1660    +4     
Impacted Files Coverage Δ
server/application/application.go 31.40% <9.52%> (-0.43%) ⬇️
util/grpc/errors.go 47.16% <100.00%> (+24.44%) ⬆️
server/badge/badge.go 78.72% <0.00%> (-3.28%) ⬇️

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 4a51875...ea63864. Read the comment docs.

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

There's no way to overstate what a big deal this is for debugging. Thanks for doing this.

Comments include mostly nits and one important change.

server/application/application.go Outdated Show resolved Hide resolved
server/application/application.go Outdated Show resolved Hide resolved
server/application/application.go Outdated Show resolved Hide resolved
server/application/application.go Outdated Show resolved Hide resolved
util/grpc/errors.go Show resolved Hide resolved
util/grpc/errors.go Show resolved Hide resolved
Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

lgtm!

@crenshaw-dev crenshaw-dev enabled auto-merge (squash) May 20, 2022 20:44
@crenshaw-dev crenshaw-dev merged commit ba7d2e7 into argoproj:master May 20, 2022
@leoluz leoluz added the cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch label May 31, 2022
crenshaw-dev pushed a commit that referenced this pull request May 31, 2022
* chore: Improve application logs adding message context

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* fix bug returning error incorrectly

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix unit-test and avoid api breaking change

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix e2e test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Fix e2e test

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* small fix

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>

* Address review comments

Signed-off-by: Leonardo Luz Almeida <leonardo_almeida@intuit.com>
@crenshaw-dev
Copy link
Collaborator

Cherry-picked onto 2.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/2.4 Candidate for cherry picking into the 2.4 release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants