Skip to content

Commit dae07fa

Browse files
committed
chore: update to Go 1.25
Rekres, fix linting errors. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 62a079b commit dae07fa

15 files changed

Lines changed: 265 additions & 63 deletions

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2023-07-12T20:09:13Z by kres latest.
3+
# Generated on 2025-08-27T10:18:10Z by kres 4a0b905.
44

55
*
66
!tls
@@ -10,3 +10,4 @@
1010
!.golangci.yml
1111
!README.md
1212
!.markdownlint.json
13+
!hack/govulncheck.sh

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-07-02T13:16:58Z by kres 5128bc1-dirty.
3+
# Generated on 2025-08-27T10:18:10Z by kres 4a0b905.
44

5-
name: default
65
concurrency:
76
group: ${{ github.head_ref || github.run_id }}
87
cancel-in-progress: true
@@ -17,6 +16,7 @@ concurrency:
1716
branches:
1817
- main
1918
- release-*
19+
name: default
2020
jobs:
2121
default:
2222
permissions:
@@ -56,7 +56,7 @@ jobs:
5656
done
5757
continue-on-error: true
5858
- name: checkout
59-
uses: actions/checkout@v4
59+
uses: actions/checkout@v5
6060
- name: Unshallow
6161
run: |
6262
git fetch --prune --unshallow

.github/workflows/lock.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-07-02T13:16:08Z by kres 5128bc1-dirty.
3+
# Generated on 2025-08-27T10:18:10Z by kres 4a0b905.
44

5-
name: Lock old issues
65
"on":
76
schedule:
87
- cron: 0 2 * * *
8+
name: Lock old issues
99
permissions:
1010
issues: write
1111
jobs:
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
2+
#
3+
# Generated on 2025-08-27T10:18:10Z by kres 4a0b905.
4+
5+
"on":
6+
workflow_run:
7+
workflows:
8+
- default
9+
types:
10+
- completed
11+
branches:
12+
- main
13+
name: slack-notify-failure
14+
jobs:
15+
slack-notify:
16+
runs-on:
17+
- self-hosted
18+
- generic
19+
if: github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event != 'pull_request'
20+
steps:
21+
- name: Slack Notify
22+
uses: slackapi/slack-github-action@v2
23+
with:
24+
method: chat.postMessage
25+
payload: |
26+
{
27+
"channel": "ci-failure",
28+
"text": "${{ github.event.workflow_run.conclusion }} - ${{ github.repository }}",
29+
"icon_emoji": "${{ github.event.workflow_run.conclusion == 'success' && ':white_check_mark:' || github.event.workflow_run.conclusion == 'failure' && ':x:' || ':warning:' }}",
30+
"username": "GitHub Actions",
31+
"attachments": [
32+
{
33+
"blocks": [
34+
{
35+
"fields": [
36+
{
37+
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}",
38+
"type": "mrkdwn"
39+
},
40+
{
41+
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`",
42+
"type": "mrkdwn"
43+
}
44+
],
45+
"type": "section"
46+
},
47+
{
48+
"fields": [
49+
{
50+
"text": "*Author:*\n`${{ github.actor }}`",
51+
"type": "mrkdwn"
52+
},
53+
{
54+
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`",
55+
"type": "mrkdwn"
56+
}
57+
],
58+
"type": "section"
59+
},
60+
{
61+
"type": "divider"
62+
},
63+
{
64+
"elements": [
65+
{
66+
"text": {
67+
"text": "Logs",
68+
"type": "plain_text"
69+
},
70+
"type": "button",
71+
"url": "${{ github.event.workflow_run.html_url }}"
72+
},
73+
{
74+
"text": {
75+
"text": "Commit",
76+
"type": "plain_text"
77+
},
78+
"type": "button",
79+
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
80+
}
81+
],
82+
"type": "actions"
83+
}
84+
],
85+
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}"
86+
}
87+
]
88+
}
89+
token: ${{ secrets.SLACK_BOT_TOKEN_V2 }}
Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2024-12-04T08:15:33Z by kres 232fe63.
3+
# Generated on 2025-08-27T10:18:10Z by kres 4a0b905.
44

