Skip to content

Commit

Permalink
merging with main
Browse files Browse the repository at this point in the history
  • Loading branch information
Gleb Brozhe committed Apr 17, 2024
2 parents 757f14f + 35a861a commit 0134ea4
Show file tree
Hide file tree
Showing 142 changed files with 4,741 additions and 580 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/breaking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
contents: read
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install gorelease
run: test -e ~/go/bin/gorelease || go install golang.org/x/exp/cmd/gorelease@latest
- name: Check broken API changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Changelog updated
uses: Zomzog/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -63,7 +63,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -76,4 +76,4 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
12 changes: 6 additions & 6 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
YDB_VERSION: ${{ matrix.ydb-version }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
cache: true
- name: Run basic example ${{ matrix.application }}
Expand Down Expand Up @@ -74,9 +74,9 @@ jobs:
POSTGRES_CONNECTION_STRING: postgres://postgres:postgres@localhost:5432/basic?sslmode=disable
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
cache: true
- name: Run basic example ${{ matrix.application }} with postgres
Expand All @@ -97,9 +97,9 @@ jobs:
SQLITE_CONNECTION_STRING: ${{ matrix.application }}.db
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
cache: true
- name: Run basic example ${{ matrix.application }} with sqlite
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=5m
Expand All @@ -29,11 +29,11 @@ jobs:
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: generate examples golangci-lint config
run: sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/examples/g' .golangci.yml > examples/.golangci.yml
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=5m
Expand All @@ -45,11 +45,11 @@ jobs:
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: generate slo golangci-lint config
run: sed 's/github.com\/ydb-platform\/ydb-go-sdk\/v3/slo/g' .golangci.yml > tests/slo/.golangci.yml
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout=5m
Expand All @@ -61,9 +61,9 @@ jobs:
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: "1.21"
- name: Install utilities
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
CHANGELOG_FILE: CHANGELOG.md
GITHUB_TOKEN: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }}
fetch-depth: 0
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/slo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run SLO
uses: ydb-platform/slo-tests@js-version
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
workload_build_context4: ../..
workload_build_options4: -f Dockerfile --build-arg SRC_PATH=xorm --build-arg JOB_NAME=workload-xorm

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: always()
with:
name: slo-logs
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ jobs:
runs-on: ${{ matrix.os }}-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Test
run: go test -race -coverprofile unit.txt -covermode atomic ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./unit.txt
flags: unit,${{ matrix.os }},go-${{ matrix.go-version }}
Expand Down Expand Up @@ -71,16 +71,16 @@ jobs:
HIDE_APPLICATION_OUTPUT: 1
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Integration test
run: go test -race -tags integration -coverpkg=./... -coverprofile integration-secure.txt -covermode atomic ./tests/integration
- name: Upload Test secure connection coverage report to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./integration-secure.txt
flags: integration,${{ matrix.os }},go-${{ matrix.go-version }},ydb-${{ matrix.ydb-version }}
Expand Down
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,12 @@ linters:
- godot
- goerr113
- golint
- gomnd
- ifshort
- interfacebloat
- ireturn
- maintidx
- nonamedreturns
- paralleltest
- scopelint
- structcheck
- testableexamples
- testpackage
Expand Down Expand Up @@ -295,6 +293,7 @@ issues:
- predeclared
- path: _test\.go
linters:
- scopelint
- funlen
- unused
- unparam
Expand All @@ -304,6 +303,9 @@ issues:
- staticcheck
- path: _test\.go
text: "ydb.Connection is deprecated"
- path: examples
linters:
- gomnd

# Allow underscore and capital camel case for readability
# Examples: Type_PRIMITIVE_TYPE_ID_UNSPECIFIED, Ydb_Discovery_V1, _voidValue
Expand Down
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
## v3.65.1
* Updated dependency `ydb-go-genproto`
* Added processing of `Ydb.StatusIds_EXTERNAL_ERROR` in `retry.Retry`

## v3.65.0
* Supported OAuth 2.0 Token Exchange credentials provider

## v3.64.0
* Supported `table.Session.RenameTables` method
* Fixed out of range panic if next query result set part is empty
* Updated the indirect dependencies `golang.org/x/net` to `v0.17.0` and `golang.org/x/sys` to `v0.13.0` due to vulnerability issue

## v3.63.0
* Added versioning policy

## v3.62.0
* Restored `WithSessionPoolKeepAliveMinSize` and `WithSessionPoolKeepAliveTimeout` for backward compatibility.
* Fixed leak timers
* Changed default StartTime (time of retries for connect to server) for topic writer from 1 minute to infinite (can be overrided by WithWriterStartTimeout topic option)
* Added `Struct` support for `Variant` in `ydb.ParamsBuilder()`
* Added `go` with anonymous function case in `gstack`

## v3.61.2
* Changed default transaction control to `NoTx` for execute query through query service client
* Changed default transaction control to `NoTx` for execute query through query service client

