Prior to this change, the migration touched the disk path. This has been
removed.
Further, I believe it also fixes a bug. It seems that GitLab Shell
checks if the root path exists, when the path is duplicated. For
example, if the shard is located at /home/git, it did check if
`/home/git/home/git` existed.
This old migration used Rugged to find a commit, while Gitaly is the
prefered way now. By migrating this to Gitaly, Gitaly is now a required
running component for this migration.
Part of https://gitlab.com/gitlab-org/gitaly/issues/1106
If the source encoding is not UTF-8 we need to encode the data as
`JSON.dump` may throw an error if the input can not be converted to
UTF-8. We only encode when necessary to reduce the overhead.
Fixesgitlab-org/gitlab-ce#25489
By passing commit data to this worker we remove the need for querying
the Git repository for every job. This in turn reduces the time spent
processing each job.
The migration included migrates jobs from the old format to the new
format. For this to work properly it requires downtime as otherwise
workers may start producing errors until they're using a newer version
of the worker code.