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

chore: Move to Go 1.23.1, along with golangci update #14294

Merged
merged 4 commits into from
Sep 27, 2024
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"image": "grafana/loki-build-image:0.33.6",
"image": "grafana/loki-build-image:0.34.0",
"containerEnv": {
"BUILD_IN_CONTAINER": "false"
},
Expand Down
2 changes: 1 addition & 1 deletion .github/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"subdir": "workflows"
}
},
"version": "98ce96e408db867d64fb95b59a99c24440ddf441"
"version": "d900569c04b53e02de6ef208fa77cba41ec5f709"
}
],
"legacyImports": true
Expand Down
4 changes: 2 additions & 2 deletions .github/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"subdir": "workflows"
}
},
"version": "98ce96e408db867d64fb95b59a99c24440ddf441",
"sum": "pqEiutdl50ghtCY0wReq+Xa3AymHEyMa1OJQvRQXINI="
"version": "d900569c04b53e02de6ef208fa77cba41ec5f709",
"sum": "+uAzU+b+aJtp3k+JX5mDxuh8LNY23+cHvUOwzCQ8CS8="
}
],
"legacyImports": false
Expand Down
2 changes: 1 addition & 1 deletion .github/release-workflows.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ local weeklyImageJobs = {

local buildImageVersion = std.extVar('BUILD_IMAGE_VERSION');
local buildImage = 'grafana/loki-build-image:%s' % buildImageVersion;
local golangCiLintVersion = 'v1.55.1';
local golangCiLintVersion = 'v1.60.3';

local imageBuildTimeoutMin = 60;
local imagePrefix = 'grafana';
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.33.6"
"golang_ci_lint_version": "v1.55.1"
"build_image": "grafana/loki-build-image:0.34.0"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
"use_github_app_token": true
Expand All @@ -12,4 +12,4 @@
"pull_request": {}
"push":
"branches":
- "main"
- "main"
6 changes: 3 additions & 3 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.33.6"
"golang_ci_lint_version": "v1.55.1"
"build_image": "grafana/loki-build-image:0.34.0"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
"use_github_app_token": true
Expand Down Expand Up @@ -430,4 +430,4 @@
"permissions":
"contents": "write"
"id-token": "write"
"pull-requests": "write"
"pull-requests": "write"
2 changes: 1 addition & 1 deletion .github/workflows/lint-jsonnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
go-version: '1.23.1'
- name: setup jsonnet
run: |
go install github.com/google/go-jsonnet/cmd/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.33.6"
golang_ci_lint_version: "v1.55.1"
build_image: "grafana/loki-build-image:0.34.0"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
use_github_app_token: true
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.33.6"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down Expand Up @@ -828,4 +828,4 @@ name: "Prepare Minor Release PR from Weekly"
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
pull-requests: "write"
8 changes: 4 additions & 4 deletions .github/workflows/patch-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.33.6"
golang_ci_lint_version: "v1.55.1"
build_image: "grafana/loki-build-image:0.34.0"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
use_github_app_token: true
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.33.6"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down Expand Up @@ -828,4 +828,4 @@ name: "Prepare Patch Release PR"
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
pull-requests: "write"
4 changes: 2 additions & 2 deletions .github/workflows/promtail-windows-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
go-version: [ '1.21.9', '1.22.2' ]
go-version: [ '1.22.2', '1.23.1' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
Expand All @@ -21,4 +21,4 @@ jobs:
- name: Display Go version
run: go version
- name: Run promtail tests
run: go test .\clients\pkg\promtail\targets\windows\... -v
run: go test .\clients\pkg\promtail\targets\windows\... -v
4 changes: 2 additions & 2 deletions .github/workflows/verify-release-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
- name: setup go
uses: actions/setup-go@v5
with:
go-version: '1.22.2'
go-version: '1.23.1'
- name: setup jsonnet
run: |
go install github.com/google/go-jsonnet/cmd/[email protected]
go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
- name: Check that the release workflows have been updated properly
run: |
make BUILD_IN_CONTAINER=false release-workflows-check
make BUILD_IN_CONTAINER=false release-workflows-check
45 changes: 23 additions & 22 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# options for analysis running
run:
# define go version
go: "1.20"
go: "1.23"

# default concurrency is a available CPU number
concurrency: 16

# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 5m
timeout: 10m

# exit code when at least one issue was found, default is 1
issues-exit-code: 1
Expand All @@ -24,28 +24,12 @@ run:
- cgo
- promtail_journal_enabled
- integration

# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- win_eventlog$
- operator
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- .*.pb.go
- .*.y.go
- .*.rl.go
- .*.deepcopy.go

# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
format: colored-line-number
formats:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
- format: colored-line-number

# print lines of code with issue, default is true
print-issued-lines: true
Expand Down Expand Up @@ -101,3 +85,20 @@ issues:
linters:
- goconst
fix: true
# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
exclude-dirs:
- win_eventlog$
- operator
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
exclude-files:
- .*.pb.go
- .*.y.go
- .*.rl.go
- .*.deepcopy.go
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
BUILD_IN_CONTAINER ?= true

# ensure you run `make release-workflows` after changing this
BUILD_IMAGE_VERSION ?= 0.33.6
GO_VERSION := 1.22.6
BUILD_IMAGE_VERSION ?= 0.34.0
GO_VERSION := 1.23.1

# Docker image info
IMAGE_PREFIX ?= grafana
Expand Down
4 changes: 2 additions & 2 deletions clients/cmd/docker-driver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.33.6
ARG BUILD_IMAGE=grafana/loki-build-image:0.34.0
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/loki -f cmd/loki/Dockerfile .
Expand All @@ -9,7 +9,7 @@ COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false clients/cmd/docker-driver/docker-driver

FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates tzdata
COPY --from=build /src/loki/clients/cmd/docker-driver/docker-driver /bin/docker-driver
WORKDIR /bin/
Expand Down
2 changes: 1 addition & 1 deletion clients/cmd/fluent-bit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.6-bullseye AS builder
FROM golang:1.23-bullseye AS builder

COPY . /src

Expand Down
2 changes: 1 addition & 1 deletion clients/cmd/promtail/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION}-bookworm as build

COPY . /src/loki
Expand Down
2 changes: 1 addition & 1 deletion clients/cmd/promtail/Dockerfile.arm32
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.6-bookworm as build
FROM golang:1.23-bookworm as build

COPY . /src/loki
WORKDIR /src/loki
Expand Down
4 changes: 2 additions & 2 deletions clients/cmd/promtail/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.33.6
ARG GO_VERSION=1.22
ARG BUILD_IMAGE=grafana/loki-build-image:0.34.0
ARG GO_VERSION=1.23
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile .
Expand Down
4 changes: 2 additions & 2 deletions clients/cmd/promtail/Dockerfile.debug
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is intended to be called from the root like so:
# docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile.debug .

FROM grafana/loki-build-image:0.33.6 as build
FROM grafana/loki-build-image:0.34.0 AS build
ARG GOARCH="amd64"
COPY . /src/loki
WORKDIR /src/loki
RUN make clean && make BUILD_IN_CONTAINER=false PROMTAIL_JOURNAL_ENABLED=true promtail-debug


FROM alpine:3.20.2
FROM alpine:3.20.3
RUN apk add --update --no-cache ca-certificates tzdata
COPY --from=build /src/loki/clients/cmd/promtail/promtail-debug /usr/bin/promtail-debug
COPY --from=build /usr/bin/dlv /usr/bin/dlv
Expand Down
2 changes: 1 addition & 1 deletion cmd/logcli/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION} as build

