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

The tidy build target doesn't tidy all the modules #2088

Closed
jpeach opened this issue Jun 3, 2021 · 3 comments · Fixed by #2818
Closed

The tidy build target doesn't tidy all the modules #2088

jpeach opened this issue Jun 3, 2021 · 3 comments · Fixed by #2818

Comments

@jpeach
Copy link
Contributor

jpeach commented Jun 3, 2021

Summary

If you do make tidy, it only runs go mod tidy on the modules in . ./api/ ./pkg/plugins/resources/k8s/native.
I was expecting it to be able to tidy all the modules in the repository.

xref #2087

@jpeach jpeach changed the title The tidy build target dpesn The tidy build target doesn't tidy all the modules Jun 3, 2021
@jpeach
Copy link
Contributor Author

jpeach commented Jun 3, 2021

xref #2069
xref #2068
xref #2066
xref #2065
xref #2031
xref #2030
xref #2029
xref #2028
xref #2025

@jpeach
Copy link
Contributor Author

jpeach commented Jun 3, 2021

This updates the tidy target, but runs into module dependency problems

diff --git mk/check.mk mk/check.mk
index ca1fa3ad..0a1b2fc3 100644
--- mk/check.mk
+++ mk/check.mk
@@ -21,12 +21,13 @@ vet: ## Dev: Run go vet
 
 .PHONY: tidy
 tidy:
-       @TOP=$(shell pwd) && \
-       for m in . ./api/ ./pkg/plugins/resources/k8s/native; do \
-               cd $$m ; \
-               rm go.sum ; \
-               go mod tidy ; \
-               cd $$TOP; \
+       for m in $$(find . -name go.mod | grep -v ./vendored); do \
+               ( \
+                       set -o errexit; \
+                       cd $$(dirname $$m); \
+                       echo tidying $$(pwd); \
+                       go mod tidy; \
+               ) \
        done
 
 .PHONY: golangci-lint

@jpeach
Copy link
Contributor Author

jpeach commented Jul 17, 2021

The embedded Go module for k8s/native was removed in #2360. Remaining modules are:

./go.mod
./pkg/transparentproxy/istio/go.mod
./vendored/github.com/prometheus/prometheus/go.mod

But you can't tidy the istio submodule

~/upstream/konghq/kuma/pkg/transparentproxy/istio$ go mod tidy
go: finding module for package github.com/kumahq/kuma/pkg/transparentproxy/config
go: downloading github.com/kumahq/kuma v1.2.1
go: found github.com/kumahq/kuma/pkg/transparentproxy/config in github.com/kumahq/kuma v1.2.1
go: github.com/kumahq/kuma@v1.2.1 requires

@jpeach jpeach mentioned this issue Sep 22, 2021
5 tasks
jakubdyszkiewicz pushed a commit that referenced this issue Sep 22, 2021
This fixes #2088.

Signed-off-by: James Peach <james.peach@konghq.com>
mergify bot pushed a commit that referenced this issue Sep 22, 2021
This fixes #2088.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit e48d37a)
jpeach added a commit that referenced this issue Sep 23, 2021
This fixes #2088.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit e48d37a)
jpeach added a commit that referenced this issue Sep 23, 2021
This fixes #2088.

Signed-off-by: James Peach <james.peach@konghq.com>
(cherry picked from commit e48d37a)

Co-authored-by: James Peach <james.peach@konghq.com>
nikita15p pushed a commit to nikita15p/kuma that referenced this issue Sep 28, 2021
This fixes kumahq#2088.

Signed-off-by: James Peach <james.peach@konghq.com>
nikita15p pushed a commit to nikita15p/kuma that referenced this issue Sep 28, 2021
This fixes kumahq#2088.

Signed-off-by: James Peach <james.peach@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant