Move detection of pending post migrations to use Thanos metrics
Follow-on from #2490 (closed)
Currently the check for any and how many pending post-deployment migrations comes from an Ansible play in deploy-tooling
that executes a Rake task that queries the DB. However, another play exists in deploy-tooling that performs the same query and creates a metric from export to Thanos that contains the number of pending migrations.
Ideally we should switch over the CI check for the number of pending migrations to simply query Thanos on the main stage, rather than executing the same Rake task.
Loosely the logic should be:
- Check if there pending post migrations on gprd (
{stage="main"} > 0
) - If there are, fetch the pending post migrations sent by deployer and proceed with the execution
- If there are not, the execution is skipped.