COPY . /src/loki
Expand Down
2 changes: 1 addition & 1 deletion cmd/logql-analyzer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION} as build

COPY . /src/loki
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki-canary-boringcrypto/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION} as build

COPY . /src/loki
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki-canary/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION} as build

COPY . /src/loki
Expand Down
4 changes: 2 additions & 2 deletions cmd/loki-canary/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.33.6
ARG GO_VERSION=1.22
ARG BUILD_IMAGE=grafana/loki-build-image:0.34.0
ARG GO_VERSION=1.23
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/promtail -f cmd/promtail/Dockerfile .
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION} as build

COPY . /src/loki
Expand Down
2 changes: 1 addition & 1 deletion cmd/loki/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/loki -f cmd/loki/Dockerfile .
Expand Down
4 changes: 2 additions & 2 deletions cmd/loki/Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.33.6
ARG GO_VERSION=1.22
ARG BUILD_IMAGE=grafana/loki-build-image:0.34.0
ARG GO_VERSION=1.23
# Directories in this file are referenced from the root of the project not this folder
# This file is intended to be called from the root like so:
# docker build -t grafana/loki -f cmd/loki/Dockerfile.debug .
Expand Down
2 changes: 1 addition & 1 deletion cmd/migrate/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GO_VERSION=1.22
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION} as build
COPY . /src/loki
WORKDIR /src/loki
Expand Down
Loading
Loading