Skip to content

refactor: use @heroku/sdk for maintenance commands#3713

Merged
eablack merged 1 commit into
feat/heroku-sdk-integrationfrom
eb/refactor/sdk-maintenance-commands
May 15, 2026
Merged

refactor: use @heroku/sdk for maintenance commands#3713
eablack merged 1 commit into
feat/heroku-sdk-integrationfrom
eb/refactor/sdk-maintenance-commands

Conversation

@eablack
Copy link
Copy Markdown
Contributor

@eablack eablack commented May 15, 2026

Summary

  • Replace direct Platform API calls in maintenance:on, maintenance:off, and maintenance (status) with @heroku/sdk equivalents: enableMaintenanceMode, disableMaintenanceMode, and createPlatformClient().app.info().
  • Bump @heroku/sdk to the commit that ships a prepare script so the SDK's dist/ folder is built when installed from GitHub.
  • Remove a setTimeout/setInterval stub in test/helpers/init.mjs that forced ky's internal timeout to fire immediately and triggered fetch-retry loops against nock.

Type of Change

  • refactor: Refactoring existing code without changing behavior

Testing

Notes: SDK calls hit the same endpoints with the same payloads as before, so existing nock fixtures still apply. Tests now reply with a JSON body ({maintenance: true|false}) since the SDK dispatcher calls response.json().

Steps:

  1. npm test — unit suite passes.
  2. Manually verify via ./bin/run.js against a test app: maintenance:on, maintenance, maintenance:off.

Related Issues

GUS work item: W-22265433

Replace direct Platform API calls in maintenance:on, maintenance:off,
and maintenance status commands with @heroku/sdk equivalents
(enableMaintenanceMode, disableMaintenanceMode, createPlatformClient).

Bumps @heroku/sdk to the commit that ships a prepare script so the
SDK's dist/ folder is built at install time. Removes a setTimeout
stub in test/helpers/init.mjs that interfered with ky's internal
timeout handling and triggered fetch retries against nock.
@eablack eablack requested a review from a team as a code owner May 15, 2026 22:32
Copy link
Copy Markdown
Contributor

@tlowrimore-heroku tlowrimore-heroku left a comment

Choose a reason for hiding this comment

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

🎉 LGTM! 🎉

@eablack eablack merged commit 2cdc0fa into feat/heroku-sdk-integration May 15, 2026
5 of 18 checks passed
@eablack eablack deleted the eb/refactor/sdk-maintenance-commands branch May 15, 2026 22:43
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