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

Function status

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

Source from the content-addressed store, hash-verified

155}
156
157pub 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.
192async 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