diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 863c33df698..1d61c173af8 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -13,7 +13,8 @@ "^make codegen$", "^make generate$", "^install/kubernetes/test.sh$", - "^go mod vendor$" + "^go mod vendor$", + "^install-tool golang [0-9]\\.[0-9]+\\.[0-9]+$" ], // repository configuration "$schema": "https://docs.renovatebot.com/renovate-schema.json", @@ -24,16 +25,18 @@ ], "gitAuthor": "cilium-renovate[bot] <134692979+cilium-renovate[bot]@users.noreply.github.com>", "includePaths": [ - ".github/workflows/**", - "go.mod", - "go.sum", - "api/go.mod", - "api/go.sum", - "pkg/k8s/go.mod", - "pkg/k8s/go.sum", + "\\.github/renovate\\.json5", + "\\.github/workflows/**", + "go\\.mod", + "go\\.sum", + "api/go\\.mod", + "api/go\\.sum", + "pkg/k8s/go\\.mod", + "pkg/k8s/go\\.sum", "Dockerfile*", - "install/kubernetes/values.yaml", - "Makefile.cli" + "install/kubernetes/values\\.yaml", + "Makefile\\.cli", + "Makefile", ], "postUpdateOptions": [ "gomodTidy" @@ -64,7 +67,10 @@ "groupName": "all github action dependencies", "groupSlug": "all-github-action", "matchFileNames": [ - ".github/workflows/**" + "\\.github/workflows/**" + ], + "matchManagers": [ + "github-actions" ], "matchUpdateTypes": [ "major", @@ -80,7 +86,7 @@ }, { "matchFileNames": [ - ".github/workflows/**" + "\\.github/workflows/**" ], "matchManagers": [ "github-actions" @@ -90,8 +96,8 @@ { // not grouping Go minor and major updates together "matchFileNames": [ - "go.mod", - "go.sum" + "go\\.mod", + "go\\.sum" ], "postUpdateOptions": [ // update source import paths on major updates @@ -114,8 +120,8 @@ "groupName": "all go dependencies main", "groupSlug": "all-go-deps-main", "matchFileNames": [ - "go.mod", - "go.sum" + "go\\.mod", + "go\\.sum" ], "postUpdateOptions": [ // update source import paths on major updates @@ -141,8 +147,8 @@ "groupName": "all API go dependencies main", "groupSlug": "all-api-go-deps-main", "matchFileNames": [ - "api/go.mod", - "api/go.sum" + "api/go\\.mod", + "api/go\\.sum" ], "postUpdateOptions": [ // update source import paths on major updates @@ -168,8 +174,8 @@ { // not grouping major updates together "matchFileNames": [ - "pkg/k8s/go.mod", - "pkg/k8s/go.sum" + "pkg/k8s/go\\.mod", + "pkg/k8s/go\\.sum" ], "postUpdateOptions": [ // update source import paths on major updates @@ -191,8 +197,8 @@ "groupName": "all k8s pkg go dependencies main", "groupSlug": "all-k8s-pkg-go-deps-main", "matchFileNames": [ - "pkg/k8s/go.mod", - "pkg/k8s/go.sum" + "pkg/k8s/go\\.mod", + "pkg/k8s/go\\.sum" ], "postUpdateOptions": [ // update source import paths on major updates @@ -216,7 +222,7 @@ }, { "matchPackageNames": [ - "docker.io/library/busybox" + "docker\\.io/library/busybox" ], "matchFileNames": [ "Dockerfile" @@ -233,18 +239,23 @@ "groupName": "Go", "matchDepNames": [ "go", - "docker.io/library/golang" + "docker\\.io/library/golang" ], // postUpgradeTasks is only for when the Go module directives are bumped "postUpgradeTasks": { - "commands": ["go mod vendor"], + // We need to trigger a golang install manually here because in some + // cases it might not be preinstalled, see: + // https://github.com/renovatebot/renovate/discussions/23485 + // renovate: datasource=golang-version depName=go + "commands": ["install-tool golang 1.20.6", "go mod vendor"], "fileFilters": ["**/**"], "executionMode": "branch" }, }, { - // Group golangci-lint updates to overrule grouping of version updates in the GHA files. - // Without this, golangci-lint updates are not in sync for GHA files and other usages. + // Group golangci-lint updates to overrule grouping of version updates in + // the GHA files. Without this, golangci-lint updates are not in sync for + // GHA files and other usages. This needs to be after the GHA grouping. "groupName": "golangci-lint", "matchDepNames": [ "golangci/golangci-lint" @@ -252,7 +263,7 @@ }, { "matchFileNames": [ - "install/kubernetes/values.yaml", + "install/kubernetes/values\\.yaml", ], // lint and generate files for helm chart "postUpgradeTasks": { @@ -280,8 +291,8 @@ "matchPackageNames": ["docker.io/library/ubuntu"], "matchManagers": ["dockerfile"], "matchFileNames": [ - "Dockerfile.clang", - "Dockerfile.clang-format" + "Dockerfile\\.clang", + "Dockerfile\\.clang-format" ], "enabled": false } @@ -299,11 +310,27 @@ }, { "fileMatch": [ - "Makefile.cli" + "^Makefile\\.cli$" ], "matchStrings": [ "# renovate: datasource=(?.*?)\\s+GO_IMAGE[[:blank:]]*=[[:blank:]]*(?.*?):(?[^\\s]*)" ] + }, + { + "fileMatch": [ + "^\\.github/renovate\\.json5$" + ], + "matchStrings": [ + "// renovate: datasource=(?.*?) depName=(?.*?)\\s+.+install-tool golang (?[^'\"]*)" + ] + }, + { + "fileMatch": [ + "^Makefile$" + ], + "matchStrings": [ + "# renovate: datasource=(?.*?) depName=(?.*?)\\s+GOLANGCILINT_WANT_VERSION[[:blank:]]*=[[:blank:]]*(?[^\\s]*)" + ] } ] } diff --git a/.github/workflows/renovate.yaml b/.github/workflows/renovate.yaml index 6d1e720351b..c27aa81b4b9 100644 --- a/.github/workflows/renovate.yaml +++ b/.github/workflows/renovate.yaml @@ -9,6 +9,11 @@ on: renovate_log_level_debug: type: boolean default: false + push: + branches: + - main + paths: + - '.github/renovate.json5' jobs: renovate: diff --git a/.github/workflows/static-checks.yaml b/.github/workflows/static-checks.yaml index fc7477bca46..4e53a3b52fa 100644 --- a/.github/workflows/static-checks.yaml +++ b/.github/workflows/static-checks.yaml @@ -25,6 +25,7 @@ jobs: - name: Run static checks uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0 with: + # renovate: datasource=docker depName=docker.io/golangci/golangci-lint version: v1.53.3 args: --config=.golangci.yml --verbose skip-cache: true diff --git a/Makefile b/Makefile index 90be529005e..95bdd0c3d8a 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ GO_LDFLAGS_STATIC="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION) GO_IMAGE_LDFLAGS=$(GO_LDFLAGS_STATIC) GO_OPERATOR_IMAGE_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)' -s -w" - +# renovate: datasource=docker depName=docker.io/golangci/golangci-lint GOLANGCILINT_WANT_VERSION = 1.53.3 GOLANGCILINT_VERSION = $(shell golangci-lint version 2>/dev/null) diff --git a/pkg/k8s/Makefile b/pkg/k8s/Makefile index 0d3e5af0cbf..41421e9d2e6 100644 --- a/pkg/k8s/Makefile +++ b/pkg/k8s/Makefile @@ -1,12 +1,4 @@ GO ?= go -VERSION=$(shell git describe --tags --always) -GO_GCFLAGS ?= "" -GO_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)'" -GO_IMAGE_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)' -linkmode external -extldflags -static" -GO_OPERATOR_IMAGE_LDFLAGS="-X 'github.com/cilium/tetragon/pkg/version.Version=$(VERSION)' -s -w" - -GOLANGCILINT_WANT_VERSION = 1.52.2 -GOLANGCILINT_VERSION = $(shell golangci-lint version 2>/dev/null) all: generate @@ -17,10 +9,6 @@ help: @echo 'Generated files:' @echo ' generate - genereate kubebuilder files' -ifeq (1,$(NOOPT)) -GO_GCFLAGS = "all=-N -l" -endif - generate: ./tools/controller-gen crd paths=./apis/... output:dir=apis/cilium.io/client/crds/v1alpha1 # Do two invocations of generate-groups.sh, one with --plural-exceptions, one without