Catch the post-deploy prepare exception
One of the initial jobs of the post-deploy pipeline is the prepare
job, which executes the AutoDeploy::PostMigrations::Prepare
class. This class is in charge of allowing or preventing the execution of the post-deploy pipeline. The class fails when:
- There are no pending post-migrations, or
- The production checks fail
In both scenarios the exception raised is not taken care by the application, which doesn't make much sense:
- There's no action for release managers to take based on that exception. They just need to wait for a post-migration or for the incident/deployment to finish
- The exception sends a message to the
#f_upcoming_release
channel. For auto-deploy, we sent a message to slack notifying release managers about it, but we don't raise an error.
Let's handle the exception in the same way auto-deploy handles it: Send a message to slack, informing release managers about the problem.