Skip to content

Commit

Permalink
backend: pass cargo check --all-features (#4946)
Browse files Browse the repository at this point in the history
  • Loading branch information
uael authored Dec 18, 2024
1 parent 48385bf commit bded602
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 16 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/backend-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
- name: cargo check
working-directory: ./backend
timeout-minutes: 16
run: SQLX_OFFLINE=true cargo check --all-features
run: |
mkdir -p fake_frontend_build
FRONTEND_BUILD_DIR=$(pwd)/fake_frontend_build SQLX_OFFLINE=true cargo check --all-features
check_ee:
runs-on: ubicloud-standard-8
Expand Down Expand Up @@ -125,6 +127,8 @@ jobs:
- name: cargo check
timeout-minutes: 16
working-directory: ./backend
run: SQLX_OFFLINE=true cargo check --all-features
run: |
mkdir -p fake_frontend_build
FRONTEND_BUILD_DIR=$(pwd)/fake_frontend_build SQLX_OFFLINE=true cargo check --all-features
1 change: 1 addition & 0 deletions backend/src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ pub async fn load_metrics_debug_enabled(db: &DB) -> error::Result<()> {
#[cfg(all(not(target_env = "msvc"), feature = "jemalloc"))]
#[derive(Debug, Clone)]
pub struct MallctlError {
#[allow(unused)]
pub code: i32,
}

Expand Down
31 changes: 27 additions & 4 deletions backend/windmill-api/src/job_helpers_ee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ use std::sync::Arc;
use windmill_common::error;
#[cfg(feature = "parquet")]
use windmill_common::{db::UserDB, s3_helpers::ObjectStoreResource};

#[cfg(feature = "parquet")]
use bytes::Bytes;
#[cfg(feature = "parquet")]
use futures::Stream;

#[derive(Serialize)]
pub struct UploadFileResponse {
pub file_key: String,
Expand All @@ -35,7 +41,7 @@ pub async fn get_workspace_s3_resource<'c>(
}

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

pub async fn get_s3_resource<'c>(
Expand All @@ -48,14 +54,31 @@ pub async fn get_s3_resource<'c>(
_resource_type: Option<StorageResourceType>,
_job_id: Option<Uuid>,
) -> error::Result<ObjectStoreResource> {
todo!()
Err(error::Error::InternalErr(
"Not implemented in Windmill's Open Source repository".to_string(),
))
}

#[cfg(feature = "parquet")]
pub async fn upload_file_from_req(
_s3_client: Arc<dyn ObjectStore>,
_file_key: &str,
_req: axum::extract::Request,
_options: PutMultipartOpts,
) -> error::Result<()> {
Err(error::Error::InternalErr(
"Not implemented in Windmill's Open Source repository".to_string(),
))
}

#[cfg(feature = "parquet")]
pub async fn upload_file_internal(
_s3_client: Arc<dyn ObjectStore>,
_file_key: &str,
_request: axum::extract::Request,
_stream: impl Stream<Item = Result<Bytes, std::io::Error>> + Unpin,
_options: PutMultipartOpts,
) -> error::Result<()> {
todo!()
Err(error::Error::InternalErr(
"Not implemented in Windmill's Open Source repository".to_string(),
))
}
6 changes: 5 additions & 1 deletion backend/windmill-api/src/smtp_server_ee.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{db::DB, users::AuthCache};
use crate::{auth::AuthCache, db::DB};
use std::{net::SocketAddr, sync::Arc};
use windmill_common::db::UserDB;

Expand All @@ -11,6 +11,10 @@ pub struct SmtpServer {

impl SmtpServer {
pub async fn start_listener_thread(self: Arc<Self>, _addr: SocketAddr) -> anyhow::Result<()> {
let _ = self.auth_cache;
let _ = self.db;
let _ = self.user_db;
let _ = self.base_internal_url;
Err(anyhow::anyhow!("Implementation not open source"))
}
}
2 changes: 0 additions & 2 deletions backend/windmill-queue/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ use reqwest::Client;
use serde::{ser::SerializeMap, Serialize};
use serde_json::{json, value::RawValue};
use sqlx::{types::Json, FromRow, Pool, Postgres, Transaction};
#[cfg(feature = "benchmark")]
use std::time::Instant;
use tokio::{sync::RwLock, time::sleep};
use ulid::Ulid;
use uuid::Uuid;
Expand Down
4 changes: 3 additions & 1 deletion backend/windmill-worker/src/handle_child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ use windmill_common::DB;
#[cfg(feature = "enterprise")]
use windmill_common::job_metrics;

#[cfg(target_os = "linux")]
use tokio::io::AsyncWriteExt;
use tokio::{
io::{AsyncBufReadExt, AsyncWriteExt, BufReader},
io::{AsyncBufReadExt, BufReader},
process::Child,
sync::{broadcast, watch},
time::{interval, sleep, Instant, MissedTickBehavior},
Expand Down
3 changes: 0 additions & 3 deletions backend/windmill-worker/src/result_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ use windmill_common::bench::{BenchmarkInfo, BenchmarkIter};

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

#[cfg(feature = "prometheus")]
use windmill_queue::register_metric;

use serde_json::{json, value::RawValue};

use tokio::{
Expand Down
7 changes: 4 additions & 3 deletions backend/windmill-worker/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ pub const DEFAULT_NATIVE_JOBS: usize = 1;

const VACUUM_PERIOD: u32 = 50000;

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

pub const MAX_BUFFERED_DEDICATED_JOBS: usize = 3;
Expand Down Expand Up @@ -855,7 +856,7 @@ pub async fn run_worker(
};

#[cfg(feature = "prometheus")]
let worker_save_completed_job_duration = if METRICS_DEBUG_ENABLED.load(Ordering::Relaxed)
let _worker_save_completed_job_duration = if METRICS_DEBUG_ENABLED.load(Ordering::Relaxed)
&& METRICS_ENABLED.load(Ordering::Relaxed)
{
Some(Arc::new(
Expand Down Expand Up @@ -1090,7 +1091,7 @@ pub async fn run_worker(
}

#[cfg(feature = "prometheus")]
let worker_dedicated_channel_queue_send_duration = {
let _worker_dedicated_channel_queue_send_duration = {
if is_dedicated_worker
&& METRICS_DEBUG_ENABLED.load(Ordering::Relaxed)
&& METRICS_ENABLED.load(Ordering::Relaxed)
Expand Down Expand Up @@ -1897,7 +1898,7 @@ async fn handle_queued_job(
job_completed_tx: JobCompletedSender,
occupancy_metrics: &mut OccupancyMetrics,
killpill_rx: &mut tokio::sync::broadcast::Receiver<()>,
#[cfg(feature = "benchmark")] bench: &mut BenchmarkIter,
#[cfg(feature = "benchmark")] _bench: &mut BenchmarkIter,
) -> windmill_common::error::Result<bool> {
// Extract the active span from the context

Expand Down

0 comments on commit bded602

Please sign in to comment.