From 1591eb4bbf64a54736e01ee40300967138af4e03 Mon Sep 17 00:00:00 2001 From: Leonidas Vrachnis Date: Mon, 25 Oct 2021 13:04:37 +0300 Subject: [PATCH 1/5] Check for go mod inconsistencies --- .github/workflows/verify.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 7a8158aec6..65bb3284c2 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -30,3 +30,9 @@ jobs: - name: Error message if: ${{ failure() }} run: echo '::error file=Makefile,line=11,col=1::Incorrectly generated files. Ensure you have run `make mocks` and committed the files locally.' + + - run: go mod tidy + - run: git diff --exit-code + - name: Error message + if: ${{ failure() }} + run: echo '::error file=go.mod,line=1,col=1::Inconsistent go mod file. Ensure you have run `go mod tidy` and committed the files locally.' From 5c40d46d3e136fd971a83eae66c56ec681fe0a20 Mon Sep 17 00:00:00 2001 From: Leonidas Vrachnis Date: Mon, 25 Oct 2021 13:22:36 +0300 Subject: [PATCH 2/5] Fake enterprise deps --- .github/workflows/verify.yml | 5 +++-- enterprise_mod.go | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 enterprise_mod.go diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 65bb3284c2..1896c9ea96 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -32,7 +32,8 @@ jobs: run: echo '::error file=Makefile,line=11,col=1::Incorrectly generated files. Ensure you have run `make mocks` and committed the files locally.' - run: go mod tidy - - run: git diff --exit-code + - run: git diff --exit-code go.mod - name: Error message if: ${{ failure() }} - run: echo '::error file=go.mod,line=1,col=1::Inconsistent go mod file. Ensure you have run `go mod tidy` and committed the files locally.' + run: echo '::error file=go.mod,line=1,col=1::Inconsistent go mod file. Ensure you have run `go mod tidy` and committed the files locally.' && \ + echo '::error file=enterprise_mod.go,line=1,col=1::Possible missing enterprise exclusive dependencies.' diff --git a/enterprise_mod.go b/enterprise_mod.go new file mode 100644 index 0000000000..40117d2926 --- /dev/null +++ b/enterprise_mod.go @@ -0,0 +1,13 @@ +// +build enterprisemod + +// This file contains enterprise exclusive dependencies. +// So that the go.mod file can be consistant regardless of enterprise code being present. +// To detect enterprise exclusive dependencies: +// 1. run `make enterprise-cleanup` +// 2. `go mod tidy` +// 3. observe the changes on go.mod `git diff go.mod` +package enterprisemod + +import ( + _ "github.com/spaolacci/murmur3" +) From 2d0650913e071362deb5eb25b3b6b35847f2413c Mon Sep 17 00:00:00 2001 From: Leonidas Vrachnis Date: Mon, 25 Oct 2021 13:34:14 +0300 Subject: [PATCH 3/5] Without import --- enterprise_mod.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/enterprise_mod.go b/enterprise_mod.go index 40117d2926..949c6b6309 100644 --- a/enterprise_mod.go +++ b/enterprise_mod.go @@ -8,6 +8,4 @@ // 3. observe the changes on go.mod `git diff go.mod` package enterprisemod -import ( - _ "github.com/spaolacci/murmur3" -) +import () From b516b88c23eeaeb32cc0722b16643cd3a0c24f3d Mon Sep 17 00:00:00 2001 From: Leonidas Vrachnis Date: Mon, 25 Oct 2021 13:38:31 +0300 Subject: [PATCH 4/5] fix command --- .github/workflows/verify.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 1896c9ea96..d791a35430 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -25,15 +25,16 @@ jobs: restore-keys: | ${{ runner.os }}-go- - run: go version + + - run: go mod tidy + - run: git diff --exit-code go.mod + - name: Error message + if: ${{ failure() }} + run: echo '::error file=go.mod,line=1,col=1::Inconsistent go mod file. Ensure you have run `go mod tidy` and committed the files locally.'; echo '::error file=enterprise_mod.go,line=1,col=1::Possible missing enterprise exclusive dependencies.' + - run: make mocks - run: git diff --exit-code - name: Error message if: ${{ failure() }} run: echo '::error file=Makefile,line=11,col=1::Incorrectly generated files. Ensure you have run `make mocks` and committed the files locally.' - - run: go mod tidy - - run: git diff --exit-code go.mod - - name: Error message - if: ${{ failure() }} - run: echo '::error file=go.mod,line=1,col=1::Inconsistent go mod file. Ensure you have run `go mod tidy` and committed the files locally.' && \ - echo '::error file=enterprise_mod.go,line=1,col=1::Possible missing enterprise exclusive dependencies.' From 5f8d6f941e7e54013073d53996b52552809522de Mon Sep 17 00:00:00 2001 From: Leonidas Vrachnis Date: Mon, 25 Oct 2021 13:40:50 +0300 Subject: [PATCH 5/5] Revert "Without import" This reverts commit 2d0650913e071362deb5eb25b3b6b35847f2413c. --- enterprise_mod.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/enterprise_mod.go b/enterprise_mod.go index 949c6b6309..40117d2926 100644 --- a/enterprise_mod.go +++ b/enterprise_mod.go @@ -8,4 +8,6 @@ // 3. observe the changes on go.mod `git diff go.mod` package enterprisemod -import () +import ( + _ "github.com/spaolacci/murmur3" +)