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: Update third-party dependencies to their latest releases #1615

Merged
merged 5 commits into from
Jul 23, 2020

Conversation

nfnt
Copy link
Member

@nfnt nfnt commented Jul 21, 2020

What this PR does / why we need it:
This bumps the modules as well as 'golangci-lint' to their latest releases.
It also fixes linter warnings due to updated linters, among them a potential DoS when copying files from archives (gosec G110).
gotest.tools has been removed in favor of stretchr/testify, as it offers the same functionality.

This bump the modules as well as 'golangci-lint' to their latest releases.
It also fixes linter warnings due to updated linters, among them a potential DoS when copying files from archives (gosec G110).
'gotest.tools' has been removed in favor of 'stretchr/testify', as it offers the same functionality.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt added component/linter component/testing dependencies Pull requests that update a dependency file labels Jul 21, 2020
@nfnt nfnt changed the title Update third-party dependencies to their latest releases Chore: Update third-party dependencies to their latest releases Jul 21, 2020
@nfnt nfnt requested a review from ANeumann82 July 21, 2020 08:06
Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

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

Looks pretty good, apart from that one change that I commented. It may be ok to change the behavior, but i'd like to get some more opinions about it

pkg/engine/task/podexec/pod_exec.go Outdated Show resolved Hide resolved
pkg/kudoctl/packages/writer/writer_test.go Outdated Show resolved Hide resolved
Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt requested a review from ANeumann82 July 21, 2020 12:51
Copy link
Contributor

@alenkacz alenkacz left a comment

Choose a reason for hiding this comment

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

Looks good, I have two questions but they probably won't be a blockers. Thanks 👏

@@ -29,5 +29,4 @@ linters-settings:
dupl:
threshold: 400
goimports:
# Don't use 'github.com/kudobuilder/kudo', it'll result in unreliable output!
local-prefixes: github.com/kudobuilder
local-prefixes: github.com/kudobuilder/kudo
Copy link
Contributor

Choose a reason for hiding this comment

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

what changed here? that we can do it now...

Copy link
Member Author

Choose a reason for hiding this comment

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

No idea 😆
I had a lot of issues with that back when we introduced golangci-lint. Now I don't see them anymore and have been using it with full prefixes successfully in other (albeit smaller) projects -- kitt and test-tools.

Copy link
Member

Choose a reason for hiding this comment

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

why don't we leave it local-prefixes: github.com/kudobuilder? It seems to function and allows for a usable configuration across projects.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because that wouldn't just group kudo packages but packages from other projects in the kudobuilder org as well. For example in pkg/engine/task/task_kudo_operator_test.go, a kuttl import was grouped with kudo imports. This will be fixed with this change to local-prefixes.

pkg/engine/renderer/dependencies_test.go Show resolved Hide resolved
Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

make generate leaves the repo dirty
CRDs and bindata.go are dirty

@@ -29,5 +29,4 @@ linters-settings:
dupl:
threshold: 400
goimports:
# Don't use 'github.com/kudobuilder/kudo', it'll result in unreliable output!
local-prefixes: github.com/kudobuilder
local-prefixes: github.com/kudobuilder/kudo
Copy link
Member

Choose a reason for hiding this comment

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

why don't we leave it local-prefixes: github.com/kudobuilder? It seems to function and allows for a usable configuration across projects.

@kensipe
Copy link
Member

kensipe commented Jul 22, 2020

I would push the updated changes... but it likely needs some analysis... some of the change looks like simple line limits which result in wrapping... like:

                   email:
-                    description: Email is an optional email address to contact the named maintainer.
+                    description: Email is an optional email address to contact the
+                      named maintainer.
                     type: string

It would be good to understand what is causing this change... and if innocuous.. then including the changed files

@kensipe
Copy link
Member

kensipe commented Jul 22, 2020

after generating files make generate, make test passes... but make integration-test fails. (around crds)

@kensipe
Copy link
Member

kensipe commented Jul 22, 2020

additionally... golangci needs a change to install-golangcilint.sh which is missing in this change.
https://github.com/kudobuilder/kudo/blob/main/hack/install-golangcilint.sh#L7

which makes me question if the correct linter version was used..

@kensipe
Copy link
Member

kensipe commented Jul 22, 2020

I should add.. there are some really good mods here... In particular the error handling around io.Copy and size limitations!

@nfnt
Copy link
Member Author

nfnt commented Jul 23, 2020

@kensipe, interesting,make generate was run here and resulted in updated CRDs, make integration-test succeeds in the CI. But controller-gen isn't being updated as part of this PR. This must be due to the Kubernetes APIs bump to 0.18.6. The updated APIs are used by controller-gen as well -- because that's how dependency resolution works with Go modules. As a result, the output is different.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt
Copy link
Member Author

nfnt commented Jul 23, 2020

This would also explain why running make generate locally leaves your repo dirty: You already have controller-gen in the right version installed. But if you would rebuild controller-gen, it would use different dependencies, which results in a different binary.
This is a problem 😦. Thanks for surfacing this.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt requested a review from kensipe July 23, 2020 08:01
Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

lgtm

It was necessary to delete controller-gen and go-bindata. after that all is well!

Signed-off-by: Jan Schlicht <jan@d2iq.com>
@nfnt nfnt merged commit 8b3711c into main Jul 23, 2020
@nfnt nfnt deleted the nfnt/bump-deps branch July 23, 2020 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/linter component/testing dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants