Skip to content

feat(pg,redis): add --as flag to pg:promote and redis:promote (W-23597911, #1819) - #3841

Open
heroku-johnny wants to merge 3 commits into
mainfrom
W-23597911
Open

feat(pg,redis): add --as flag to pg:promote and redis:promote (W-23597911, #1819)#3841
heroku-johnny wants to merge 3 commits into
mainfrom
W-23597911

Conversation

@heroku-johnny

Copy link
Copy Markdown
Contributor

Summary

  • Adds --as NAME flag to heroku pg:promote — allows creating the promoted database attachment under a custom name instead of the hardcoded DATABASE
  • Adds --as NAME flag to heroku redis:promote — allows creating the promoted Key-Value Store attachment under a custom name instead of the hardcoded REDIS
  • When --as is omitted both commands fall back to the original default names, so existing behavior is unchanged
  • Follows the same flags.as pattern already established in addons:attach and pg:connection-pooling:attach

Resolves GUS W-23597911 / GitHub #1819

Test plan

  • pg:promote unit tests pass, including new test for --as CUSTOM_DB which asserts the attachment POST sends name: 'CUSTOM_DB'
  • redis:promote unit tests pass, including new test for --as CUSTOM_REDIS which asserts the attachment POST sends name: 'CUSTOM_REDIS'
  • ESLint passes with zero new errors on changed files
  • heroku pg:promote --app <app> <db> --as STAGING_DB creates attachment named STAGING_DB_URL
  • heroku redis:promote --app <app> <redis> --as STAGING_REDIS creates attachment named STAGING_REDIS_URL
  • Omitting --as still promotes to DATABASE_URL / REDIS_URL as before

🤖 Generated with Claude Code

…tom attachment names

Resolves W-23597911 / GitHub #1819. Previously, both commands hardcoded
the attachment name (DATABASE and REDIS respectively). With this change,
users can pass --as NAME to create the promoted attachment under a custom
name, falling back to the original default when the flag is omitted.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@heroku-johnny
heroku-johnny requested a review from a team as a code owner July 27, 2026 20:07

@michaelmalave michaelmalave 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.

Nice! Testing successful and code passes checks. LGTM!

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