Skip to content

Add a Rake task to fix incorrectly-recorded external diffs

What does this MR do?

External merge request diffs were introduced in January 2019, in this commit: f9e41d0d

When rolling it out for GitLab.com, in , we discovered an issue with some diffs being uploaded to object storage (expected), but recorded as being on the filesystem (unexpected): #216216 (closed) . This was fixed in %13.0 with !31005 (merged)

This merge request, targeted for v13.2, introduces a rake task that will update the record to point the affected diffs at object storage again.

For simplicity, it makes the assumption that the external diffs feature has never been configured to use local storage. This is true for GitLab.com, and should be true for most-to-all of our, users. The documentation strongly recommends object storage over file storage for diffs.

If a diff might be on disk or in object storage, the only way to find out which is true is to check object storage for every file, which sounds too expensive. The simplifying assumption allows us to skip that, but if an installation has ever had file storage enabled, we will do the wrong thing for at least some diffs (marking them as in-object-storage rather than on-disk). This is why it is a rake task, and not a background migration.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #216216 (closed)

Edited by Nick Thomas

Merge request reports