Support touch_last_downloaded_at in Packages::Npm::MetadataCache
What does this MR do and why?
Part of #393655 (closed)
We'd like to support #touch_last_downloaded_at
in Packages::Npm::MetadataCache
.
For that this MR proposes to extrcat the code of #touch_last_downloaded_at
from Packages::Package
model (including EE
part) into its own concern
to re-use it in multiple places.
- Adds
Packages::Downloadable
concern +EE
part of it. - Removes
#touch_last_downloaded_at
fromPackages::Package
. - Changes
Packages::Package
andPackages::Npm::MetadataCache
to usePackages::Downloadable
concern. - Adds/removes related tests.
Screenshots or screen recordings
No.
How to set up and validate locally
Run the following commands in rails console:
-
Create and verify a new package
def fixture_file_upload(*args, **kwargs) Rack::Test::UploadedFile.new(*args, **kwargs) end p = FactoryBot.create(:npm_package) p.touch_last_downloaded_at
-
Create and verify a new metadata cache
c = FactoryBot.create(:npm_metadata_cache) c.touch_last_downloaded_at
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