Skip to content

Unified Backup: Update gitlab-backup-cli to have custom process title

Gabriel Mazetto requested to merge brodock/gitlab-backup-cli-process-title into master

What does this MR do and why?

When running gitlab-backup-cli, it does show up in ps, top and equivalent as ruby ./bin/gitlab-backup-cli some arguments here. We can customize what is displayed there by relying on Process.setproctitle : https://docs.ruby-lang.org/en//3.2/Process.html#method-c-setproctitle.

This allows for providing custom status of running operation.

This MR renames the process title to gitlab-backup-cli upon start, and uses the following template to provide custom status that can be used at any point in the execution: gitlab-backup-cli: whatever you want to write here.

It currently implements the custom status for when a backup is being performed or a restore.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

  1. Run: ./bin/gitlab-backup-cli backup all in one terminal
  2. While above is running, type ps c | grep gitlab-backup-cli in another terminal
  3. Expect some output similar to : 57175 s008 R+ 0:02.50 gitlab-backup-cli: backup all
  4. Optionally compare the above with a branch on master
  5. Run ./bin/gitlab-backup-cli restore BACKUP_ID_FROM_PREVIOUS_RUN in one terminal
  6. While above is runnig type ps c | grep gitlab-backup-cli in another terminal
  7. Expect some output similar to : 57175 s008 R+ 0:02.50 gitlab-backup-cli: restore all from BACKUP_ID_FROM_PREVIOUS_RUN
Edited by Gabriel Mazetto

Merge request reports

Loading