Skip to content

Commit c5410e1

Browse files
authored
Merge pull request #1181 from ydb-platform/versioning
Versioning policy
2 parents 5d5dff4 + 66ea269 commit c5410e1

Some content is hidden

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

64 files changed

+1103
-328
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Added versioning policy
2+
13
## v3.62.0
24
* Restored `WithSessionPoolKeepAliveMinSize` and `WithSessionPoolKeepAliveTimeout` for backward compatibility.
35
* Fixed leak timers

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Supports `table`, `query`, `discovery`, `coordination`, `ratelimiter`, `scheme`,
2222
`ydb-go-sdk` supports all Go versions supported by the official [Go Release Policy](https://go.dev/doc/devel/release#policy).
2323
That is, the two most recent releases of Go.
2424

25+
## Versioning Policy
26+
27+
`ydb-go-sdk` comply to guidelines from [SemVer2.0.0](https://semver.org/) with an several [exceptions](VERSIONING.md).
28+
2529
## Installation
2630

2731
```sh

VERSIONING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# YDB-Go-SDK Versioning Policy
2+
3+
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.
4+
5+
We endeavor to adhere to versioning guidelines as defined by [SemVer2.0.0](https://semver.org/).
6+
7+
We making the following exceptions to those guidelines:
8+
## Experimental
9+
- We use the `// Experimental` comment for new features in the `ydb-go-sdk`.
10+
- Early adopters of newest feature can report bugs and imperfections in functionality.
11+
- For fix this issues we can make broken changes in experimental API.
12+
- We reserve the right to remove or modify these experimental features at any time without increase of major part of version.
13+
- We want to make experimental API as stable in the future
14+
## Deprecated
15+
- We use the `// Deprecated` comment for deprecated features in the `ydb-go-sdk`.
16+
- 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).
17+
- This helps to our users to soft decline to use the deprecated feature without any impact on their code.
18+
- Deprecated features will not be removed or changed for a minimum period of **six months** since the mark added.
19+
- We reserve the right to remove or modify these deprecated features without increase of major part of version.
20+
## Internals
21+
- Some public API of `ydb-go-sdk` relate to the internals.
22+
- We use the `// Internals` comment for public internals in the `ydb-go-sdk`.
23+
- `ydb-go-sdk` internals can be changed at any time without increase of major part of version.
24+
- Internals will never marked as stable

balancers/balancers.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99
"github.com/ydb-platform/ydb-go-sdk/v3/internal/xstring"
1010
)
1111

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

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

config/config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ type Option func(c *Config)
107107

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

171173
// WithUserAgent add provided user agent to all api requests
172174
//
173-
// Deprecated: use WithApplicationName instead
175+
// Deprecated: use WithApplicationName instead.
176+
// Will be removed after Oct 2024.
177+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
174178
func WithUserAgent(userAgent string) Option {
175179
return func(c *Config) {
176180
c.metaOptions = append(c.metaOptions, meta.WithApplicationNameOption(userAgent))

connection.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import (
1616
// Connection interface provide access to YDB service clients
1717
// Interface and list of clients may be changed in the future
1818
//
19-
// Deprecated: use directly *Driver type from ydb.Open instead
20-
//
21-
//nolint:interfacebloat
22-
type Connection interface {
19+
// Deprecated: use Driver instance instead.
20+
// Will be removed at next major release.
21+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
22+
type Connection interface { //nolint:interfacebloat
2323
// Endpoint returns initial endpoint
2424
Endpoint() string
2525

@@ -37,9 +37,7 @@ type Connection interface {
3737

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

4543
// Scheme returns scheme client

coordination/coordination.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ type Client interface {
2626
// - close the Client which the session was created with,
2727
// - call any method of the Session until the ErrSessionClosed is returned.
2828
//
29-
// # Experimental
30-
//
31-
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
29+
// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
3230
Session(ctx context.Context, path string, opts ...options.SessionOption) (Session, error)
3331
}
3432

driver.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,7 @@ func (d *Driver) Table() table.Client {
191191

192192
// Query returns query client
193193
//
194-
// # Experimental
195-
//
196-
// Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.
194+
// Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental
197195
func (d *Driver) Query() query.Client {
198196
return d.query.Get()
199197
}
@@ -275,10 +273,12 @@ func MustOpen(ctx context.Context, dsn string, opts ...Option) *Driver {
275273

276274
// New connects to database and return driver runtime holder
277275
//
278-
// Deprecated: use Open with required param connectionString instead
279-
//
280-
//nolint:nonamedreturns
281-
func New(ctx context.Context, opts ...Option) (_ *Driver, err error) {
276+
// Deprecated: use ydb.Open instead.
277+
// New func have no required arguments, such as connection string.
278+
// Thats why we recognize that New have wrong signature.
279+
// Will be removed after Oct 2024.
280+
// Read about versioning policy: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#deprecated
281+
func New(ctx context.Context, opts ...Option) (_ *Driver, err error) { //nolint:nonamedreturns
282282
d, err := newConnectionFromOptions(ctx, opts...)
283283
if err != nil {
284284
return nil, xerrors.WithStackTrace(err)

examples/topic/topicreader/topicreader_advanced.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ func UnmarshalMessageContentToOwnType(ctx context.Context, reader *topicreader.R
5050
// ProcessMessagesWithSyncCommit example about guarantee wait for commit accepted by server
5151
func ProcessMessagesWithSyncCommit(ctx context.Context, db *ydb.Driver) {
5252
reader, _ := db.Topic().StartReader("consumer", nil,
53-
topicoptions.WithCommitMode(topicoptions.CommitModeSync),
53+
topicoptions.WithReaderCommitMode(topicoptions.CommitModeSync),
5454
)
5555
defer func() {
5656
_ = reader.Close(ctx)
5757
}()
5858

5959
for {
60-
batch, _ := reader.ReadMessageBatch(ctx)
60+
batch, _ := reader.ReadMessagesBatch(ctx)
6161
processBatch(batch.Context(), batch)
6262
_ = reader.Commit(ctx, batch) // will wait response about commit from server
6363
}
@@ -67,7 +67,7 @@ func ProcessMessagesWithSyncCommit(ctx context.Context, db *ydb.Driver) {
6767
// commit messages to YDB
6868
func OwnReadProgressStorage(ctx context.Context, db *ydb.Driver) {
6969
reader, _ := db.Topic().StartReader("consumer", topicoptions.ReadTopic("asd"),
70-
topicoptions.WithGetPartitionStartOffset(
70+
topicoptions.WithReaderGetPartitionStartOffset(
7171
func(
7272
ctx context.Context,
7373
req topicoptions.GetPartitionStartOffsetRequest,
@@ -84,7 +84,7 @@ func OwnReadProgressStorage(ctx context.Context, db *ydb.Driver) {
8484
)
8585

8686
for {
87-
batch, _ := reader.ReadMessageBatch(ctx)
87+
batch, _ := reader.ReadMessagesBatch(ctx)
8888

8989
processBatch(batch.Context(), batch)
9090
_ = externalSystemCommit(

examples/topic/topicreader/topicreader_simple.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func PrintMessageContent(ctx context.Context, reader *topicreader.Reader) {
2424
// ReadMessagesByBatch it is recommended way for process messages
2525
func ReadMessagesByBatch(ctx context.Context, reader *topicreader.Reader) {
2626
for {
27-
batch, _ := reader.ReadMessageBatch(ctx)
27+
batch, _ := reader.ReadMessagesBatch(ctx)
2828
processBatch(batch.Context(), batch)
2929
_ = reader.Commit(batch.Context(), batch)
3030
}

0 commit comments

Comments
 (0)