Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions src/api/data_types/chunking/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use serde::{Deserialize, Serialize};
use sha1_smol::Digest;

use crate::api::VcsInfo;

use super::ChunkedFileState;

#[derive(Debug, Serialize)]
Expand All @@ -11,23 +13,8 @@ pub struct ChunkedBuildRequest<'a> {
pub build_configuration: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub release_notes: Option<&'a str>,
// VCS fields
#[serde(skip_serializing_if = "Option::is_none")]
pub head_sha: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub base_sha: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub provider: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub head_repo_name: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub base_repo_name: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub head_ref: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub base_ref: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pr_number: Option<&'a u32>,
#[serde(flatten)]
pub vcs_info: &'a VcsInfo<'a>,
}

#[derive(Debug, Deserialize)]
Expand Down
10 changes: 9 additions & 1 deletion src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2521,15 +2521,23 @@ struct LogsResponse {
}

/// VCS information for build app uploads
#[derive(Debug)]
#[derive(Debug, Serialize)]
pub struct VcsInfo<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub head_sha: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub base_sha: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none", rename = "provider")]
pub vcs_provider: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub head_repo_name: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub base_repo_name: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub head_ref: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub base_ref: Option<&'a str>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pr_number: Option<&'a u32>,
}

Expand Down
9 changes: 1 addition & 8 deletions src/commands/build/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,14 +566,7 @@ fn upload_file(
chunks: &checksums,
build_configuration,
release_notes,
head_sha: vcs_info.head_sha,
base_sha: vcs_info.base_sha,
provider: vcs_info.vcs_provider,
head_repo_name: vcs_info.head_repo_name,
base_repo_name: vcs_info.base_repo_name,
head_ref: vcs_info.head_ref,
base_ref: vcs_info.base_ref,
pr_number: vcs_info.pr_number,
vcs_info,
},
)?;
chunks.retain(|Chunk((digest, _))| response.missing_chunks.contains(digest));
Expand Down