Skip to content

Commit 3993a1d

Browse files
fmt fix
1 parent ff00f37 commit 3993a1d

6 files changed

Lines changed: 14 additions & 10 deletions

File tree

src/alerts/alert_enums.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ mod tests {
266266

267267
#[test]
268268
fn alert_request_deserializes_promql_query_type() {
269-
let request: crate::alerts::alert_structs::AlertRequest = serde_json::from_value(
270-
serde_json::json!({
269+
let request: crate::alerts::alert_structs::AlertRequest =
270+
serde_json::from_value(serde_json::json!({
271271
"severity": "high",
272272
"title": "Test alert",
273273
"alertType": "threshold",
@@ -284,9 +284,8 @@ mod tests {
284284
"targets": [],
285285
"notificationConfig": {"interval": 1},
286286
"datasets": ["azure-prod-cluster-metrics"]
287-
}),
288-
)
289-
.unwrap();
287+
}))
288+
.unwrap();
290289

291290
assert_eq!(request.query_type, AlertQueryType::Promql);
292291
assert_eq!(request.datasets, vec!["azure-prod-cluster-metrics"]);

src/alerts/alert_structs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ impl AlertRequest {
346346
)));
347347
}
348348
if self.query_type == AlertQueryType::Promql
349-
&& !PARSEABLE.check_or_load_stream(&datasets[0], &tenant_id).await
349+
&& !PARSEABLE
350+
.check_or_load_stream(&datasets[0], &tenant_id)
351+
.await
350352
{
351353
return Err(AlertError::ValidationFailure(format!(
352354
"Invalid PromQL metrics stream: {}",

src/alerts/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ pub async fn user_auth_for_alert_config(
108108
alert: &AlertConfig,
109109
) -> Result<(), actix_web::Error> {
110110
match alert.query_type {
111-
AlertQueryType::Builder | AlertQueryType::Code => user_auth_for_query(session, &alert.query).await,
111+
AlertQueryType::Builder | AlertQueryType::Code => {
112+
user_auth_for_query(session, &alert.query).await
113+
}
112114
AlertQueryType::Promql => {
113115
let [dataset] = alert.datasets.as_slice() else {
114116
return Err(actix_web::error::ErrorUnauthorized(

src/handlers/http/alerts.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ use std::{collections::HashMap, str::FromStr};
2020

2121
use crate::{
2222
alerts::{
23-
ALERTS, AlertError, AlertState, Severity, user_auth_for_alert_config,
23+
ALERTS, AlertError, AlertState, Severity,
2424
alert_enums::{AlertType, NotificationState},
2525
alert_structs::{AlertConfig, AlertRequest, AlertStateEntry, NotificationStateRequest},
2626
alert_traits::AlertTrait,
2727
alert_types::ThresholdAlert,
2828
target::Retry,
29+
user_auth_for_alert_config,
2930
},
3031
metastore::metastore_traits::MetastoreObject,
3132
parseable::PARSEABLE,

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ use once_cell::sync::Lazy;
6868
pub use openid;
6969
use parseable::PARSEABLE;
7070
use reqwest::{Client, ClientBuilder};
71+
pub use {clap, tracing_actix_web, tracing_opentelemetry, tracing_subscriber};
7172
pub use {opentelemetry, opentelemetry_otlp, opentelemetry_proto, opentelemetry_sdk};
72-
pub use {tracing_actix_web, tracing_opentelemetry, tracing_subscriber, clap};
7373

7474
// It is very unlikely that panic will occur when dealing with locks.
7575
pub const LOCK_EXPECT: &str = "Thread shouldn't panic while holding a lock";

src/metastore/metastore_traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pub trait Metastore: std::fmt::Debug + Send + Sync {
229229
stream_name: &str,
230230
get_base: bool,
231231
tenant_id: &Option<String>,
232-
is_migration: bool
232+
is_migration: bool,
233233
) -> Result<Bytes, MetastoreError>;
234234
async fn put_stream_json(
235235
&self,

0 commit comments

Comments
 (0)