Skip to content

Commit dd65d3b

Browse files
committed
Tweaks
1 parent 5d65e66 commit dd65d3b

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/api/data_types/chunking/mobile_app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct ChunkedMobileAppRequest<'a> {
2626
#[serde(skip_serializing_if = "Option::is_none")]
2727
pub base_ref: Option<&'a str>,
2828
#[serde(skip_serializing_if = "Option::is_none")]
29-
pub pr_number: Option<&'a str>,
29+
pub pr_number: Option<i32>,
3030
}
3131

3232
#[derive(Debug, Deserialize)]

src/api/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ impl<'a> AuthenticatedApi<'a> {
10391039
base_repo_name: Option<&str>,
10401040
head_ref: Option<&str>,
10411041
base_ref: Option<&str>,
1042-
pr_number: Option<&str>,
1042+
pr_number: Option<i32>,
10431043
) -> ApiResult<AssembleMobileAppResponse> {
10441044
let url = format!(
10451045
"/projects/{}/{}/files/preprodartifacts/assemble/",

src/commands/mobile_app/upload.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
115115
let base_repo_name = matches.get_one("base_repo_name").map(String::as_str);
116116
let head_ref = matches.get_one("head_ref").map(String::as_str);
117117
let base_ref = matches.get_one("base_ref").map(String::as_str);
118-
let pr_number = matches.get_one("pr_number").map(String::as_str);
118+
let pr_number = matches.get_one("pr_number").map(String::as_str).and_then(|s| s.parse::<i32>().ok());
119119

120120
let build_configuration = matches.get_one("build_configuration").map(String::as_str);
121121

@@ -401,7 +401,7 @@ fn upload_file(
401401
base_repo_name: Option<&str>,
402402
head_ref: Option<&str>,
403403
base_ref: Option<&str>,
404-
pr_number: Option<&str>,
404+
pr_number: Option<i32>,
405405
) -> Result<()> {
406406
const SELF_HOSTED_ERROR_HINT: &str = "If you are using a self-hosted Sentry server, \
407407
update to the latest version of Sentry to use the mobile-app upload command.";
@@ -417,7 +417,10 @@ fn upload_file(
417417
base_repo_name.unwrap_or("unknown"),
418418
head_ref.unwrap_or("unknown"),
419419
base_ref.unwrap_or("unknown"),
420-
pr_number.unwrap_or("unknown"),
420+
pr_number
421+
.map(|n| n.to_string())
422+
.as_deref()
423+
.unwrap_or("unknown"),
421424
build_configuration.unwrap_or("unknown")
422425
);
423426

@@ -511,7 +514,7 @@ fn poll_assemble(
511514
base_repo_name: Option<&str>,
512515
head_ref: Option<&str>,
513516
base_ref: Option<&str>,
514-
pr_number: Option<&str>,
517+
pr_number: Option<i32>,
515518
) -> Result<()> {
516519
debug!("Polling assemble for checksum: {}", checksum);
517520

src/utils/vcs.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,6 @@ pub fn find_head() -> Result<String> {
399399
Ok(head.id().to_string())
400400
}
401401

402-
pub fn find_base_sha(repo: &Repository, branch: &str) -> Result<String> {
403-
let head = repo.revparse_single(branch)?;
404-
Ok(head.id().to_string())
405-
}
406-
407-
408-
409402
/// Given commit specs, repos and remote_name this returns a list of head
410403
/// commits from it.
411404
pub fn find_heads(

0 commit comments

Comments
 (0)