Skip to content

Track file on body uploads for 8.30.X

David Fernandez requested to merge 10io-track-file-for-body-uploads into 8-30-stable

What does this MR do?

GitLab 12.10 received a change on the maven upload endpoint: it reads the UploadedFile set by the middleware multipart.rb.

However, for this object to be set, multipart.rb has to receive the JWT header (gitlab_workhorse_multipart_fields) from workhorse. This exists for multipart uploads but the maven upload request is a body upload. The JWT header support for body uploads has been added with !490 (merged) for workhorse 8.31.x but GitLab 12.10 is using workhorse 8.30.x 😿

This results in the Maven uploads not working at all 🤦 for GitLab 12.10.14. See the related issue: gitlab#229482 (closed).

This MR adds the JWT header support as added in !490 (merged) for 8.30.x. That is why this MR is targeting 8-30-stable.

Note that as stated here gitlab#229482 (comment 383661917), the Delivery team will not release any new non security related 12.10.x version. This MR should be merged and used in a new 8.30.x version only if a new version of GitLab 12.10 happens to be released.

Other considerations

  • This MR doesn't fully port !490 (merged) changes as we don't need to support the added JWT parameters (the ones ending with .gitlab-workhorse-upload).
  • This MR has several changes due to the move of body_uploader.go file to the upload package. See !539 (comment 386587718)
    • This move also requires some renames so that the formatter is happy and the build is 💚 :

      internal/upload/body_uploader.go:20:6: type name will be used as upload.UploadVerifier by other packages, and that stutters; consider calling this Verifier

      internal/upload/body_uploader.go:26:6: type name will be used as upload.UploadPreparer by other packages, and that stutters; consider calling this Preparer

Edited by David Fernandez

Merge request reports