Skip to content

Commit fb3dc15

Browse files
runningcodeclaude
andcommitted
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, and data types 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) <noreply@anthropic.com>
1 parent 06cbbda commit fb3dc15

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

src/api/data_types/chunking/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub struct AssembleBuildResponse {
2828
pub artifact_url: Option<String>,
2929
}
3030

31+
#[cfg(not(feature = "managed"))]
3132
#[derive(Debug, Deserialize)]
3233
#[serde(rename_all = "camelCase")]
3334
pub struct BuildInstallDetails {

src/api/data_types/chunking/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ mod hash_algorithm;
1010
mod upload;
1111

1212
pub use self::artifact::{AssembleArtifactsResponse, ChunkedArtifactRequest};
13-
pub use self::build::{AssembleBuildResponse, BuildInstallDetails, ChunkedBuildRequest, VcsInfo};
13+
#[cfg(not(feature = "managed"))]
14+
pub use self::build::BuildInstallDetails;
15+
pub use self::build::{AssembleBuildResponse, ChunkedBuildRequest, VcsInfo};
1416
pub use self::compression::ChunkCompression;
1517
pub use self::dif::{AssembleDifsRequest, AssembleDifsResponse, ChunkedDifRequest};
1618
pub use self::file_state::ChunkedFileState;

src/api/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ impl AuthenticatedApi<'_> {
723723
.convert_rnf(ApiErrorKind::ProjectNotFound)
724724
}
725725

726+
#[cfg(not(feature = "managed"))]
726727
pub fn get_build_install_details(
727728
&self,
728729
org: &str,
@@ -737,6 +738,7 @@ impl AuthenticatedApi<'_> {
737738
self.get(&url)?.convert()
738739
}
739740

741+
#[cfg(not(feature = "managed"))]
740742
pub fn download_installable_build(&self, url: &str, dst: &mut File) -> ApiResult<ApiResponse> {
741743
self.request(Method::Get, url)?
742744
.progress_bar_mode(ProgressBarMode::Response)

src/commands/build/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ use clap::{ArgMatches, Command};
33

44
use crate::utils::args::ArgExt as _;
55

6+
#[cfg(not(feature = "managed"))]
67
pub mod download;
78
pub mod snapshots;
89
pub mod upload;
910

1011
macro_rules! each_subcommand {
1112
($mac:ident) => {
13+
#[cfg(not(feature = "managed"))]
1214
$mac!(download);
1315
$mac!(snapshots);
1416
$mac!(upload);

0 commit comments

Comments
 (0)