Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pg): Restoring behavior for backup scheduling #2981

Merged
merged 3 commits into from
Aug 19, 2024

Conversation

sbosio
Copy link
Contributor

@sbosio sbosio commented Aug 16, 2024

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

  • Fetch the branch and run yarn and yarn build.
  • Create (or reuse) an essential-tier database on any test app you own, e.g. heroku addons:create heroku-postgresql:essential-0 -a <test-app>.
  • Run 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.
  • Run the same with the fixed version ./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

@sbosio sbosio requested a review from a team as a code owner August 16, 2024 20:56
Copy link
Contributor

@k80bowman k80bowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great, approving but I do have one request. Could you add a test or two for this? I want to make sure we don't mess this up again in the future. Thank you!

@sbosio sbosio merged commit bfac653 into main Aug 19, 2024
8 checks passed
@sbosio sbosio deleted the sbosio/fix-backups-schedule branch August 19, 2024 15:19
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