| 508 | } |
| 509 | |
| 510 | pub async fn fetch_local_run(&self, vars: FetchLocalRunVars) -> Result<FetchLocalRunResponse> { |
| 511 | let response = self |
| 512 | .gql_client |
| 513 | .query_with_vars_unwrap::<FetchLocalRunData, FetchLocalRunVars>( |
| 514 | include_str!("queries/FetchLocalRun.gql"), |
| 515 | vars, |
| 516 | ) |
| 517 | .await; |
| 518 | match response { |
| 519 | Ok(response) => Ok(FetchLocalRunResponse { |
| 520 | run: response.repository.run, |
| 521 | }), |
| 522 | Err(err) if err.contains_error_code("UNAUTHENTICATED") => { |
| 523 | bail!("Your session has expired, please login again using `codspeed auth login`") |
| 524 | } |
| 525 | Err(err) => bail!("Failed to fetch local run: {err}"), |
| 526 | } |
| 527 | } |
| 528 | |
| 529 | pub async fn get_or_create_project_repository( |
| 530 | &self, |