5-
name: slack-notify
65
"on":
76
workflow_run:
87
workflows:
98
- default
109
types:
1110
- completed
11+
name: slack-notify
1212
jobs:
1313
slack-notify:
1414
runs-on:
@@ -29,64 +29,66 @@ jobs:
2929
method: chat.postMessage
3030
payload: |
3131
{
32-
"channel": "proj-talos-maintainers",
32+
"channel": "ci-all",
33+
"text": "${{ github.event.workflow_run.conclusion }} - ${{ github.repository }}",
34+
"icon_emoji": "${{ github.event.workflow_run.conclusion == 'success' && ':white_check_mark:' || github.event.workflow_run.conclusion == 'failure' && ':x:' || ':warning:' }}",
35+
"username": "GitHub Actions",
3336
"attachments": [
3437
{
35-
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}",
36-
"fallback": "test",
3738
"blocks": [
3839
{
39-
"type": "section",
4040
"fields": [
4141
{
42-
"type": "mrkdwn",
43-
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}"
42+
"text": "${{ github.event.workflow_run.event == 'pull_request' && format('*Pull Request:* {0} (`{1}`)\n<{2}/pull/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, steps.get-pr-number.outputs.pull_request_number, github.event.workflow_run.display_title) || format('*Build:* {0} (`{1}`)\n<{2}/commit/{3}|{4}>', github.repository, github.ref_name, github.event.repository.html_url, github.sha, github.event.workflow_run.display_title) }}",
43+
"type": "mrkdwn"
4444
},
4545
{
46-
"type": "mrkdwn",
47-
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`"
46+
"text": "*Status:*\n`${{ github.event.workflow_run.conclusion }}`",
47+
"type": "mrkdwn"
4848
}
49-
]
49+
],
50+
"type": "section"
5051
},
5152
{
52-
"type": "section",
5353
"fields": [
5454
{
55-
"type": "mrkdwn",
56-
"text": "*Author:*\n`${{ github.actor }}`"
55+
"text": "*Author:*\n`${{ github.actor }}`",
56+
"type": "mrkdwn"
5757
},
5858
{
59-
"type": "mrkdwn",
60-
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`"
59+
"text": "*Event:*\n`${{ github.event.workflow_run.event }}`",
60+
"type": "mrkdwn"
6161
}
62-
]
62+
],
63+
"type": "section"
6364
},
6465
{
6566
"type": "divider"
6667
},
6768
{
68-
"type": "actions",
6969
"elements": [
7070
{
71-
"type": "button",
7271
"text": {
73-
"type": "plain_text",
74-
"text": "Logs"
72+
"text": "Logs",
73+
"type": "plain_text"
7574
},
75+
"type": "button",
7676
"url": "${{ github.event.workflow_run.html_url }}"
7777
},
7878
{
79-
"type": "button",
8079
"text": {
81-
"type": "plain_text",
82-
"text": "Commit"
80+
"text": "Commit",
81+
"type": "plain_text"
8382
},
83+
"type": "button",
8484
"url": "${{ github.event.repository.html_url }}/commit/${{ github.sha }}"
8585
}
86-
]
86+
],
87+
"type": "actions"
8788
}
88-
]
89+
],
90+
"color": "${{ github.event.workflow_run.conclusion == 'success' && '#2EB886' || github.event.workflow_run.conclusion == 'failure' && '#A30002' || '#FFCC00' }}"
8991
}
9092
]
9193
}
92-
token: ${{ secrets.SLACK_BOT_TOKEN }}
94+
token: ${{ secrets.SLACK_BOT_TOKEN_V2 }}

.github/workflows/stale.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-07-02T13:16:08Z by kres 5128bc1-dirty.
3+
# Generated on 2025-08-27T10:18:10Z by kres 4a0b905.
44

5-
name: Close stale issues and PRs
65
"on":
76
schedule:
87
- cron: 30 1 * * *
8+
name: Close stale issues and PRs
99
permissions:
1010
issues: write
1111
pull-requests: write

.golangci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-05-14T13:00:06Z by kres 5ad3e5f.
3+
# Generated on 2025-08-27T10:18:10Z by kres 4a0b905.
44

55
version: "2"
66

@@ -49,6 +49,9 @@ linters:
4949
- perfsprint # complains about us using fmt.Sprintf in non-performance critical code, updating just kres took too long
5050
- musttag # seems to be broken - goes into imported libraries and reports issues there
5151
- nolintlint # gives false positives - disable until https://github.com/golangci/golangci-lint/issues/3228 is resolved
52+
- wsl # replaced by wsl_v5
53+
- noinlineerr
54+
- embeddedstructfieldcheck # fighting in many places with fieldalignment
5255
# all available settings of specific linters
5356
settings:
5457
cyclop:
@@ -90,6 +93,10 @@ linters:
9093
simple: true
9194
range-loops: true # Report preallocation suggestions on range loops, true by default
9295
for-loops: false # Report preallocation suggestions on for loops, false by default
96+
revive:
97+
rules:
98+
- name: var-naming # Complains about package names like "common"
99+
disabled: true
93100
rowserrcheck: { }
94101
testpackage: { }
95102
unparam:

Dockerfile

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# syntax = docker/dockerfile-upstream:1.16.0-labs
1+
# syntax = docker/dockerfile-upstream:1.17.1-labs
22

