(api_client: &CodSpeedAPIClient, config: &CodSpeedConfig)
| 155 | } |
| 156 | |
| 157 | pub async fn status(api_client: &CodSpeedAPIClient, config: &CodSpeedConfig) -> Result<()> { |
| 158 | let has_token = config.auth.token.is_some(); |
| 159 | let parsed = detect_repository(); |
| 160 | |
| 161 | let auth_status = if has_token { |
| 162 | resolve_auth_status(api_client, parsed).await? |
| 163 | } else { |
| 164 | AuthStatus { |
| 165 | session: None, |
| 166 | detected_repository: parsed.map(|p| (p, None)), |
| 167 | } |
| 168 | }; |
| 169 | |
| 170 | info!( |
| 171 | "{} (profile: {})", |
| 172 | style("Authentication").bold(), |
| 173 | config.selected_profile_name() |
| 174 | ); |
| 175 | print_authentication_section(has_token, auth_status.session.as_ref()); |
| 176 | info!(""); |
| 177 | |
| 178 | info!("{}", style("Repository").bold()); |
| 179 | let local_runs_fallback = print_repository_section(&auth_status.detected_repository, has_token); |
| 180 | |
| 181 | if local_runs_fallback { |
| 182 | warn!( |
| 183 | "Runs will be uploaded to a {} CodSpeed project not associated with any repository.", |
| 184 | crate::cli::exec::DEFAULT_REPOSITORY_NAME |
| 185 | ); |
| 186 | } |
| 187 | |
| 188 | Ok(()) |
| 189 | } |
| 190 | |
| 191 | /// Resolve the session and (when a git remote is detected) the repository overview. |
| 192 | async fn resolve_auth_status( |
no test coverage detected