Skip to content

Fix Geo checksummable check failing when file is nil

Catalin Irimie requested to merge cat-fix-blob-file-exists-check into master

What does this MR do and why?

In specific cases, such as the LFS download flow, we would first create a model before updating it to contain a file as well, which means it's possible the model's file doesn't exist.

We have an after_commit hook that attempts to verify if a record's file is checksummable to run verification on, however this would have failed if the file was nil before this.

Fixes #352368 (closed)

How to set up and validate locally

  1. Attempt to import a public repository with LFS files. (example with links from a customer in an internal Slack thread)
  2. Notice LFS objects aren't imported, and if you look at the application.log: 2022-02-09T09:52:42.351Z: LFS file with oid *** could't be downloaded from https://***: undefined method exists?' for nil:NilClass`
  3. Checkout this branch, re-import the project and notice it's working

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Catalin Irimie

Merge request reports