Skip to content

Commit 2db2ef7

Browse files
authored
Remove dependabot, add more tools to renovate (#2448)
Problem: dependabot is not very configurable and can't keep track of all of our dependencies. It also has been missing some updates lately. Solution: Remove dependabot and use renovate. This also allows us to remove some dependencies from tools.go and control them directly in the Makefile.
1 parent 6e86f7e commit 2db2ef7

15 files changed

+51
-158
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/labeler.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ jobs:
5858
- name: Output Variables
5959
id: vars
6060
run: |
61+
K8S_KIND_VERSION=v1.31.0 # renovate: datasource=docker depName=kindest/node
6162
echo "go_path=$(go env GOPATH)" >> $GITHUB_OUTPUT
6263
echo "min_k8s_version=v1.25.16" >> $GITHUB_OUTPUT
63-
echo "k8s_latest=$(grep -m1 'FROM kindest/node' <tests/Dockerfile | awk -F'[:]' '{print $2}')" >> $GITHUB_OUTPUT
64+
echo "k8s_latest=${K8S_KIND_VERSION}" >> $GITHUB_OUTPUT
6465
6566
- name: Check if go.mod and go.sum are up to date
6667
run: go mod tidy && git diff --exit-code -- go.mod go.sum
@@ -169,7 +170,7 @@ jobs:
169170
- name: Build binary
170171
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
171172
with:
172-
version: latest
173+
version: v2.2.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
173174
args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} --clean
174175
env:
175176
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/conformance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- name: Build binary
8383
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
8484
with:
85-
version: latest
85+
version: v2.2.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
8686
args: build --single-target --snapshot --clean
8787
env:
8888
TELEMETRY_ENDPOINT: "" # disables sending telemetry

.github/workflows/functional.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Build binary
7070
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
7171
with:
72-
version: latest
72+
version: v2.2.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
7373
args: build --single-target --snapshot --clean
7474
env:
7575
TELEMETRY_ENDPOINT: otel-collector-opentelemetry-collector.collector.svc.cluster.local:4317
@@ -102,11 +102,11 @@ jobs:
102102
103103
- name: Install cloud-provider-kind
104104
run: |
105-
curl -fsSL -O https://github.com/kubernetes-sigs/cloud-provider-kind/releases/download/v0.3.0/cloud-provider-kind_0.3.0_linux_amd64.tar.gz
106-
tar -xvf cloud-provider-kind_0.3.0_linux_amd64.tar.gz
105+
CLOUD_PROVIDER_KIND_VERSION=v0.3.0 # renovate: datasource=github-tags depName=kubernetes-sigs/cloud-provider-kind
106+
go install github.com/kubernetes-sigs/cloud-provider-kind@${CLOUD_PROVIDER_KIND_VERSION}
107107
108108
- name: Run cloud-provider-kind
109-
run: ./cloud-provider-kind & > cloud-provider-kind.log 2>&1
109+
run: $(go env GOPATH)/bin/cloud-provider-kind & > cloud-provider-kind.log 2>&1
110110

111111
- name: Deploy Kubernetes
112112
id: k8s

.github/workflows/helm.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ jobs:
8686
8787
- name: Install cloud-provider-kind
8888
run: |
89-
curl -fsSL -O https://github.com/kubernetes-sigs/cloud-provider-kind/releases/download/v0.3.0/cloud-provider-kind_0.3.0_linux_amd64.tar.gz
90-
tar -xvf cloud-provider-kind_0.3.0_linux_amd64.tar.gz
89+
CLOUD_PROVIDER_KIND_VERSION=v0.3.0 # renovate: datasource=github-tags depName=kubernetes-sigs/cloud-provider-kind
90+
go install github.com/kubernetes-sigs/cloud-provider-kind@${CLOUD_PROVIDER_KIND_VERSION}
9191
9292
- name: Run cloud-provider-kind
93-
run: ./cloud-provider-kind & > cloud-provider-kind.log 2>&1
93+
run: $(go env GOPATH)/bin/cloud-provider-kind & > cloud-provider-kind.log 2>&1
9494

9595
- name: Deploy Kubernetes
9696
id: k8s
@@ -130,11 +130,11 @@ jobs:
130130

