Skip to content

Commit 2ee1373

Browse files
committed
backend: pass cargo check --all-features
1 parent ee28955 commit 2ee1373

File tree

8 files changed

+46
-16
lines changed

8 files changed

+46
-16
lines changed

.github/workflows/backend-check.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ jobs:
4848
- name: cargo check
4949
working-directory: ./backend
5050
timeout-minutes: 16
51-
run: SQLX_OFFLINE=true cargo check --all-features
51+
run: |
52+
mkdir -p fake_frontend_build
53+
FRONTEND_BUILD_DIR=fake_frontend_build SQLX_OFFLINE=true cargo check --all-features
5254
5355
check_ee:
5456
runs-on: ubicloud-standard-8
@@ -125,6 +127,8 @@ jobs:
125127
- name: cargo check
126128
timeout-minutes: 16
127129
working-directory: ./backend
128-
run: SQLX_OFFLINE=true cargo check --all-features
130+
run: |
131+
mkdir -p fake_frontend_build
132+
FRONTEND_BUILD_DIR=fake_frontend_build SQLX_OFFLINE=true cargo check --all-features
129133
130134

backend/src/monitor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ pub async fn load_metrics_debug_enabled(db: &DB) -> error::Result<()> {
344344
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
345345
#[derive(Debug, Clone)]
346346
pub struct MallctlError {
347+
#[allow(unused)]
347348
pub code: i32,
348349
}
349350

backend/windmill-api/src/job_helpers_ee.rs

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ use std::sync::Arc;
1212
use windmill_common::error;
1313
#[cfg(feature = "parquet")]
1414
use windmill_common::{db::UserDB, s3_helpers::ObjectStoreResource};
15+
16+
#[cfg(feature = "parquet")]
17+
use bytes::Bytes;
18+
#[cfg(feature = "parquet")]
19+
use futures::Stream;
20+
1521
#[derive(Serialize)]
1622
pub struct UploadFileResponse {
1723
pub file_key: String,
@@ -35,7 +41,7 @@ pub async fn get_workspace_s3_resource<'c>(
3541
}
3642

3743
pub fn get_random_file_name(_file_extension: Option<String>) -> String {
38-
todo!()
44+
unimplemented!("Not implemented in Windmill's Open Source repository")
3945
}
4046

4147
pub async fn get_s3_resource<'c>(
@@ -48,14 +54,31 @@ pub async fn get_s3_resource<'c>(
4854
_resource_type: Option<StorageResourceType>,
4955
_job_id: Option<Uuid>,
5056
) -> error::Result<ObjectStoreResource> {
51-
todo!()
57+
Err(error::Error::InternalErr(
58+
"Not implemented in Windmill's Open Source repository".to_string(),
59+
))
60+
}
61+
62+
#[cfg(feature = "parquet")]
63+
pub async fn upload_file_from_req(
64+
_s3_client: Arc<dyn ObjectStore>,
65+
_file_key: &str,
66+
_req: axum::extract::Request,
67+
_options: PutMultipartOpts,
68+
) -> error::Result<()> {
69+
Err(error::Error::InternalErr(
70+
"Not implemented in Windmill's Open Source repository".to_string(),
71+
))
5272
}
5373

74+
#[cfg(feature = "parquet")]
5475
pub async fn upload_file_internal(
5576
_s3_client: Arc<dyn ObjectStore>,
5677
_file_key: &str,
57-
_request: axum::extract::Request,
78+
_stream: impl Stream<Item = Result<Bytes, std::io::Error>> + Unpin,
5879
_options: PutMultipartOpts,
5980
) -> error::Result<()> {
60-
todo!()
81+
Err(error::Error::InternalErr(
82+
"Not implemented in Windmill's Open Source repository".to_string(),
83+
))
6184
}

backend/windmill-api/src/smtp_server_ee.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{db::DB, users::AuthCache};
1+
use crate::{auth::AuthCache, db::DB};
22
use std::{net::SocketAddr, sync::Arc};
33
use windmill_common::db::UserDB;
44

