Skip to content

Commit

Permalink
Bump lots of dependencies
Browse files Browse the repository at this point in the history
arrow, http, prost, tonic, ...

Also bump the resolver, fix some new lint errors, and improve CI.
  • Loading branch information
sd2k committed Jan 4, 2024
1 parent 5c558a0 commit fc02b74
Show file tree
Hide file tree
Showing 12 changed files with 383 additions and 116 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -48,12 +48,12 @@ jobs:
with:
command: test

lints:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -69,6 +69,21 @@ jobs:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Change the `plugin_context` field of various structs to be non-optional, matching the Go SDK.
- Plugins will only spawn shutdown handlers when compiled in debug mode. When compiled in release mode the shutdown handler attribute will do nothing.
- Bump arrow2 dependency to 0.17.0
- Bump arrow2 dependency to 0.18.0
- Bump http dependency to 1.0
- Bump syn dependency to 2.0
- Bump tonic dependency to 0.9.1
- Bump prost dependency to 0.12.3
- Bump tonic dependency to 0.10.2

## [0.4.2] - 2022-09-19

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
members = [
"crates/*",
]
resolver = "2"
18 changes: 9 additions & 9 deletions crates/grafana-plugin-sdk-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@ name = "grafana-plugin-sdk-macros"
version = "0.4.2"
authors = ["Ben Sully <ben.sully@grafana.com>"]
license = "MIT/Apache-2.0"
edition = "2018"
edition = "2021"
repository = "https://github.com/grafana/grafana-plugin-sdk-rust"
description = "Convenience macros for the Grafana backend plugin SDK."

[lib]
proc-macro = true

[dependencies]
proc-macro2 = "1.0.53"
quote = "1.0.10"
syn = { version = "2.0.4", features = ["full"] }
proc-macro2 = "1.0.60"
quote = "1.0.28"
syn = { version = "2.0.18", features = ["full"] }

[dev-dependencies]
grafana-plugin-sdk = { path = "../grafana-plugin-sdk" }
http = "0.2.8"
serde = { version = "1.0.144", features = ["derive"] }
thiserror = "1.0.35"
tokio = { version = "1.13.0", features = ["rt-multi-thread"] }
trybuild = "1.0.52"
http = "1.0.0"
serde = { version = "1.0.164", features = ["derive"] }
thiserror = "1.0.40"
tokio = { version = "1.28.2", features = ["rt-multi-thread"] }
trybuild = "1.0.80"

[package.metadata.docs.rs]
all-features = true
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ error[E0277]: the trait bound `MyPlugin: DataService` is not satisfied
note: required by a bound in `grafana_plugin_sdk::backend::Plugin::<D, Q, R, S>::data_service`
--> $WORKSPACE/crates/grafana-plugin-sdk/src/backend/mod.rs
|
| pub fn data_service<T>(self, service: T) -> Plugin<D, T, R, S>
| ------------ required by a bound in this associated function
| where
| T: DataService + Send + Sync + 'static,
| ^^^^^^^^^^^ required by this bound in `Plugin::<D, Q, R, S>::data_service`
= note: this error originates in the attribute macro `grafana_plugin_sdk::main` (in Nightly builds, run with -Z macro-backtrace for more info)
Expand Down
66 changes: 33 additions & 33 deletions crates/grafana-plugin-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,49 @@ repository = "https://github.com/grafana/grafana-plugin-sdk-rust"
description = "SDK for building Grafana backend plugins."

