Skip to content

fix: validate error message fix from @heroku/sdk - #3998

Merged
erika-wallace merged 1 commit into
v12.0.0from
ew/pg-database-not-found-error
Oct 16, 2026
Merged

erika-wallace merged 1 commit into
v12.0.0from
ew/pg-database-not-found-error

Conversation

@erika-wallace

Copy link
Copy Markdown
Contributor

Summary

This PR validates the resolvePgDatabase fix in @heroku/sdk against the regression michaelmalave found reviewing #3980: an invalid DATABASE argument to pg:backups:capture or pg:backups:schedule was mislabeled is not yet provisioned instead of Unknown database: <name>. Valid options are: <list>. The cause was in the SDK's resolver, not those commands — data.database.describe() resolves the attachment and fetches its info in one call, and the attachment-resolution 404 surfaced as the same NotFoundError type the commands already catch to build their "not yet provisioned" message. Since the regression lives in the resolver, the fix was scoped to a separate heroku-sdk PR rather than bundled into #3980.

No command code changes are needed in this PR — the fix is entirely in the SDK's resolver. V12-CHANGES.md is updated to describe the resulting message differences, since the fix reshapes resolver error messages for every command that resolves a Postgres database through the SDK (not just the two from #3980).

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 Postgres database attached.

Setup:

  1. Pull down this branch
  2. npm i && npm run build
  3. heroku logout && HEROKU_NETRC_WRITE=true ./bin/run login

Steps

  1. Create a backup using an invalid database. Confirm the error is Unknown database: FAKE_DATABASE on <app>. Valid options are: <list>
./bin/run pg:backups:capture FAKE_DATABASE --app <app>
  1. Create a backup on an app with no databases. Confirm the error is <app> has no <service> databases
./bin/run pg:backups:capture --app <app>
  1. Schedule a backup using an invalid database. Confirm the error is Unknown database: FAKE_DATABASE on <app>. Valid options are: <list>
./bin/run pg:backups:schedule FAKE_DATABASE --app <app> --at 03:00
  1. Schedule a backup on an app with no databases. Confirm the error is <app> has no <service> databases
./bin/run pg:backups:schedule --app <app> --at 03:00

Cleanup

  • ./bin/run logout

Screenshots (if applicable)

Related Issues

GUS work item: W-24493221

@erika-wallace
erika-wallace requested a review from a team as a code owner October 16, 2026 15:49
@erika-wallace
erika-wallace deployed to AcceptanceTests October 16, 2026 15:49 — with GitHub Actions Active
@erika-wallace
erika-wallace deployed to AcceptanceTests October 16, 2026 15:49 — with GitHub Actions Active
@erika-wallace
erika-wallace deployed to AcceptanceTests October 16, 2026 15:49 — with GitHub Actions Active
@erika-wallace
erika-wallace deployed to AcceptanceTests October 16, 2026 15:49 — with GitHub Actions Active
@github-actions github-actions Bot added size/XS Extra small PR (code churn < 10) docs Touches documentation labels Oct 16, 2026

@tlowrimore-heroku tlowrimore-heroku 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.

LGTM!

@erika-wallace
erika-wallace merged commit 50dfc75 into v12.0.0 Oct 16, 2026
20 checks passed
@erika-wallace
erika-wallace deleted the ew/pg-database-not-found-error branch October 16, 2026 16:33

This branch was successfully deployed

1 active deployment
AcceptanceTests — 913f5b2b Deployed Oct 16, 2026 by erika-wallace via integration (24.x, ubuntu-latest) #9482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Touches documentation size/XS Extra small PR (code churn < 10)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants