Skip to content

Commit 1dd7526

Browse files
authored
Merge pull request #1744 from cloudwego/release-v0.13.0
chore: release v0.13.0
2 parents 3012782 + d955a94 commit 1dd7526

File tree

187 files changed

+5354
-4623
lines changed

Some content is hidden

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

187 files changed

+5354
-4623
lines changed

.codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore:
2+
- "tool/**/*.go"

.github/workflows/pr-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1515

1616
- name: Check Spell
17-
uses: crate-ci/typos@v1.13.14
17+
uses: crate-ci/typos@master
1818

1919
golangci-lint:
2020
runs-on: [ Linux, X64 ]

.github/workflows/tests.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
- name: Set up Go
1111
uses: actions/setup-go@v5
1212
with:
13-
go-version: "1.23"
13+
go-version: "1.24"
1414
cache: false
1515
- name: Scenario Tests
1616
run: |
1717
cd ..
1818
rm -rf kitex-tests
19-
git clone https://github.com/cloudwego/kitex-tests.git
20-
cd kitex-tests
21-
./run.sh ${{github.workspace}}
19+
git clone --depth=1 https://github.com/cloudwego/kitex-tests.git
20+
cd kitex-tests
21+
KITEX_TOOL_USE_PROTOC=0 ./run.sh ${{github.workspace}}
2222
cd ${{github.workspace}}
2323
- name: Upload coverage to Codecov # coverage generated by run.sh
2424
uses: codecov/codecov-action@v5
@@ -33,7 +33,7 @@ jobs:
3333
- name: Set up Go
3434
uses: actions/setup-go@v5
3535
with:
36-
go-version: "1.23"
36+
go-version: "1.24"
3737
- name: Benchmark
3838
# we only use this CI to verify bench code works
3939
# setting benchtime=100ms is saving our time...
@@ -42,7 +42,7 @@ jobs:
4242
unit-test-x64:
4343
strategy:
4444
matrix:
45-
go: [ "1.18", "1.19", "1.20", "1.21", "1.22", "1.23" ]
45+
go: [ "1.19", "1.20", "1.21", "1.22", "1.23", "1.24" ]
4646
runs-on: [ Linux, X64 ]
4747
steps:
4848
- uses: actions/checkout@v4
@@ -57,7 +57,7 @@ jobs:
5757
unit-test-arm:
5858
strategy:
5959
matrix:
60-
go: [ "1.18", "1.19", "1.20", "1.21", "1.22", "1.23" ]
60+
go: [ "1.19", "1.20", "1.21", "1.22", "1.23", "1.24" ]
6161
runs-on: [ ARM64 ] # It's OK under Linux or macOS
6262
steps:
6363
- uses: actions/checkout@v4
@@ -76,7 +76,7 @@ jobs:
7676
- name: Set up Go
7777
uses: actions/setup-go@v5
7878
with:
79-
go-version: "1.23"
79+
go-version: "1.24"
8080
- name: Prepare
8181
run: |
8282
go install github.com/cloudwego/thriftgo@main
@@ -105,7 +105,7 @@ jobs:
105105
- name: Set up Go
106106
uses: actions/setup-go@v5
107107
with:
108-
go-version: "1.23"
108+
go-version: "1.24"
109109
cache: false # don't use cache for self-hosted runners
110110
- name: Windows compatibility test
111111
run: go test -run=^$ ./...
@@ -118,7 +118,7 @@ jobs:
118118
- name: Set up Go
119119
uses: actions/setup-go@v5
120120
with:
121-
go-version: "1.23"
121+
go-version: "1.24"
122122
cache: false # don't use cache for self-hosted runners
123123
- name: Run coverage
124124
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...

.typos.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Typo check: https://github.com/crate-ci/typos
2+
3+
[files]
4+
extend-exclude = ["go.mod", "go.sum"]
5+
6+
[default.extend-words]
7+
typ = "typ" # type
8+
Descritor = "Descritor" # reflect pkg typo, exported func, let it go
9+
10+
[default.extend-identifiers]
11+
GoAways = "GoAways" # GoAway frame plural noun
12+
henc = "henc" # hpack encoder

_typos.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.

client/callopt/options.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type CallOptions struct {
4747
RetryPolicy retry.Policy
4848
Fallback *fallback.Policy
4949
CompressorName string
50+
StreamOptions client.StreamOptions
5051
}
5152

5253
func newOptions() interface{} {

client/callopt/streamcall/call_options.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package streamcall
1818

1919
import (
20+
"strings"
2021
"time"
2122

2223
"github.com/cloudwego/kitex/client/callopt"
@@ -45,3 +46,15 @@ func WithConnectTimeout(d time.Duration) Option {
4546
func WithTag(key, val string) Option {
4647
return ConvertOptionFrom(callopt.WithTag(key, val))
4748
}
49+
50+
// WithRecvTimeout add recv timeout for stream.Recv function.
51+
// NOTICE: ONLY effective for ttheader streaming protocol for now.
52+
func WithRecvTimeout(d time.Duration) Option {
53+
return Option{f: func(o *callopt.CallOptions, di *strings.Builder) {
54+
di.WriteString("WithRecvTimeout(")
55+
di.WriteString(d.String())
56+
di.WriteString(")")
57+
58+
o.StreamOptions.RecvTimeout = d
59+
}}
60+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright 2025 CloudWeGo Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package streamcall
18+
19+
import (
20+
"strings"
21+
"testing"
22+
"time"
23+
24+
"github.com/cloudwego/kitex/client/callopt"
25+
"github.com/cloudwego/kitex/internal/test"
26+
)
27+
28+
func TestWithRecvTimeout(t *testing.T) {
29+
var sb strings.Builder
30+
callOpts := callopt.CallOptions{}
31+
testTimeout := 1 * time.Second
32+
WithRecvTimeout(testTimeout).f(&callOpts, &sb)
33+
test.Assert(t, callOpts.StreamOptions.RecvTimeout == testTimeout)
34+
test.Assert(t, sb.String() == "WithRecvTimeout(1s)")
35+
}

0 commit comments

Comments
 (0)