From 6a503394f0db7db25fcb8f47ccddc5634c3b4d8d Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Tue, 22 Jul 2025 16:31:42 +0200 Subject: [PATCH] feat(mobile-app): Reintroduce mobile-app feature gating This reverts commit 952feeb58f7ef928904bb590ca3fcea1b5317b42. --- .github/workflows/lint.yml | 9 +++++++-- .github/workflows/test.yml | 9 +++++++-- .vscode/settings.json | 4 ++++ Cargo.toml | 6 +++++- src/api/data_types/chunking/mobile_app.rs | 1 + src/api/data_types/chunking/mod.rs | 1 + src/api/mod.rs | 1 + src/commands/mobile_app/mod.rs | 2 ++ src/commands/mod.rs | 1 + src/utils/mobile_app/mod.rs | 2 ++ tests/integration/mobile_app/mod.rs | 2 ++ 11 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5caf330ab4..5631df08df 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,6 +16,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-24.04, macos-14, windows-2022] + feature-args: ['', '-Funstable-mobile-app'] include: - os: ubuntu-24.04 display-os: Linux @@ -23,8 +24,12 @@ jobs: display-os: macOS - os: windows-2022 display-os: Windows + - feature-args: '' + feature-suffix: '' + - feature-args: '-Funstable-mobile-app' + feature-suffix: ' (-Funstable-mobile-app)' - name: ${{ matrix.display-os }} + name: ${{ matrix.display-os }}${{ matrix.feature-suffix }} runs-on: ${{ matrix.os }} steps: - name: Checkout Repository @@ -40,4 +45,4 @@ jobs: run: cargo fmt --all -- --check - name: Run Clippy - run: cargo clippy --workspace --tests + run: cargo clippy --workspace --tests ${{ matrix.feature-args }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e523f8ae2..dccc7fcb7f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,6 +16,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-24.04, macos-14, windows-2022] + feature-args: ['', '-Funstable-mobile-app'] include: - os: ubuntu-24.04 display-os: Linux @@ -23,8 +24,12 @@ jobs: display-os: macOS - os: windows-2022 display-os: Windows + - feature-args: '' + feature-suffix: '' + - feature-args: '-Funstable-mobile-app' + feature-suffix: ' (-Funstable-mobile-app)' - name: ${{ matrix.display-os }} + name: ${{ matrix.display-os }}${{ matrix.feature-suffix }} runs-on: ${{ matrix.os }} steps: @@ -35,4 +40,4 @@ jobs: uses: swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0 - name: Run Cargo Tests - run: cargo test --workspace + run: cargo test --workspace ${{ matrix.feature-args }} diff --git a/.vscode/settings.json b/.vscode/settings.json index e69de29bb2..045a559f42 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "rust-analyzer.cargo.features": ["unstable-mobile-app"], + "rust-analyzer.cargo.noDefaultFeatures": false +} diff --git a/Cargo.toml b/Cargo.toml index d1c0d7ec8e..a57a0201f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ rust-version = "1.86" [dependencies] anylog = "0.6.3" anyhow = { version = "1.0.69", features = ["backtrace"] } +apple-catalog-parsing = { path = "apple-catalog-parsing", optional = true } backoff = "0.4.0" brotli2 = "0.3.2" bytecount = "0.6.3" @@ -93,6 +94,10 @@ default = [] managed = [] with_crash_reporting = [] +# Feature flag for the mobile-app command, as it is still under development. +# CI tests run against this flag, but we don't include it in release builds. +unstable-mobile-app = ["apple-catalog-parsing"] + [workspace.lints.clippy] allow-attributes = "warn" str-to-string = "warn" @@ -111,7 +116,6 @@ workspace = true [target."cfg(target_os = \"macos\")".dependencies] mac-process-info = "0.2.0" -apple-catalog-parsing = { path = "apple-catalog-parsing"} [target."cfg(unix)"] diff --git a/src/api/data_types/chunking/mobile_app.rs b/src/api/data_types/chunking/mobile_app.rs index b64f56ab80..b29f3a18b1 100644 --- a/src/api/data_types/chunking/mobile_app.rs +++ b/src/api/data_types/chunking/mobile_app.rs @@ -1,3 +1,4 @@ +#![cfg(feature = "unstable-mobile-app")] use serde::{Deserialize, Serialize}; use sha1_smol::Digest; diff --git a/src/api/data_types/chunking/mod.rs b/src/api/data_types/chunking/mod.rs index c1c2267625..448ed2b09b 100644 --- a/src/api/data_types/chunking/mod.rs +++ b/src/api/data_types/chunking/mod.rs @@ -14,5 +14,6 @@ pub use self::compression::ChunkCompression; pub use self::dif::{AssembleDifsRequest, AssembleDifsResponse, ChunkedDifRequest}; pub use self::file_state::ChunkedFileState; pub use self::hash_algorithm::ChunkHashAlgorithm; +#[cfg(feature = "unstable-mobile-app")] pub use self::mobile_app::{AssembleMobileAppResponse, ChunkedMobileAppRequest}; pub use self::upload::{ChunkServerOptions, ChunkUploadCapability}; diff --git a/src/api/mod.rs b/src/api/mod.rs index e11ad680ea..bbba47f0ba 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -1017,6 +1017,7 @@ impl<'a> AuthenticatedApi<'a> { .convert_rnf(ApiErrorKind::ReleaseNotFound) } + #[cfg(feature = "unstable-mobile-app")] pub fn assemble_mobile_app( &self, org: &str, diff --git a/src/commands/mobile_app/mod.rs b/src/commands/mobile_app/mod.rs index 9cae9207a6..cc0efac261 100644 --- a/src/commands/mobile_app/mod.rs +++ b/src/commands/mobile_app/mod.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "unstable-mobile-app")] + use anyhow::Result; use clap::{ArgMatches, Command}; diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 2ae9cbb39b..ecb7f95691 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -57,6 +57,7 @@ macro_rules! each_subcommand { $mac!(info); $mac!(issues); $mac!(login); + #[cfg(feature = "unstable-mobile-app")] $mac!(mobile_app); $mac!(monitors); $mac!(organizations); diff --git a/src/utils/mobile_app/mod.rs b/src/utils/mobile_app/mod.rs index 5e80986449..4d07590a34 100644 --- a/src/utils/mobile_app/mod.rs +++ b/src/utils/mobile_app/mod.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "unstable-mobile-app")] + #[cfg(target_os = "macos")] mod apple; mod validation; diff --git a/tests/integration/mobile_app/mod.rs b/tests/integration/mobile_app/mod.rs index fff27de69c..cec6153810 100644 --- a/tests/integration/mobile_app/mod.rs +++ b/tests/integration/mobile_app/mod.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "unstable-mobile-app")] + use crate::integration::TestManager; mod upload;