MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / upload_all

Method upload_all

src/executor/orchestrator.rs:272–317  ·  view source on GitHub ↗
(
        &self,
        completed_runs: &mut [(ExecutionContext, ExecutorName)],
        api_client: &mut CodSpeedAPIClient,
    )

Source from the content-addressed store, hash-verified

270 }
271
272 pub async fn upload_all(
273 &self,
274 completed_runs: &mut [(ExecutionContext, ExecutorName)],
275 api_client: &mut CodSpeedAPIClient,
276 ) -> Result<UploadResult> {
277 let mut last_upload_result: Option<UploadResult> = None;
278
279 let total_runs = completed_runs.len();
280 for (run_part_index, (ctx, executor_name)) in completed_runs.iter_mut().enumerate() {
281 // OIDC tokens can expire quickly, so refresh just before each upload
282 self.provider.set_oidc_token(api_client).await?;
283
284 if run_part_index == 0 {
285 // After the mint, so this names the token the upload actually uses
286 self.log_authentication(api_client);
287 }
288
289 if total_runs > 1 {
290 info!("Uploading results {}/{total_runs}", run_part_index + 1);
291 }
292 let run_part_suffix =
293 Self::build_run_part_suffix(executor_name, run_part_index, total_runs);
294 let upload_result = upload(
295 self,
296 api_client,
297 ctx,
298 executor_name.clone(),
299 run_part_suffix,
300 )
301 .await?;
302 last_upload_result = Some(upload_result);
303 }
304 info!("Performance data uploaded");
305 if let Some(upload_result) = &last_upload_result {
306 info!(
307 "Linked repository: {}",
308 console::style(format!(
309 "{}/{}",
310 upload_result.owner, upload_result.repository
311 ))
312 .bold()
313 );
314 }
315
316 last_upload_result.ok_or_else(|| anyhow::anyhow!("No completed runs to upload"))
317 }
318}

Callers 1

upload_and_pollMethod · 0.80

Calls 4

uploadFunction · 0.85
lenMethod · 0.80
log_authenticationMethod · 0.80
set_oidc_tokenMethod · 0.45

Tested by

no test coverage detected