From 00643ace540fd3b55b17f556384f07da08100cd6 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 26 Mar 2026 08:55:38 +0100 Subject: [PATCH 1/2] fix(build): Gate build download command behind managed feature flag The `build download` command uses `ProgressBarMode::Response` and `BuildInstallDetails`, both of which are excluded from managed builds. Gate the command module, API methods, data types, and the `File` import behind `#[cfg(not(feature = "managed"))]` to match the existing pattern used by `download_with_progress` and other interactive-only code. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/api/data_types/chunking/build.rs | 1 + src/api/data_types/chunking/mod.rs | 4 +++- src/api/mod.rs | 3 +++ src/commands/build/mod.rs | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/api/data_types/chunking/build.rs b/src/api/data_types/chunking/build.rs index b46e23bb01..72d4970fba 100644 --- a/src/api/data_types/chunking/build.rs +++ b/src/api/data_types/chunking/build.rs @@ -28,6 +28,7 @@ pub struct AssembleBuildResponse { pub artifact_url: Option, } +#[cfg(not(feature = "managed"))] #[derive(Debug, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BuildInstallDetails { diff --git a/src/api/data_types/chunking/mod.rs b/src/api/data_types/chunking/mod.rs index f5d5c86d62..0dc7850842 100644 --- a/src/api/data_types/chunking/mod.rs +++ b/src/api/data_types/chunking/mod.rs @@ -10,7 +10,9 @@ mod hash_algorithm; mod upload; pub use self::artifact::{AssembleArtifactsResponse, ChunkedArtifactRequest}; -pub use self::build::{AssembleBuildResponse, BuildInstallDetails, ChunkedBuildRequest, VcsInfo}; +#[cfg(not(feature = "managed"))] +pub use self::build::BuildInstallDetails; +pub use self::build::{AssembleBuildResponse, ChunkedBuildRequest, VcsInfo}; pub use self::compression::ChunkCompression; pub use self::dif::{AssembleDifsRequest, AssembleDifsResponse, ChunkedDifRequest}; pub use self::file_state::ChunkedFileState; diff --git a/src/api/mod.rs b/src/api/mod.rs index 03f3ec5460..7f1ad698bf 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -16,6 +16,7 @@ use std::borrow::Cow; use std::cell::RefCell; use std::collections::HashMap; use std::error::Error as _; +#[cfg(any(target_os = "macos", not(feature = "managed")))] use std::fs::File; use std::io::{self, Read as _, Write}; use std::rc::Rc; @@ -723,6 +724,7 @@ impl AuthenticatedApi<'_> { .convert_rnf(ApiErrorKind::ProjectNotFound) } + #[cfg(not(feature = "managed"))] pub fn get_build_install_details( &self, org: &str, @@ -737,6 +739,7 @@ impl AuthenticatedApi<'_> { self.get(&url)?.convert() } + #[cfg(not(feature = "managed"))] pub fn download_installable_build(&self, url: &str, dst: &mut File) -> ApiResult { self.request(Method::Get, url)? .progress_bar_mode(ProgressBarMode::Response) diff --git a/src/commands/build/mod.rs b/src/commands/build/mod.rs index 55b28d1dfb..5940738b5d 100644 --- a/src/commands/build/mod.rs +++ b/src/commands/build/mod.rs @@ -3,12 +3,14 @@ use clap::{ArgMatches, Command}; use crate::utils::args::ArgExt as _; +#[cfg(not(feature = "managed"))] pub mod download; pub mod snapshots; pub mod upload; macro_rules! each_subcommand { ($mac:ident) => { + #[cfg(not(feature = "managed"))] $mac!(download); $mac!(snapshots); $mac!(upload); From bc1c1798cb5d38c160ce272a6feca320b8cb6655 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 26 Mar 2026 08:55:51 +0100 Subject: [PATCH 2/2] ci(lint): Add managed feature check to CI The managed feature flag was only tested during Docker image builds, which run late in the release pipeline. Add `cargo check --features managed` to the Linux lint job so breakage is caught on every PR. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f3d2a77d19..70c43992ad 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -89,3 +89,7 @@ jobs: - name: Run Clippy run: cargo clippy --workspace --tests --target ${{ matrix.target }} + + - name: Check managed feature compiles + if: matrix.target == 'x86_64-unknown-linux-musl' + run: cargo check --features managed --target ${{ matrix.target }}