Skip to content

BatchedBackgroundMigrations API for ChatOps

Omar Qunsul requested to merge 346357-background-migrations-api-endpoints into master

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.

Related to #346357 (closed)

Edited by Diogo Frazão

Merge request reports