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(store): add missing error checks in store #17794

Merged
merged 4 commits into from
Sep 20, 2023

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Sep 18, 2023

Description

A-7

Add missing errors checks in store.
I am curious why golangci-lint have not caught these.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@julienrbrt julienrbrt added backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release labels Sep 18, 2023
@max-hontar
Copy link
Contributor

I am curious why golangci-lint have not caught these.

To catch such issues worth to add errcheck linter to enabled list.

@julienrbrt julienrbrt removed backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release backport/v0.50.x PR scheduled for inclusion in the v0.50's next stable release labels Sep 20, 2023
@julienrbrt julienrbrt marked this pull request as ready for review September 20, 2023 08:16
@julienrbrt julienrbrt requested a review from a team as a code owner September 20, 2023 08:16
@julienrbrt
Copy link
Member Author

I am curious why golangci-lint have not caught these.

To catch such issues worth to add errcheck linter to enabled list.

Yes, we but have it, which is why it is weird:

- errcheck

@github-prbot github-prbot requested review from a team, alexanderbez and testinginprod and removed request for a team September 20, 2023 08:19
@max-hontar
Copy link
Contributor

- errcheck

Oops, missed that. Then, or this linter was added after that code (without error check), or passed intentionally - as by default executed "lint (short)" workflow which check only git diff, so in all next PR's this issue not spotted...

@julienrbrt
Copy link
Member Author

Oops, missed that. Then, or this linter was added after that code (without error check), or passed intentionally - as by default executed "lint (short)" workflow which check only git diff, so in all next PR's this issue not spotted...

Sure, but this is not that. The CI optimization has been added later, additionally any Makefile edit makes it run fully (which happened quite some time since as well). Running it locally does not catch anything either (make lint) or directly running golangci-lint (cd store; golangci-lint run ./... -c ../.golangci.yml). 🤷🏾‍♂️

@max-hontar
Copy link
Contributor

Yep, it is. But also strange - release branches (v0.47 & v0.50) don't have errcheck linter in list and I tried to add it to both - there I can see related errors (a lot, more than 100!!! for v0.50). Maybe problem with latest linter version used on main v1.54.2, maybe somewhere else... But worth to add errcheck to release branches anyway!

Copy link
Contributor

@testinginprod testinginprod left a comment

Choose a reason for hiding this comment

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

LGTM.

@julienrbrt
Copy link
Member Author

But worth to add errcheck to release branches anyway!

We do not lint on release branches once they have been cut. This means release/v0.51.x will be the first release branch with that linter enabled.

Maybe problem with latest linter version used on main v1.54.2, maybe somewhere else...

Possibly, if I remove an error check anywhere in the codebase, as well as in store, make lint will find it.
I think it may simply be a bug in errcheck.

@tac0turtle tac0turtle added this pull request to the merge queue Sep 20, 2023
Merged via the queue into main with commit 22925c7 Sep 20, 2023
48 checks passed
@tac0turtle tac0turtle deleted the julien/store-err-check branch September 20, 2023 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants