Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
name: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
version: '3.x'
version: '27.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: make check
run: make check
- name: Catch unexpected changes in the generated code
Expand All @@ -38,16 +38,16 @@ jobs:
NEXTEST_PROFILE: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
version: '3.x'
version: '27.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
uses: taiki-e/install-action@aed063e1f30df6b3706dd77fc425d37778911ac2 # nextest
- name: unit test
run: make unit-test

Expand All @@ -64,14 +64,14 @@ jobs:
RUST_LOG: info
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install Protoc
uses: arduino/setup-protoc@v1
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3.0.0
with:
version: '3.x'
version: '27.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
- name: install tiup
run: curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
- name: start tiup playground
Expand All @@ -85,12 +85,12 @@ jobs:
sleep 1
done
- name: Install latest nextest release
uses: taiki-e/install-action@nextest
uses: taiki-e/install-action@aed063e1f30df6b3706dd77fc425d37778911ac2 # nextest
- name: Integration test
run: MULTI_REGION=1 make ${{ matrix.case }}
- name: Upload logs
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: cluster-logs
path: |
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ lazy_static = "1"
log = "0.4"
pin-project = "1"
prometheus = { version = "0.13", default-features = false }
prost = "0.12"
prost = "0.14"
rand = "0.8"
regex = "1"
semver = "1.0"
Expand All @@ -45,7 +45,8 @@ serde_json = "1"
take_mut = "0.2.2"
thiserror = "1"
tokio = { version = "1", features = ["sync", "rt-multi-thread", "macros"] }
tonic = { version = "0.10", features = ["tls"] }
tonic = { version = "0.14", features = ["transport", "tls-ring"] }
tonic-prost = "0.14"

[dev-dependencies]
clap = "2"
Expand Down
2 changes: 1 addition & 1 deletion proto-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ edition = "2021"

[dependencies]
glob = "0.3"
tonic-build = { version = "0.10", features = ["cleanup-markdown"] }
tonic-prost-build = "0.14"
18 changes: 10 additions & 8 deletions proto-build/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// Copyright 2023 TiKV Project Authors. Licensed under Apache-2.0.

use std::path::PathBuf;

fn main() {
tonic_build::configure()
let protos: Vec<PathBuf> = glob::glob("proto/*.proto")
.unwrap()
.collect::<Result<Vec<_>, _>>()
.unwrap();
let includes: Vec<PathBuf> = vec!["proto/include".into(), "proto".into()];

tonic_prost_build::configure()
.emit_rerun_if_changed(false)
.build_server(false)
.include_file("mod.rs")
.out_dir("src/generated")
.compile(
&glob::glob("proto/*.proto")
.unwrap()
.collect::<Result<Vec<_>, _>>()
.unwrap(),
&["proto/include", "proto"],
)
.compile_protos(&protos, &includes)
.unwrap();
}
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.84.1"
channel = "1.86.0"
components = ["rustfmt", "clippy"]
44 changes: 22 additions & 22 deletions src/generated/autoid.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AutoIdRequest {
#[prost(int64, tag = "1")]
pub db_id: i64,
Expand All @@ -17,8 +16,7 @@ pub struct AutoIdRequest {
#[prost(uint32, tag = "7")]
pub keyspace_id: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AutoIdResponse {
#[prost(int64, tag = "1")]
pub min: i64,
Expand All @@ -27,8 +25,7 @@ pub struct AutoIdResponse {
#[prost(bytes = "vec", tag = "3")]
pub errmsg: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RebaseRequest {
#[prost(int64, tag = "1")]
pub db_id: i64,
Expand All @@ -41,15 +38,20 @@ pub struct RebaseRequest {
#[prost(bool, tag = "5")]
pub force: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RebaseResponse {
#[prost(bytes = "vec", tag = "1")]
pub errmsg: ::prost::alloc::vec::Vec<u8>,
}
/// Generated client implementations.
pub mod auto_id_alloc_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
Expand All @@ -69,10 +71,10 @@ pub mod auto_id_alloc_client {
}
impl<T> AutoIdAllocClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Expand All @@ -90,14 +92,14 @@ pub mod auto_id_alloc_client {
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
AutoIdAllocClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -140,12 +142,11 @@ pub mod auto_id_alloc_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/autoid.AutoIDAlloc/AllocAutoID",
);
Expand All @@ -162,12 +163,11 @@ pub mod auto_id_alloc_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/autoid.AutoIDAlloc/Rebase",
);
Expand Down
Loading
Loading