-
Notifications
You must be signed in to change notification settings - Fork 41
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
fix: fix pieces of code currently omitted by the linter #1227
fix: fix pieces of code currently omitted by the linter #1227
Conversation
Most of the //nolint issues are fixed in this PR however there are three that are not.
|
Thanks @JasonPowr fantastic work.
I think this is by design and it's up to the caller to Close the response. @ziccardi is this correct?
This one we need to wait for a drop in replacement implementation to be available or use external libs.
For this one, the issue is the string "txid" which is used as key. We need to define a type just like https://github.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/blob/main/pkg/db/context.go#L12, the declare the "txid" as of that type just like https://github.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/blob/main/pkg/db/context.go#L15 and use it in place. |
@machi1990 Correct. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
abd04de
to
c8b7505
Compare
So I tried to fix this like you said but it still does not seem to work. It fixes the linter Issue all right but seems to break everything else. |
Codecov Report
@@ Coverage Diff @@
## main #1227 +/- ##
==========================================
+ Coverage 82.47% 83.27% +0.79%
==========================================
Files 133 133
Lines 11813 11815 +2
==========================================
+ Hits 9743 9839 +96
+ Misses 1714 1622 -92
+ Partials 356 354 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@JasonPowr I think we need to change all the other references of |
Sure yeah work away thanks for the help :) |
Also breaks up a cycling dependency issue between context.go and logger.go
Pushed a commit on top of you change. Let's see what CI says @JasonPowr , it should be happy :-) |
// adding txid explicitly to context with a simple string key and int value | ||
// due to a cyclical import cycle between pkg/db and pkg/logging | ||
ctx = context.WithValue(ctx, "txid", tx.txid) //nolint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was fixed by de3c8de which introduced the https://github.com/bf2fc6cc711aee1a0c2a/kas-fleet-manager/blob/de3c8de28fba0d5031cfc2e1cf8d701bf3df4ccd/pkg/constants/db_context_keys.go to also fix the cyclic dependency issue
Description
This PR is to Investigate and fix pieces of code currently omitted by the linter, i.e lines that have
//nolint
Jira: https://issues.redhat.com/browse/MGDSTRM-900
Checklist (Definition of Done)
Unit and integration tests added that prove the fix is effective or the feature works (tested against emulated and non-emulated OCM environment)Documentation added for the featureRequired metrics/dashboards/alerts have been added (or PR created).Required Standard Operating Procedure (SOP) is added.JIRA has been created for changes required on the client side