Skip to content

Commit 832da85

Browse files
authored
Merge branch 'master' into master
2 parents 87bdfe9 + 9ca8650 commit 832da85

File tree

310 files changed

+2346
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

310 files changed

+2346
-199
lines changed

.github/scripts/format-go-code.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ FILEPATH="$1"
66

77
gofmt -s -w "$FILEPATH"
88

9-
# https://github.com/rinchsan/gosimports
9+
# https://github.com/daixiang0/gci
1010
if [[ "$FILEPATH" == *"tests/slo/"* ]]
1111
then
12-
gosimports -local slo -w "$FILEPATH"
12+
gci write --skip-generated -s standard -s default -s "prefix(slo)" "$FILEPATH"
13+
elif [[ "$FILEPATH" == *"examples/"* ]]
14+
then
15+
gci write --skip-generated -s standard -s default -s "prefix(examples)" "$FILEPATH"
1316
else
14-
gosimports -local github.com/ydb-platform/ydb-go-sdk/v3 -w "$FILEPATH"
17+
gci write --skip-generated -s standard -s default -s "prefix(github.com/ydb-platform/ydb-go-sdk/v3)" "$FILEPATH"
1518
fi
1619

1720

.github/workflows/check-codegen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ ubuntu-latest ]
17-
go-version: [1.20.x, 1.21.x]
17+
go-version: [1.21.x, 1.22.x]
1818
runs-on: ${{ matrix.os }}
1919
steps:
2020
- name: Checkout

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
- name: Install utilities
7070
run: |
7171
go install mvdan.cc/gofumpt@v0.3.1
72-
go install github.com/rinchsan/gosimports/cmd/gosimports@v0.1.5
72+
go install github.com/daixiang0/gci@v0.12.1
7373
- name: format all files with auto-formatter
7474
run: bash ./.github/scripts/format-all-go-code.sh "$PWD"
7575
- name: Check repository diff

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
TAG="v$MAJOR.$MINOR.$PATCH";
7171
fi;
7272
git tag $TAG
73-
git push --tags && git push
73+
git push && git push --tags
7474
CHANGELOG="$CHANGELOG
7575
7676
Full Changelog: [$LAST_TAG...$TAG](https://github.com/ydb-platform/ydb-go-sdk/compare/$LAST_TAG...$TAG)"

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
go-version: [1.20.x, 1.21.x]
17+
go-version: [1.21.x, 1.22.x]
1818
os: [ubuntu, windows, macOS]
1919
env:
2020
OS: ${{ matrix.os }}-latest
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
fail-fast: false
4646
matrix:
47-
go-version: [1.20.x, 1.21.x]
47+
go-version: [1.21.x, 1.22.x]
4848
ydb-version: [22.5, 23.1, 23.2, 23.3]
4949
services:
5050
ydb:

.golangci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ linters-settings:
6464
# put imports beginning with prefix after 3rd-party packages;
6565
# it's a comma-separated list of prefixes
6666
local-prefixes: github.com/ydb-platform/ydb-go-sdk/v3
67+
gci:
68+
sections:
69+
- standard # Standard section: captures all standard packages.
70+
- default # Default section: contains all imports that could not be matched to another section type.
71+
- prefix(github.com/ydb-platform/ydb-go-sdk/v3) # Custom section: groups all imports with the specified Prefix.
72+
skip-generated: true
6773
goconst:
6874
# minimal length of string constant, 3 by default
6975
min-len: 2
@@ -220,7 +226,6 @@ linters:
220226
- forbidigo
221227
- forcetypeassert
222228
- funlen
223-
- gci
224229
- gochecknoglobals
225230
- gocognit
226231
- godot
@@ -230,12 +235,9 @@ linters:
230235
- gomoddirectives
231236
- ifshort
232237
- interfacebloat
233-
- interfacer
234238
- ireturn
235239
- maintidx
236240
- maligned
237-
- nilerr
238-
- nlreturn
239241
- nonamedreturns
240242
- paralleltest
241243
- scopelint

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1+
12
* Refactored internal packages by `protogetter` linter issues
23

4+
## v3.56.1
5+
* Fixed fixenv usage (related to tests only)
6+
7+
## v3.56.0
8+
* Fixed handle of operational errors in topic streams
9+
* The minimum version of Go in `ydb-go-sdk` has been raised to `go1.21`
10+
* Fixed topic writer infinite reconnections in some cases
11+
* Refactored nil on err `internal/grpcwrapper/rawydb/issues.go`, when golangci-lint nilerr enabled
12+
* Refactored nil on err `internal/grpcwrapper/rawtopic/describe_topic.go`, when golangci-lint nilerr enabled
13+
14+
## v3.55.3
15+
* Fixed handle of operational errors in topic streams (backported fix only)
16+
17+
## v3.55.2
18+
* Fixed init info in topic writer, when autoseq num turned off.
19+
20+
## v3.55.1
21+
* Supported column name prefix `__discard_column_` for discard columns in result sets
22+
* Made `StatusIds_SESSION_EXPIRED` retriable for idempotent operations
23+
24+
325
## v3.55.0
426
* Refactored `internal/value/intervalValue.Yql()`
527
* The minimum version of Go in `ydb-go-sdk` has been raised to `go1.20`

balancers/balancers.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func (filterLocalDC) String() string {
4040
func PreferLocalDC(balancer *balancerConfig.Config) *balancerConfig.Config {
4141
balancer.Filter = filterLocalDC{}
4242
balancer.DetectLocalDC = true
43+
4344
return balancer
4445
}
4546

@@ -49,6 +50,7 @@ func PreferLocalDC(balancer *balancerConfig.Config) *balancerConfig.Config {
4950
func PreferLocalDCWithFallBack(balancer *balancerConfig.Config) *balancerConfig.Config {
5051
balancer = PreferLocalDC(balancer)
5152
balancer.AllowFallback = true
53+
5254
return balancer
5355
}
5456

@@ -61,6 +63,7 @@ func (locations filterLocations) Allow(_ balancerConfig.Info, c conn.Conn) bool
6163
return true
6264
}
6365
}
66+
6467
return false
6568
}
6669

@@ -91,6 +94,7 @@ func PreferLocations(balancer *balancerConfig.Config, locations ...string) *bala
9194
}
9295
sort.Strings(locations)
9396
balancer.Filter = filterLocations(locations)
97+
9498
return balancer
9599
}
96100

@@ -100,6 +104,7 @@ func PreferLocations(balancer *balancerConfig.Config, locations ...string) *bala
100104
func PreferLocationsWithFallback(balancer *balancerConfig.Config, locations ...string) *balancerConfig.Config {
101105
balancer = PreferLocations(balancer, locations...)
102106
balancer.AllowFallback = true
107+
103108
return balancer
104109
}
105110

@@ -129,6 +134,7 @@ func Prefer(balancer *balancerConfig.Config, filter func(endpoint Endpoint) bool
129134
balancer.Filter = filterFunc(func(_ balancerConfig.Info, c conn.Conn) bool {
130135
return filter(c.Endpoint())
131136
})
137+
132138
return balancer
133139
}
134140

@@ -138,6 +144,7 @@ func Prefer(balancer *balancerConfig.Config, filter func(endpoint Endpoint) bool
138144
func PreferWithFallback(balancer *balancerConfig.Config, filter func(endpoint Endpoint) bool) *balancerConfig.Config {
139145
balancer = Prefer(balancer, filter)
140146
balancer.AllowFallback = true
147+
141148
return balancer
142149
}
143150

balancers/balancers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ func applyPreferFilter(info balancerConfig.Info, b *balancerConfig.Config, conns
6666
res = append(res, c)
6767
}
6868
}
69+
6970
return res
7071
}

balancers/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func CreateFromConfig(s string) (*balancerConfig.Config, error) {
9292
if c.Fallback {
9393
return PreferLocalDCWithFallBack(b), nil
9494
}
95+
9596
return PreferLocalDC(b), nil
9697
case preferTypeLocations:
9798
if len(c.Locations) == 0 {
@@ -100,6 +101,7 @@ func CreateFromConfig(s string) (*balancerConfig.Config, error) {
100101
if c.Fallback {
101102
return PreferLocationsWithFallback(b, c.Locations...), nil
102103
}
104+
103105
return PreferLocations(b, c.Locations...), nil
104106
default:
105107
return b, nil
@@ -125,6 +127,7 @@ func FromConfig(config string, opts ...fromConfigOption) *balancerConfig.Config
125127
if h.errorHandler != nil {
126128
h.errorHandler(err)
127129
}
130+
128131
return h.fallbackBalancer
129132
}
130133

0 commit comments

Comments
 (0)