131131
- name: Install cloud-provider-kind
132132
run: |
133-
curl -fsSL -O https://github.com/kubernetes-sigs/cloud-provider-kind/releases/download/v0.3.0/cloud-provider-kind_0.3.0_linux_amd64.tar.gz
134-
tar -xvf cloud-provider-kind_0.3.0_linux_amd64.tar.gz
133+
CLOUD_PROVIDER_KIND_VERSION=v0.3.0 # renovate: datasource=github-tags depName=kubernetes-sigs/cloud-provider-kind
134+
go install github.com/kubernetes-sigs/cloud-provider-kind@${CLOUD_PROVIDER_KIND_VERSION}
135135
136136
- name: Run cloud-provider-kind
137-
run: ./cloud-provider-kind & > cloud-provider-kind.log 2>&1
137+
run: $(go env GOPATH)/bin/cloud-provider-kind & > cloud-provider-kind.log 2>&1
138138

139139
- name: Deploy Kubernetes
140140
id: k8s

.github/workflows/labeler.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ jobs:
1212
pull-requests: write
1313
runs-on: ubuntu-22.04
1414
steps:
15+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
16+
with:
17+
sparse-checkout: |
18+
labeler.yml
19+
sparse-checkout-cone-mode: false
20+
repository: nginxinc/k8s-common
21+
1522
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
1623
with:
1724
repo-token: "${{ secrets.GITHUB_TOKEN }}"
1825
sync-labels: true
26+
configuration-path: labeler.yml

.github/workflows/lint.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
4141
with:
4242
working-directory: ${{ matrix.directory }}
43+
version: v1.60.2 # renovate: datasource=github-tags depName=golangci/golangci-lint
4344

4445
njs-lint:
4546
name: NJS Lint
@@ -48,11 +49,6 @@ jobs:
4849
- name: Checkout Repository
4950
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5051

51-
- name: Get Prettier version
52-
id: prettier-version
53-
run: |
54-
echo "version=$(jq -r .devDependencies.prettier ${{ github.workspace }}/internal/mode/static/nginx/modules/package.json)" >> $GITHUB_OUTPUT
55-
5652
- name: Setup Node.js Environment
5753
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
5854
with:
@@ -64,7 +60,7 @@ jobs:
6460
with:
6561
config_path: ${{ github.workspace }}/internal/mode/static/nginx/modules/.prettierrc
6662
file_pattern: ${{ github.workspace }}/internal/mode/static/nginx/modules/**/*.js
67-
prettier_version: ${{ steps.prettier-version.outputs.version }}
63+
prettier_version: 3.3.3 # renovate: datasource=npm depName=prettier
6864

6965
- name: Prettier Output
7066
if: failure()
@@ -117,6 +113,8 @@ jobs:
117113

118114
- name: Set up chart-testing
119115
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
116+
with:
117+
version: 3.11.0 # renovate: datasource=github-tags depName=helm/chart-testing
120118

121119
- name: Run chart-testing
122120
run: ct lint --print-config --config .ct.yaml

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,4 @@ repos:
9090
ci:
9191
skip: [golangci-lint-full, prettier, markdownlint-cli2, yamllint]
9292
autofix_prs: false
93+
autoupdate_schedule: quarterly # We use renovate for more frequent updates and there's no way to disable autoupdate

Makefile

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,27 @@ TELEMETRY_ENDPOINT=# if empty, NGF will report telemetry in its logs at debug le
1616
TELEMETRY_ENDPOINT_INSECURE = false
1717

1818
ENABLE_EXPERIMENTAL ?= false
19-
NODE_VERSION = $(shell cat .nvmrc)
2019

2120
# go build flags - should not be overridden by the user
2221
GO_LINKER_FlAGS_VARS = -X main.version=${VERSION} -X main.telemetryReportPeriod=${TELEMETRY_REPORT_PERIOD} -X main.telemetryEndpoint=${TELEMETRY_ENDPOINT} -X main.telemetryEndpointInsecure=${TELEMETRY_ENDPOINT_INSECURE}
2322
GO_LINKER_FLAGS_OPTIMIZATIONS = -s -w
2423
GO_LINKER_FLAGS = $(GO_LINKER_FLAGS_OPTIMIZATIONS) $(GO_LINKER_FlAGS_VARS)
2524

