Skip to content

Use OS tempdir for artifact metadata

Jacob Vosmaer requested to merge jv-artifacts-temppath into master

When accepting a CI artifact upload, Workhorse generates an accompanying artifact metadata file. It then hands off this temporary metadata file to Rails. Prior to this commit, the temporary file would either be stored in a directory chosen by Rails, or in os.TempDir(). This commit changes the behavior to always use os.TempDir().

Controlling the tempdir is a performance optimization in the case of local file storage, because it allows the file to be finalized via a rename rather than a copy+delete. However, this optimization is pointless in the case where we use object storage because no matter what directory the temporary file is stored in, Rails must upload it to object storage anyway.

Note that this only applies to the artifact metadata file. The artifact archive itself is still benefiting from the "store in correct directory" optimization.

Changelog: other

Edited by Jacob Vosmaer

Merge request reports