Skip to content

Commit

Permalink
chore(manager/gomod): Update go version to 1.23.3 in tests/examples (#…
Browse files Browse the repository at this point in the history
…32514)

Co-authored-by: Rhys Arkins <[email protected]>
  • Loading branch information
echarrod and rarkins authored Nov 13, 2024
1 parent 41ba7c3 commit 894250d
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 50 deletions.
6 changes: 3 additions & 3 deletions docs/usage/golang.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ By default, Renovate will keep up with the latest version of the `go` binary.

You can force Renovate to use a specific version of Go by setting a constraint.

```json title="Getting Renovate to use the latest patch version of the 1.16 Go binary"
```json title="Getting Renovate to use the latest patch version of the 1.23 Go binary"
{
"constraints": {
"go": "1.16"
"go": "1.23"
}
}
```

We do not support patch level versions for the minimum `go` version.
This means you cannot use `go 1.16.6`, but you can use `go 1.16` as a constraint.
This means you cannot use `go 1.23.3`, but you can use `go 1.23` as a constraint.

### Custom registry support, and authentication

Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/asdf/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ github-cli 2.32.1
gitleaks 8.21.1
gleam 1.3.1
gohugo extended_0.104.3
golang 1.19.2
golang 1.23.3
golangci-lint 1.52.2
gomplate 3.11.7
hadolint 2.12.0
Expand Down Expand Up @@ -325,7 +325,7 @@ dummy 1.2.3
extractVersion: '^v(?<version>\\S+)',
},
{
currentValue: '1.19.2',
currentValue: '1.23.3',
datasource: 'github-tags',
packageName: 'golang/go',
depName: 'golang',
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/manager/custom/regex/__fixtures__/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ RUN chmod +x /usr/local/bin/composer
RUN apt-get update && apt-get install -y bzr mercurial && \
rm -rf /var/lib/apt/lists/*

ENV GOLANG_VERSION=1.13.4
ENV GOLANG_VERSION=1.23.3

# Disable GOPROXY and GOSUMDB until we offer a solid solution to configure
# private repositories.
Expand Down
6 changes: 3 additions & 3 deletions lib/modules/manager/dockerfile/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ describe('modules/manager/dockerfile/extract', () => {

it('detects ["stage"] and ["final"] deps of docker multi-stage build.', () => {
const res = extractPackageFile(
'FROM node:8.15.1-alpine as skippedfrom\nFROM golang:1.7.3 as builder\n\n# comment\nWORKDIR /go/src/github.com/alexellis/href-counter/\nRUN go get -d -v golang.org/x/net/html \nCOPY app.go .\nRUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .\n\nFROM alpine:latest \nRUN apk --no-cache add ca-certificates\nWORKDIR /root/\nCOPY --from=builder /go/src/github.com/alexellis/href-counter/app .\nCMD ["./app"]\n',
'FROM node:8.15.1-alpine as skippedfrom\nFROM golang:1.23.3 as builder\n\n# comment\nWORKDIR /go/src/github.com/alexellis/href-counter/\nRUN go get -d -v golang.org/x/net/html \nCOPY app.go .\nRUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .\n\nFROM alpine:latest \nRUN apk --no-cache add ca-certificates\nWORKDIR /root/\nCOPY --from=builder /go/src/github.com/alexellis/href-counter/app .\nCMD ["./app"]\n',
'',
{},
)?.deps;
Expand All @@ -482,11 +482,11 @@ describe('modules/manager/dockerfile/extract', () => {
autoReplaceStringTemplate:
'{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}',
currentDigest: undefined,
currentValue: '1.7.3',
currentValue: '1.23.3',
datasource: 'docker',
depName: 'golang',
depType: 'stage',
replaceString: 'golang:1.7.3',
replaceString: 'golang:1.23.3',
},
{
autoReplaceStringTemplate:
Expand Down
3 changes: 1 addition & 2 deletions lib/modules/manager/gomod/__fixtures__/3/go-mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module k8s.io/minikube

go 1.13
go 1.23

require (
cloud.google.com/go v0.45.1
Expand Down Expand Up @@ -133,4 +133,3 @@ replace (
)

toolchain go1.22.1

54 changes: 27 additions & 27 deletions lib/modules/manager/gomod/artifacts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -480,7 +480,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.14.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
'"',
Expand All @@ -505,7 +505,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand All @@ -524,7 +524,7 @@ describe('modules/manager/gomod/artifacts', () => {
},
]);
expect(execSnapshots).toMatchObject([
{ cmd: 'install-tool golang 1.14.0' },
{ cmd: 'install-tool golang 1.23.3' },
{
cmd: 'go get -d -t ./...',
options: {
Expand Down Expand Up @@ -595,7 +595,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -645,7 +645,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.14.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
'"',
Expand Down Expand Up @@ -704,7 +704,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -772,7 +772,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -837,7 +837,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -911,7 +911,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -984,7 +984,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -1065,7 +1065,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum');
fs.readLocalFile.mockResolvedValueOnce(gomod1);
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -1120,7 +1120,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum 3');
fs.readLocalFile.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -1155,7 +1155,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.14.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
' && ' +
Expand Down Expand Up @@ -1184,7 +1184,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum 3');
fs.readLocalFile.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -1219,7 +1219,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.14.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
' && ' +
Expand Down Expand Up @@ -1248,7 +1248,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum 3');
fs.readLocalFile.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -1283,7 +1283,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.14.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
' && ' +
Expand Down Expand Up @@ -1312,7 +1312,7 @@ describe('modules/manager/gomod/artifacts', () => {
fs.readLocalFile.mockResolvedValueOnce('New go.sum 3');
fs.readLocalFile.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
expect(
await gomod.updateArtifacts({
Expand Down Expand Up @@ -1347,7 +1347,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.14.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
' && ' +
Expand Down Expand Up @@ -1905,7 +1905,7 @@ describe('modules/manager/gomod/artifacts', () => {
.mockResolvedValueOnce('New main.go')
.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
const res = await gomod.updateArtifacts({
packageFileName: 'go.mod',
Expand All @@ -1924,7 +1924,7 @@ describe('modules/manager/gomod/artifacts', () => {
{ file: { type: 'addition', path: 'go.mod', contents: 'New go.mod' } },
]);
expect(execSnapshots).toMatchObject([
{ cmd: 'install-tool golang 1.14.0' },
{ cmd: 'install-tool golang 1.23.3' },
{
cmd: 'go get -d -t ./...',
options: { cwd: '/tmp/github/some/repo' },
Expand Down Expand Up @@ -1964,7 +1964,7 @@ describe('modules/manager/gomod/artifacts', () => {
.mockResolvedValueOnce('New main.go')
.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
const res = await gomod.updateArtifacts({
packageFileName: 'go.mod',
Expand Down Expand Up @@ -2004,7 +2004,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.17.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
' && ' +
Expand Down Expand Up @@ -2038,7 +2038,7 @@ describe('modules/manager/gomod/artifacts', () => {
.mockResolvedValueOnce('New main.go')
.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
const res = await gomod.updateArtifacts({
packageFileName: 'go.mod',
Expand Down Expand Up @@ -2077,7 +2077,7 @@ describe('modules/manager/gomod/artifacts', () => {
.mockResolvedValueOnce('New main.go')
.mockResolvedValueOnce('New go.mod');
datasource.getPkgReleases.mockResolvedValueOnce({
releases: [{ version: '1.17.0' }, { version: '1.14.0' }],
releases: [{ version: '1.17.0' }, { version: '1.23.3' }],
});
const res = await gomod.updateArtifacts({
packageFileName: 'go.mod',
Expand Down Expand Up @@ -2119,7 +2119,7 @@ describe('modules/manager/gomod/artifacts', () => {
'-w "/tmp/github/some/repo" ' +
'ghcr.io/containerbase/sidecar' +
' bash -l -c "' +
'install-tool golang 1.14.0' +
'install-tool golang 1.23.3' +
' && ' +
'go get -d -t ./...' +
' && ' +
Expand Down
12 changes: 6 additions & 6 deletions lib/modules/manager/gomod/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('modules/manager/gomod/extract', () => {
it('extracts replace directives from multi-line and single line', () => {
const goMod = codeBlock`
module github.com/renovate-tests/gomod
go 1.18
go 1.23
replace golang.org/x/foo => github.com/pravesht/gocql v0.0.0
replace (
k8s.io/client-go => k8s.io/client-go v0.21.9
Expand All @@ -66,7 +66,7 @@ describe('modules/manager/gomod/extract', () => {
},
depName: 'go',
depType: 'golang',
currentValue: '1.18',
currentValue: '1.23',
datasource: 'golang-version',
versioning: 'go-mod-directive',
},
Expand Down Expand Up @@ -127,8 +127,8 @@ describe('modules/manager/gomod/extract', () => {
it('extracts the toolchain directive', () => {
const goMod = codeBlock`
module github.com/renovate-tests/gomod
go 1.21
toolchain go1.21.7
go 1.23
toolchain go1.23.3
replace golang.org/x/foo => github.com/pravesht/gocql v0.0.0
`;
const res = extractPackageFile(goMod);
Expand All @@ -140,7 +140,7 @@ describe('modules/manager/gomod/extract', () => {
},
depName: 'go',
depType: 'golang',
currentValue: '1.21',
currentValue: '1.23',
datasource: 'golang-version',
versioning: 'go-mod-directive',
},
Expand All @@ -150,7 +150,7 @@ describe('modules/manager/gomod/extract', () => {
},
depName: 'go',
depType: 'toolchain',
currentValue: '1.21.7',
currentValue: '1.23.3',
datasource: 'golang-version',
},
{
Expand Down
8 changes: 4 additions & 4 deletions lib/modules/manager/gomod/line-parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ describe('modules/manager/gomod/line-parser', () => {
});

it('should parse go version', () => {
const line = 'go 1.16';
const line = 'go 1.23';
const res = parseLine(line);
expect(res).toStrictEqual({
currentValue: '1.16',
currentValue: '1.23',
datasource: 'golang-version',
depName: 'go',
depType: 'golang',
Expand All @@ -31,10 +31,10 @@ describe('modules/manager/gomod/line-parser', () => {
});

it('should parse toolchain version', () => {
const line = 'toolchain go1.16';
const line = 'toolchain go1.23';
const res = parseLine(line);
expect(res).toStrictEqual({
currentValue: '1.16',
currentValue: '1.23',
datasource: 'golang-version',
depName: 'go',
depType: 'toolchain',
Expand Down
Loading

0 comments on commit 894250d

Please sign in to comment.