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

Function status

src/cli/auth.rs:159–191  ·  view source on GitHub ↗
(api_client: &CodSpeedAPIClient, config: &CodSpeedConfig)

Source from the content-addressed store, hash-verified

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

Callers 2

runFunction · 0.70
runFunction · 0.70

Calls 4

detect_repositoryFunction · 0.85
resolve_auth_statusFunction · 0.85
print_repository_sectionFunction · 0.85

Tested by

no test coverage detected