@@ -11,6 +11,10 @@ pub struct SmtpServer {
1111

1212
impl SmtpServer {
1313
pub async fn start_listener_thread(self: Arc<Self>, _addr: SocketAddr) -> anyhow::Result<()> {
14+
let _ = self.auth_cache;
15+
let _ = self.db;
16+
let _ = self.user_db;
17+
let _ = self.base_internal_url;
1418
Err(anyhow::anyhow!("Implementation not open source"))
1519
}
1620
}

backend/windmill-queue/src/jobs.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ use reqwest::Client;
2020
use serde::{ser::SerializeMap, Serialize};
2121
use serde_json::{json, value::RawValue};
2222
use sqlx::{types::Json, FromRow, Pool, Postgres, Transaction};
23-
#[cfg(feature = "benchmark")]
24-
use std::time::Instant;
2523
use tokio::{sync::RwLock, time::sleep};
2624
use ulid::Ulid;
2725
use uuid::Uuid;

backend/windmill-worker/src/handle_child.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ use windmill_common::DB;
3434
#[cfg(feature = "enterprise")]
3535
use windmill_common::job_metrics;
3636

37+
#[cfg(target_os = "linux")]
38+
use tokio::io::AsyncWriteExt;
3739
use tokio::{
38-
io::{AsyncBufReadExt, AsyncWriteExt, BufReader},
40+
io::{AsyncBufReadExt, BufReader},
3941
process::Child,
4042
sync::{broadcast, watch},
4143
time::{interval, sleep, Instant, MissedTickBehavior},

backend/windmill-worker/src/result_processor.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ use windmill_common::bench::{BenchmarkInfo, BenchmarkIter};
3030

3131
use windmill_queue::{append_logs, get_queued_job, CanceledBy, WrappedError};
3232

33-
#[cfg(feature = "prometheus")]
34-
use windmill_queue::register_metric;
35-
3633
use serde_json::{json, value::RawValue};
3734

3835
use tokio::{

backend/windmill-worker/src/worker.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ pub const DEFAULT_NATIVE_JOBS: usize = 1;
305305

306306
const VACUUM_PERIOD: u32 = 50000;
307307

308+
#[cfg(any(target_os = "linux"))]
308309
const DROP_CACHE_PERIOD: u32 = 1000;
309310

310311
pub const MAX_BUFFERED_DEDICATED_JOBS: usize = 3;
@@ -855,7 +856,7 @@ pub async fn run_worker(
855856
};
856857

857858
#[cfg(feature = "prometheus")]
858-
let worker_save_completed_job_duration = if METRICS_DEBUG_ENABLED.load(Ordering::Relaxed)
859+
let _worker_save_completed_job_duration = if METRICS_DEBUG_ENABLED.load(Ordering::Relaxed)
859860
&& METRICS_ENABLED.load(Ordering::Relaxed)
860861
{
861862
Some(Arc::new(
@@ -1090,7 +1091,7 @@ pub async fn run_worker(
10901091
}
10911092

10921093
#[cfg(feature = "prometheus")]
1093-
let worker_dedicated_channel_queue_send_duration = {
1094+
let _worker_dedicated_channel_queue_send_duration = {
10941095
if is_dedicated_worker
10951096
&& METRICS_DEBUG_ENABLED.load(Ordering::Relaxed)
10961097
&& METRICS_ENABLED.load(Ordering::Relaxed)
@@ -1897,7 +1898,7 @@ async fn handle_queued_job(
18971898
job_completed_tx: JobCompletedSender,
18981899
occupancy_metrics: &mut OccupancyMetrics,
18991900
killpill_rx: &mut tokio::sync::broadcast::Receiver<()>,
1900-
#[cfg(feature = "benchmark")] bench: &mut BenchmarkIter,
1901+
#[cfg(feature = "benchmark")] _bench: &mut BenchmarkIter,
19011902
) -> windmill_common::error::Result<bool> {
19021903
// Extract the active span from the context
19031904

0 commit comments

Comments
 (0)