fix: pg:copy confirmation prompt shows addon name not app name - #3834
Merged
Conversation
The destructive-action confirmation prompt in `pg:copy` was asking the user to type the app name to confirm, even when the target was a Heroku PostgreSQL attachment. This meant that copying to the wrong database on the same app would show an identical prompt with no way to distinguish targets — a silent data-loss risk. The `postgres://` URL branch already used the database name as the `confirm` value. This commit aligns the attachment branch to do the same: extract the human-readable addon name (e.g. `JADE`) from the attachment's config-var name and use it for both `name` and `confirm`. Fixes: W-23597886 Related: #1545 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:15 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:15 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:15 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:15 — with
GitHub Actions
Inactive
The fix to `getAttachmentInfo` changed `confirm` from the app name to the attachment addon name. Update all existing test cases that passed `--confirm <app>` to pass `--confirm <addon>` instead, and add a regression test that explicitly verifies the app name is rejected when a specific addon name is required. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:17 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:17 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:17 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 19:17 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Inactive
heroku-johnny
had a problem deploying
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Failure
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Inactive
heroku-johnny
had a problem deploying
to
AcceptanceTests
July 27, 2026 21:45 — with
GitHub Actions
Error
tlowrimore-heroku
requested changes
Jul 27, 2026
tlowrimore-heroku
left a comment
Contributor
There was a problem hiding this comment.
Actually, it looks like something has broken the integration tests.
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 28, 2026 16:07 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 28, 2026 16:48 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 28, 2026 17:16 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 28, 2026 17:16 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 28, 2026 17:16 — with
GitHub Actions
Inactive
heroku-johnny
temporarily deployed
to
AcceptanceTests
July 28, 2026 17:16 — with
GitHub Actions
Inactive
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
pg:copydestructive-action confirmation prompt asked users to type the app name to confirm, even when the target was a named Heroku PostgreSQL attachment. A user copying to the wrong database on the same app would see an identical prompt for both, providing no safety signal.confirmvalue was always the app name, not the specific database, a mistakenheroku pg:copy SOURCE TARGETagainst the wrong database on the same app would clear and overwrite data with no distinguishing warning. This is a real data-safety gap.JADE,CRIMSON) from the config-var attachment name and use it for bothnameandconfirm, mirroring the existing behavior of thepostgres://URL branch which already correctly usesconn.database || conn.host.Fixes: W-23597886
Related: #1545
Before / After
Before — both prompts for two databases on the same app look identical:
After — each prompt names the specific database:
Test plan
heroku pg:copy SOURCE TARGET --app my-appwhere target is a named attachment: prompt asks you to type the addon name (e.g.JADE), not the app name.heroku pg:copy postgres://... TARGET --app my-app: existing behavior unchanged — prompt still usesconn.database || conn.host.--confirm JADEflag bypasses the prompt correctly.🤖 Generated with Claude Code