Skip to content

Commit

Permalink
chore: more renovate defaults
Browse files Browse the repository at this point in the history
Add renovate defaults, so we don't repeat over in `.kres.yaml`.

Signed-off-by: Noel Georgi <[email protected]>
  • Loading branch information
frezbo committed Dec 18, 2024
1 parent b9507d6 commit fcff05e
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 [email protected] [email protected]
COPY .markdownlint.json .
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
8 changes: 4 additions & 4 deletions internal/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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=^(?<version>v\d+)\.\d+\.\d+$ depName=actions/checkout
CheckOutActionVersion = "v4"
Expand All @@ -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=^(?<version>v\d+)\.\d+\.\d+$ depName=actions/download-artifact
DownloadArtifactActionVersion = "v4"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion internal/output/renovate/renovate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
47 changes: 47 additions & 0 deletions internal/project/pkgfile/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@ package pkgfile

import (
"fmt"
"slices"
"strings"

"github.com/siderolabs/kres/internal/config"
"github.com/siderolabs/kres/internal/dag"
"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=(?<datasource>.*?)(?:\s+extractVersion=(?<extractVersion>.+?))?(?:\s+versioning=(?<versioning>.+?))?\s+depName=(?<depName>.+?)?\s(?:.*_(?:version|VERSION):\s+(?<currentValue>.*))?(?:(\s)?.*_(?:ref|REF):\s+(?<currentDigest>.*))?` //nolint:lll
)

// Build provides common pkgfile build environment settings.
type Build struct {
dag.BaseNode
Expand Down Expand Up @@ -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:(?<currentValue>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
}

0 comments on commit fcff05e

Please sign in to comment.