Skip to content

Conversation

@michaelmalave
Copy link
Contributor

@michaelmalave michaelmalave commented Jan 8, 2026

Summary

Migrated 7 pg:backups commands from src/oldCommands to src/commands and updated them to use ESM and the new UX helpers from @heroku/heroku-cli-util (hux). Replaced ux.log with ux.stdout, replaced lodash sorts with native JavaScript, and updated all imports for ESM compatibility. Fixed nls.ts to work with ESM by using readFileSync instead of JSON imports. Updated and fixed all unit tests to work with the new hux.table() output format.

Type of Change

  • fix: Bug fix or issue (patch semvar update)
  • feat: Introduces a new feature to the codebase (minor semvar update)
  • perf: Performance improvement
  • docs: Documentation only changes
  • tests: Adding missing tests or correcting existing tests
  • chore: Code cleanup tasks, dependency updates, or other changes

Verification

Test in a non-private space database. You can test with an essential-0 database.
To create one: heroku addons:create heroku-postgresql:essential-0 -app $APP_NAME

./bin/run pg:backups --app $APP_NAME
./bin/run pg:backups:info --app $APP_NAME
./bin/run pg:backups:restore --app $APP_NAME
./bin/run pg:backups:schedule --app $APP_NAME --at "9:00 PST"
./bin/run pg:backups:schedules --app $APP_NAME
./bin/run pg:backups:unschedule --app $APP_NAME
./bin/run pg:backups:url --app $APP_NAME

Additional Context

  • Replaced ux.log with ux.stdout per @oclif/core API
  • Replaced lodash.sortBy with native Array.prototype.sort()
  • Updated imports to use .js extensions for ESM compatibility
  • Updated test expectations to use removeAllWhitespace() helper for flexible table output matching (following pattern from releases/index.unit.test.ts)
  • Created ESM wrapper for backupsFactory in test/helpers/wrappers/backups-wrapper.ts to enable mocking in tests

Related Issue

Closes #W-19701068

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.

1 participant