| 551 | } |
| 552 | |
| 553 | pub async fn fetch_local_run(&self, vars: FetchLocalRunVars) -> Result<FetchLocalRunResponse> { |
| 554 | let response = self |
| 555 | .gql_client |
| 556 | .query_with_vars_unwrap::<FetchLocalRunData, FetchLocalRunVars>( |
| 557 | include_str!("queries/FetchLocalRun.gql"), |
| 558 | vars, |
| 559 | ) |
| 560 | .await; |
| 561 | match response { |
| 562 | Ok(response) => Ok(FetchLocalRunResponse { |
| 563 | run: response.repository.run, |
| 564 | }), |
| 565 | Err(err) if err.contains_error_code("UNAUTHENTICATED") => { |
| 566 | bail!("Your session has expired, please login again using `codspeed auth login`") |
| 567 | } |
| 568 | Err(err) => bail!("Failed to fetch local run: {err}"), |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | pub async fn get_or_create_project_repository( |
| 573 | &self, |