Skip to content

refactor: use @heroku/sdk for redis commands#3829

Merged
k80bowman merged 3 commits into
v12.0.0from
k80/redis-sdk
Jul 23, 2026
Merged

refactor: use @heroku/sdk for redis commands#3829
k80bowman merged 3 commits into
v12.0.0from
k80/redis-sdk

Conversation

@k80bowman

Copy link
Copy Markdown
Contributor

Summary

Migrates the redis command family off the raw APIClient in @heroku-cli/command onto @heroku/sdk (with the redisExtensions extension). Every command in the topic — redis (info), redis:cli, redis:credentials, redis:keyspace-notifications, redis:maxmemory, redis:promote, redis:stats-reset, redis:timeout, redis:upgrade, redis:wait — now resolves the addon and fetches Redis state through the SDK's data.redis / platform.addOn / platform.configVar surfaces, and the legacy src/lib/redis/api.ts helper is removed. Unit tests are updated to stub @heroku/sdk directly in place of the previous nock HTTP mocks.

Also bumps the pinned @heroku/sdk git dependency to the latest SHA to pick up upstream fixes required by these commands.

Type of Change

Breaking Changes (major semver update)

  • Add a ! after your change type to denote a change that breaks current behavior

Feature Additions (minor semver update)

  • feat: Introduces a new feature to the codebase

Patch Updates (patch semver update)

  • fix: Bug fix
  • deps: Dependency upgrade
  • revert: Revert a previous commit
  • chore: Change that does not affect production code
  • refactor: Refactoring existing code without changing behavior
  • test: Add/update/remove tests

Testing

Notes:

  • Requires an app with a Heroku Key-Value Store (Redis) addon attached. For some commands (like redis:promote) it helps if you have two Redis addons attached.
  • Build the CLI locally (npm run build) and run with ./bin/run

Steps:

  1. heroku redis -a <app> — confirm info renders for the default Redis addon (headered output with config-var list and info rows).
  2. heroku redis -a <app> --json — confirm JSON output filters out formation, metaas_source, and port fields and includes config_vars.
  3. heroku redis:credentials <addon> -a <app> and --reset — confirm the credentials URL is returned and reset completes.
  4. heroku redis:info <addon> -a <app> — confirm addon-scoped info renders correctly.
  5. heroku redis:keyspace-notifications <addon> -a <app> (view and set), redis:maxmemory, redis:timeout — confirm reads and writes round-trip.
  6. heroku redis:stats-reset <addon> -a <app> — confirm reset succeeds.
  7. heroku redis:promote <addon> -a <app> — confirm the addon is promoted to the primary attachment.
  8. heroku redis:upgrade <addon> -a <app> --version <version> — confirm the upgrade kicks off.
  9. heroku redis:wait <addon> -a <app> — confirm it polls until the addon reaches available.
  10. heroku redis:cli <addon> -a <app> — confirm the interactive session opens on a non-shield plan and is blocked with the shield guidance message
    on a shield plan.
  11. Run npm test — full unit suite (including the rewritten Redis specs) should pass.

Screenshots (if applicable)

Related Issues

GUS work item: W-23374158

@k80bowman
k80bowman requested a review from a team as a code owner July 23, 2026 14:25
@k80bowman
k80bowman temporarily deployed to AcceptanceTests July 23, 2026 14:25 — with GitHub Actions Inactive
@k80bowman
k80bowman temporarily deployed to AcceptanceTests July 23, 2026 14:25 — with GitHub Actions Inactive
@k80bowman
k80bowman temporarily deployed to AcceptanceTests July 23, 2026 14:25 — with GitHub Actions Inactive
@k80bowman
k80bowman temporarily deployed to AcceptanceTests July 23, 2026 14:25 — with GitHub Actions Inactive
@k80bowman k80bowman changed the title K80/redis sdk refactor: use @heroku/sdk for redis commands Jul 23, 2026

@jdodson jdodson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with a thing you prob want to fix.

  • Looked over the PR, looks good
  • Code went over with a claude & chatgpt reviewer, looks good
  • Manual testing found a thing:

Doing this:

./bin/run redis:stats-reset redis-concave-96888 -a nodejs-getting-starteeed

Since I don't pass the confirm, I have to type it in, but the type in area is mangled. Looks like what's happening is that characters are already there so when I type something it's wrong. Could just be me, but maybe not?

Screenshot below:

Image

@k80bowman

Copy link
Copy Markdown
Contributor Author

I was unable to reproduce that bug, but I did fix the extra > in the warning output.

@k80bowman
k80bowman merged commit 68e5ec5 into v12.0.0 Jul 23, 2026
19 checks passed
@k80bowman
k80bowman deleted the k80/redis-sdk branch July 23, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants