fix(pg): Restoring behavior for backup scheduling #2981
Merged
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.
Description
When migrating the
pb:backups:schedule
command, a refactor incorrectly removed the ability to specify timezones through IANA identifiers. The refactor done considered only valid the US timezone abbreviations, when previously they were only used to map them to their IANA equivalents.Here we restore that functionality and improve the regular expression used to match the scheduled time and zone format, only allowing values for hours between 0 and 23 (previously it would accept the values 24-29, too, which caused a 500 error on the backend).
Test procedure
yarn
andyarn build
.heroku addons:create heroku-postgresql:essential-0 -a <test-app>
.heroku pg:backups:schedule <addon-name> --at "03:00 America/New_York" -a <test-app>
, you should see a message that it will default to UTC because the timezone doesn't exist../bin/run pg:backups:schedule <addon-name> --at "03:00 America/New_York" -a <test-app>
, it should succeed without warnings.SOC2 Compliance
GUS Work Item