## v3.61.1
* Renamed `db.Coordination().CreateSession()` to `db.Coordination().Session()` for compatibility with protos
Expand Down Expand Up @@ -82,7 +104,7 @@
* Fixed sometime panic on topic writer closing
* Added experimental query parameters builder `ydb.ParamsBuilder()`
* Changed types of `table/table.{QueryParameters,ParameterOption}` to aliases on `internal/params.{Parameters,NamedValue}`
* Fixed bug with optional decimal serialization
* Fixed bug with optional decimal serialization

## v3.56.2
* Fixed return private error for commit to stopped partition in topic reader.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Supports `table`, `query`, `discovery`, `coordination`, `ratelimiter`, `scheme`,
`ydb-go-sdk` supports all Go versions supported by the official [Go Release Policy](https://go.dev/doc/devel/release#policy).
That is, the two most recent releases of Go.

## Versioning Policy

`ydb-go-sdk` comply to guidelines from [SemVer2.0.0](https://semver.org/) with an several [exceptions](VERSIONING.md).

## Installation

```sh
Expand Down
24 changes: 24 additions & 0 deletions VERSIONING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# YDB-Go-SDK Versioning Policy

By adhering to these guidelines and exceptions, we aim to provide a stable and reliable development experience for our users (aka [LTS](https://en.wikipedia.org/wiki/Long-term_support)) while still allowing for innovation and improvement.

We endeavor to adhere to versioning guidelines as defined by [SemVer2.0.0](https://semver.org/).

We making the following exceptions to those guidelines:
## Experimental
- We use the `// Experimental` comment for new features in the `ydb-go-sdk`.
- Early adopters of newest feature can report bugs and imperfections in functionality.
- For fix this issues we can make broken changes in experimental API.
- We reserve the right to remove or modify these experimental features at any time without increase of major part of version.
- We want to make experimental API as stable in the future
## Deprecated
- We use the `// Deprecated` comment for deprecated features in the `ydb-go-sdk`.
- Usage of some entity marked with `// Deprecated` can be detected with linters such as [check-deprecated](https://github.com/black-06/check-deprecated), [staticcheck](https://github.com/dominikh/go-tools/tree/master/cmd/staticcheck) or [go-critic](https://github.com/go-critic/go-critic).
- This helps to our users to soft decline to use the deprecated feature without any impact on their code.
- Deprecated features will not be removed or changed for a minimum period of **six months** since the mark added.
- We reserve the right to remove or modify these deprecated features without increase of major part of version.
## Internals
- Some public API of `ydb-go-sdk` relate to the internals.
- We use the `// Internals` comment for public internals in the `ydb-go-sdk`.
- `ydb-go-sdk` internals can be changed at any time without increase of major part of version.
- Internals will never marked as stable
6 changes: 5 additions & 1 deletion balancers/balancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import (
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xstring"
)

// Deprecated: RoundRobin is RandomChoice now
// Deprecated: RoundRobin is an alias to RandomChoice now
// Will be removed after Oct 2024.
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func RoundRobin() *balancerConfig.Config {
return &balancerConfig.Config{}
}
Expand Down Expand Up @@ -115,6 +117,8 @@ type Endpoint interface {

// Deprecated: LocalDC check "local" by compare endpoint location with discovery "selflocation" field.
// It work good only if connection url always point to local dc.
// Will be removed after Oct 2024.
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
LocalDC() bool
}

Expand Down
8 changes: 6 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ type Option func(c *Config)

// WithInternalDNSResolver
//
// Deprecated: always used internal dns-resolver
// Deprecated: always used internal dns-resolver.
// Will be removed after Oct 2024.
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func WithInternalDNSResolver() Option {
return func(c *Config) {}
}
Expand Down Expand Up @@ -170,7 +172,9 @@ func WithApplicationName(applicationName string) Option {

// WithUserAgent add provided user agent to all api requests
//
// Deprecated: use WithApplicationName instead
// Deprecated: use WithApplicationName instead.
// Will be removed after Oct 2024.
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
func WithUserAgent(userAgent string) Option {
return func(c *Config) {
c.metaOptions = append(c.metaOptions, meta.WithApplicationNameOption(userAgent))
Expand Down
12 changes: 5 additions & 7 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
// Connection interface provide access to YDB service clients
// Interface and list of clients may be changed in the future
//
// Deprecated: use directly *Driver type from ydb.Open instead
//
//nolint:interfacebloat
type Connection interface {
// Deprecated: use Driver instance instead.
// Will be removed at next major release.
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
type Connection interface { //nolint:interfacebloat
// Endpoint returns initial endpoint
Endpoint() string

Expand All @@ -37,9 +37,7 @@ type Connection interface {

// Query returns query client
//
// # Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
Query() query.Client

// Scheme returns scheme client
Expand Down
Loading

0 comments on commit 0134ea4

Please sign in to comment.