superfly / flyctl

Command line tools for fly.io services
https://fly.io
Apache License 2.0
1.37k stars 226 forks source link

Check for host issues affecting app #3605

Closed aschiavo closed 1 month ago

aschiavo commented 1 month ago

Change Summary

What and Why:

When running a command where the appName is available, a preparer triggers a RunFinalizer background task to pull the app's associated hosts issues, if any. The why is to present users as soon as possible with host issues affecting their apps.

How: By triggering an async task as RunFinalizer, that will be executed after the main context completes.

Also performed some refactoring to move queryStatuspageIncidents to the incidents module instead of in command.go, and also convert from Run to RunFinalizer so it's executed at the end of the command to avoid interleaving the warning message with the command output.

Depends on https://github.com/superfly/fly-go/pull/67 to pass the checks