Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renovate: let renovate update golangci-lint and various fixes #1263

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 58 additions & 31 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down Expand Up @@ -64,7 +67,10 @@
"groupName": "all github action dependencies",
"groupSlug": "all-github-action",
"matchFileNames": [
".github/workflows/**"
"\\.github/workflows/**"
],
"matchManagers": [
"github-actions"
],
"matchUpdateTypes": [
"major",
Expand All @@ -80,7 +86,7 @@
},
{
"matchFileNames": [
".github/workflows/**"
"\\.github/workflows/**"
],
"matchManagers": [
"github-actions"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -216,7 +222,7 @@
},
{
"matchPackageNames": [
"docker.io/library/busybox"
"docker\\.io/library/busybox"
],
"matchFileNames": [
"Dockerfile"
Expand All @@ -233,26 +239,31 @@
"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"
]
},
{
"matchFileNames": [
"install/kubernetes/values.yaml",
"install/kubernetes/values\\.yaml",
],
// lint and generate files for helm chart
"postUpgradeTasks": {
Expand Down Expand Up @@ -280,8 +291,8 @@
"matchPackageNames": ["docker.io/library/ubuntu"],
"matchManagers": ["dockerfile"],
"matchFileNames": [
"Dockerfile.clang",
"Dockerfile.clang-format"
"Dockerfile\\.clang",
"Dockerfile\\.clang-format"
],
"enabled": false
}
Expand All @@ -299,11 +310,27 @@
},
{
"fileMatch": [
"Makefile.cli"
"^Makefile\\.cli$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?)\\s+GO_IMAGE[[:blank:]]*=[[:blank:]]*(?<depName>.*?):(?<currentValue>[^\\s]*)"
]
},
{
"fileMatch": [
"^\\.github/renovate\\.json5$"
],
"matchStrings": [
"// renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+.+install-tool golang (?<currentValue>[^'\"]*)"
]
},
{
"fileMatch": [
"^Makefile$"
],
"matchStrings": [
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)\\s+GOLANGCILINT_WANT_VERSION[[:blank:]]*=[[:blank:]]*(?<currentValue>[^\\s]*)"
]
}
]
}
5 changes: 5 additions & 0 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
renovate_log_level_debug:
type: boolean
default: false
push:
branches:
- main
paths:
- '.github/renovate.json5'

jobs:
renovate:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 0 additions & 12 deletions pkg/k8s/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
Loading