Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): upgrade deps and regen protos #214

Merged
merged 11 commits into from
Aug 20, 2024
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,21 @@ jobs:


build:
name: Build
name: Build on rust-${{ matrix.rust-version}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-version:
- "stable"
- "nightly"
- "1.78.0" # MSRV

steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
toolchain: ${{ matrix.rust-version }}
components: clippy, rustfmt
- name: Install Protoc
uses: arduino/setup-protoc@v3
Expand All @@ -59,17 +66,9 @@ jobs:
version: ${{ env.PROTOC_VERSION }}
- uses: actions/checkout@v4
- name: Build
run: cargo build
- name: Build examples
run: |
cd examples
cargo build --examples
- name: Build proto-gen
run: |
cd proto-gen
cargo build
run: cargo build --workspace --all-targets --all-features
- name: Run Tests
run: cargo test --all-targets
run: cargo test --workspace --all-targets --all-features

publish:
name: Publish
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/dapr-bot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "dapr-bot"
authors = ["hey@mike.ee"]
authors = ["Mike Nguyen <hey@mike.ee>"]
license = "Apache-2.0"
license-file = "LICENSE"
version = "0.1.0"
edition = "2021"
rust-version = "1.70.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
exitcode = "1.1.2"
octocrab = "0.34.1"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
tokio = { version = "1.36.0", features = ["full"] }
38 changes: 36 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,43 @@
members = [
"dapr",
"dapr-macros",
]
exclude = [
"proto-gen",
"examples",
]
exclude = [
".github/workflows/dapr-bot" # Bot used in GitHub workflow
]
resolver = "2"

[workspace.dependencies]
async-trait = "0.1"

dapr = { version = "0.15.1", path = "./dapr" }
dapr-macros = { version = "0.15.1", path = "./dapr-macros" }

prost = "0.13.1"
prost-build = "0.13.1"
prost-types = "0.13.1"

serde = "1.0"
serde_json = "1.0"

tokio = "1.39"
tokio-stream = "0.1"
tokio-test = "0.4"
tokio-util = "0.7"

tonic = "0.12.1"
tonic-build = "0.12.1"

[workspace.package]
version = "0.15.1"
authors = [
"Mike Nguyen <hey@mike.ee>",
"The Dapr Authors <dapr@dapr.io>"
]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/dapr/rust-sdk"

rust-version = "1.78.0" # MSRV
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ resiliency.

## Prerequisites

Ensure you have Rust version 1.79 or higher installed. If not, install Rust [here](https://www.rust-lang.org/tools/install).
Ensure you have Rust version 1.78 or higher installed. If not, install Rust [here](https://www.rust-lang.org/tools/install).

You will also need to install [protoc](https://github.com/protocolbuffers/protobuf#protobuf-compiler-installation).

Expand All @@ -58,9 +58,10 @@ dapr = "0.15.0"

Here's a basic example to create a client:

```rust
```Rust
use dapr;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Get the Dapr port and create a connection
let port: u16 = std::env::var("DAPR_GRPC_PORT")?.parse()?;
Expand Down
19 changes: 11 additions & 8 deletions dapr-macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
[package]
name = "dapr-macros"
version = "0.15.0"
edition = "2021"
description = "Dapr Rust SDK"
license = "Apache-2.0"
version.workspace = true
authors.workspace = true
edition.workspace = true
description = "Dapr Rust SDK (Macros)"
license.workspace = true
repository.workspace = true
rust-version.workspace = true

[lib]
proc-macro = true

[dependencies]
async-trait = "0.1"
async-trait = { workspace = true }
axum = "0.7"
log = "0.4"
axum = "0.7.4"
syn = { version = "2.0.29", features = ["full"] }
quote = "1.0.8"
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full"] }
3 changes: 2 additions & 1 deletion dapr-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use proc_macro::TokenStream;
use std::iter;

use proc_macro2::TokenTree;
use quote::{format_ident, quote};
use syn::parse::{Parse, ParseStream};
use syn::{parse_macro_input, Ident, LitStr};

use proc_macro::TokenStream;

macro_rules! derive_parse {(
@derive_only
$( #[$attr:meta] )*
Expand Down
52 changes: 26 additions & 26 deletions dapr/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
[package]
name = "dapr"
version = "0.15.0"
authors = ["dapr.io"]
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/dapr/rust-sdk"
version.workspace = true
authors.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Rust SDK for dapr"
readme = "../README.md"
keywords = ["microservices", "dapr"]
rust-version.workspace = true

[dependencies]
dapr-macros = { version = "0.15.0", path = "../dapr-macros" }
async-trait = { workspace = true }
axum = "0.7"
bytes = "1.7"
chrono = "0.4"
dapr-macros = { workspace = true }
futures = "0.3"
tonic = "0.11.0"
prost = "0.12.3"
bytes = "1"
prost-types = "0.12.3"
async-trait = "0.1"
env_logger = "0.11.2"
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
axum = "0.7.4"
tokio = { version = "1.29", features = ["sync"] }
tokio-util = { version = "0.7.10", features = ["io"] }
chrono = "0.4.38"
base64 = "0.22.1"
prost = { workspace = true }
prost-types = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tonic = { workspace = true }
tokio = { workspace = true, features = ["sync"] }
tokio-util = { workspace = true, features = ["io"] }


[dev-dependencies]
axum-test = "15.0.1"
once_cell = "1.18.0"
tokio = { version = "1", features = ["full"] }
uuid = { version = "1.4.0", features = ["v4"] }
dapr = { path = "./" }
tokio-test = "0.4.2"
tokio-stream = { version = "0.1" }
axum-test = "15.3"
once_cell = "1.19"
tokio = { workspace = true, features = ["full"] }
uuid = { version = "1.10", features = ["v4"] }
dapr = { workspace = true }
tokio-test = { workspace = true }
tokio-stream = { workspace = true }
50 changes: 8 additions & 42 deletions dapr/src/dapr/dapr.proto.common.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,7 @@ pub mod http_extension {
/// Type of HTTP 1.1 Methods
/// RFC 7231: <https://tools.ietf.org/html/rfc7231#page-24>
/// RFC 5789: <https://datatracker.ietf.org/doc/html/rfc5789>
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Verb {
None = 0,
Expand Down Expand Up @@ -153,10 +143,8 @@ pub struct StateItem {
pub etag: ::core::option::Option<Etag>,
/// The metadata which will be passed to state store component.
#[prost(map = "string, string", tag = "4")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
/// Options for concurrency and consistency to save the state.
#[prost(message, optional, tag = "5")]
pub options: ::core::option::Option<StateOptions>,
Expand All @@ -171,7 +159,7 @@ pub struct Etag {
}
/// StateOptions configures concurrency and consistency for state operations
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StateOptions {
#[prost(enumeration = "state_options::StateConcurrency", tag = "1")]
pub concurrency: i32,
Expand All @@ -181,17 +169,7 @@ pub struct StateOptions {
/// Nested message and enum types in `StateOptions`.
pub mod state_options {
/// Enum describing the supported concurrency for state.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StateConcurrency {
ConcurrencyUnspecified = 0,
Expand Down Expand Up @@ -221,17 +199,7 @@ pub mod state_options {
}
}
/// Enum describing the supported consistency for state.
#[derive(
Clone,
Copy,
Debug,
PartialEq,
Eq,
Hash,
PartialOrd,
Ord,
::prost::Enumeration
)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum StateConsistency {
ConsistencyUnspecified = 0,
Expand Down Expand Up @@ -273,8 +241,6 @@ pub struct ConfigurationItem {
pub version: ::prost::alloc::string::String,
/// the metadata which will be passed to/from configuration store component.
#[prost(map = "string, string", tag = "3")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
pub metadata:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
Loading
Loading