Load the CodSpeed config for this invocation, resolving the active profile (CLI `--profile` / `CODSPEED_PROFILE` / shell-session / built-in `default`) and applying CLI overrides for the OAuth token and api URL. `auth` and `profile` subcommands are allowed to run against a config where the selected profile does not yet exist (e.g. first-time setup).
(cli: &Cli)
| 210 | /// `auth` and `profile` subcommands are allowed to run against a config |
| 211 | /// where the selected profile does not yet exist (e.g. first-time setup). |
| 212 | fn load_config(cli: &Cli) -> Result<CodSpeedConfig> { |
| 213 | // The field carries a `#[deprecated]` marker but we still need to |
| 214 | // honour it during the deprecation window. |
| 215 | #[allow(deprecated)] |
| 216 | let config_name = cli.config_name.as_deref(); |
| 217 | if config_name.is_some() { |
| 218 | warn!( |
| 219 | "`--config-name` / `CODSPEED_CONFIG_NAME` is deprecated; use `--profile` / `CODSPEED_PROFILE` instead." |
| 220 | ); |
| 221 | } |
| 222 | CodSpeedConfig::load_with_profile( |
| 223 | config_name, |
| 224 | cli.profile.as_deref(), |
| 225 | ConfigOverrides { |
| 226 | oauth_token: cli.oauth_token.as_deref(), |
| 227 | api_url: cli.api_url.as_deref(), |
| 228 | upload_url: None, |
| 229 | }, |
| 230 | matches!(&cli.command, Commands::Auth(_) | Commands::Profile(_)), |
| 231 | ) |
| 232 | } |
| 233 | |
| 234 | /// Build the api client for this invocation, resolving the auth token |
| 235 | /// from the most specific source available. This is the single source |