2625
# tools versions
27-
GOLANGCI_LINT_VERSION := $(shell awk '/repo:.*golangci-lint/{getline; if ($$1 == "rev:") {sub(/^v/, "", $$2); print $$2}}' $(SELF_DIR).pre-commit-config.yaml)
26+
# renovate: datasource=go depName=golangci/golangci-lint
27+
GOLANGCI_LINT_VERSION = v1.60.2
28+
# renovate: datasource=docker depName=kindest/node
29+
KIND_K8S_VERSION = v1.31.0
30+
# renovate: datasource=go depName=norwoodj/helm-docs
31+
HELM_DOCS_VERSION = v1.14.2
32+
# renovate: datasource=go depName=ahmetb/gen-crd-api-reference-docs
33+
GEN_CRD_API_REFERENCE_DOCS_VERSION = v0.3.0
34+
# renovate: datasource=go depName=sigs.k8s.io/controller-tools
35+
CONTROLLER_TOOLS_VERSION = v0.16.1
36+
# renovate: datasource=docker depName=node
37+
NODE_VERSION = 20
38+
# renovate: datasource=docker depName=quay.io/helmpack/chart-testing
39+
CHART_TESTING_VERSION = v3.11.0
2840

2941
# variables that can be overridden by the user
3042
PREFIX ?= nginx-gateway-fabric## The name of the NGF image. For example, nginx-gateway-fabric
@@ -108,7 +120,7 @@ generate: ## Run go generate
108120

109121
.PHONY: generate-crds
110122
generate-crds: ## Generate CRDs and Go types using kubebuilder
111-
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd object paths=./apis/... output:crd:artifacts:config=config/crd/bases
123+
go run sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION) crd object paths=./apis/... output:crd:artifacts:config=config/crd/bases
112124
kubectl kustomize config/crd >deploy/crds.yaml
113125

114126
.PHONY: install-crds
@@ -128,11 +140,11 @@ generate-manifests: ## Generate manifests using Helm.
128140
./scripts/generate-manifests.sh
129141

130142
generate-api-docs: ## Generate API docs
131-
go run github.com/ahmetb/gen-crd-api-reference-docs -config site/config/api/config.json -template-dir site/config/api -out-file site/content/reference/api.md -api-dir "github.com/nginxinc/nginx-gateway-fabric/apis"
143+
go run github.com/ahmetb/gen-crd-api-reference-docs@$(GEN_CRD_API_REFERENCE_DOCS_VERSION) -config site/config/api/config.json -template-dir site/config/api -out-file site/content/reference/api.md -api-dir "github.com/nginxinc/nginx-gateway-fabric/apis"
132144

133145
.PHONY: generate-helm-docs
134146
generate-helm-docs: ## Generate the Helm chart documentation
135-
docker run --pull always --rm -v $(CURDIR):/nginx-gateway-fabric -w /nginx-gateway-fabric jnorwood/helm-docs:latest --chart-search-root=charts --template-files _templates.gotmpl --template-files README.md.gotmpl
147+
go run github.com/norwoodj/helm-docs/cmd/helm-docs@$(HELM_DOCS_VERSION) --chart-search-root=charts --template-files _templates.gotmpl --template-files README.md.gotmpl
136148

137149
.PHONY: generate-all
138150
generate-all: generate generate-crds generate-manifests generate-api-docs generate-helm-docs ## Generate all the necessary files
@@ -151,8 +163,8 @@ deps: ## Add missing and remove unused modules, verify deps and download them to
151163

152164
.PHONY: create-kind-cluster
153165
create-kind-cluster: ## Create a kind cluster
154-
$(eval KIND_IMAGE=$(shell grep -m1 'FROM kindest/node' <$(SELF_DIR)tests/Dockerfile | awk -F'[ ]' '{print $$2}'))
155-
kind create cluster --image $(KIND_IMAGE) --config $(KIND_CONFIG_FILE)
166+
@kind version || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with kind. Follow the docs to install it https://kind.sigs.k8s.io/docs/user/quick-start/\n"; exit $$code)
167+
kind create cluster --image kindest/node:$(KIND_K8S_VERSION) --config $(KIND_CONFIG_FILE)
156168

157169
.PHONY: delete-kind-cluster
158170
delete-kind-cluster: ## Delete kind cluster
@@ -173,14 +185,9 @@ njs-fmt: ## Run prettier against the njs httpmatches module
173185
vet: ## Run go vet against code
174186
go vet ./...
175187

