Skip the final store path for Maven checksum uploads
What does this MR do and why?
Maven clients upload a .sha1 and a .md5 file next to each package file. GitLab does not store these files: the upload endpoint returns early for them, because the checksums are already columns on the package file.
The authorize request for these files still asks Workhorse to upload to a final store path. That path adds an entry to the pending direct uploads list and tells Workhorse to keep the object. Only a stored file removes the entry, so for checksum files the entry and the uploaded object stay until the stale upload cleanup reaches them.
This MR authorizes .sha1 and .md5 files to a temporary path instead. No pending entry is added, and Workhorse deletes the object after the request. Clients see no change: these files were never stored.
The change is behind the maven_checksum_upload_skip_final_store_path feature flag (gitlab_com_derisk, disabled by default).
References
Screenshots or screen recordings
Not applicable: no UI change.
How to set up and validate locally
-
Enable direct upload for packages in
config/gitlab.yml(packages.object_store.direct_upload: true), with object storage enabled (for example, the GDK MinIO setup). -
In the Rails console, enable the feature flag:
Feature.enable(:maven_checksum_upload_skip_final_store_path) -
Note the current count:
ObjectStorage::PendingDirectUpload.count -
Deploy a Maven package to a project in the GDK, for example with
mvn deploy. -
Check the count again. It is the same as before the deploy. With the flag disabled, each
.sha1and.md5file adds one entry that stays. -
Check that the deploy succeeded and the package files are listed in Deploy > Package registry.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.