From b8ad22a6fbbb09842af949584f1e80aa5efcf6d0 Mon Sep 17 00:00:00 2001 From: Jai A Date: Fri, 18 Oct 2024 16:23:32 -0700 Subject: [PATCH] Fix checks --- .github/workflows/turbo-ci.yml | 2 ++ apps/labrinth/tests/common/api_common/models.rs | 13 +++++++++++++ .../tests/common/api_common/request_data.rs | 3 +++ apps/labrinth/tests/project.rs | 4 ++-- turbo.json | 3 ++- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/turbo-ci.yml b/.github/workflows/turbo-ci.yml index 7920aad8b..30f4084c3 100644 --- a/.github/workflows/turbo-ci.yml +++ b/.github/workflows/turbo-ci.yml @@ -62,6 +62,8 @@ jobs: - name: Build run: pnpm build + env: + SQLX_OFFLINE: true - name: Lint run: pnpm lint diff --git a/apps/labrinth/tests/common/api_common/models.rs b/apps/labrinth/tests/common/api_common/models.rs index bf4875acc..d5850bcd1 100644 --- a/apps/labrinth/tests/common/api_common/models.rs +++ b/apps/labrinth/tests/common/api_common/models.rs @@ -32,6 +32,7 @@ use serde::Deserialize; // as the environment generator for both uses common fields. #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonProject { // For example, for CommonProject, we do not include: // - game_versions (v2 only) @@ -62,6 +63,7 @@ pub struct CommonProject { pub monetization_status: MonetizationStatus, } #[derive(Deserialize, Clone)] +#[allow(dead_code)] pub struct CommonVersion { pub id: VersionId, pub loaders: Vec, @@ -81,6 +83,7 @@ pub struct CommonVersion { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonLoaderData { pub icon: String, pub name: String, @@ -88,6 +91,7 @@ pub struct CommonLoaderData { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonCategoryData { pub icon: String, pub name: String, @@ -97,6 +101,7 @@ pub struct CommonCategoryData { /// A member of a team #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonTeamMember { pub team_id: TeamId, pub user: User, @@ -110,6 +115,7 @@ pub struct CommonTeamMember { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonNotification { pub id: NotificationId, pub user_id: UserId, @@ -122,6 +128,7 @@ pub struct CommonNotification { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonNotificationAction { pub action_route: (String, String), } @@ -147,6 +154,7 @@ impl CommonItemType { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonReport { pub id: ReportId, pub report_type: String, @@ -168,6 +176,7 @@ pub enum LegacyItemType { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonThread { pub id: ThreadId, #[serde(rename = "type")] @@ -179,6 +188,7 @@ pub struct CommonThread { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonThreadMessage { pub id: ThreadMessageId, pub author_id: Option, @@ -187,6 +197,7 @@ pub struct CommonThreadMessage { } #[derive(Deserialize)] +#[allow(dead_code)] pub enum CommonMessageBody { Text { body: String, @@ -206,6 +217,7 @@ pub enum CommonMessageBody { } #[derive(Deserialize)] +#[allow(dead_code)] pub enum CommonThreadType { Report, Project, @@ -213,6 +225,7 @@ pub enum CommonThreadType { } #[derive(Deserialize)] +#[allow(dead_code)] pub struct CommonUser { pub id: UserId, pub username: String, diff --git a/apps/labrinth/tests/common/api_common/request_data.rs b/apps/labrinth/tests/common/api_common/request_data.rs index 3bfc886aa..eb3a78136 100644 --- a/apps/labrinth/tests/common/api_common/request_data.rs +++ b/apps/labrinth/tests/common/api_common/request_data.rs @@ -5,18 +5,21 @@ use labrinth::util::actix::MultipartSegment; use crate::common::dummy_data::TestFile; +#[allow(dead_code)] pub struct ProjectCreationRequestData { pub slug: String, pub jar: Option, pub segment_data: Vec, } +#[allow(dead_code)] pub struct VersionCreationRequestData { pub version: String, pub jar: Option, pub segment_data: Vec, } +#[allow(dead_code)] pub struct ImageData { pub filename: String, pub extension: String, diff --git a/apps/labrinth/tests/project.rs b/apps/labrinth/tests/project.rs index 27f0d1b1d..11c63abbc 100644 --- a/apps/labrinth/tests/project.rs +++ b/apps/labrinth/tests/project.rs @@ -18,7 +18,7 @@ use labrinth::models::teams::ProjectPermissions; use labrinth::util::actix::{MultipartSegment, MultipartSegmentData}; use serde_json::json; -use crate::common::api_common::models::{CommonItemType, CommonProject}; +use crate::common::api_common::models::CommonProject; use crate::common::api_common::request_data::ProjectCreationRequestData; use crate::common::api_common::{ApiProject, ApiTeams, ApiVersion}; use crate::common::dummy_data::{ @@ -1343,7 +1343,7 @@ async fn projects_various_visibility() { for (pat, expected_count) in visible_pat_pairs { let projects = env .api - .get_projects(&[&alpha_project_id, &beta_project_id], pat) + .get_projects(&[alpha_project_id, beta_project_id], pat) .await; let projects: Vec = test::read_body_json(projects).await; diff --git a/turbo.json b/turbo.json index f76adcfdb..e9981fdb1 100644 --- a/turbo.json +++ b/turbo.json @@ -15,7 +15,8 @@ "VERCEL_*", "CF_PAGES_*", "HEROKU_APP_NAME", - "STRIPE_PUBLISHABLE_KEY" + "STRIPE_PUBLISHABLE_KEY", + "SQLX_OFFLINE" ] }, "lint": {},