Improve UI rollback check command
Current output of the `/chatops run rollback check <environment>` looks like this: ![Screen_Shot_2021-11-01_at_10.01.41](/uploads/f872b828351396574669b5773f436920/Screen_Shot_2021-11-01_at_10.01.41.png) There are multiple improvement areas: 1. The message indicates the rollback is unsafe, but the reason for it is unclear. By taking a look at the output, I had assumed it was unsafe due to the migrations, but it was unsafe because there was an ongoing deployment to `gprd`. If a rollback is deemed unsafe let's highlight the reason. 1. Let's considered removing the regular migrations section. Regular migrations don't prevent rollbacks, as such they don't add any value to this context. This doesn't apply for post-deployment migrations, amount and specific details should be displayed for those. 1. Between the SHA's (`New`, `Current`, `Previous`) and the packages, the output shows a lot of information. Additionally showing the package and the coordinated pipeline, as in the [proposed solution](https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/1699#proposed-solution), could make this output even more verbose. Perhaps we should consider a more succinct version. ### Proposal Let's make the `rollback check` command succinct by applying the above suggestions. Final output: | When a deployment is in progress | With post-migrations | When a deployment is in progress and there are post-migrations | | ------ | ------ | ------ | | ![Screen_Shot_2021-11-02_at_11.44.41](/uploads/363451ee70404763962e8cb9107c14b8/Screen_Shot_2021-11-02_at_11.44.41.png) | ![Screen_Shot_2021-11-02_at_11.46.46](/uploads/ecf2fb4268ef79d3faec95a6f60e97d9/Screen_Shot_2021-11-02_at_11.46.46.png) | ![Screen_Shot_2021-11-02_at_11.41.57](/uploads/1f58f81989a817f8f11013b37f91952c/Screen_Shot_2021-11-02_at_11.41.57.png) | | [Link to Slack editor](https://app.slack.com/block-kit-builder/T02592416#%7B%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22:red_circle:%20%20Rollback%20unavailable%20for%20gprd:%20Deployment%20in%20progress%22,%22emoji%22:true%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*New*:%20%60%3Cwww.google.com%7C14.4.202110120620-3b3dce4acc8.6d8cea69481%3E%60%20%3Cwww.google.com%7C(Compare%20to%20current)%3E%20%5Cn*Current*:%20%60%3Cwww.google.com%7C14.4.202110120320-f21f76b8044.6bcfd3ba1f3%3E%60%20%3Cwww.google.com%7C(Compare%20to%20Previous)%3E%5Cn*Previous*:%20%60%3Cwww.google.com%7C14.4.202110112020-309f6cd0cf2.b460363d78c%3E%60%22%7D%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22:book:%20%3Chttps://gitlab.com/gitlab-org/release/docs/-/blob/master/runbooks/rollback-a-deployment.md%7CView%20runbook%3E%22%7D%5D%7D%5D%7D) | [Link to Slack Editor](https://app.slack.com/block-kit-builder/T02592416#%7B%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22:red_circle:%20%20Rollback%20unavailable%20for%20gprd:%20Post-deployment%20migrations%20included%22,%22emoji%22:true%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Current*:%20%60%3Cwww.google.com%7C14.4.202110120320-f21f76b8044.6bcfd3ba1f3%3E%60%20%3Cwww.google.com%7C(Compare%20to%20Previous)%3E%5Cn*Previous*:%20%60%3Cwww.google.com%7C14.4.202110112020-309f6cd0cf2.b460363d78c%3E%60%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22%20*Post-deploy%20migrations:*%20%5Cn%20%20%20%20%20%20-%20%6020211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb%60%20%5Cn%20%20%20%20%20%20-%20%6020211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb%60%22%7D%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22:book:%20%3Chttps://gitlab.com/gitlab-org/release/docs/-/blob/master/runbooks/rollback-a-deployment.md%7CView%20runbook%3E%22%7D%5D%7D%5D%7D)| [Link to Slack editor](https://app.slack.com/block-kit-builder/T02592416#%7B%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22:red_circle:%20%20Rollback%20unavailable%20for%20gprd:%22,%22emoji%22:true%7D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22-%20A%20deployment%20is%20in%20progress%20%5Cn%20-%20Post-deployment%20migrations%20included%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*New*:%20%60%3Cwww.google.com%7C14.4.202110120620-3b3dce4acc8.6d8cea69481%3E%60%20%3Cwww.google.com%7C(Compare%20to%20current)%3E%20%5Cn*Current*:%20%60%3Cwww.google.com%7C14.4.202110120320-f21f76b8044.6bcfd3ba1f3%3E%60%20%3Cwww.google.com%7C(Compare%20to%20Previous)%3E%5Cn*Previous*:%20%60%3Cwww.google.com%7C14.4.202110112020-309f6cd0cf2.b460363d78c%3E%60%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22%20*Post-deploy%20migrations:*%20%5Cn%20%20%20%20%20%20-%20%6020211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb%60%20%5Cn%20%20%20%20%20%20-%20%6020211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb%60%22%7D%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22:book:%20%3Chttps://gitlab.com/gitlab-org/release/docs/-/blob/master/runbooks/rollback-a-deployment.md%7CView%20runbook%3E%22%7D%5D%7D%5D%7D) | Main differences with the current look: * The reason behind a rollback deemed unsafe is in a specific section. * `New`, `Current` and `Previous` reference to the package and not only to the SHA and they are links to the coordinated pipeline * `db/post_migrate/` was removed from the post-migrations path, as it's redundant. ### Implementation steps - [x] Remove the migrations https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1595 - [x] Remove `db/post_migrate` prefix https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2064 / https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1595 - [x] Consider running deployments on rollback check command - https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1596 - [x] Highlight the reason(s) that prevents the rollback - https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1599 - [ ] Include the [`New` deployment](https://gitlab.com/gitlab-com/gl-infra/delivery/uploads/1bb4fe810bdb165394ddc66e26ab9d52/Screen_Shot_2021-11-02_at_11.41.57.png) information if any. - This one should appear whenever there's a deployment in progress. - It should include a `Compare to current` link pointing to a compare link between `New` and `Current` - It should include a `Compare to previous` link pointing to a compare link between `New` and `Previous` (in case we want to rollback more than one version). - [ ] Include the environment affected, when a rollback is unavailable it should state `Rollback unavailable for gprd` instead of `Rollback unavailable` ### Development log * Rollback check command was moved to release-tools, as result the UI was updated https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2080#note_720105406 * **October 29th** - Merge request to remove the regular migration was submitted https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1595 * **November 1st** - Running deployment check was removed from https://gitlab.com/gitlab-com/chatops/-/merge_requests/261/diffs, an MR was opened to re-introduced this check https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1596 * **November 2nd** - It was noticed the `RollbackChecks` class doesn't have specs associated. MR opened to introduce them https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1598. We require those specs to extend the functionality. * **November 3rd** - MR to remove the migrations block was merged https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1595 - MR with specs for `RollbackChecks` was merged https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1598 * **November 4th** - Running deployment check MR was merged https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1596 * **November 5th** - An MR to highlight the reason why a rollback is not available was submitted https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1599 * **November 8th** - https://gitlab.com/gitlab-org/release-tools/-/merge_requests/1599 was merged
issue