Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Go vendor test #466

Merged
merged 1 commit into from
Nov 15, 2019
Merged

Go vendor test #466

merged 1 commit into from
Nov 15, 2019

Conversation

pohly
Copy link
Contributor

@pohly pohly commented Nov 14, 2019

Ensure that go.mod, go.sum and vendor are up-to-date.

@pohly
Copy link
Contributor Author

pohly commented Nov 14, 2019

This depends on #461

The test is currently expected to fail, because in the current version of that PR the go.sum file was not up-to-date (go mod tidy not called).

@pohly pohly changed the title Go vendor test WIP: Go vendor test Nov 14, 2019
@pohly
Copy link
Contributor Author

pohly commented Nov 14, 2019

Worked as expected (https://cloudnative-k8sci.southcentralus.cloudapp.azure.com/job/pmem-csi/view/change-requests/job/PR-466/1/console):

13:15:43  go: downloading github.com/opencontainers/go-digest v1.0.0-rc1
13:15:43  go: extracting github.com/konsorten/go-windows-terminal-sequences v1.0.2
13:15:43  go: extracting github.com/opencontainers/go-digest v1.0.0-rc1
13:15:43  ERROR: go module files *not* up-to-date, they did get modified by 'GO111MODULE=on go mod tidy':
13:15:43  diff --git a/go.sum b/go.sum
13:15:43  index 15772219..02b1f941 100644
13:15:43  --- a/go.sum
13:15:43  +++ b/go.sum
13:15:43  @@ -696,8 +696,6 @@ k8s.io/kubectl v0.0.0-20191016120415-2ed914427d51 h1:RBkTKVMF+xsNsSOVc0+HdC0B5gD
13:15:43   k8s.io/kubectl v0.0.0-20191016120415-2ed914427d51/go.mod h1:gL826ZTIfD4vXTGlmzgTbliCAT9NGiqpCqK2aNYv5MQ=
13:15:43   k8s.io/kubelet v0.0.0-20191016114556-7841ed97f1b2 h1:YXArqZfchiY+62+AyWPWE59wICh7xnAEowHGWggxBXs=
13:15:43   k8s.io/kubelet v0.0.0-20191016114556-7841ed97f1b2/go.mod h1:SBvrtLbuePbJygVXGGCMtWKH07+qrN2dE1iMnteSG8E=
13:15:43  -k8s.io/kubernetes v1.16.2 h1:k0f/OVp6Yfv+UMTm6VYKhqjRgcvHh4QhN9coanjrito=
13:15:43  -k8s.io/kubernetes v1.16.2/go.mod h1:SmhGgKfQ30imqjFVj8AI+iW+zSyFsswNErKYeTfgoH0=
13:15:43   k8s.io/kubernetes v1.17.0-alpha.0.0.20191109043140-c3f2a6524ed8 h1:+6/wrEXyQxJU5/Y6X4fqRtRpqP6rJASAqI7bBigJpF0=
13:15:43   k8s.io/kubernetes v1.17.0-alpha.0.0.20191109043140-c3f2a6524ed8/go.mod h1:hJd0X6w7E/MiE7PcDp11XHhdgQBYc33vP+WtTJqG/AU=
13:15:43   k8s.io/legacy-cloud-providers v0.0.0-20191016115753-cf0698c3a16b h1:cgLCVtQnxjALxIUjjEkiMaKlQZW5sGj6P3+3K5Y/d+8=
13:15:43  @@ -707,8 +705,6 @@ k8s.io/repo-infra v0.0.0-20181204233714-00fe14e3d1a3/go.mod h1:+G1xBfZDfVFsm1Tj/
13:15:43   k8s.io/sample-apiserver v0.0.0-20191016112829-06bb3c9d77c9/go.mod h1:sXltHZrQa4jdKL14nOFRRUhhzpmbnRF0qGuAhRQbaxc=
13:15:43   k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE=
13:15:43   k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
13:15:43  -k8s.io/utils v0.0.0-20191010214722-8d271d903fe4 h1:Gi+/O1saihwDqnlmC8Vhv1M5Sp4+rbOmK9TbsLn8ZEA=
13:15:43  -k8s.io/utils v0.0.0-20191010214722-8d271d903fe4/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
13:15:43   modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
13:15:43   modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
13:15:43   modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
13:15:43  make: *** [test/test.make:43: test_vendor] Error 1

@avalluri
Copy link
Contributor

I fixed g

This depends on #461

The test is currently expected to fail, because in the current version of that PR the go.sum file was not up-to-date (go mod tidy not called).

I fixed this in #461. Can you please rebase.

@avalluri
Copy link
Contributor

avalluri commented Nov 14, 2019

@pohly As part of this change, Can you make test_vendor_bom target work again with go modules. This was left as TODO in #461. Then we can drop Gopkg.lock file.

@pohly
Copy link
Contributor Author

pohly commented Nov 14, 2019

Can you make test_vendor_bom target work again with go modules. This was left as TODO in #461.

I didn't know that. There's no such TODO in

pmem-csi/test/test.make

Lines 23 to 36 in 56dce6a

# This ensures that the vendor directory and vendor-bom.csv are in sync
# at least as far as the listed components go.
.PHONY: test_vendor_bom
test: test_vendor_bom
test_vendor_bom:
@ if ! diff -c \
<(tail -n +2 vendor-bom.csv | sed -e 's/;.*//') \
<((grep '^ name =' Gopkg.lock | sed -e 's/.*"\(.*\)"/\1/') | LC_ALL=C LANG=C sort); then \
echo; \
echo "vendor-bom.csv not in sync with vendor directory (aka Gopk.lock):"; \
echo "+ new entry, missing in vendor-bom.csv"; \
echo "- obsolete entry in vendor-bom.csv"; \
false; \
fi
and as it wasn't failing, I assumed that you had changed it.

I can try to fix it. But unless I come up with something, we can't merge #461. Having our process in working shape is more important than moving to Go 1.13.

@avalluri
Copy link
Contributor

Can you make test_vendor_bom target work again with go modules. This was left as TODO in #461.

I didn't know that. There's no such TODO in

TODO was in Commit message:

TODO: We can drop Gopkg.lock file, but 'test_vendor_bom' make target uses this
file to retrieve the package list to validate vendor tree. One should replace
this check with go module equivalent.

I can try to fix it. But unless I come up with something, we can't merge #461. Having our process in working shape is more important than moving to Go 1.13.

I agree.

@pohly
Copy link
Contributor Author

pohly commented Nov 14, 2019

TODO was in Commit message:

I read that once, but didn't go back to check whether it's still there. It also doesn't show up in the GitHub diffs and would not have been found by "git grep TODO" if we had merged the PR. When the PR was no longer marked as WIP, I assumed that it is complete.

Anyway, please cherry-pick 9682ae7 into your branch.

@pohly pohly force-pushed the go-vendor-test branch 2 times, most recently from 3832a70 to 43dfe7f Compare November 15, 2019 09:26
"go mod tidy && go mod vendor" is something that should be done before
committing a dependency change, but may be overlooked. Therefore we
should enforce it with a test.
@pohly pohly changed the title WIP: Go vendor test Go vendor test Nov 15, 2019
@pohly
Copy link
Contributor Author

pohly commented Nov 15, 2019

@avalluri : rebased, please approve.

Copy link
Contributor

@avalluri avalluri 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 to me.

@avalluri avalluri merged commit 152ea9c into intel:devel Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants