From 7cbed27a802f176f78bc4a37bff26a0d66c87007 Mon Sep 17 00:00:00 2001 From: k8s-bot Date: Wed, 5 Jun 2024 13:15:11 +0200 Subject: [PATCH] Remove deadcode checker CI The deadcode checker doesn't work well with our features setup as it detects non-main feature modules (that are used e.g. in moonray) as unused and blocks the CI. That checker hasn't really contributed anything useful anyway, so let's just remove it. --- .github/workflows/go.yaml | 4 ---- src/k8s/Makefile | 3 --- src/k8s/tools/deadcode.sh | 20 -------------------- src/k8s/tools/go.mod | 8 +------- src/k8s/tools/go.sum | 8 -------- src/k8s/tools/tools.go | 1 - 6 files changed, 1 insertion(+), 43 deletions(-) delete mode 100755 src/k8s/tools/deadcode.sh diff --git a/.github/workflows/go.yaml b/.github/workflows/go.yaml index 799acad062..4d88a233ea 100644 --- a/.github/workflows/go.yaml +++ b/.github/workflows/go.yaml @@ -61,10 +61,6 @@ jobs: working-directory: src/k8s run: make go.vet - - name: go deadcode - working-directory: src/k8s - run: make go.deadcode - - name: go test working-directory: src/k8s run: make go.unit diff --git a/src/k8s/Makefile b/src/k8s/Makefile index 8e6c40f209..42ad1def1f 100644 --- a/src/k8s/Makefile +++ b/src/k8s/Makefile @@ -13,9 +13,6 @@ go.vet: go.unit: $(DQLITE_BUILD_SCRIPTS_DIR)/static-go-test.sh -v ./pkg/... ./cmd/... ./api/... -coverprofile=coverage.txt --cover -go.deadcode: - $(TOOLS_DIR)/deadcode.sh - go.doc: bin/static/k8s bin/static/k8s generate-docs --output-dir ../../docs/src/_parts/commands/ diff --git a/src/k8s/tools/deadcode.sh b/src/k8s/tools/deadcode.sh deleted file mode 100755 index 14bc3604d5..0000000000 --- a/src/k8s/tools/deadcode.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -eu - -# Build deadcode -TOOLS_DIR="$(realpath `dirname "${0}"`)" -( - cd "${TOOLS_DIR}" - go install golang.org/x/tools/cmd/deadcode -) - -# Run deadcode -DIR="${TOOLS_DIR}/../hack" -. "${DIR}/static-dqlite.sh" -( - cd "${TOOLS_DIR}/.." - x="$($(go env GOPATH)/bin/deadcode -tags dqlite,libsqlite3 -test ./...)" - if [ ! -z "$x" ]; then - echo "$x" - exit 1 - fi -) diff --git a/src/k8s/tools/go.mod b/src/k8s/tools/go.mod index 9c9a9e5de4..02a4e8ebf3 100644 --- a/src/k8s/tools/go.mod +++ b/src/k8s/tools/go.mod @@ -2,10 +2,7 @@ module github.com/canonical/k8s/tools go 1.22 -require ( - github.com/regclient/regclient v0.6.1 - golang.org/x/tools v0.20.0 -) +require github.com/regclient/regclient v0.6.1 require ( github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 // indirect @@ -17,9 +14,6 @@ require ( github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ulikunitz/xz v0.5.12 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.20.0 // indirect - golang.org/x/telemetry v0.0.0-20240405141642-5e7a33625e65 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/src/k8s/tools/go.sum b/src/k8s/tools/go.sum index 1bf76fa9e3..42e110ebf1 100644 --- a/src/k8s/tools/go.sum +++ b/src/k8s/tools/go.sum @@ -30,17 +30,9 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/telemetry v0.0.0-20240405141642-5e7a33625e65 h1:2YD4MqNQYEQlI4t931POAM5w8fe4ZFkHRWTJhRIAjz8= -golang.org/x/telemetry v0.0.0-20240405141642-5e7a33625e65/go.mod h1:W6pterlIx28wS98MzYROSpZ8u12XJW5a0ZVeaJ6pfSo= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/src/k8s/tools/tools.go b/src/k8s/tools/tools.go index ad2694534b..1c97d31648 100644 --- a/src/k8s/tools/tools.go +++ b/src/k8s/tools/tools.go @@ -2,5 +2,4 @@ package main import ( _ "github.com/regclient/regclient/cmd/regsync" - _ "golang.org/x/tools/cmd/deadcode" )