Do not load a project when trigger a sync of maven metadata
What does this MR do and why?
Change the #sync_maven_metadata
method to use project_id
instead of project.id
to avoid loading a project.
Screenshots or screen recordings
No.
How to set up and validate locally
Execute the following code in the Rails console
# stub file upload
def fixture_file_upload(*args, **kwargs)
Rack::Test::UploadedFile.new(*args, **kwargs)
end
p = FactoryBot.create(:maven_package)
u = FactoryBot.create(:user)
p.sync_maven_metadata(u)
Check that the database query to load the package's project wasn't triggered.
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 #432435 (closed)
Edited by Dzmitry Meshcharakou