176-
.PHONY: check-golangci-lint
177-
check-golangci-lint:
178-
@golangci-lint --version || (code=$$?; printf "\033[0;31mError\033[0m: there was a problem with golangci-lint. Follow the docs to install it https://golangci-lint.run/welcome/install/\n"; exit $$code)
179-
@golangci-lint --version | grep -q $(GOLANGCI_LINT_VERSION) || (printf "\033[0;33mWarning\033[0m: your golangci-lint version is different from the one specified in .pre-commit-config.yaml. The recommended version is $(GOLANGCI_LINT_VERSION)\n")
180-
181188
.PHONY: lint
182-
lint: check-golangci-lint ## Run golangci-lint against code
183-
golangci-lint run --fix
189+
lint: ## Run golangci-lint against code
190+
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --fix
184191

185192
.PHONY: unit-test
186193
unit-test: ## Run unit tests for the go code
@@ -199,7 +206,7 @@ njs-unit-test: ## Run unit tests for the njs httpmatches module
199206

200207
.PHONY: lint-helm
201208
lint-helm: ## Run the helm chart linter
202-
docker run --pull always --rm -v $(CURDIR):/nginx-gateway-fabric -w /nginx-gateway-fabric quay.io/helmpack/chart-testing:latest ct lint --config .ct.yaml
209+
docker run --pull always --rm -v $(CURDIR):/nginx-gateway-fabric -w /nginx-gateway-fabric quay.io/helmpack/chart-testing:$(CHART_TESTING_VERSION) ct lint --config .ct.yaml
203210

204211
.PHONY: load-images
205212
load-images: ## Load NGF and NGINX images on configured kind cluster.

go.mod

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module github.com/nginxinc/nginx-gateway-fabric
33
go 1.22.0
44

55
require (
6-
github.com/ahmetb/gen-crd-api-reference-docs v0.3.0
76
github.com/go-kit/log v0.2.1
87
github.com/go-logr/logr v1.4.2
98
github.com/google/go-cmp v0.6.0
@@ -25,7 +24,6 @@ require (
2524
k8s.io/apimachinery v0.31.0
2625
k8s.io/client-go v0.31.0
2726
sigs.k8s.io/controller-runtime v0.19.0
28-
sigs.k8s.io/controller-tools v0.16.1
2927
sigs.k8s.io/gateway-api v1.1.0
3028
)
3129

@@ -36,7 +34,6 @@ require (
3634
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3735
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
3836
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
39-
github.com/fatih/color v1.17.0 // indirect
4037
github.com/fsnotify/fsnotify v1.7.0 // indirect
4138
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
4239
github.com/go-logfmt/logfmt v0.5.1 // indirect
@@ -46,7 +43,6 @@ require (
4643
github.com/go-openapi/jsonreference v0.21.0 // indirect
4744
github.com/go-openapi/swag v0.23.0 // indirect
4845
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
49-
github.com/gobuffalo/flect v1.0.2 // indirect
5046
github.com/gogo/protobuf v1.3.2 // indirect
5147
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5248
github.com/golang/protobuf v1.5.4 // indirect
@@ -61,15 +57,12 @@ require (
6157
github.com/json-iterator/go v1.1.12 // indirect
6258
github.com/klauspost/compress v1.17.9 // indirect
6359
github.com/mailru/easyjson v0.7.7 // indirect
64-
github.com/mattn/go-colorable v0.1.13 // indirect
65-
github.com/mattn/go-isatty v0.0.20 // indirect
6660
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6761
github.com/modern-go/reflect2 v1.0.2 // indirect
6862
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6963
github.com/pkg/errors v0.9.1 // indirect
7064
github.com/prometheus/client_model v0.6.1 // indirect
7165
github.com/prometheus/procfs v0.15.1 // indirect
72-
github.com/russross/blackfriday/v2 v2.1.0 // indirect
7366
github.com/x448/float16 v0.8.4 // indirect
7467
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
7568
go.opentelemetry.io/otel/metric v1.28.0 // indirect
@@ -96,8 +89,6 @@ require (
9689
gopkg.in/inf.v0 v0.9.1 // indirect
9790
gopkg.in/yaml.v2 v2.4.0 // indirect
9891
gopkg.in/yaml.v3 v3.0.1 // indirect
99-
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
100-
k8s.io/klog v0.2.0 // indirect
10192
k8s.io/klog/v2 v2.130.1 // indirect
10293
k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 // indirect
10394
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect

0 commit comments

Comments
 (0)