Container image virtual registry: cache entry service layer
🗒️ Goal
Create the necessary services to handle VirtualRegistries::Containers::Image::Cache::Entry objects.
CreateOrUpdateService
This service is called when we need to create a new cache entry. Given the high chances to run things in parallel (eg. having multiple web requests for the exact same file/object), we could run into race condition issues. Thus, the service should be ready to find an existing entry and simply update it.
To cope with this requirement, we have a .create_or_update_by! function in the cache entry (https://gitlab.com/gitlab-org/gitlab/-/blob/ea6256f802369b25c57e32fe9940ddcb35ab74f1/ee/app/models/virtual_registries/packages/maven/cache/entry.rb#L67).
The service should correctly handle errors and user permissions. It should mirror this service.
🔮 Other considerations
Take this opportunity to centralize the logic, functions or aspects with the Maven virtual registry objects.
🛠️ Implementation plan
- Container image virtual registry: database models (#548783 - closed) • Adie (she/her), Radamanthus Batnag • 18.5 • Needs attention
-
Container image virtual registry: cache entry s... (#549103 - closed) • Radamanthus Batnag • 18.5 • On track
👈 - Container image virtual registry: upstream serv... (#549104 - closed) • Adie (she/her) • 18.4
- Container image virtual registry: handle file r... (#549134 - closed) • Adie (she/her) • 18.6
- Container image virtual registry: manage APIs (... (#548794 - closed) • Adie (she/her) • 18.5 • On track
- Container image virtual registry: push/pull end... (#549131) • Radamanthus Batnag • 18.8 • On track
- Container image virtual registry: performance r... (#549136) • Unassigned • Backlog
- Container image virtual registry: documentation... (#549138 - closed) • Adie (she/her) • 18.6
- Container image virtual registry: additional fe... (#549470) • Unassigned • Backlog