fix(auth): support Redis Cloud secret env var alias#913
Merged
Conversation
3 tasks
joshrotenberg
added a commit
that referenced
this pull request
May 28, 2026
Both `cloud_secret_env_prefers_canonical_name` and `cloud_secret_env_falls_back_to_alias` (added in #913) mutate the same process-wide env vars (`REDIS_CLOUD_SECRET_KEY` and `REDIS_CLOUD_API_SECRET`). cargo test runs in parallel by default, so when one test sets `REDIS_CLOUD_SECRET_KEY=canonical-secret` and the other expects that key to be unset, whichever wins the race gets the wrong env state and fails. Observed symptom on PR #924's CI: state::tests::cloud_secret_env_falls_back_to_alias left: "canonical-secret" right: "alias-secret" Reproduced locally on `main` — the failing test alternates between the two depending on scheduling. Five consecutive runs with the fix all pass; serial-only runs already passed. Fix: annotate both tests with `#[serial_test::serial(cloud_secret_env)]` to put them in the same named serialization group. `serial_test` is already a workspace dev-dep used by `redisctl-core/src/config/config.rs` for the same reason; this just adds it to `redisctl-mcp`'s dev-deps and applies the standard pattern. Test plan - cargo fmt --all -- --check - cargo test -p redisctl-mcp --features cloud --lib state::tests::cloud_secret (run 5x in a loop; all green)
joshrotenberg
added a commit
that referenced
this pull request
May 28, 2026
Both `cloud_secret_env_prefers_canonical_name` and `cloud_secret_env_falls_back_to_alias` (added in #913) mutate the same process-wide env vars (`REDIS_CLOUD_SECRET_KEY` and `REDIS_CLOUD_API_SECRET`). cargo test runs in parallel by default, so when one test sets `REDIS_CLOUD_SECRET_KEY=canonical-secret` and the other expects that key to be unset, whichever wins the race gets the wrong env state and fails. Observed symptom on PR #924's CI: state::tests::cloud_secret_env_falls_back_to_alias left: "canonical-secret" right: "alias-secret" Reproduced locally on `main` — the failing test alternates between the two depending on scheduling. Five consecutive runs with the fix all pass; serial-only runs already passed. Fix: annotate both tests with `#[serial_test::serial(cloud_secret_env)]` to put them in the same named serialization group. `serial_test` is already a workspace dev-dep used by `redisctl-core/src/config/config.rs` for the same reason; this just adds it to `redisctl-mcp`'s dev-deps and applies the standard pattern. Test plan - cargo fmt --all -- --check - cargo test -p redisctl-mcp --features cloud --lib state::tests::cloud_secret (run 5x in a loop; all green)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
REDIS_CLOUD_SECRET_KEYas the canonical Redis Cloud secret env varREDIS_CLOUD_API_SECRETworking as a compatibility alias in CLI, core config resolution, and MCP OAuth env handlingTesting
cargo test -p redisctl-corecargo test -p redisctl-mcpcargo test -p redisctlcargo clippy --all-targets --all-features -- -D warningsCloses #908