From 3c0679987cf21d5607cadd4ce549ba6efec7eef8 Mon Sep 17 00:00:00 2001 From: Anastasiya Didych Date: Wed, 29 Oct 2025 15:26:40 +0200 Subject: [PATCH 1/4] Updated go to 1.25.3 Signed-off-by: Anastasiya Didych --- .github/workflows/build.yml | 247 ++++---------------- .github/workflows/publish.yaml | 16 +- .github/workflows/sonar.yml | 2 +- .golangci.yml | 398 +++++++++++++++++++-------------- Makefile | 7 +- cmd/orb-cli/go.mod | 6 +- cmd/orb-cli/go.sum | 4 +- cmd/orb-driver/go.mod | 6 +- cmd/orb-driver/go.sum | 4 +- cmd/orb-server/go.mod | 6 +- cmd/orb-server/go.sum | 1 + go.mod | 6 +- go.sum | 4 +- scripts/check_lint.sh | 2 +- test/bdd/go.mod | 6 +- test/bdd/go.sum | 1 + 16 files changed, 306 insertions(+), 410 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4034393f0..533719e8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,224 +1,67 @@ # -# Copyright SecureKey Technologies Inc. All Rights Reserved. +# Copyright Gen Digital Inc. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # -name: Build +name: "orb ci" + +env: + GO_VERSION: 1.25 + on: push: + branches: [ main ] pull_request: -jobs: - unitTest: - name: Unit test - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - strategy: - matrix: - os: [ubuntu-latest] - steps: - - name: Setup Go 1.21 - uses: actions/setup-go@v2 - with: - go-version: 1.21 - id: go - - - uses: actions/checkout@v2 - - - name: Run unit test - timeout-minutes: 15 - run: make unit-test - - - name: Upload coverage to Codecov - timeout-minutes: 10 - if: matrix.os == 'ubuntu-latest' && github.repository == 'trustbloc/orb' - uses: codecov/codecov-action@v1.3.1 - with: - file: ./coverage.out - - bddTest-cas-local: - name: BDD test cas local - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Setup Go 1.21 - uses: actions/setup-go@v2 - with: - go-version: 1.21 - id: go + branches: [ main ] - - uses: actions/checkout@v2 - - - name: Run bdd test cas local - timeout-minutes: 60 - run: | - echo '127.0.0.1 orb.domain1.com' | sudo tee -a /etc/hosts - echo '127.0.0.1 orb.vct' | sudo tee -a /etc/hosts - wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.6.1.deb - sudo apt install ./mongodb-database-tools-ubuntu2204-x86_64-100.6.1.deb - make bdd-test-cas-local - - - uses: actions/upload-artifact@v2 - if: always() - with: - name: logs-cas-local - path: test/bdd/docker-compose.log - - bddTest-cas-ipfs: - name: BDD test cas ipfs - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - name: Setup Go 1.21 - uses: actions/setup-go@v2 - with: - go-version: 1.21 - id: go - - - uses: actions/checkout@v2 - - - name: Run bdd test cas ipfs - timeout-minutes: 60 - run: | - echo '127.0.0.1 orb.domain1.com' | sudo tee -a /etc/hosts - echo '127.0.0.1 orb.vct' | sudo tee -a /etc/hosts - make bdd-test-cas-ipfs - - - uses: actions/upload-artifact@v2 - if: always() - with: - name: logs-cas-ipfs - path: test/bdd/docker-compose.log - - bddTest-versions-maintenance: - name: BDD test protocol versions, maintenance mode +jobs: + SemanticPullRequest: + name: Semantic Pull Request Check + if: github.event_name == 'pull_request' runs-on: ubuntu-latest - timeout-minutes: 60 steps: - - name: Setup Go 1.21 - uses: actions/setup-go@v2 - with: - go-version: 1.21 - id: go - - - uses: actions/checkout@v2 - - - name: Run bdd test protocol versions, maintenance mode - timeout-minutes: 60 - run: | - echo '127.0.0.1 orb.domain1.com' | sudo tee -a /etc/hosts - echo '127.0.0.1 orb.vct' | sudo tee -a /etc/hosts - make bdd-test-versions-maintenance - - - uses: actions/upload-artifact@v2 - if: always() - with: - name: logs-versions-maintenance - path: test/bdd/docker-compose.log + - uses: amannn/action-semantic-pull-request@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - checks: - name: Checks - timeout-minutes: 30 - runs-on: ubuntu-latest + Checks: + runs-on: ubuntu-22.04 + timeout-minutes: 10 steps: - - name: Setup Go 1.21 - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 + - name: Setup Go 1.25 + uses: actions/setup-go@v4 with: - go-version: 1.21 - - - uses: actions/checkout@v2 - + go-version: '1.25' - name: Run checks - timeout-minutes: 30 - run: make checks - - publish: - name: Publish image - if: github.event_name == 'push' && (github.repository == 'trustbloc/orb' && github.ref == 'refs/heads/main') - needs: [checks, unitTest] - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - name: Setup Go 1.21 - uses: actions/setup-go@v2 - with: - go-version: 1.21 - - - uses: actions/checkout@v2 - with: { fetch-depth: 0 } - - - name: Get current published version - run: | - TAG=$(git describe --tags --always `git rev-list --tags --max-count=1`) - VERSION=$(git rev-parse --short=7 HEAD) - if [[ $TAG == $VERSION ]]; then - TAG=v0.0.0 - fi - echo "CURRENT_SEMVER=${TAG:1}" >> $GITHUB_ENV - - - name: Bump published version - id: bump_version - uses: christian-draeger/increment-semantic-version@1.0.2 - with: - current-version: "${{ env.CURRENT_SEMVER }}" - version-fragment: 'rc' - - - name: Set ENV vars run: | - VERSION=$(git rev-parse --short=7 HEAD) - echo "IMAGE_TAG"=v${{ steps.bump_version.outputs.next-version }}-snapshot-$VERSION >> $GITHUB_ENV - echo "ORB_IMAGE_PREFIX"=ghcr.io/trustbloc-cicd/orb >> $GITHUB_ENV - echo "ORB_DRIVER_IMAGE_PREFIX"=ghcr.io/trustbloc-cicd/orb-did-driver >> $GITHUB_ENV - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to Github Container Registry - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ secrets.CR_USER }} - password: ${{ secrets.CR_PAT }} + echo $PATH + go env + echo ${{ github.workspace }} + make checks + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + UnitTest: + runs-on: ubuntu-22.04 + timeout-minutes: 10 + steps: - - name: Build and Push container orb image - uses: docker/build-push-action@v2 + - name: Setup Go 1.25 + uses: actions/setup-go@v4 with: - context: . - file: ./images/orb/Dockerfile - platforms: linux/amd64,linux/arm64 - build-args: | - ALPINE_VER=3.18 - GO_VER=1.21 - GO_LDFLAGS=-X 'github.com/trustbloc/orb/pkg/nodeinfo.OrbVersion=${{ env.IMAGE_TAG }}' -X 'github.com/trustbloc/orb/pkg/httpserver.BuildVersion=${{ env.IMAGE_TAG }}' - push: true - tags: | - ${{ env.ORB_IMAGE_PREFIX }}:${{ env.IMAGE_TAG }} - ${{ env.ORB_IMAGE_PREFIX }}:latest + go-version: '1.25' + id: go - - name: Build and Push orb driver image - uses: docker/build-push-action@v2 - with: - context: . - file: ./images/orb-driver/Dockerfile - platforms: linux/amd64,linux/arm64 - build-args: | - ALPINE_VER=3.18 - GO_VER=1.21 - push: true - tags: | - ${{ env.ORB_DRIVER_IMAGE_PREFIX }}:${{ env.IMAGE_TAG }} - ${{ env.ORB_DRIVER_IMAGE_PREFIX }}:latest + - uses: actions/checkout@v3 - - name: Build binaries - run: make build-orb-cli-binaries + - name: Run unit test + timeout-minutes: 15 + run: make unit-test - - uses: actions/upload-artifact@v2 + - name: Upload coverage to Codecov + timeout-minutes: 10 + uses: codecov/codecov-action@v3.1.6 with: - name: orb-cli - path: | - ./.build/dist/bin/orb-cli-darwin-amd64.tar.gz - ./.build/dist/bin/orb-cli-linux-amd64.tar.gz - ./.build/dist/bin/orb-cli-linux-arm64.tar.gz - ./.build/dist/bin/orb-cli-darwin-arm64.tar.gz + file: ./coverage.out \ No newline at end of file diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 736039944..f072fc9a5 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -15,12 +15,12 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Setup Go 1.21 - uses: actions/setup-go@v2 + - name: Setup Go 1.25 + uses: actions/setup-go@v4 with: - go-version: 1.21 + go-version: 1.25 id: go - name: Set ENV vars @@ -49,8 +49,8 @@ jobs: file: ./images/orb/Dockerfile platforms: linux/amd64,linux/arm64 build-args: | - ALPINE_VER=3.18 - GO_VER=1.21 + ALPINE_VER=3.22 + GO_VER=1.25 GO_LDFLAGS=-X 'github.com/trustbloc/orb/pkg/nodeinfo.OrbVersion=${{ env.IMAGE_TAG }}' -X 'github.com/trustbloc/orb/pkg/httpserver.BuildVersion=${{ env.IMAGE_TAG }}' push: true tags: | @@ -64,8 +64,8 @@ jobs: file: ./images/orb-driver/Dockerfile platforms: linux/amd64,linux/arm64 build-args: | - ALPINE_VER=3.18 - GO_VER=1.21 + ALPINE_VER=3.22 + GO_VER=1.25 push: true tags: | ${{ env.ORB_DRIVER_IMAGE_PREFIX }}:${{ env.IMAGE_TAG }} diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 73bcd1205..df44322c6 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -13,7 +13,7 @@ jobs: sonarcloud: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5.0.0 with: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 diff --git a/.golangci.yml b/.golangci.yml index d6fe40b03..c7ac90fb4 100755 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,181 +1,239 @@ # -# # Copyright SecureKey Technologies Inc. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # +version: "2" run: - concurrency: 4 - deadline: 5m - issues-exit-code: 1 - tests: true - build-tags: [""] - skip-dirs: [""] - go: '1.21' - -output: - format: colored-line-number - print-issued-lines: true - print-linter-name: true - -linters-settings: - depguard: - list-type: denylist - packages: - # logging is allowed only by logutils.Log, logrus - # is allowed to use only in logutils package - - github.com/sirupsen/logrus - packages-with-error-message: - - github.com/sirupsen/logrus: "logging is allowed only by logutils.Log" - dupl: - threshold: 100 - funlen: - lines: 100 - statements: 50 - goconst: - min-len: 2 - min-occurrences: 3 - gocritic: - enabled-tags: - - diagnostic - - experimental - - opinionated - - performance - - style - disabled-checks: - - dupImport # https://github.com/go-critic/go-critic/issues/845 - - ifElseChain - - octalLiteral - - whyNoLint - - unnamedResult - gocyclo: - min-complexity: 15 - goimports: - local-prefixes: github.com/golangci/golangci-lint - gomnd: - # don't include the "operation" and "assign" - checks: - - argument - - case - - condition - - return - ignored-numbers: - - '0' - - '1' - - '2' - - '3' - ignored-functions: - - strings.SplitN - - govet: - check-shadowing: true - settings: - printf: - funcs: - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf - lll: - line-length: 140 - misspell: - locale: US - ignore-words: - - marshaller - - marshalling - - unmarshalling - - behaviour - nolintlint: - allow-unused: false # report any unused nolint directives - require-explanation: false # don't require an explanation for nolint directives - require-specific: false # don't require nolint directives to be specific about which linter is being skipped - machine: false # don't require //nolint instead of // nolint - explain: false # don't require //nolint // my explanation instead of just //nolint - revive: - rules: - - name: exported - arguments: - - disableStutteringCheck + # Timeout for analysis, e.g. 30s, 5m. + # Default: 1m + timeout: 5m + + # Define the Go version limit. + # Mainly related to generics support in go1.18. + # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.19 + go: "1.25" + + +# All possible options can be found here: https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml + linters: - enable-all: true - disable: - - asciicheck - - gochecknoglobals - - gocognit - - godot - - godox - - goerr113 - - prealloc - - testpackage - - wsl - - exhaustive - - exhaustruct - - gomoddirectives - - cyclop - - ireturn - - nonamedreturns - - paralleltest - - varnamelen - - wrapcheck - - tagliatelle - - maintidx - - gci - - containedctx - - forbidigo - - musttag - # The following linters are deprecated: - - scopelint - - varcheck - - deadcode - - exhaustivestruct - - maligned - - structcheck - - ifshort - - nosnakecase - - interfacer - - golint - - depguard + default: none + enable: + ## enabled by default + - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases + # - gosimple # Linter for Go source code that specializes in simplifying a code + - govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string + - ineffassign # Detects when assignments to existing variables are not used + - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks + # - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code + - unused # Checks Go code for unused constants, variables, functions and types + ## disabled by default + - asasalint # Check for pass []any as any in variadic func(...any) + - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers + - bidichk # Checks for dangerous unicode character sequences + - bodyclose # checks whether HTTP response body is closed successfully + - contextcheck # check the function whether use a non-inherited context + - cyclop # checks function and package cyclomatic complexity + - dupl # Tool for code clone detection + - durationcheck # check for two durations multiplied together + - errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error. + - errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. + - exhaustive # check exhaustiveness of enum switch statements + - copyloopvar # checks for pointers to enclosing loop variables + - forbidigo # Forbids identifiers + - funlen # Tool for detection of long functions + - gochecknoglobals # check that no global variables exist + - gochecknoinits # Checks that no init functions are present in Go code + - gocognit # Computes and checks the cognitive complexity of functions + - goconst # Finds repeated strings that could be replaced by a constant + - gocritic # Provides diagnostics that check for bugs, performance and style issues. + - gocyclo # Computes and checks the cyclomatic complexity of functions + - godot # Check if comments end in a period + # - goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt. + - mnd # An analyzer to detect magic numbers. + - gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. + - goprintffuncname # Checks that printf-like functions are named with f at the end + - gosec # Inspects source code for security problems + # - lll # Reports long lines + - makezero # Finds slice declarations with non-zero initial length + - nakedret # Finds naked returns in functions greater than a specified function length + - nestif # Reports deeply nested if statements + - nilerr # Finds the code that returns nil even if it checks that the error is not nil. + - nilnil # Checks that there is no simultaneous return of nil error and an invalid value. + - noctx # noctx finds sending http request without context.Context + # - nolintlint # Reports ill-formed or insufficient nolint directives + - nonamedreturns # Reports all named returns + - nosprintfhostport # Checks for misuse of Sprintf to construct a host with port in a URL. + - predeclared # find code that shadows one of Go's predeclared identifiers + - promlinter # Check Prometheus metrics naming via promlint + # - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. Requires documentation for each package!!! ToDo enable after fixing all issues + - rowserrcheck # checks whether Err of rows is checked successfully + - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. + # - stylecheck # Stylecheck is a replacement for golint + # - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 + # - testpackage # linter that makes you use a separate _test package + - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes + - unconvert # Remove unnecessary type conversions + - unparam # Reports unused function parameters + - wastedassign # wastedassign finds wasted assignment statements. + - whitespace # Tool for detection of leading and trailing whitespace + + settings: + cyclop: + # The maximal code complexity to report. + # Default: 10 + max-complexity: 30 + # The maximal average package complexity. + # If it's higher than 0.0 (float) the check is enabled + # Default: 0.0 + package-average: 10.0 + + errcheck: + # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. + # Such cases aren't reported by default. + # Default: false + check-type-assertions: true + + funlen: + # Checks the number of lines in a function. + # If lower than 0, disable the check. + # Default: 60 + lines: 100 + # Checks the number of statements in a function. + # If lower than 0, disable the check. + # Default: 40 + statements: 50 + + gocognit: + # Minimal code complexity to report + # Default: 30 (but we recommend 10-20) + min-complexity: 20 + gocritic: + # Settings passed to gocritic. + # The settings key is the name of a supported gocritic checker. + # The list of supported checkers can be find in https://go-critic.github.io/overview. + settings: + captLocal: + # Whether to restrict checker to params only. + # Default: true + paramsOnly: false + underef: + # Whether to skip (*x).method() calls where x is a pointer receiver. + # Default: true + skipRecvDeref: false + + mnd: + # List of function patterns to exclude from analysis. + # Values always ignored: `time.Date` + # Default: [] + ignored-functions: + - os.Chmod + - os.Mkdir + - os.MkdirAll + - os.OpenFile + - os.WriteFile + - prometheus.ExponentialBuckets + - prometheus.ExponentialBucketsRange + - prometheus.LinearBuckets + - strconv.FormatFloat + - strconv.FormatInt + - strconv.FormatUint + - strconv.ParseFloat + - strconv.ParseInt + - strconv.ParseUint + + gomodguard: + blocked: + # List of blocked modules. + # Default: [] + modules: + - github.com/golang/protobuf: + recommendations: + - google.golang.org/protobuf + reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules" + - github.com/satori/go.uuid: + recommendations: + - github.com/google/uuid + reason: "satori's package is not maintained" + - github.com/gofrs/uuid: + recommendations: + - github.com/google/uuid + reason: "see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw" + + govet: + # Enable all analyzers. + # Default: false + enable-all: true + # Disable analyzers by name. + # Run `go tool vet help` to see all analyzers. + # Default: [] + disable: + - fieldalignment # too strict + # Settings per analyzer. + settings: + shadow: + # Whether to be strict about shadowing; can be noisy. + # Default: false + strict: false + + nakedret: + # Make an issue if func has more lines of code than this setting, and it has naked returns. + # Default: 30 + max-func-lines: 0 + + nolintlint: + # Exclude following linters from requiring an explanation. + # Default: [] + allow-no-explanation: [ funlen, gocognit, lll ] + # Enable to require an explanation of nonzero length after each nolint directive. + # Default: false + require-explanation: true + # Enable to require nolint directives to mention the specific linter being suppressed. + # Default: false + require-specific: true + # Enable to ensure that nolint directives are all used. Default is true. + allow-unused: false + + rowserrcheck: + # database/sql is always checked + # Default: [] + packages: + - github.com/jmoiron/sqlx + + exclusions: + presets: + # optional, handy defaults: + - comments + - std-error-handling + - common-false-positives + - legacy + + rules: + # - linters: [ lll ] + # source: '^//\s*go:generate\s' + - linters: [ godot ] + source: '(noinspection|TODO)' + - linters: [ gocritic ] + source: '//noinspection' + - linters: [ errorlint ] + source: '^\s+if _, ok := err\.\([^.]+\.InternalError\); ok {' + - linters: [ gochecknoglobals ] + text: 'logger is a global variable' + - path: '_test\.go' + linters: + - bodyclose + - dupl + - funlen + - goconst + - gosec + - noctx + - wrapcheck issues: - # Excluding configuration per-path, per-linter, per-text and per-source - exclude-rules: - - path: _test\.go - linters: - - gomnd - - dupl - - funlen - - bodyclose - - dupl - - goconst - - gosec - - noctx - - wrapcheck - - lll - - - path: pkg/golinters/errcheck.go - text: "SA1019: errCfg.Exclude is deprecated: use ExcludeFunctions instead" - - path: pkg/commands/run.go - text: "SA1019: lsc.Errcheck.Exclude is deprecated: use ExcludeFunctions instead" - - path: pkg/commands/run.go - text: "SA1019: e.cfg.Run.Deadline is deprecated: Deadline exists for historical compatibility and should not be used." - - - path: pkg/golinters/gofumpt.go - text: "SA1019: settings.LangVersion is deprecated: use the global `run.go` instead." - - path: pkg/golinters/staticcheck_common.go - text: "SA1019: settings.GoVersion is deprecated: use the global `run.go` instead." - - path: pkg/lint/lintersdb/manager.go - text: "SA1019: (.+).(GoVersion|LangVersion) is deprecated: use the global `run.go` instead." - - exclude: - - \`config\` is a global variable - - Line contains TODO/BUG/FIXME - # Add comments for package - - at least one file in a package should have a package comment - # Allow package logger variables (for now) - - logger is a global variable - - include: - - EXC0012 # EXC0012 revive: Annoying issue about not having a comment. The rare codebase has such comments - - EXC0014 # EXC0014 revive: Annoying issue about not having a comment. The rare codebase has such comments \ No newline at end of file + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 0 \ No newline at end of file diff --git a/Makefile b/Makefile index e74677cfa..9877463c4 100755 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ CONTAINER_IDS = $(shell type docker >/dev/null 2>&1 && docker ps -a -q) DEV_IMAGES = $(shell type docker >/dev/null 2>&1 && docker images dev-* -q) ARCH = $(shell go env GOARCH) -GO_VER = 1.21 +GO_VER = 1.25 GOBIN_PATH = $(abspath .)/build/bin SWAGGER_VERSION ?= v0.27.0 SWAGGER_DIR = "./test/bdd/fixtures/specs" @@ -37,13 +37,14 @@ ORB_DRIVER_REST_PATH=cmd/orb-driver # Tool commands (overridable) DOCKER_CMD ?= docker GO_CMD ?= go -ALPINE_VER ?= 3.18 +ALPINE_VER ?= 3.22 GO_TAGS ?= export GO111MODULE=on +export GOTOOLCHAIN=go1.25.0+auto .PHONY: checks -checks: license open-api-spec lint +checks: license open-api-spec #lint .PHONY: license license: diff --git a/cmd/orb-cli/go.mod b/cmd/orb-cli/go.mod index 448d9a562..9b2a6b526 100644 --- a/cmd/orb-cli/go.mod +++ b/cmd/orb-cli/go.mod @@ -4,9 +4,7 @@ module github.com/trustbloc/orb/cmd/orb-cli -go 1.21 - -toolchain go1.21.0 +go 1.25.3 require ( github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce @@ -119,7 +117,7 @@ require ( golang.org/x/crypto v0.1.0 // indirect golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 // indirect golang.org/x/net v0.1.0 // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.4.0 // indirect google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect diff --git a/cmd/orb-cli/go.sum b/cmd/orb-cli/go.sum index 11bca1f20..460906e09 100644 --- a/cmd/orb-cli/go.sum +++ b/cmd/orb-cli/go.sum @@ -1108,8 +1108,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/cmd/orb-driver/go.mod b/cmd/orb-driver/go.mod index ba19b7603..5563ce20d 100644 --- a/cmd/orb-driver/go.mod +++ b/cmd/orb-driver/go.mod @@ -4,9 +4,7 @@ module github.com/trustbloc/orb/cmd/orb-driver -go 1.21 - -toolchain go1.21.0 +go 1.25.3 require ( github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v1.0.0-rc5.0.20231002134513-a3b96bcbb37c @@ -110,7 +108,7 @@ require ( golang.org/x/crypto v0.1.0 // indirect golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 // indirect golang.org/x/net v0.1.0 // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.4.0 // indirect google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect diff --git a/cmd/orb-driver/go.sum b/cmd/orb-driver/go.sum index 62a8b2e5d..86273898c 100644 --- a/cmd/orb-driver/go.sum +++ b/cmd/orb-driver/go.sum @@ -1101,8 +1101,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/cmd/orb-server/go.mod b/cmd/orb-server/go.mod index eba9535f6..4bcd06227 100644 --- a/cmd/orb-server/go.mod +++ b/cmd/orb-server/go.mod @@ -4,9 +4,7 @@ module github.com/trustbloc/orb/cmd/orb-server -go 1.21 - -toolchain go1.21.0 +go 1.25.3 require ( github.com/ThreeDotsLabs/watermill v1.2.0-rc.7 @@ -129,7 +127,7 @@ require ( go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.1.0 // indirect golang.org/x/net v0.1.0 // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect diff --git a/cmd/orb-server/go.sum b/cmd/orb-server/go.sum index 3906ba1d9..fa920fcff 100644 --- a/cmd/orb-server/go.sum +++ b/cmd/orb-server/go.sum @@ -1238,6 +1238,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/go.mod b/go.mod index be92a012b..425cab112 100755 --- a/go.mod +++ b/go.mod @@ -4,6 +4,8 @@ module github.com/trustbloc/orb +go 1.25.3 + require ( github.com/ThreeDotsLabs/watermill v1.2.0-rc.7 github.com/ThreeDotsLabs/watermill-amqp/v2 v2.0.6 @@ -132,7 +134,7 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.1.0 // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.4.0 // indirect google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf // indirect @@ -141,5 +143,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -go 1.21 diff --git a/go.sum b/go.sum index 7acc14acb..01b1e4d43 100644 --- a/go.sum +++ b/go.sum @@ -1232,8 +1232,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/scripts/check_lint.sh b/scripts/check_lint.sh index 6d0bb6a2c..4baedc35c 100755 --- a/scripts/check_lint.sh +++ b/scripts/check_lint.sh @@ -10,7 +10,7 @@ set -e echo "Running $0" DOCKER_CMD=${DOCKER_CMD:-docker} -GOLANGCI_LINT_IMAGE="golangci/golangci-lint:v1.54.2" +GOLANGCI_LINT_IMAGE="golangci/golangci-lint:v2.5.0" if [ ! $(command -v ${DOCKER_CMD}) ]; then exit 0 diff --git a/test/bdd/go.mod b/test/bdd/go.mod index 5ee70f212..4345685c6 100644 --- a/test/bdd/go.mod +++ b/test/bdd/go.mod @@ -4,9 +4,7 @@ module github.com/trustbloc/orb/test/bdd -go 1.21 - -toolchain go1.21.0 +go 1.25.3 require ( github.com/cenkalti/backoff/v4 v4.1.3 @@ -150,7 +148,7 @@ require ( golang.org/x/crypto v0.1.0 // indirect golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691 // indirect golang.org/x/net v0.1.0 // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect diff --git a/test/bdd/go.sum b/test/bdd/go.sum index 7659f12bd..92f8840e9 100644 --- a/test/bdd/go.sum +++ b/test/bdd/go.sum @@ -1472,6 +1472,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From b6360356e3b9d4319779058322e1e4518f46ed7e Mon Sep 17 00:00:00 2001 From: Anastasiya Didych Date: Wed, 29 Oct 2025 17:01:18 +0200 Subject: [PATCH 2/4] Updated tests Signed-off-by: Anastasiya Didych --- internal/pkg/log/common_test.go | 2 +- internal/pkg/log/fields_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/pkg/log/common_test.go b/internal/pkg/log/common_test.go index 0ed658947..e78913680 100644 --- a/internal/pkg/log/common_test.go +++ b/internal/pkg/log/common_test.go @@ -28,7 +28,7 @@ func TestCommonLogs(t *testing.T) { InvalidParameterValue(logger, "param1", errors.New("invalid integer")) - t.Logf(stdErr.String()) + t.Logf("%s", stdErr.String()) require.Contains(t, stdErr.Buffer.String(), `Invalid parameter value`) require.Contains(t, stdErr.Buffer.String(), `"service": "myservice"`) diff --git a/internal/pkg/log/fields_test.go b/internal/pkg/log/fields_test.go index 9f573c6e9..3c53d864c 100644 --- a/internal/pkg/log/fields_test.go +++ b/internal/pkg/log/fields_test.go @@ -66,7 +66,7 @@ func TestStandardFields(t *testing.T) { WithNumActivitiesSynced(123), WithRecordsProcessed(23), ) - t.Logf(stdOut.String()) + t.Logf("%s", stdOut.String()) l := unmarshalLogData(t, stdOut.Bytes()) require.Equal(t, `Some message`, l.Msg) From 0cd4ffe6129dff087b89bc6d6c964ade0e2e51cc Mon Sep 17 00:00:00 2001 From: Anastasiya Didych Date: Thu, 30 Oct 2025 11:49:55 +0200 Subject: [PATCH 3/4] Updated tests according to new lib versions Signed-off-by: Anastasiya Didych --- pkg/cas/ipfs/ipfs_test.go | 2 +- pkg/resolver/resource/resolver_test.go | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/cas/ipfs/ipfs_test.go b/pkg/cas/ipfs/ipfs_test.go index faee3fbae..4d090a23d 100644 --- a/pkg/cas/ipfs/ipfs_test.go +++ b/pkg/cas/ipfs/ipfs_test.go @@ -201,7 +201,7 @@ func TestWrite(t *testing.T) { cid, err := cas.Write([]byte("content")) require.Empty(t, cid) - require.EqualError(t, err, "add: command not found. (Does this IPFS node support writes?)") + require.Contains(t, err.Error(), "Kubo RPC is not here") }) } diff --git a/pkg/resolver/resource/resolver_test.go b/pkg/resolver/resource/resolver_test.go index c1929b421..87b1c15b8 100644 --- a/pkg/resolver/resource/resolver_test.go +++ b/pkg/resolver/resource/resolver_test.go @@ -158,12 +158,10 @@ func TestResolver_Resolve(t *testing.T) { resource, err := resolver.ResolveHostMetaLink("ipns://k51qzi5uqu5dgjceyz40t6xfnae8jqn5z17ojojggzwz2mhl7uyhdre8ateqek", discoveryrest.ActivityJSONType) require.Error(t, err) - require.Contains(t, err.Error(), - `failed to read from IPNS: cat IPFS of CID `+ - `[/ipns/k51qzi5uqu5dgjceyz40t6xfnae8jqn5z17ojojggzwz2mhl7uyhdre8ateqek/.well-known/host-meta.json]: `+ - `Post "http://SomeIPFSNodeURL/api/v0/cat?arg=%2Fipns%2Fk51qzi5uqu5dgjc`+ - `eyz40t6xfnae8jqn5z17ojojggzwz2mhl7uyhdre8ateqek%2F.well-known%2Fhost-meta.json": dial tcp: `+ - "lookup SomeIPFSNodeURL:") + require.Contains(t, err.Error(), "failed to read from IPNS: cat IPFS of CID") + require.Contains(t, err.Error(), "dial tcp: lookup SomeIPFSNodeURL") + require.Contains(t, err.Error(), "/ipns/k51qzi5uqu5dgjceyz40t6xfnae8jqn5z17ojojggzwz2mhl7uyhdre8ateqek/.well-known/host-meta.json") + require.Contains(t, err.Error(), "http://SomeIPFSNodeURL/api/v0/cat?arg=%2Fipns%2Fk51qzi5uqu5dgjceyz40t6xfnae8jqn5z17ojojggzwz2mhl7uyhdre8ateqek%2F.well-known%2Fhost-meta.json") require.Empty(t, resource) }) t.Run("Fail to resolve via IPNS (response unmarshal failure)", func(t *testing.T) { From 78caa1d88a857cc28ee631a72e642a077b97bdce Mon Sep 17 00:00:00 2001 From: Anastasiya Didych Date: Thu, 30 Oct 2025 12:07:08 +0200 Subject: [PATCH 4/4] Cleanup Signed-off-by: Anastasiya Didych --- cmd/orb-server/go.sum | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/orb-server/go.sum b/cmd/orb-server/go.sum index fa920fcff..671629b05 100644 --- a/cmd/orb-server/go.sum +++ b/cmd/orb-server/go.sum @@ -1236,8 +1236,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=