[dependencies]
arrow2 = { version = "0.17.0", features = ["io_ipc"] }
arrow2 = { version = "0.18.0", features = ["io_ipc"] }
cfg-if = "1.0.0"
chrono = "0.4.19"
futures-core = "0.3.17"
futures-util = "0.3.17"
chrono = "0.4.26"
futures-core = "0.3.28"
futures-util = "0.3.28"
grafana-plugin-sdk-macros = { version = "0.4.0", path = "../grafana-plugin-sdk-macros" }
http = "0.2.5"
itertools = "0.10.1"
num-traits = "0.2.14"
prost = "0.11.0"
reqwest_lib = { package = "reqwest", version = "0.11.6", optional = true }
serde = { version = "1.0.130", features = ["derive"] }
serde_json = { version = "1.0.69", features = ["float_roundtrip", "raw_value"] }
serde_with = "2.0.0"
thiserror = "1.0.30"
time = { version = "0.3.5", features = ["formatting", "macros"] }
tokio = { version = "1.13.0", features = ["rt-multi-thread"] }
tokio-stream = { version = "0.1.8", features = ["net"] }
tonic = "0.9.1"
tonic-health = "0.9.1"
tracing = "0.1.29"
tracing-core = "0.1.21"
tracing-log = "0.1.2"
tracing-serde = "0.1.2"
tracing-subscriber = { version = "0.3.1", features = [
http = "1.0.0"
itertools = "0.12.0"
num-traits = "0.2.15"
prost = "0.12.3"
reqwest_lib = { package = "reqwest", version = "0.11.18", optional = true }
serde = { version = "1.0.164", features = ["derive"] }
serde_json = { version = "1.0.96", features = ["float_roundtrip", "raw_value"] }
serde_with = "3.0.0"
thiserror = "1.0.40"
time = { version = "0.3.22", features = ["formatting", "macros"] }
tokio = { version = "1.28.2", features = ["rt-multi-thread"] }
tokio-stream = { version = "0.1.14", features = ["net"] }
tonic = "0.10.2"
tonic-health = "0.10.2"
tracing = "0.1.37"
tracing-core = "0.1.31"
tracing-log = "0.2.0"
tracing-serde = "0.1.3"
tracing-subscriber = { version = "0.3.17", features = [
"env-filter",
"json",
"time",
] }

[dev-dependencies]
async-stream = "0.3.2"
bytes = "1.1.0"
futures = "0.3.17"
paste = "1.0.6"
pretty_assertions = "1.0.0"
prometheus = { version = "0.13.0", default-features = false }
tokio = { version = "1.13.0", features = ["rt-multi-thread"] }
tokio-stream = "0.1.8"
async-stream = "0.3.5"
bytes = "1.4.0"
futures = "0.3.28"
paste = "1.0.12"
pretty_assertions = "1.3.0"
prometheus = { version = "0.13.3", default-features = false }
tokio = { version = "1.28.2", features = ["rt-multi-thread"] }
tokio-stream = "0.1.14"

[build-dependencies]
prost-build = { version = "0.11.1", optional = true }
tonic-build = { version = "0.9.1", optional = true }
prost-build = { version = "0.12.3", optional = true }
tonic-build = { version = "0.10.2", optional = true }

# docs.rs-specific configuration
[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion crates/grafana-plugin-sdk/examples/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl backend::StreamService for MyPluginService {
async_stream::try_stream! {
loop {
frame.fields_mut()[0].set_values(
(x..x+n)
x..x+n
)?;
let packet = backend::StreamPacket::from_frame(frame.check()?)?;
debug!("Yielding frame from {} to {}", x, x+n);
Expand Down
2 changes: 1 addition & 1 deletion crates/grafana-plugin-sdk/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ pub enum ConvertToError {

type ConvertFromResult<T> = std::result::Result<T, ConvertFromError>;

pub(self) fn read_json<T>(jdoc: &[u8]) -> ConvertFromResult<T>
fn read_json<T>(jdoc: &[u8]) -> ConvertFromResult<T>
where
T: DeserializeOwned,
{
Expand Down
20 changes: 8 additions & 12 deletions crates/grafana-plugin-sdk/src/data/field_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ where
type ElementType = i64;
const TYPE_INFO_TYPE: TypeInfoType = TypeInfoType::Time;
fn into_field_type(self) -> Option<Self::ElementType> {
Some(self.timestamp_nanos())
self.timestamp_nanos_opt()
}
}

Expand Down Expand Up @@ -179,11 +179,9 @@ where
type ElementType = i64;
const TYPE_INFO_TYPE: TypeInfoType = TypeInfoType::Time;
fn into_field_type(self) -> Option<Self::ElementType> {
Some(
self.and_hms_opt(0, 0, 0)
.expect("hms are valid")
.timestamp_nanos(),
)
self.and_hms_opt(0, 0, 0)
.expect("hms are valid")
.timestamp_nanos_opt()
}
}

Expand All @@ -201,11 +199,9 @@ impl IntoFieldType for NaiveDate {
type ElementType = i64;
const TYPE_INFO_TYPE: TypeInfoType = TypeInfoType::Time;
fn into_field_type(self) -> Option<Self::ElementType> {
Some(
self.and_hms_opt(0, 0, 0)
.expect("hms are valid")
.timestamp_nanos(),
)
self.and_hms_opt(0, 0, 0)
.expect("hms are valid")
.timestamp_nanos_opt()
}
}

Expand All @@ -223,7 +219,7 @@ impl IntoFieldType for NaiveDateTime {
type ElementType = i64;
const TYPE_INFO_TYPE: TypeInfoType = TypeInfoType::Time;
fn into_field_type(self) -> Option<Self::ElementType> {
Some(self.timestamp_nanos())
self.timestamp_nanos_opt()
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/grafana-plugin-sdk/src/data/frame/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<'de> Deserialize<'de> for Frame {
fields: schema
.fields
.into_iter()
.zip(data.values.into_iter())
.zip(data.values)
.map(|(f, values)| crate::data::field::Field {
name: f.name,
labels: f.labels,
Expand Down
4 changes: 2 additions & 2 deletions crates/grafana-plugin-sdk/src/data/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use crate::{
live::Channel,
};

pub(self) mod de;
pub(self) mod ser;
mod de;
mod ser;
pub(crate) mod to_arrow;

use ser::{SerializableField, SerializableFrame, SerializableFrameData, SerializableFrameSchema};
Expand Down
Loading

0 comments on commit fc02b74

Please sign in to comment.