Update mirror status command
We are in the process of moving the mirror status logic to release tools in gitlab-com/gl-infra/delivery#19333 (closed). We have already moved the logic to release tools in gitlab-org/release-tools!2472 (merged) and created a CI job to check the status and post it to slack in gitlab-org/release-tools!2479 (merged).
This MR updates the /chatops run mirror status
command to trigger a pipeline on release-tools to fetch the mirror status rather than using the deprecated logic within chatops.
A separate MR will follow this one to remove all of the deprecated mirror status logic.
Local testing
I ran the command locally, which triggered a successful pipeline on release tools: https://ops.gitlab.net/gitlab-org/release/tools/-/pipelines/2089238. The mirror status was posted in #release_tools_tests
:
~/workspace/gitlab-com/chatops (delivery19333-mirror-status-release-tools ✗) CHAT_CHANNEL=<release_tools_test_id> GITLAB_OPS_TOKEN=<pat_token> RELEASE_TRIGGER_TOKEN=<trigger_token> CHAT_INPUT='status' bundle exec ./bin/chatops mirror
2023-07-06 09:16:40.047191 I [{:user=>nil}] Chatops -- Command to be executed -- {:name=>"mirror", :chat_input=>"status", :split_chat_input=>["status"]}
2023-07-06 09:16:40.047304 I [{:user=>nil}] Chatops::Commands::Mirror -- Calling release tools trigger API -- {:params=>{:CHAT_CHANNEL=>"REDACTED", :MIRROR_STATUS=>"true"}}
2023-07-06 09:16:41.702661 D [{:user=>nil}] Chatops::Gitlab::Client -- [HTTParty] [2023-07-06 09:16:41 -0600] 201 "POST https://ops.gitlab.net/api/v4/projects/gitlab-org%2Frelease%2Ftools/trigger/pipeline" 1075
#<Gitlab::ObjectifiedHash:0x00000001130b5d10>