Hashed Storage: `AfterRenameService` was not renaming Pages or Uploads folder on legacy storage
During a previous refactor on project model, code related to the hashed storage was extracted into AfterRenameService, see 4b9c17f1.
The path_before
was changed from using previous_changes['path']
to
path_was
. They are not equivalent. path_was
exists reliably only
before persisting to the database. After database persistence is
confirmed, the value is moved to previous_changes[:attribute_name]
.
Because the repository/attachments rename or storage upgrade happens after it was persisted to the database, we were in fact not informing the right parameters (and therefore not doing what it was supposed to).
See: https://gitlab.com/gitlab-org/gitlab-ce/commit/4b9c17f196bab6075563f62d01f9db65c1a0515c#d77bcf2e32d9b5be36cec41f45385e3a96ae2202_1644_1643 and: https://gitlab.com/gitlab-org/gitlab-ce/commit/4b9c17f196bab6075563f62d01f9db65c1a0515c#10cc50b56c2339f43124a7283a1f51f5e3baf56e_0_30
this could be related to https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6022