Skip to content

Conversation

@k80bowman
Copy link
Contributor

@k80bowman k80bowman commented Aug 21, 2025

Adds support for SF Trust API to the heroku status command.

Details

  • The SF Trust API will only be called if the Heroku Status API call fails
  • The responses from the SF Trust API endpoints are formatted to fit the current structure of the command response
  • The command will error (with an error message already approved by CX) if calls to both the Heroku Status API and SF Trust API fail

There is a lot of logic in here for formatting the responses from the SF Trust API endpoints. The basic outline of the logic is as follows:

  • Retrieve data from the SF Trust API endpoints.
    • Heroku instances, active incidents, upcoming Heroku maintenances, and localizations.
  • Filter the array of active incidents by the array of Heroku instances to get an array of Heroku active incidents.
  • Filter the array of Heroku active incidents by a given list of service keys in order to separate them into apps incidents, data incidents, and tools incidents.
  • Format the data into a structure that matches the basic structure of the Heroku Status API response.

Testing

  • Checkout this branch and run yarn and yarn build
  • Run ./bin/run status to see responses from the Heroku Status API
  • Run TRUST_ONLY=true ./bin/run status to see responses from the SF Trust API
  • Run TRUST_ONLY=true SF_TRUST_STAGING=true ./bin/run status to see responses from the SF Trust staging API

W-19005486

@k80bowman k80bowman requested a review from a team as a code owner August 21, 2025 19:15
Copy link
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.

@k80bowman I left a comment on packages/cli/src/commands/status.ts. It appears there are some logical statements that are not expressed in a way that yields the desired outcome. Of course, I'm making an assumption about what the desired outcome is.

Copy link
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.

Nice! This looks great!

@k80bowman k80bowman merged commit 32eb409 into main Aug 26, 2025
8 checks passed
@k80bowman k80bowman deleted the k80/status-api-migration branch August 26, 2025 13:12
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