Skip to content

Enqueue NPM metadata cache worker after async upload

What does this MR do and why?

In Add worker to upload npm packages async (!146493 - merged), we changed how we process publishing packages to the npm Registry from sync to async. Meaning, we now process the upload in a background job.

The change is behind a feature flag. After a partial rollout on gitlab.com, we received a couple of comments from customers that they are facing issues in correctly getting the recent published packages' tags/versions.

It turned out that we forgot to handle the metadata cache generation correctly in case of async upload. We generate the metadata cache in a background job after publishing the package. However, in the context of the async upload, the package isn't really published yet. It will be published once we mark its status as default in Packages::Npm::ProcessPackageFileService.

That means we need to enqueue the metadata cache generation worker after we mark the package's status as default in the async upload.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #433009 (closed)

Edited by Moaz Khalifa

Merge request reports