From 8b6961c8010251d5cc2f85541474fba68bce4900 Mon Sep 17 00:00:00 2001 From: Yury Kovalev Date: Mon, 19 Jan 2026 13:58:07 +0100 Subject: [PATCH 1/2] ROX-32712: Bump golang to v1.25 --- .github/workflows/aws-integration.yaml | 2 +- .github/workflows/ci.yaml | 4 ++-- .github/workflows/emailsender-central-compatibility.yaml | 2 +- .golangci.yml | 2 +- .openshift-ci/e2e-runtime/Dockerfile | 2 +- CLAUDE.md | 2 +- Dockerfile | 4 ++-- README.md | 2 +- emailsender/Dockerfile | 4 ++-- fleetshard-operator/Dockerfile | 4 ++-- go.mod | 2 +- probe/Dockerfile | 4 ++-- tools/go.mod | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/aws-integration.yaml b/.github/workflows/aws-integration.yaml index 578826d178..5b60e78ce4 100644 --- a/.github/workflows/aws-integration.yaml +++ b/.github/workflows/aws-integration.yaml @@ -50,7 +50,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - name: Check out code into the Go module directory uses: actions/checkout@v4 - name: Cache go module diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e6f0c11d42..bcb39fd533 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,7 +33,7 @@ jobs: python-version: '3.12' - uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - uses: pre-commit/action@v3.0.1 - uses: pre-commit/action@v3.0.1 name: Verify generated files are up-to-date @@ -81,7 +81,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - name: Check out code into the Go module directory uses: actions/checkout@v4 - name: Cache go module diff --git a/.github/workflows/emailsender-central-compatibility.yaml b/.github/workflows/emailsender-central-compatibility.yaml index 65159e57ba..3e385153f0 100644 --- a/.github/workflows/emailsender-central-compatibility.yaml +++ b/.github/workflows/emailsender-central-compatibility.yaml @@ -36,7 +36,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v6 with: - go-version: "1.24" + go-version: "1.25" - name: Cache go module uses: actions/cache@v4 with: diff --git a/.golangci.yml b/.golangci.yml index 0851bc9862..6fcc1cf8de 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,7 @@ version: 2 run: # timeout for analysis, e.g. 30s, 5m, default is 1m timeout: 10m - go: "1.24.7" + go: "1.25.3" issues: exclude-use-default: false diff --git a/.openshift-ci/e2e-runtime/Dockerfile b/.openshift-ci/e2e-runtime/Dockerfile index 64a1e976df..8f5499af2f 100644 --- a/.openshift-ci/e2e-runtime/Dockerfile +++ b/.openshift-ci/e2e-runtime/Dockerfile @@ -5,7 +5,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial RUN dnf update -y --disablerepo=\* --enablerepo=baseos,appstream && dnf -y install procps make which git gettext jq gcc && dnf clean all && rm -rf /var/cache/dnf -COPY --from=registry.redhat.io/rhel9/go-toolset:1.24.6 /usr/lib/golang /usr/lib/golang +COPY --from=registry.redhat.io/ubi9/go-toolset:1.25 /usr/lib/golang /usr/lib/golang COPY --from=quay.io/openshift/origin-cli:4.21 /usr/bin/oc /usr/bin ENV GOPATH=/go diff --git a/CLAUDE.md b/CLAUDE.md index ddc66ca4a5..58200581c2 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -152,7 +152,7 @@ The codebase follows a dependency injection pattern using the `goava/di` framewo ## Development Workflow ### Environment Setup -1. Install prerequisites: Go 1.24+, Docker, Node.js, Java, OCM CLI +1. Install prerequisites: Go 1.25+, Docker, Node.js, Java, OCM CLI 2. Run `make setup/git/hooks` to install pre-commit hooks 3. Use `make deploy/bootstrap` to set up development cluster 4. Run `make deploy/dev` to start local development environment diff --git a/Dockerfile b/Dockerfile index aa3fa3a18e..d859c1e4a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build +FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/go-toolset:1.25.3@sha256:e8938564f866174a6d79e55dfe577c2ed184b1f53e91d782173fb69b07ce69ef AS build USER root RUN mkdir /src /rds_ca @@ -26,7 +26,7 @@ RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=cache,target=/go/.cache/ \ make fleet-manager fleetshard-sync GOOS=linux GOARCH=${TARGETARCH} -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1295 AS standard +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7@sha256:90bd85dcd061d1ad6dbda70a867c41958c04a86462d05c631f8205e8870f28f8 AS standard RUN microdnf install shadow-utils diff --git a/README.md b/README.md index a81c3d1790..3aaa44edcf 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ ACS fleet-manager repository for the ACS managed service. #### Prerequisites -* [Golang 1.24+](https://golang.org/dl/) +* [Golang 1.25+](https://golang.org/dl/) * [Docker](https://docs.docker.com/get-docker/) - to create database * [ocm cli](https://github.com/openshift-online/ocm-cli/releases) - ocm command line tool * [Node.js v12.20+](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) diff --git a/emailsender/Dockerfile b/emailsender/Dockerfile index d6796c960d..87731c9847 100644 --- a/emailsender/Dockerfile +++ b/emailsender/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build +FROM registry.access.redhat.com/ubi9/go-toolset:1.25.3@sha256:e8938564f866174a6d79e55dfe577c2ed184b1f53e91d782173fb69b07ce69ef AS build USER root ENV GOFLAGS="-mod=mod" @@ -10,7 +10,7 @@ COPY . ./ RUN make emailsender -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1295 AS standard +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7@sha256:90bd85dcd061d1ad6dbda70a867c41958c04a86462d05c631f8205e8870f28f8 AS standard RUN microdnf install shadow-utils diff --git a/fleetshard-operator/Dockerfile b/fleetshard-operator/Dockerfile index 2c0c648e2e..6c532b7ec7 100644 --- a/fleetshard-operator/Dockerfile +++ b/fleetshard-operator/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build +FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/go-toolset:1.25.3@sha256:e8938564f866174a6d79e55dfe577c2ed184b1f53e91d782173fb69b07ce69ef AS build USER root RUN mkdir /src @@ -25,7 +25,7 @@ RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=cache,target=/go/.cache/ \ make fleetshard-operator GOOS=linux GOARCH=${TARGETARCH} -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1295 +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7@sha256:90bd85dcd061d1ad6dbda70a867c41958c04a86462d05c631f8205e8870f28f8 RUN microdnf install shadow-utils diff --git a/go.mod b/go.mod index 5a4f942155..40171083b2 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/stackrox/acs-fleet-manager -go 1.24.6 +go 1.25 require ( github.com/DATA-DOG/go-sqlmock v1.5.2 diff --git a/probe/Dockerfile b/probe/Dockerfile index 14f61fc235..467ac10c7d 100644 --- a/probe/Dockerfile +++ b/probe/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi8/go-toolset:1.24.6-1756315360 AS build +FROM --platform=$BUILDPLATFORM registry.access.redhat.com/ubi9/go-toolset:1.25.3@sha256:e8938564f866174a6d79e55dfe577c2ed184b1f53e91d782173fb69b07ce69ef AS build USER root ENV GOFLAGS="-mod=mod" @@ -12,7 +12,7 @@ ARG TARGETARCH RUN make probe GOOS=linux GOARCH=${TARGETARCH} -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1295 as standard +FROM registry.access.redhat.com/ubi9/ubi-minimal:9.7@sha256:90bd85dcd061d1ad6dbda70a867c41958c04a86462d05c631f8205e8870f28f8 as standard RUN microdnf install shadow-utils diff --git a/tools/go.mod b/tools/go.mod index 19657212d6..1d35f862a9 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,6 +1,6 @@ module github.com/stackrox/acs-fleet-manager/tools -go 1.24.6 +go 1.25 require ( github.com/matryer/moq v0.5.2 From 74f1ee01384ad7b66aa3a912dc2cadd0f0bcd7d4 Mon Sep 17 00:00:00 2001 From: Yury Kovalev Date: Mon, 19 Jan 2026 14:16:23 +0100 Subject: [PATCH 2/2] Bump golangci-lint --- .golangci.yml | 219 +++++++++++++++++++++------------------- .pre-commit-config.yaml | 2 +- 2 files changed, 115 insertions(+), 106 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 6fcc1cf8de..250f362bbb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,110 +1,8 @@ -# golangci-lint configuration v2 -version: 2 - +version: "2" run: - # timeout for analysis, e.g. 30s, 5m, default is 1m - timeout: 10m - go: "1.25.3" - -issues: - exclude-use-default: false - exclude-files: - - ".*_moq.go" - exclude-dirs: - - "internal/central/pkg/api/public" - - "internal/central/pkg/api/private" - - "internal/central/pkg/api/admin/private" - - "pkg/client/redhatsso/api" - - "emailsender/pkg/client/openapi" - exclude-rules: - - path: _test\.go - linters: - - wrapcheck - - path: pkg/client/fleetmanager/client.go # Ignore wrapcheck for the client, specifically within the RoundTripper. - linters: - - wrapcheck - - linters: - - revive - text: "should have a package comment, unless it's in another file for this package" - - linters: - - revive - text: "should not use dot imports" - - linters: - - revive - text: "returns unexported type .* which can be annoying to use" - - linters: - - revive - text: "error strings should not be capitalized or end with punctuation or a newline" - - linters: - - revive - text: "should omit type int from declaration" - - linters: - - revive - text: "don't use leading k in Go names" - -linters-settings: - staticcheck: - # Disable specific staticcheck rules that were excluded in v1 config - # staticcheck now includes both SA (staticcheck) and ST (stylecheck) rules - checks: ["all", "-ST1000", "-ST1001", "-ST1003", "-ST1005", "-SA1019", "-SA4001", "-ST1016"] - gosec: - includes: - - G601 - revive: - rules: - - name: blank-imports - - name: context-as-argument - - name: context-keys-type - - name: dot-imports - - name: error-return - - name: error-strings - - name: error-naming - - name: exported - arguments: ["disableStutteringCheck"] - - name: if-return - - name: increment-decrement - - name: var-naming - - name: var-declaration - - name: package-comments - - name: range - - name: receiver-naming - - name: time-naming - - name: unexported-return - - name: indent-error-flow - - name: errorf - govet: - enable-all: true - disable: - - shadow - - fieldalignment - settings: - printf: # analyzer name, run `go tool vet help` to see all analyzers - funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer - - Print - - Printf - - Println - - Debug - - Debugf - - Info - - Infof - - Warn - - Warnf - - Error - - Errorf - gocritic: - enabled-checks: - - commentFormatting - nolintlint: - allow-unused: false # report any unused nolint directives - require-explanation: false # don't require an explanation for nolint directives - require-specific: true # require nolint directives to be specific about which linter is being skipped - wrapcheck: {} - # ignoreSigRegexps: uncomment to add ignore rules - + go: 1.25.3 linters: - # please, do not use `enable-all`: it's deprecated and will be removed soon. - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint - disable-all: true + default: none enable: - asciicheck # - bodyclose @@ -152,3 +50,114 @@ linters: # - whitespace - wrapcheck # - wsl + settings: + gocritic: + enabled-checks: + - commentFormatting + gosec: + includes: + - G601 + govet: + disable: + - shadow + - fieldalignment + enable-all: true + settings: + printf: # analyzer name, run `go tool vet help` to see all analyzers + funcs: # run `go tool vet help printf` to see available settings for `printf` analyzer + - Print + - Printf + - Println + - Debug + - Debugf + - Info + - Infof + - Warn + - Warnf + - Error + - Errorf + nolintlint: + allow-unused: false # report any unused nolint directives + require-explanation: false # don't require an explanation for nolint directives + require-specific: true # require nolint directives to be specific about which linter is being skipped + revive: + rules: + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: exported + arguments: + - disableStutteringCheck + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: package-comments + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + # Disable specific staticcheck rules that were excluded in v1 config + # staticcheck now includes both SA (staticcheck) and ST (stylecheck) rules + staticcheck: + checks: + - all + - -SA1019 + - -SA4001 + - -ST1000 + - -ST1001 + - -ST1003 + - -ST1005 + - -ST1016 + + exclusions: + generated: lax + rules: + - linters: + - wrapcheck + path: _test\.go + # Ignore wrapcheck for the client, specifically within the RoundTripper. + - linters: + - wrapcheck + path: pkg/client/fleetmanager/client.go + - linters: + - revive + text: should have a package comment, unless it's in another file for this package + - linters: + - revive + text: should not use dot imports + - linters: + - revive + text: returns unexported type .* which can be annoying to use + - linters: + - revive + text: error strings should not be capitalized or end with punctuation or a newline + - linters: + - revive + text: should omit type int from declaration + - linters: + - revive + text: don't use leading k in Go names + paths: + - .*_moq.go + - internal/central/pkg/api/public + - internal/central/pkg/api/private + - internal/central/pkg/api/admin/private + - pkg/client/redhatsso/api + - emailsender/pkg/client/openapi + - third_party$ + - builtin$ + - examples$ +formatters: + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 956f8a9118..05155df1f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: detect-secrets args: ["--baseline", ".secrets.baseline"] - repo: https://github.com/golangci/golangci-lint - rev: v2.4.0 + rev: v2.8.0 hooks: - id: golangci-lint - repo: https://github.com/pre-commit/pre-commit-hooks