Skip to content

Commit 19cea5b

Browse files
committed
Merge branch 'master' into fix-1506-optional-in-params
# Conflicts: # CHANGELOG.md # internal/params/optional_test.go
2 parents 85ba858 + b911372 commit 19cea5b

32 files changed

+161
-247
lines changed

.github/workflows/slo-report.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: slo-report
2+
3+
on:
4+
workflow_run:
5+
workflows: ['slo']
6+
types:
7+
- completed
8+
9+
jobs:
10+
test-ydb-slo-action:
11+
runs-on: ubuntu-latest
12+
name: Publish YDB SLO Report
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
if: github.event.workflow_run.conclusion == 'success'
17+
steps:
18+
- name: Publish YDB SLO Report
19+
uses: ydb-platform/ydb-slo-action/report@main
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
run_id: ${{ github.event.workflow_run.id }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
* Fixed send optional arguments to the server with `ydb.ParamsBuilder`
22

3+
## v3.88.0
4+
* Removed UUID methods from ydb.ParamsBuilder()
5+
36
## v3.87.0
47
* BREAK OLD STYLE WORK WITH UUID. See https://github.com/ydb-platform/ydb-go-sdk/issues/1501 for details.
58
At the version you must explicit choose way for work with uuid: old with bug or new (fixed).

internal/cmd/gtrace/writer.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ func (w *Writer) compose(trace *Trace) {
337337
w.code(`func (`, t, ` *`, trace.Name, `) Compose(`, x, ` *`, trace.Name, `, opts ...`+trace.Name+`ComposeOption) `)
338338
w.line(`*`, trace.Name, ` {`)
339339
w.block(func() {
340+
w.line(`if `, t, ` == nil {`)
341+
w.block(func() {
342+
w.line(`return x`)
343+
})
344+
w.line(`}`)
340345
w.line(`var `, ret, ` `, trace.Name, ``)
341346
if len(trace.Hooks) > 0 {
342347
w.line(`options := `, unexported(trace.Name), `ComposeOptions{}`)

internal/params/dict.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -444,18 +444,18 @@ func (d *dictValue) YSON(v []byte) *dict {
444444
return d.pair.parent
445445
}
446446

447-
// UUID has data corruption bug and will be removed in next version.
447+
//// UUID has data corruption bug and will be removed in next version.
448+
////
449+
//// Deprecated: Use Uuid (prefer) or UUIDWithIssue1501Value (for save old behavior) instead.
450+
//// https://github.com/ydb-platform/ydb-go-sdk/issues/1501
451+
//func (d *dictValue) UUID(v [16]byte) *dict {
452+
// d.pair.parent.values = append(d.pair.parent.values, value.DictValueField{
453+
// K: d.pair.keyValue,
454+
// V: value.UUIDWithIssue1501Value(v),
455+
// })
448456
//
449-
// Deprecated: Use Uuid (prefer) or UUIDWithIssue1501Value (for save old behavior) instead.
450-
// https://github.com/ydb-platform/ydb-go-sdk/issues/1501
451-
func (d *dictValue) UUID(v [16]byte) *dict {
452-
d.pair.parent.values = append(d.pair.parent.values, value.DictValueField{
453-
K: d.pair.keyValue,
454-
V: value.UUIDWithIssue1501Value(v),
455-
})
456-
457-
return d.pair.parent
458-
}
457+
// return d.pair.parent
458+
//}
459459

460460
func (d *dictValue) Uuid(v uuid.UUID) *dict { //nolint:revive,stylecheck
461461
d.pair.parent.values = append(d.pair.parent.values, value.DictValueField{

internal/params/dict_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -347,22 +347,6 @@ func TestDict(t *testing.T) {
347347
},
348348
},
349349
},
350-
{
351-
method: "UUID",
352-
args: []any{[...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}},
353-
354-
expected: expected{
355-
Type: &Ydb.Type{
356-
Type: &Ydb.Type_TypeId{TypeId: Ydb.Type_UUID},
357-
},
358-
Value: &Ydb.Value{
359-
Value: &Ydb.Value_Low_128{
360-
Low_128: 651345242494996240,
361-
},
362-
High_128: 72623859790382856,
363-
},
364-
},
365-
},
366350
{
367351
method: "Uuid",
368352
args: []any{uuid.UUID{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}},

internal/params/list.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,15 @@ func (l *listItem) YSON(v []byte) *list {
167167
return l.parent
168168
}
169169

170-
// UUID has data corruption bug and will be removed in next version.
170+
//// UUID has data corruption bug and will be removed in next version.
171+
////
172+
//// Deprecated: Use Uuid (prefer) or UUIDWithIssue1501Value (for save old behavior) instead.
173+
//// https://github.com/ydb-platform/ydb-go-sdk/issues/1501
174+
//func (l *listItem) UUID(v [16]byte) *list {
175+
// l.parent.values = append(l.parent.values, value.UUIDWithIssue1501Value(v))
171176
//
172-
// Deprecated: Use Uuid (prefer) or UUIDWithIssue1501Value (for save old behavior) instead.
173-
// https://github.com/ydb-platform/ydb-go-sdk/issues/1501
174-
func (l *listItem) UUID(v [16]byte) *list {
175-
l.parent.values = append(l.parent.values, value.UUIDWithIssue1501Value(v))
176-
177-
return l.parent
178-
}
177+
// return l.parent
178+
//}
179179

180180
func (l *listItem) Uuid(v uuid.UUID) *list { //nolint:revive,stylecheck
181181
l.parent.values = append(l.parent.values, value.Uuid(v))

internal/params/list_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,6 @@ func TestList(t *testing.T) {
346346
},
347347
},
348348
},
349-
{
350-
method: "UUID",
351-
args: []any{[...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}},
352-
353-
expected: expected{
354-
Type: &Ydb.Type{
355-
Type: &Ydb.Type_TypeId{TypeId: Ydb.Type_UUID},
356-
},
357-
Value: &Ydb.Value{
358-
Value: &Ydb.Value_Low_128{
359-
Low_128: 651345242494996240,
360-
},
361-
High_128: 72623859790382856,
362-
},
363-
},
364-
},
365349
{
366350
method: "Uuid",
367351
args: []any{uuid.UUID{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}},

internal/params/optional.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ func (p *optional) YSON(v *[]byte) *optionalBuilder {
155155
return &optionalBuilder{opt: p}
156156
}
157157

158-
// UUID has data corruption bug and will be removed in next version.
158+
//// UUID has data corruption bug and will be removed in next version.
159+
////
160+
//// Deprecated: Use Uuid (prefer) or UUIDWithIssue1501Value (for save old behavior) instead.
161+
//// https://github.com/ydb-platform/ydb-go-sdk/issues/1501
162+
//func (p *optional) UUID(v *[16]byte) *optionalBuilder {
163+
// p.value = value.NullableUUIDValue(v)
159164
//
160-
// Deprecated: Use Uuid (prefer) or UUIDWithIssue1501Value (for save old behavior) instead.
161-
// https://github.com/ydb-platform/ydb-go-sdk/issues/1501
162-
func (p *optional) UUID(v *[16]byte) *optionalBuilder {
163-
p.value = value.NullableUUIDValue(v)
164-
165-
return &optionalBuilder{opt: p}
166-
}
165+
// return &optionalBuilder{opt: p}
166+
//}
167167

168168
func (p *optional) Uuid(v *uuid.UUID) *optionalBuilder { //nolint:revive,stylecheck
169169
p.value = value.NullableUuidValue(v)

internal/params/optional_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,6 @@ func TestOptional(t *testing.T) {
346346
},
347347
},
348348
},
349-
{
350-
method: "UUID",
351-
args: []any{p([...]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16})},
352-
353-
expected: expected{
354-
Type: &Ydb.Type{
355-
Type: &Ydb.Type_TypeId{TypeId: Ydb.Type_UUID},
356-
},
357-
Value: &Ydb.Value{
358-
Value: &Ydb.Value_Low_128{
359-
Low_128: 651345242494996240,
360-
},
361-
High_128: 72623859790382856,
362-
},
363-
},
364-
},
365349
{
366350
method: "Uuid",
367351
args: []any{p(uuid.UUID{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16})},

internal/params/parameters.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ func (p *Parameter) YSON(v []byte) Builder {
297297
return p.parent
298298
}
299299

300-
// removed for https://github.com/ydb-platform/ydb-go-sdk/issues/1501
301-
//func (p *Parameter) UUID(v [16]byte) Builder {
302-
// return p.UUIDWithIssue1501Value(v)
303-
//}
300+
//// removed for https://github.com/ydb-platform/ydb-go-sdk/issues/1501
301+
////func (p *Parameter) UUID(v [16]byte) Builder {
302+
//// return p.UUIDWithIssue1501Value(v)
303+
////}
304304

305305
// UUIDWithIssue1501Value is field serializer for save data with format bug.
306306
// For any new code use Uuid

0 commit comments

Comments
 (0)