Make logs from the migrations Job visible to RMs

Summary

Our current setup with running migrations in Ansible shows the logs from the gitlab-rake db:migrate command directly in the CI jobs. This is useful because we can see quickly what migrations ran, and in the case of errors, we can readily inspect the error logs.

When we move migrations to Kubernetes, we would like to retain this behavior. Specifically, we want to ensure that logs from the migrations job are easily accessible.

This point was brought up by @dat.tang.gitlab and @rpereira2 during the 2025-04-16 Delivery group demo meeting. (notes here, internal only).

Approaches

We talked about some ideas.

The first one was to print the logs from the Kubernetes pod using kubectl logs immediately after the Helm command had succeeded. This would emulate the behavior of Ansible, because Ansible also prints logs from the db:migrate Rake task after the task is complete (as opposed to during the task's execution)

As a short-term fix, we should also consider printing a link to the logs on each environment within the ./k-ctl upgrade command. This will help RMs quickly go to the page where logs are being uploaded.

Acceptance criteria

  • Short-term: Print a link to the page where logs from the migrations Job can be seen
  • Logs from the migrations Job should be easily accessible to RMs
Edited by Siddharth Kannan