From 88a039cc86fb5b667c1736ff766a6bb394a9b885 Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 21 Aug 2024 16:42:58 +0300 Subject: [PATCH 1/3] [#1316] go.mod: Bump go version to 1.22 Signed-off-by: Ekaterina Lebedeva Signed-off-by: Evgenii Stratonikov --- .forgejo/workflows/dco.yml | 2 +- .forgejo/workflows/tests.yml | 4 ++-- Dockerfile | 2 +- Makefile | 4 ++-- go.mod | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/dco.yml b/.forgejo/workflows/dco.yml index dcee5fc..89a6fac 100644 --- a/.forgejo/workflows/dco.yml +++ b/.forgejo/workflows/dco.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 with: - go-version: '1.22' + go-version: '1.23' - name: Run commit format checker uses: https://git.frostfs.info/TrueCloudLab/dco-go@v3 diff --git a/.forgejo/workflows/tests.yml b/.forgejo/workflows/tests.yml index 1ad32dc..c4cb72a 100644 --- a/.forgejo/workflows/tests.yml +++ b/.forgejo/workflows/tests.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Install linters @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go_versions: [ '1.21', '1.22' ] + go_versions: [ '1.22', '1.23' ] fail-fast: false steps: - uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile index a4cfb15..5428467 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 +FROM golang:1.22 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install make openjdk-11-jre -y WORKDIR /work diff --git a/Makefile b/Makefile index 0b4011f..33ab7d5 100755 --- a/Makefile +++ b/Makefile @@ -2,8 +2,8 @@ ANTLR_VERSION="4.13.0" TMP_DIR := .cache -LINT_VERSION ?= 1.56.2 -TRUECLOUDLAB_LINT_VERSION ?= 0.0.2 +LINT_VERSION ?= 1.60.1 +TRUECLOUDLAB_LINT_VERSION ?= 0.0.6 OUTPUT_LINT_DIR ?= $(shell pwd)/bin LINT_DIR = $(OUTPUT_LINT_DIR)/golangci-lint-$(LINT_VERSION)-v$(TRUECLOUDLAB_LINT_VERSION) diff --git a/go.mod b/go.mod index a481fb2..6802892 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go -go 1.21 +go 1.22 require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e -- 2.45.2 From ebe708852e01669288e6bec335d7d15116769e5c Mon Sep 17 00:00:00 2001 From: Ekaterina Lebedeva Date: Wed, 21 Aug 2024 16:43:53 +0300 Subject: [PATCH 2/3] [#1316] lint: Fix warnings Signed-off-by: Ekaterina Lebedeva Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 3 ++- netmap/aggregator.go | 12 ++++++------ netmap/context.go | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index aca0746..ff8989a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,7 +12,8 @@ run: # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" - format: tab + formats: + - format: tab # all available settings of specific linters linters-settings: diff --git a/netmap/aggregator.go b/netmap/aggregator.go index c4a43c1..1faba9e 100644 --- a/netmap/aggregator.go +++ b/netmap/aggregator.go @@ -73,8 +73,8 @@ func newMinAgg() aggregator { // newReverseMinNorm returns a normalizer which // normalize values in range of 0.0 to 1.0 to a minimum value. -func newReverseMinNorm(min float64) normalizer { - return &reverseMinNorm{min: min} +func newReverseMinNorm(minV float64) normalizer { + return &reverseMinNorm{min: minV} } // newSigmoidNorm returns a normalizer which @@ -125,22 +125,22 @@ func (a *meanIQRAgg) Compute() float64 { slices.Sort(a.arr) - var min, max float64 + var minV, maxV float64 const minLn = 4 if l < minLn { - min, max = a.arr[0], a.arr[l-1] + minV, maxV = a.arr[0], a.arr[l-1] } else { start, end := l/minLn, l*3/minLn-1 - min, max = a.arr[start], a.arr[end] + minV, maxV = a.arr[start], a.arr[end] } count := 0 sum := float64(0) for _, e := range a.arr { - if e >= min && e <= max { + if e >= minV && e <= maxV { sum += e count++ } diff --git a/netmap/context.go b/netmap/context.go index df3c85b..ca791e8 100644 --- a/netmap/context.go +++ b/netmap/context.go @@ -94,14 +94,14 @@ func (c *context) addUsedNodes(ns ...NodeInfo) { func defaultWeightFunc(ns nodes) weightFunc { mean := newMeanAgg() - min := newMinAgg() + minV := newMinAgg() for i := range ns { mean.Add(float64(ns[i].capacity())) - min.Add(float64(ns[i].Price())) + minV.Add(float64(ns[i].Price())) } return newWeightFunc( newSigmoidNorm(mean.Compute()), - newReverseMinNorm(min.Compute())) + newReverseMinNorm(minV.Compute())) } -- 2.45.2 From a7aabe53491c506827bc9877d6f9c25c6209764e Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 6 Sep 2024 16:54:07 +0300 Subject: [PATCH 3/3] [#266] go.mod: Update api-go Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 2 +- go.mod | 31 +++++++++++++++++++------------ go.sum | Bin 17844 -> 18480 bytes 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ff8989a..49626f0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,7 +26,7 @@ linters-settings: # report about shadowed variables check-shadowing: false staticcheck: - checks: ["all"] + checks: ["all", "-SA1019"] funlen: lines: 80 # default 60 statements: 60 # default 40 diff --git a/go.mod b/go.mod index 6802892..afc7696 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.frostfs.info/TrueCloudLab/frostfs-sdk-go go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240726072425-3dfa2f4fd65e + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240906121927-2c79f770e449 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 @@ -12,36 +12,43 @@ require ( github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/klauspost/reedsolomon v1.12.1 github.com/mr-tron/base58 v1.2.0 - github.com/nspcc-dev/neo-go v0.106.2 + github.com/nspcc-dev/neo-go v0.106.3 github.com/stretchr/testify v1.9.0 go.uber.org/zap v1.27.0 - google.golang.org/grpc v1.62.0 - google.golang.org/protobuf v1.33.0 + google.golang.org/grpc v1.66.0 + google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v3 v3.0.1 ) require ( git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 // indirect git.frostfs.info/TrueCloudLab/rfc6979 v0.4.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.1 // indirect github.com/gorilla/websocket v1.5.1 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/klauspost/cpuid/v2 v2.2.6 // indirect github.com/nspcc-dev/go-ordered-json v0.0.0-20240301084351-0246b013f8b2 // indirect - github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240521091047-78685785716d // indirect + github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20240727093519-1a48f1ce43ec // indirect github.com/nspcc-dev/rfc6979 v0.2.1 // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.48.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect github.com/twmb/murmur3 v1.1.8 // indirect go.etcd.io/bbolt v1.3.9 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect + golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect ) diff --git a/go.sum b/go.sum index a23b40507544d292113ef84fa0af08fdd62862b8..af1f9134b6c5a6854f42bb3d9c374a612c22c718 100644 GIT binary patch delta 3276 zcmb7GORVE&8P%OBty)Ue5n`t8P}HKT8r8km@7K`MCb45Du^q>W6Wa?^zwP+_NaA?G zNbCR!3f{6nV#5MKOArzZgxIj@l06aLwkEWJWE5n(c#WWBOkqy8k)^qnW6 zV}$iRk@ocN&c%Zt{Ooz*lgU6oyGkPax5)+#ty$_B?u*?galK~z;L zF6&ERUkT;i;m(EdID%e5C!8u!Fy5&2yr_n8Xtf*PZ`WFo`J^QfnMU_5$w&o69d4`c z`%iqe+YO#M{O*Z=TtL_fz4JyZ`Iur~jaFj|krEY*Bt{?g7XjFYsz$>=y!4dDD6sC` zCm&p3hdWQ*x%H?t)5tPYu-JrlRJ&FE(iXmgu`B$<>3DisDtn<0iv`W?Cz|gBK!k;< zu0iD>AN{E3ga#LNK&_E@JN`&fS z)?##aV(DJHk92=|;g1k{GJ$9Jfgi1BI>3AVHmk)kj5H0h+)ULxh*ICcA~srYHKt~- z!T-Mh42hlvN4M;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