33
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
44
#
5-
# Generated on 2025-07-02T13:16:58Z by kres 5128bc1-dirty.
5+
# Generated on 2025-08-27T14:43:15Z by kres 4a927f7.
66

77
ARG TOOLCHAIN
88

99
# cleaned up specs and compiled versions
1010
FROM scratch AS generate
1111

1212
# runs markdownlint
13-
FROM docker.io/oven/bun:1.2.15-alpine AS lint-markdown
13+
FROM docker.io/oven/bun:1.2.20-alpine AS lint-markdown
1414
WORKDIR /src
1515
RUN bun i markdownlint-cli@0.45.0 sentences-per-line@0.3.0
1616
COPY .markdownlint.json .
@@ -19,7 +19,7 @@ RUN bunx markdownlint --ignore "CHANGELOG.md" --ignore "**/node_modules/**" --ig
1919

2020
# base toolchain image
2121
FROM --platform=${BUILDPLATFORM} ${TOOLCHAIN} AS toolchain
22-
RUN apk --update --no-cache add bash curl build-base protoc protobuf-dev openssl
22+
RUN apk --update --no-cache add bash build-base curl jq protoc protobuf-dev openssl
2323

2424
# build tools
2525
FROM --platform=${BUILDPLATFORM} toolchain AS tools
@@ -66,28 +66,41 @@ COPY .golangci.yml .
6666
ENV GOGC=50
6767
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint,id=crypto/root/.cache/golangci-lint,sharing=locked --mount=type=cache,target=/go/pkg,id=crypto/go/pkg golangci-lint run --config .golangci.yml
6868

69+
# runs golangci-lint fmt
70+
FROM base AS lint-golangci-lint-fmt-run
71+
WORKDIR /src
72+
COPY .golangci.yml .
73+
ENV GOGC=50
74+
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint,id=crypto/root/.cache/golangci-lint,sharing=locked --mount=type=cache,target=/go/pkg,id=crypto/go/pkg golangci-lint fmt --config .golangci.yml
75+
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint,id=crypto/root/.cache/golangci-lint,sharing=locked --mount=type=cache,target=/go/pkg,id=crypto/go/pkg golangci-lint run --fix --issues-exit-code 0 --config .golangci.yml
76+
6977
# runs govulncheck
7078
FROM base AS lint-govulncheck
7179
WORKDIR /src
72-
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg govulncheck ./...
80+
COPY --chmod=0755 hack/govulncheck.sh ./hack/govulncheck.sh
81+
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg ./hack/govulncheck.sh ./...
7382

7483
# runs unit-tests with strict FIPS-140 mode
7584
FROM base AS unit-tests-fips
7685
WORKDIR /src
7786
ARG TESTPKGS
78-
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg --mount=type=cache,target=/tmp,id=crypto/tmp GOFIPS140=latest GODEBUG=fips140=only go test -v -count 1 ${TESTPKGS}
87+
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg --mount=type=cache,target=/tmp,id=crypto/tmp GOFIPS140=latest GODEBUG=fips140=only,tlsmlkem=0 go test ${TESTPKGS}
7988

8089
# runs unit-tests with race detector
8190
FROM base AS unit-tests-race
8291
WORKDIR /src
8392
ARG TESTPKGS
84-
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg --mount=type=cache,target=/tmp,id=crypto/tmp CGO_ENABLED=1 go test -v -race -count 1 ${TESTPKGS}
93+
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg --mount=type=cache,target=/tmp,id=crypto/tmp CGO_ENABLED=1 go test -race ${TESTPKGS}
8594

8695
# runs unit-tests
8796
FROM base AS unit-tests-run
8897
WORKDIR /src
8998
ARG TESTPKGS
90-
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg --mount=type=cache,target=/tmp,id=crypto/tmp go test -v -covermode=atomic -coverprofile=coverage.txt -coverpkg=${TESTPKGS} -count 1 ${TESTPKGS}
99+
RUN --mount=type=cache,target=/root/.cache/go-build,id=crypto/root/.cache/go-build --mount=type=cache,target=/go/pkg,id=crypto/go/pkg --mount=type=cache,target=/tmp,id=crypto/tmp go test -covermode=atomic -coverprofile=coverage.txt -coverpkg=${TESTPKGS} ${TESTPKGS}
100+
101+
# clean golangci-lint fmt output
102+
FROM scratch AS lint-golangci-lint-fmt
103+
COPY --from=lint-golangci-lint-fmt-run /src .
91104

92105
FROM scratch AS unit-tests
93106
COPY --from=unit-tests-run /src/coverage.txt /coverage-unit-tests.txt

0 commit comments

Comments
 (0)