Skip to content

Commit

Permalink
chore: bump dependencies and fix clippy/lint errors (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
sd2k authored Sep 17, 2024
1 parent f564589 commit 87858b6
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 161 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased] - ReleaseDate

- Bump itertools dependency to 0.13.0
- Bump prost dependency to 0.13.2
- Bump reqwest dependency to 0.12.7
- Bump tonic dependency to 0.12.2
- Bump tonic-health dependency to 0.12.2
- Increase MSRV to 1.63, due to tokio-util requiring it

## [0.4.3] - 2024-01-18

### Added
Expand Down
16 changes: 8 additions & 8 deletions crates/grafana-plugin-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.4.3"
authors = ["Ben Sully <ben.sully@grafana.com>"]
license = "MIT/Apache-2.0"
edition = "2021"
rust-version = "1.57"
rust-version = "1.63"
repository = "https://github.com/grafana/grafana-plugin-sdk-rust"
description = "SDK for building Grafana backend plugins."

Expand All @@ -18,19 +18,19 @@ futures-core = "0.3.28"
futures-util = "0.3.28"
grafana-plugin-sdk-macros = { version = "0.4.3", path = "../grafana-plugin-sdk-macros" }
http = "1.0.0"
itertools = "0.12.0"
itertools = "0.13.0"
num-traits = "0.2.15"
prost = "0.12.3"
reqwest_lib = { package = "reqwest", version = "0.11.18", optional = true }
prost = "0.13.2"
reqwest_lib = { package = "reqwest", version = "0.12.7", 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"
tonic = "0.12.2"
tonic-health = "0.12.2"
tracing = "0.1.37"
tracing-core = "0.1.31"
tracing-log = "0.2.0"
Expand All @@ -52,8 +52,8 @@ tokio = { version = "1.28.2", features = ["rt-multi-thread"] }
tokio-stream = "0.1.14"

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

# docs.rs-specific configuration
[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion crates/grafana-plugin-sdk/src/backend/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl TryFrom<pluginv2::CallResourceRequest> for CallResourceRequest {
impl TryFrom<Response<Bytes>> for pluginv2::CallResourceResponse {
type Error = ConvertToError;
fn try_from(mut other: Response<Bytes>) -> Result<Self, Self::Error> {
let grouped_headers = other.headers_mut().drain().group_by(|x| x.0.clone());
let grouped_headers = other.headers_mut().drain().chunk_by(|x| x.0.clone());
let headers = grouped_headers
.into_iter()
.map(|(k, values)| {
Expand Down
3 changes: 2 additions & 1 deletion crates/grafana-plugin-sdk/src/data/field_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ impl IntoFieldType for NaiveDate {
fn into_field_type(self) -> Option<Self::ElementType> {
self.and_hms_opt(0, 0, 0)
.expect("hms are valid")
.and_utc()
.timestamp_nanos_opt()
}
}
Expand All @@ -219,7 +220,7 @@ impl IntoFieldType for NaiveDateTime {
type ElementType = i64;
const TYPE_INFO_TYPE: TypeInfoType = TypeInfoType::Time;
fn into_field_type(self) -> Option<Self::ElementType> {
self.timestamp_nanos_opt()
self.and_utc().timestamp_nanos_opt()
}
}

Expand Down
4 changes: 0 additions & 4 deletions crates/grafana-plugin-sdk/src/data/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ pub const TIME_FIELD_NAME: &str = "Time";
/// The standard name for time series value fields.
pub const VALUE_FIELD_NAME: &str = "Value";

mod sealed {
pub trait Sealed {}
}

/// A structured, two-dimensional data frame.
///
/// `Frame`s can be created manually using [`Frame::new`] if desired.
Expand Down
8 changes: 4 additions & 4 deletions crates/grafana-plugin-sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
This crate contains a Rust implementation of the Grafana plugin SDK. It is divided into three main modules:
- [`backend`] contains the traits that must be implemented by backend plugins for various pieces of functionality,
whether querying data, calling resources, or streaming data between Grafana and the plugin.
whether querying data, calling resources, or streaming data between Grafana and the plugin.
- [`data`] contains the fundamental data structures used by backend plugins, such as [`Frame`][data::Frame]s, [`Field`][data::Field]s,
and their associated metadata.
and their associated metadata.
- [`live`] contains functionality used by [Grafana Live], the streaming messaging service available from
Grafana 8.0.
Grafana 8.0.
The [`prelude`] contains some useful unambiguous traits which are helpful when creating some structures,
particularly [`Frame`][data::Frame]s and [`Field`][data::Field]s.
Expand All @@ -24,7 +24,7 @@ the [crate examples] or [sample app repo] to get started with writing a backend
The following feature flags enable additional functionality for this crate:
- `reqwest` - adds an [`IntoHttpResponse`][crate::backend::IntoHttpResponse] implementation for
[`reqwest::Response`]
[`reqwest::Response`]
[Backend plugins on grafana.com]: https://grafana.com/docs/grafana/latest/developers/plugins/backend/
[Grafana Live]: https://grafana.com/docs/grafana/latest/live/
Expand Down
Loading

0 comments on commit 87858b6

Please sign in to comment.