You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): add profile system with versioned config
Introduce named profiles in the CodSpeed CLI config. Each profile carries
its own auth token plus optional api-url/upload-url overrides. Profile
selection at runtime follows: `--profile` / `CODSPEED_PROFILE` env var,
then a per-shell-session selection registered by `codspeed profile use`
(parent-PID keyed file under `$XDG_RUNTIME_DIR/codspeed_profile`, mirroring
how `codspeed use <mode>` works), then the built-in `default` profile.
There is no globally persisted default profile.
The on-disk config gains a `version: 1` schema field. A private
`RawConfig` deserialisation type and a `migrate` function are the only
place legacy YAML shapes are mentioned; when migration is needed the
canonical form is rewritten to disk immediately so the rest of the app
only ever sees the clean shape. Today this folds the legacy top-level
`auth.token` into `profiles.default`.
`CodSpeedConfig` is split: a private `PersistedConfig` is the on-disk
shape (version + profiles), and `CodSpeedConfig` wraps it with the
runtime-resolved auth/URLs/selected_profile. `persist` writes only the
persisted half, so runtime overrides (e.g. `CODSPEED_OAUTH_TOKEN`) can
never leak to disk.
The parent-PID shell-session machinery used by `codspeed use <mode>` is
extracted into a generic `shell_session_store` module so profile and
runner-mode share the same implementation. `src/runner_mode/` is
flattened into `src/runner_mode.rs` now that the sub-file is gone.
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments