Change JSON key dist_tags to dist-tags in npm metadata cache
What does this MR do and why?
Part of #393655 (closed)
Align JSON key dist-tags
in npm metadata cache with origin package metadata:
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-metadata-format
to avoid any confusion between dist_tags
and dist-tags
.
Screenshots or screen recordings
No.
How to set up and validate locally
All steps need to be executed in rails console
-
Create a new npm package:
def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end package = FactoryBot.create(:npm_package, project: Project.first)
-
Execute the service to create a new entity of
Packages::Npm::MetadataCache
:Packages::Npm::CreateMetadataCacheService.new(package.project, package.name).execute
-
Verify that the metadata JSON from a new entity of
Packages::Npm::MetadataCache
containsdist-tags
key on the top level:metadata_cache = Packages::Npm::MetadataCache.last Gitlab::Json.parse(metadata_cache.file.read)
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.
Related to #393655 (closed)
Edited by Dzmitry (Dima) Meshcharakou