Repository navigation
refactor: use @heroku/sdk for pg:backups commands (part 2) - #3978
Merged
Merged
Conversation
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 19:51 — with
GitHub Actions
Error
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 19:51 — with
GitHub Actions
Error
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 19:51 — with
GitHub Actions
Failure
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 19:51 — with
GitHub Actions
Failure
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:01 — with
GitHub Actions
Failure
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:01 — with
GitHub Actions
Error
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:01 — with
GitHub Actions
Error
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:01 — with
GitHub Actions
Failure
This reverts commit 89b26f2.
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:18 — with
GitHub Actions
Error
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:18 — with
GitHub Actions
Error
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:18 — with
GitHub Actions
Failure
erika-wallace
had a problem deploying
to
AcceptanceTests
October 8, 2026 20:18 — with
GitHub Actions
Failure
This branch was successfully deployed
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
This PR updates three
pg:backupscommands —pg:backups:schedule,pg:backups:schedules, andpg:backups:unschedule— to use the SDK instead of calling the Heroku API directly.Changes Made
pg:backups:schedulenow loads the database withdata.database.describeand creates the schedule withdata.transferSchedule.create. The command no longer buildsschedule_name; the SDK sets it from the resolved attachment name.pg:backups:schedulesnow lists schedules withdata.transferSchedule.list.pg:backups:unschedulenow lists schedules withdata.transferSchedule.listand deletes the match withdata.transferSchedule.delete.src/lib/pg/types.tsno longer definesTransferScheduleorPublicUrlResponse. Those types now come from@heroku/sdkand@heroku/types.src/commands/pg/backups/index.tsdrops an unusedtransferExtensionsimport left over from thepg:backupspart-1 migration (refactor: use @heroku/sdk for pg:backups commands (part 1) #3958).Behavior notes (also documented in
V12-CHANGES.md):pg:backups:schedule's "not yet provisioned" error now names theDATABASEargument (orDATABASE_URLwhen omitted) instead of the resolved add-on's resource name, since the SDK'sNotFoundErrorsurfaces before the add-on name is known. The scheduling spinner still shows that add-on name whendatabase.describereturnsname; ifnameis absent it falls back to theDATABASEargument, thenDATABASE_URL.pg:backups:unschedule's "no daily backups found" error now names theDATABASEargument (or the auto-selected schedule name) instead of the resolved add-on's resource name.Type of Change
Breaking Changes (major semver update)
!after your change type to denote a change that breaks current behaviorFeature Additions (minor semver update)
Patch Updates (patch semver update)
Testing
Notes:
Requires an app with a Heroku Postgres legacy-tier database attached.
Setup:
npm i && npm run buildheroku logout && HEROKU_NETRC_WRITE=true ./bin/run loginSteps:
Scheduling automatic daily backups of <name> at 4:00 UTC... done.Scheduling automatic daily backups of <name> at 14:00 America/Los_Angeles... done. If<database>only has one attachment, this replaces the step 1 schedule instead of adding a second one.DATABASE_URL: daily at 14:00 America/Los_Angelesline and no4:00 UTCline. With a different attachment, both new schedules are listed. Other schedules already on the app are listed too.Unscheduling <schedule-name> daily backups... done.Unscheduling <name> daily backups... done. If more than one schedule is still on the app, the command errors and lists them instead. If none remain, it errors withNo schedules on <app>.No backup schedules found on <app>. Otherwise the remaining schedules are listed.Cleanup:
./bin/run logoutScreenshots (if applicable)
Related Issues
GUS work item: W-23386457