From fcff05e4785a07509d644c5d7d817262ca64f38c Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Wed, 18 Dec 2024 22:55:16 +0530 Subject: [PATCH] chore: more renovate defaults Add renovate defaults, so we don't repeat over in `.kres.yaml`. Signed-off-by: Noel Georgi --- Dockerfile | 6 ++-- Makefile | 4 +-- go.mod | 2 +- go.sum | 4 +-- internal/config/constants.go | 8 ++--- internal/output/renovate/renovate.go | 2 +- internal/project/pkgfile/build.go | 47 ++++++++++++++++++++++++++++ 7 files changed, 60 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8cb7bc5..4e3cd71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -# syntax = docker/dockerfile-upstream:1.12.0-labs +# syntax = docker/dockerfile-upstream:1.12.1-labs # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-12-16T13:00:41Z by kres fb2c01d-dirty. +# Generated on 2024-12-18T17:24:46Z by kres b9507d6-dirty. ARG TOOLCHAIN @@ -11,7 +11,7 @@ FROM ghcr.io/siderolabs/ca-certificates:v1.9.0 AS image-ca-certificates FROM ghcr.io/siderolabs/fhs:v1.9.0 AS image-fhs # runs markdownlint -FROM docker.io/oven/bun:1.1.38-alpine AS lint-markdown +FROM docker.io/oven/bun:1.1.40-alpine AS lint-markdown WORKDIR /src RUN bun i markdownlint-cli@0.43.0 sentences-per-line@0.3.0 COPY .markdownlint.json . diff --git a/Makefile b/Makefile index 43381e3..df8f113 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-12-09T10:37:39Z by kres 2e7a4967. +# Generated on 2024-12-18T17:24:46Z by kres b9507d6-dirty. # common variables @@ -17,7 +17,7 @@ WITH_RACE ?= false REGISTRY ?= ghcr.io USERNAME ?= siderolabs REGISTRY_AND_USERNAME ?= $(REGISTRY)/$(USERNAME) -PROTOBUF_GO_VERSION ?= 1.35.2 +PROTOBUF_GO_VERSION ?= 1.36.0 GRPC_GO_VERSION ?= 1.5.1 GRPC_GATEWAY_VERSION ?= 2.24.0 VTPROTOBUF_VERSION ?= 0.6.0 diff --git a/go.mod b/go.mod index b614fed..b1c32be 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/go-git/go-git/v5 v5.12.0 github.com/google/go-github/v67 v67.0.0 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 - github.com/siderolabs/gen v0.7.0 + github.com/siderolabs/gen v0.8.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 golang.org/x/mod v0.22.0 diff --git a/go.sum b/go.sum index 003f232..94735b5 100644 --- a/go.sum +++ b/go.sum @@ -110,8 +110,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= -github.com/siderolabs/gen v0.7.0 h1:uHAt3WD0dof28NHFuguWBbDokaXQraR/HyVxCLw2QCU= -github.com/siderolabs/gen v0.7.0/go.mod h1:an3a2Y53O7kUjnnK8Bfu3gewtvnIOu5RTU6HalFtXQQ= +github.com/siderolabs/gen v0.8.0 h1:Pj93+hexkk5hQ7izjJ6YXnEWc8vlzOmDwFz13/VzS7o= +github.com/siderolabs/gen v0.8.0/go.mod h1:an3a2Y53O7kUjnnK8Bfu3gewtvnIOu5RTU6HalFtXQQ= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= diff --git a/internal/config/constants.go b/internal/config/constants.go index ee07f67..f774311 100644 --- a/internal/config/constants.go +++ b/internal/config/constants.go @@ -21,7 +21,7 @@ const ( // BuildKitContainerVersion is the version of buildkit container image. // renovate: datasource=docker versioning=docker depName=moby/buildkit - BuildKitContainerVersion = "v0.18.1" + BuildKitContainerVersion = "v0.18.2" // CheckOutActionVersion is the version of checkout github action. // renovate: datasource=github-releases extractVersion=^(?v\d+)\.\d+\.\d+$ depName=actions/checkout CheckOutActionVersion = "v4" @@ -36,7 +36,7 @@ const ( DindContainerImageVersion = "27.4-dind" // DockerfileFrontendImageVersion is the version of the dockerfile frontend image. // renovate: datasource=docker versioning=docker depName=docker/dockerfile-upstream - DockerfileFrontendImageVersion = "1.12.0-labs" + DockerfileFrontendImageVersion = "1.12.1-labs" // DownloadArtifactActionVersion is the version of download artifact github action. // renovate: datasource=github-releases extractVersion=^(?v\d+)\.\d+\.\d+$ depName=actions/download-artifact DownloadArtifactActionVersion = "v4" @@ -72,13 +72,13 @@ const ( MarkdownLintCLIVersion = "0.43.0" // BunContainerImageVersion is the default bun container image. // renovate: datasource=docker versioning=docker depName=oven/bun - BunContainerImageVersion = "1.1.38-alpine" + BunContainerImageVersion = "1.1.40-alpine" // PkgsVersion is the version of pkgs. // renovate: datasource=github-tags depName=siderolabs/pkgs PkgsVersion = "v1.9.0" // ProtobufGoVersion is the version of protobuf. // renovate: datasource=go depName=google.golang.org/protobuf/cmd/protoc-gen-go - ProtobufGoVersion = "v1.35.2" + ProtobufGoVersion = "v1.36.0" // ProtobufTSGatewayVersion is the version of protobuf-ts. // renovate: datasource=go depName=github.com/siderolabs/protoc-gen-grpc-gateway-ts ProtobufTSGatewayVersion = "v1.2.1" diff --git a/internal/output/renovate/renovate.go b/internal/output/renovate/renovate.go index 322de78..1d0800d 100644 --- a/internal/output/renovate/renovate.go +++ b/internal/output/renovate/renovate.go @@ -73,7 +73,7 @@ func (o *Output) Enable() { // CustomManagers sets custom managers. func (o *Output) CustomManagers(customManagers []CustomManager) { - o.result.CustomManagers = customManagers + o.result.CustomManagers = slices.Concat(o.result.CustomManagers, customManagers) } // PackageRules sets package rules. diff --git a/internal/project/pkgfile/build.go b/internal/project/pkgfile/build.go index 859ed57..9e28b9e 100644 --- a/internal/project/pkgfile/build.go +++ b/internal/project/pkgfile/build.go @@ -7,6 +7,7 @@ package pkgfile import ( "fmt" + "slices" "strings" "github.com/siderolabs/kres/internal/config" @@ -14,10 +15,15 @@ import ( "github.com/siderolabs/kres/internal/output/dockerignore" "github.com/siderolabs/kres/internal/output/ghworkflow" "github.com/siderolabs/kres/internal/output/makefile" + "github.com/siderolabs/kres/internal/output/renovate" "github.com/siderolabs/kres/internal/project/common" "github.com/siderolabs/kres/internal/project/meta" ) +const ( + renovateMatchStringPkgfile = `# renovate: datasource=(?.*?)(?:\s+extractVersion=(?.+?))?(?:\s+versioning=(?.+?))?\s+depName=(?.+?)?\s(?:.*_(?:version|VERSION):\s+(?.*))?(?:(\s)?.*_(?:ref|REF):\s+(?.*))?` //nolint:lll +) + // Build provides common pkgfile build environment settings. type Build struct { dag.BaseNode @@ -301,3 +307,44 @@ func (pkgfile *Build) CompileGitHubWorkflow(output *ghworkflow.Output) error { return nil } + +// CompileRenovate implements renovate.Compiler. +func (pkgfile *Build) CompileRenovate(output *renovate.Output) error { + customManagers := []renovate.CustomManager{ + { + CustomType: "regex", + FileMatch: []string{"Pkgfile"}, + MatchStrings: []string{ + renovateMatchStringPkgfile, + }, + VersioningTemplate: "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}", + }, + { + CustomType: "regex", + FileMatch: []string{"Pkgfile"}, + MatchStrings: []string{ + "ghcr.io\\/siderolabs\\/bldr:(?v.*)", + }, + DataSourceTemplate: "github-tags", + DepNameTemplate: "siderolabs/bldr", + VersioningTemplate: "semver", + }, + } + + if pkgfile.UseBldrPkgTagResolver { + customManagers = slices.Concat(customManagers, []renovate.CustomManager{ + { + CustomType: "regex", + FileMatch: []string{"vars.yaml"}, + MatchStrings: []string{ + renovateMatchStringPkgfile, + }, + VersioningTemplate: "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}", + }, + }) + } + + output.CustomManagers(customManagers) + + return nil +}