Draft: Demonstrate what happens if a pipeline artifact file goes missing
When a pipeline artifact file goes missing, the DB record left behind becomes permanently invalid due to validation error File can't be blank. This MR demonstrates that. See that the tests passed.
Therefore, if:
- You see
File can't be blankin error logs related to pipeline artifacts - the
file*fields on that DB record are filled in
Then you can be pretty confident that the file does not exist on disk or in object storage.
Tangential notes
It's unusual that a Rails ActiveRecord Model validates the presence of a CarrierWave file attachment. If Geo is configured, then it will trigger this validation error for example when it attempts to update validation status, which prevents the update from succeeding.
Interestingly, the presence validation appears to do a hard check for whether the file exists. So if the file is stored on the filesystem (when file_store == 1) then it checks the filesystem. Presumably, if the file is stored in object storage (when file_store == 2) then it will make a HTTP call to the object storage, any time you call #valid? (or anything that calls #valid?, like #save) on a Ci::PipelineArtifact.