BatchedBackgroundMigrations API for ChatOps
What does this MR do and why?
This MR aims to add a new endpoint to list the batched background migrations in the system. To simply the endpoint, we will list only ten batched background migrations sorted by created_at
(DESC). Usually, we don't have more than 2/3 batched background migrations queued, so this will cover most of the expectations.
Query:
SELECT "batched_background_migrations".* FROM "batched_background_migrations" WHERE "batched_background_migrations"."gitlab_schema" = 'gitlab_main' ORDER BY "batched_background_migrations"."created_at" DESC LIMIT 10
Query plan: https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/11591/commands/41181
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #346357 (closed)