Skip to content

Commit e791617

Browse files
authored
Merge pull request #306 from ydb-platform/check-code-generation
fix check codegen code
2 parents 6fd76e8 + b675cd8 commit e791617

File tree

5 files changed

+33
-6
lines changed

5 files changed

+33
-6
lines changed

.github/workflows/gtrace.yml renamed to .github/workflows/check-codegen.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: gtrace
1+
name: check-codegen
22
on:
33
push:
44
branches:
@@ -28,14 +28,20 @@ jobs:
2828
- name: Build
2929
run: |
3030
go install ./internal/cmd/gtrace
31+
go install github.com/golang/mock/[email protected]
3132
3233
- name: Clean and re-generate *_gtrace.go files
3334
run: |
34-
cd ./trace && rm -f *_gtrace.go && go generate
35+
rm -f ./trace/*_gtrace.go
36+
go generate ./trace
37+
go generate ./...
3538
3639
- name: Check generation
3740
run: |
38-
if [[ $(git status --porcelain) -ne 0 ]]; then
39-
echo "code-generation not compatible with gtrace output";
41+
CODE_DIFF="$(git diff)"
42+
if [ -n "$CODE_DIFF" ]; then
43+
echo "code-generation not equal with committed"
44+
echo
45+
echo "$CODE_DIFF"
4046
exit 1;
4147
fi

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Fix write KeepInCacheFlag for table traces
2+
13
## v3.29.5
24
* Fixed regression of `table/types.WriteTypeStringTo`
35

internal/table/session.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,19 @@ func (s *session) Execute(
645645
params = table.NewQueryParameters()
646646
}
647647

648-
onDone := trace.TableOnSessionQueryExecute(s.config.Trace(), &ctx, s, q, params)
648+
var optsResult options.ExecuteDataQueryDesc
649+
for _, f := range opts {
650+
f(&optsResult)
651+
}
652+
653+
onDone := trace.TableOnSessionQueryExecute(
654+
s.config.Trace(),
655+
&ctx,
656+
s,
657+
q,
658+
params,
659+
optsResult.QueryCachePolicy.GetKeepInCache(),
660+
)
649661
defer func() {
650662
onDone(txr, true, r, err)
651663
}()

internal/table/statement.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,18 @@ func (s *statement) Execute(
2626
) (
2727
txr table.Transaction, r result.Result, err error,
2828
) {
29+
var optsResult options.ExecuteDataQueryDesc
30+
for _, f := range opts {
31+
f(&optsResult)
32+
}
33+
2934
onDone := trace.TableOnSessionQueryExecute(
3035
s.session.config.Trace(),
3136
&ctx,
3237
s.session,
3338
s.query,
3439
params,
40+
optsResult.QueryCachePolicy.GetKeepInCache(),
3541
)
3642
defer func() {
3743
onDone(txr, true, r, err)

trace/table_gtrace.go

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)