Skip to content

[15.0] Revert "Use OS tempdir for artifact metadata"

Stan Hu requested to merge sh-fix-issue-363701-15-0 into 15-0-stable-ee

What does this MR do and why?

NOTE: This is 15.0 backport of !90083 (merged). It is a straight revert of !87255 (merged).

The Rails multipart middleware only allows temporary uploads to be stored in certain paths. This middleware includes Ruby's Dir.tmpdir, but this method may not necessarily return /tmp. For example, if the permissions of /tmp do not contain the sticky bit, Ruby may return the current working directory. In addition, the problem will also show up if Workhorse and GitLab Rails have TMPDIR set differently.

!87255 (merged) changed the behavior so that artifact metadata is always stored in /tmp. When Ruby's Dir.tmpdir differs from that path, then artifact uploads will be rejected with a 400 Bad Request.

To avoid this issue, we revert the changes in !87255 (merged) and always take the recommended temp path from Rails.

Relates to #363701 (closed)

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 Stan Hu

Merge request reports

Loading