@@ -117,9 +117,8 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
117117
118118 let config = Config :: current ( ) ;
119119 let ( org, project) = config. get_org_and_project ( matches) ?;
120- let base_url = config. get_base_url ( ) ?;
121120
122- let mut uploaded_paths_and_ids = vec ! [ ] ;
121+ let mut uploaded_paths_and_urls = vec ! [ ] ;
123122 let mut errored_paths_and_reasons = vec ! [ ] ;
124123 for ( path, zip) in normalized_zips {
125124 info ! ( "Uploading file: {}" , path. display( ) ) ;
@@ -132,9 +131,9 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
132131 sha. as_deref ( ) ,
133132 build_configuration,
134133 ) {
135- Ok ( artifact_id ) => {
134+ Ok ( artifact_url ) => {
136135 info ! ( "Successfully uploaded file: {}" , path. display( ) ) ;
137- uploaded_paths_and_ids . push ( ( path. to_path_buf ( ) , artifact_id ) ) ;
136+ uploaded_paths_and_urls . push ( ( path. to_path_buf ( ) , artifact_url ) ) ;
138137 }
139138 Err ( e) => {
140139 debug ! ( "Failed to upload file at path {}: {}" , path. display( ) , e) ;
@@ -158,22 +157,21 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
158157 }
159158 }
160159
161- if uploaded_paths_and_ids . is_empty ( ) {
160+ if uploaded_paths_and_urls . is_empty ( ) {
162161 bail ! ( "Failed to upload any files" ) ;
163162 } else {
164163 println ! (
165164 "Successfully uploaded {} file{} to Sentry" ,
166- uploaded_paths_and_ids . len( ) ,
167- if uploaded_paths_and_ids . len( ) == 1 {
165+ uploaded_paths_and_urls . len( ) ,
166+ if uploaded_paths_and_urls . len( ) == 1 {
168167 ""
169168 } else {
170169 "s"
171170 }
172171 ) ;
173- if uploaded_paths_and_ids. len ( ) < 3 {
174- for ( path, artifact_id) in & uploaded_paths_and_ids {
175- let url = format ! ( "{base_url}/{org}/preprod/{project}/{artifact_id}" ) ;
176- println ! ( " - {} ({url})" , path. display( ) ) ;
172+ if uploaded_paths_and_urls. len ( ) < 3 {
173+ for ( path, artifact_url) in & uploaded_paths_and_urls {
174+ println ! ( " - {} {artifact_url}" , path. display( ) ) ;
177175 }
178176 }
179177 }
@@ -283,7 +281,7 @@ fn handle_directory(path: &Path) -> Result<TempFile> {
283281 normalize_directory ( path, temp_dir. path ( ) )
284282}
285283
286- /// Returns artifact id if upload was successful.
284+ /// Returns artifact url if upload was successful.
287285fn upload_file (
288286 api : & AuthenticatedApi ,
289287 bytes : & [ u8 ] ,
@@ -336,15 +334,16 @@ fn upload_file(
336334 // In the normal case we go through this loop exactly twice:
337335 // 1. state=not_found
338336 // server tells us the we need to send every chunk and we do so
339- // 2. artifact_id set so we're done (likely state=created)
337+ // 2. artifact_url set so we're done (likely state=created)
340338 //
341339 // In the case where all the chunks are already on the server we go
342340 // through only once:
343- // 1. state=ok, artifact_id set
341+ // 1. state=created, artifact_url set
344342 //
345343 // In the case where something went wrong (which could be on either
346344 // iteration of the loop) we get:
347- // n. state=err, artifact_id unset
345+ // n. state=error, artifact_url unset
346+
348347 let result = loop {
349348 let response =
350349 api. assemble_mobile_app ( org, project, checksum, & checksums, sha, build_configuration) ?;
@@ -357,16 +356,15 @@ fn upload_file(
357356 ) ;
358357 upload_chunks ( & chunks, & chunk_upload_options, upload_progress_style) ?;
359358 }
360-
361359 // state.is_err() is not the same as this since it also returns
362360 // true for ChunkedFileState::NotFound.
363361 if response. state == ChunkedFileState :: Error {
364362 let message = response. detail . as_deref ( ) . unwrap_or ( "unknown error" ) ;
365363 bail ! ( "Failed to process uploaded files: {}" , message) ;
366364 }
367365
368- if let Some ( artifact_id ) = response. artifact_id {
369- break Ok ( artifact_id ) ;
366+ if let Some ( artifact_url ) = response. artifact_url {
367+ break Ok ( artifact_url ) ;
370368 }
371369
372370 if response. state . is_finished ( ) {
0 commit comments