[15.0] Revert "Use OS tempdir for artifact metadata"
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.
-
I have evaluated the MR acceptance checklist for this MR.