Create a service to generate npm packages metadata on the group and instance level
Description
For the context and discussion please see the thread. In two words: the npm metadata generation might take a lot of time for large group hierarchies. Example query link (internal).
We need to change the strategy of how we generate the metadata when we only know the root namespace or group. Instead of first doing a project lookup and checking for the required permissions, etc., we could filter out the packages by scoped name and than apply all additional logic: namespaces lookup, projects authorizations check and projects features check.
Simplified version:
Packages.where(name: name).each_batch do |scope|
records = scope.apply_project_filter_and_everything_else
end

Context

We earlier did these refactors:
- Refactor NPM metadata endpoint (!154577 - merged)
- Inline helper methods to the npm endpoint classes (!154919 - merged) (in progress)
Now that we have a clear separation between the helpers of each endpoint (project, group, instance), we can:
- move the existing
generate_metadata_service
helper to the project endpoint helpers - create a new
generate_metadata_service
helper that implements theeach_batch
optimization described above.- NOTE: This requires a modification to the existing index, see thread
Designs
- Show closed items
Is blocked by
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Dzmitry (Dima) Meshcharakou added grouppackage registry label
added grouppackage registry label
- 🤖 GitLab Bot 🤖 added devopspackage sectionci labels
added devopspackage sectionci labels
- Dzmitry (Dima) Meshcharakou added backend npm Registry labels
added backend npm Registry labels
- Dzmitry (Dima) Meshcharakou added Category:Package Registry label
added Category:Package Registry label
- Dzmitry (Dima) Meshcharakou changed milestone to %Backlog
changed milestone to %Backlog
- Dzmitry (Dima) Meshcharakou mentioned in issue #273427
mentioned in issue #273427
- Tim Rizzi marked this issue as blocked by #422372 (closed)
marked this issue as blocked by #422372 (closed)
added maintenanceperformance typemaintenance labels
- Dzmitry (Dima) Meshcharakou mentioned in issue #344107
mentioned in issue #344107
- Tim Rizzi mentioned in issue #464320 (closed)
mentioned in issue #464320 (closed)
- Tim Rizzi mentioned in issue #470077 (closed)
mentioned in issue #470077 (closed)
- Crystal Poole added Deliverable workflowrefinement labels
added Deliverable workflowrefinement labels
- Radamanthus Batnag mentioned in merge request !154919 (merged)
mentioned in merge request !154919 (merged)
- Radamanthus Batnag set weight to 2
set weight to 2
- Radamanthus Batnag changed the description
Compare with previous version changed the description
- Radamanthus Batnag assigned to @radbatnag
assigned to @radbatnag
- Radamanthus Batnag added workflowin dev label and removed workflowrefinement label
added workflowin dev label and removed workflowrefinement label
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#18917 (closed)
mentioned in issue gitlab-org/quality/triage-reports#18917 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19088 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19088 (closed)
- Maintainer
This issue is scheduled for completion in this milestone but is in an early development stage. Changing health status to 'at risk'.
Issue participants are welcome to override this by setting the health status to another value.
- 🤖 GitLab Bot 🤖 changed health status to at risk
changed health status to at risk
- Radamanthus Batnag mentioned in merge request !161869
mentioned in merge request !161869
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19200 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19200 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19286 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19286 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19370 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19370 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19541 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19541 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19656 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19656 (closed)
- Tim Rizzi added Package:P1 label
added Package:P1 label
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19668 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19668 (closed)
- Maintainer
Setting health status to
on track
as the milestone has just begun.Issue participants are welcome to override this by setting the health status to another value.
- 🤖 GitLab Bot 🤖 changed health status to on track
changed health status to on track
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19805 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19805 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19915 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19915 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#19997 (closed)
mentioned in issue gitlab-org/quality/triage-reports#19997 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#20131 (closed)
mentioned in issue gitlab-org/quality/triage-reports#20131 (closed)
- Maintainer
This issue is scheduled for completion in this milestone but is in an early development stage. Changing health status to 'at risk'.
Issue participants are welcome to override this by setting the health status to another value.
- 🤖 GitLab Bot 🤖 changed health status to at risk
changed health status to at risk
@radbatnag Are you working on this? I'm going to move to the backlog for now since there hasn't been much action.
- Maintainer
@trizzi I got stuck mentally on this
but I will resume the work now! - Tim Rizzi removed health status at risk
removed health status at risk
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#20444 (closed)
mentioned in issue gitlab-org/quality/triage-reports#20444 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#20581 (closed)
mentioned in issue gitlab-org/quality/triage-reports#20581 (closed)
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#20749 (closed)
mentioned in issue gitlab-org/quality/triage-reports#20749 (closed)
- Maintainer
Setting health status to
on track
as the milestone has just begun.Issue participants are welcome to override this by setting the health status to another value.
- 🤖 GitLab Bot 🤖 changed health status to on track
changed health status to on track
- 🤖 GitLab Bot 🤖 mentioned in issue gitlab-org/quality/triage-reports#20829 (closed)
mentioned in issue gitlab-org/quality/triage-reports#20829 (closed)
- Maintainer
Collapse replies @radbatnag Let me know if this issue can be completed in 17.87 or if it needs to be pushed back to 17.8.
- Maintainer
@trizzi During database review I received feedback on another query optimization that can be implemented. I integrated it into the MR and created a follow-up issue to apply it to other Package code. But it was discussed in this thread that this is better done before, and separate from this MR.
I'll get started on #505645 (closed) if that's OK, and unfortunately, yes, this issue will need to be pushed to 17.8.
1 Thanks @radbatnag, given it's almost the end of the milestone, I scheduled Package registry: Optimize query for selecting ... (#505645 - closed) for 17.8 and this issue for 17.9.
- Radamanthus Batnag added workflowin review label and removed workflowin dev label
added workflowin review label and removed workflowin dev label
- Maintainer
StatusThe MR for this is issue is paused, blocked by #505645 (closed) .
The MR for #505645 (closed) is in draft.
- Maintainer
UpdateThe MR for #505645 (closed), !175358 (merged), is in backend review.
Collapse replies @radbatnag Let me know if this issue can be completed in 17.9 or if it needs to be pushed back.
- Maintainer
@trizzi This is still blocked by !175358 (merged). !175358 (merged) can make it into 17.9 but this will need to be pushed back.
1
- Crystal Poole added rails label
added rails label
- Maintainer
Update!175358 (merged) has been merged
!161869 has been updated with the changes from !175358 (merged), and is back in backend review.