From 98854337ff99fb3d5b80664a32034ce6e7cbaee8 Mon Sep 17 00:00:00 2001 From: Andrei Aaron Date: Mon, 10 Oct 2022 15:05:55 +0300 Subject: [PATCH] build(tags): remove redundant build tag ui_base (#857) It was not used for UI, it had become a CLI dependency with the same functionality as search Signed-off-by: Andrei Aaron --- .github/workflows/branch-cov.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/golangci-lint.yaml | 2 +- CONTRIBUTING.md | 2 +- Makefile | 8 ++++---- pkg/api/controller_test.go | 4 ++-- pkg/api/routes_test.go | 4 ++-- pkg/cli/cli.go | 4 ++-- pkg/cli/client.go | 4 ++-- pkg/cli/client_elevated_test.go | 4 ++-- pkg/cli/client_test.go | 4 ++-- pkg/cli/config_cmd.go | 4 ++-- pkg/cli/config_cmd_test.go | 4 ++-- pkg/cli/cve_cmd.go | 4 ++-- pkg/cli/cve_cmd_test.go | 4 ++-- pkg/cli/extensions_test.go | 4 ++-- pkg/cli/image_cmd.go | 4 ++-- pkg/cli/image_cmd_test.go | 4 ++-- pkg/cli/minimal.go | 4 ++-- pkg/cli/repo_cmd.go | 4 ++-- pkg/cli/searcher.go | 4 ++-- pkg/cli/service.go | 4 ++-- pkg/extensions/README.md | 2 +- pkg/extensions/extension_search.go | 4 ++-- pkg/extensions/extension_search_disabled.go | 4 ++-- pkg/log/log_test.go | 4 ++-- pkg/test/common_test.go | 4 ++-- test/scripts/fuzzAll.sh | 2 +- 28 files changed, 52 insertions(+), 52 deletions(-) diff --git a/.github/workflows/branch-cov.yml b/.github/workflows/branch-cov.yml index 38fa629a..6cef4884 100644 --- a/.github/workflows/branch-cov.yml +++ b/.github/workflows/branch-cov.yml @@ -38,7 +38,7 @@ jobs: cd $GITHUB_WORKSPACE for i in $(find . -type f \( -name "*.go" -not -name "*_test.go" -not -name "generated.go" \)); do echo $i; - gobco -test '-tags=sync,search,scrub,metrics,ui_base,containers_image_openpgp' $i; + gobco -test '-tags=sync,search,scrub,metrics,containers_image_openpgp' $i; gobco -test '-tags=minimal,containers_image_openpgp' $i; done env: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 39796dbb..541ac3c9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -39,7 +39,7 @@ jobs: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed env: CGO_ENABLED: 0 - GOFLAGS: "-tags=sync,search,scrub,metrics,ui_base,containers_image_openpgp" + GOFLAGS: "-tags=sync,search,scrub,metrics,containers_image_openpgp" steps: - name: Checkout repository diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index b7ba6b7f..a0af8f7c 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -31,7 +31,7 @@ jobs: # Optional: golangci-lint command line arguments. # args: --issues-exit-code=0 - args: --config ./golangcilint.yaml --enable-all --build-tags debug,needprivileges,sync,scrub,search,metrics,ui_base,containers_image_openpgp,lint ./cmd/... ./pkg/... + args: --config ./golangcilint.yaml --enable-all --build-tags debug,needprivileges,sync,scrub,search,metrics,containers_image_openpgp,lint ./cmd/... ./pkg/... # Optional: show only new issues if it's a pull request. The default value is `false`. # only-new-issues: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3bce5169..bb46808c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,7 +45,7 @@ make binary-minimal ``` For a zot that includes only the extensions that you specify, -the available extensions that can be used at the moment are: sync, scrub, metrics, search, ui_base . +the available extensions that can be used at the moment are: sync, scrub, metrics, search. NOTES: When multiple extensions are used, they should be enlisted in the above presented order. diff --git a/Makefile b/Makefile index d660d3f1..655061f9 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ TESTDATA := $(TOP_LEVEL)/test/data OS ?= linux ARCH ?= amd64 BENCH_OUTPUT ?= stdout -EXTENSIONS ?= sync,search,scrub,metrics,ui_base,lint +EXTENSIONS ?= sync,search,scrub,metrics,lint comma:= , hyphen:= - extended-name:= @@ -59,7 +59,7 @@ binary-debug: modcheck swagger create-name build-metadata .PHONY: cli cli: modcheck create-name build-metadata - env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zli-$(OS)-$(ARCH) -buildmode=pie -tags $(EXTENSIONS),ui_base,containers_image_openpgp -v -trimpath -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=$(extended-name) -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zli + env CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build -o bin/zli-$(OS)-$(ARCH) -buildmode=pie -tags $(EXTENSIONS),search,containers_image_openpgp -v -trimpath -ldflags "-X zotregistry.io/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.io/zot/pkg/api/config.BinaryType=$(extended-name) -X zotregistry.io/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zli .PHONY: bench bench: modcheck create-name build-metadata @@ -280,12 +280,12 @@ bats-sync-verbose: binary binary-minimal check-skopeo $(BATS) $(BATS) --trace -t -x -p --verbose-run --print-output-on-failure --show-output-of-passing-tests test/blackbox/sync.bats .PHONY: bats-cve -bats-cve: EXTENSIONS=ui_base +bats-cve: EXTENSIONS=search bats-cve: binary cli check-skopeo $(BATS) $(BATS) --trace --print-output-on-failure test/blackbox/cve.bats .PHONY: bats-cve-verbose -bats-cve-verbose: EXTENSIONS=ui_base +bats-cve-verbose: EXTENSIONS=search bats-cve-verbose: binary cli check-skopeo $(BATS) $(BATS) --trace -t -x -p --verbose-run --print-output-on-failure --show-output-of-passing-tests test/blackbox/cve.bats diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index c3a3ccd4..1d3b5d0d 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -1,5 +1,5 @@ -//go:build sync && scrub && metrics && search && ui_base -// +build sync,scrub,metrics,search,ui_base +//go:build sync && scrub && metrics && search +// +build sync,scrub,metrics,search package api_test diff --git a/pkg/api/routes_test.go b/pkg/api/routes_test.go index 2bb8276f..f6094fd3 100644 --- a/pkg/api/routes_test.go +++ b/pkg/api/routes_test.go @@ -1,5 +1,5 @@ -//go:build sync && scrub && metrics && search && ui_base && lint -// +build sync,scrub,metrics,search,ui_base,lint +//go:build sync && scrub && metrics && search && lint +// +build sync,scrub,metrics,search,lint package api_test diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index f5e3e884..6c2d8b1a 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -1,5 +1,5 @@ -//go:build ui_base || search -// +build ui_base search +//go:build search +// +build search package cli diff --git a/pkg/cli/client.go b/pkg/cli/client.go index 5cea555a..8da0ab98 100644 --- a/pkg/cli/client.go +++ b/pkg/cli/client.go @@ -1,5 +1,5 @@ -//go:build search || ui_base -// +build search ui_base +//go:build search +// +build search package cli diff --git a/pkg/cli/client_elevated_test.go b/pkg/cli/client_elevated_test.go index 5168b740..2354f739 100644 --- a/pkg/cli/client_elevated_test.go +++ b/pkg/cli/client_elevated_test.go @@ -1,5 +1,5 @@ -//go:build ui_base && needprivileges -// +build ui_base,needprivileges +//go:build search && needprivileges +// +build search,needprivileges package cli //nolint:testpackage diff --git a/pkg/cli/client_test.go b/pkg/cli/client_test.go index 556f2e6e..f758f208 100644 --- a/pkg/cli/client_test.go +++ b/pkg/cli/client_test.go @@ -1,5 +1,5 @@ -//go:build ui_base -// +build ui_base +//go:build search +// +build search package cli //nolint:testpackage diff --git a/pkg/cli/config_cmd.go b/pkg/cli/config_cmd.go index 65498a4e..b94547b4 100644 --- a/pkg/cli/config_cmd.go +++ b/pkg/cli/config_cmd.go @@ -1,5 +1,5 @@ -//go:build search || ui_base -// +build search ui_base +//go:build search +// +build search package cli diff --git a/pkg/cli/config_cmd_test.go b/pkg/cli/config_cmd_test.go index 7a7b16af..6f5d3c01 100644 --- a/pkg/cli/config_cmd_test.go +++ b/pkg/cli/config_cmd_test.go @@ -1,5 +1,5 @@ -//go:build ui_base -// +build ui_base +//go:build search +// +build search package cli //nolint:testpackage diff --git a/pkg/cli/cve_cmd.go b/pkg/cli/cve_cmd.go index 6ad9e71e..83846852 100644 --- a/pkg/cli/cve_cmd.go +++ b/pkg/cli/cve_cmd.go @@ -1,5 +1,5 @@ -//go:build search || ui_base -// +build search ui_base +//go:build search +// +build search package cli diff --git a/pkg/cli/cve_cmd_test.go b/pkg/cli/cve_cmd_test.go index 011bf480..4c46365e 100644 --- a/pkg/cli/cve_cmd_test.go +++ b/pkg/cli/cve_cmd_test.go @@ -1,5 +1,5 @@ -//go:build ui_base -// +build ui_base +//go:build search +// +build search package cli //nolint:testpackage diff --git a/pkg/cli/extensions_test.go b/pkg/cli/extensions_test.go index 26445e37..84ecbc0e 100644 --- a/pkg/cli/extensions_test.go +++ b/pkg/cli/extensions_test.go @@ -1,5 +1,5 @@ -//go:build sync && scrub && metrics && search && ui_base -// +build sync,scrub,metrics,search,ui_base +//go:build sync && scrub && metrics && search +// +build sync,scrub,metrics,search package cli_test diff --git a/pkg/cli/image_cmd.go b/pkg/cli/image_cmd.go index 35f5073b..b00058f3 100644 --- a/pkg/cli/image_cmd.go +++ b/pkg/cli/image_cmd.go @@ -1,5 +1,5 @@ -//go:build search || ui_base -// +build search ui_base +//go:build search +// +build search package cli diff --git a/pkg/cli/image_cmd_test.go b/pkg/cli/image_cmd_test.go index 76480c64..19b20920 100644 --- a/pkg/cli/image_cmd_test.go +++ b/pkg/cli/image_cmd_test.go @@ -1,5 +1,5 @@ -//go:build ui_base -// +build ui_base +//go:build search +// +build search package cli //nolint:testpackage diff --git a/pkg/cli/minimal.go b/pkg/cli/minimal.go index 5a79575b..49d0762b 100644 --- a/pkg/cli/minimal.go +++ b/pkg/cli/minimal.go @@ -1,5 +1,5 @@ -//go:build !search && !ui_base -// +build !search,!ui_base +//go:build !search +// +build !search package cli diff --git a/pkg/cli/repo_cmd.go b/pkg/cli/repo_cmd.go index 71664f74..2df455a8 100644 --- a/pkg/cli/repo_cmd.go +++ b/pkg/cli/repo_cmd.go @@ -1,5 +1,5 @@ -//go:build search || ui_base -// +build search ui_base +//go:build search +// +build search package cli diff --git a/pkg/cli/searcher.go b/pkg/cli/searcher.go index 378c87e3..98b14509 100644 --- a/pkg/cli/searcher.go +++ b/pkg/cli/searcher.go @@ -1,5 +1,5 @@ -//go:build search || ui_base -// +build search ui_base +//go:build search +// +build search package cli diff --git a/pkg/cli/service.go b/pkg/cli/service.go index 4fd75a07..292a0f4a 100644 --- a/pkg/cli/service.go +++ b/pkg/cli/service.go @@ -1,5 +1,5 @@ -//go:build ui_base || search -// +build ui_base search +//go:build search +// +build search package cli diff --git a/pkg/extensions/README.md b/pkg/extensions/README.md index 297ac044..458490d8 100644 --- a/pkg/extensions/README.md +++ b/pkg/extensions/README.md @@ -27,5 +27,5 @@ package extensions - with every new extension, you should modify the EXTENSIONS variable in Makefile by adding the new extension. The EXTENSIONS variable represents all extensions and is used in Make targets that require them all (e.g make test). -- the available extensions that can be used at the moment are: sync, scrub, metrics, search, ui_base . +- the available extensions that can be used at the moment are: sync, scrub, metrics, search . NOTE: When multiple extensions are used, they should be enlisted in the above presented order. diff --git a/pkg/extensions/extension_search.go b/pkg/extensions/extension_search.go index 298e1051..e1cf5a6e 100644 --- a/pkg/extensions/extension_search.go +++ b/pkg/extensions/extension_search.go @@ -1,5 +1,5 @@ -//go:build search || ui_base -// +build search ui_base +//go:build search +// +build search package extensions diff --git a/pkg/extensions/extension_search_disabled.go b/pkg/extensions/extension_search_disabled.go index 6e8b48fe..f7f784d8 100644 --- a/pkg/extensions/extension_search_disabled.go +++ b/pkg/extensions/extension_search_disabled.go @@ -1,5 +1,5 @@ -//go:build !search && !ui_base -// +build !search,!ui_base +//go:build !search +// +build !search package extensions diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index 4e8d26bb..f4a1bffb 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -1,5 +1,5 @@ -//go:build sync && scrub && metrics && search && ui_base -// +build sync,scrub,metrics,search,ui_base +//go:build sync && scrub && metrics && search +// +build sync,scrub,metrics,search package log_test diff --git a/pkg/test/common_test.go b/pkg/test/common_test.go index c011ee76..9915143a 100644 --- a/pkg/test/common_test.go +++ b/pkg/test/common_test.go @@ -1,5 +1,5 @@ -//go:build sync && scrub && metrics && search && ui_base -// +build sync,scrub,metrics,search,ui_base +//go:build sync && scrub && metrics && search +// +build sync,scrub,metrics,search package test_test diff --git a/test/scripts/fuzzAll.sh b/test/scripts/fuzzAll.sh index a92e8706..5267665d 100644 --- a/test/scripts/fuzzAll.sh +++ b/test/scripts/fuzzAll.sh @@ -13,6 +13,6 @@ do do echo "Fuzzing $func in $file" parentDir=$(dirname $file) - go test $parentDir -run=$func -fuzz=$func$ -fuzztime=${fuzzTime}s -tags sync,metrics,search,scrub,ui_base,containers_image_openpgp | grep -oP -x '^(?:(?!\blevel\b).)*$' + go test $parentDir -run=$func -fuzz=$func$ -fuzztime=${fuzzTime}s -tags sync,metrics,search,scrub,containers_image_openpgp | grep -oP -x '^(?:(?!\blevel\b).)*$' done done \ No newline at end of file