Container Virtual Registry: Technical debts

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

🔥 Overview

Due to the high implementation velocity that we want to achieve while building this feature, several aspects will be put aside and be returned to later (i.e. code duplication with maven, refactoring opportunities).

We are listing them in this issue to take note and followup.

Here is the list:

  • Make the ::VirtualRegistries::Packages::Maven models inherit from the parent classes created for ::VirtualRegistries::Container
  • Non-blocking ~database maintainer feedback from !199508 Do we really need to add group to the filter here: self.position = self.class.where(registry:, group:).maximum(:position).to_i + 1 . This is an instance method on RegistryUpstream. Maybe this can be ...where(registry:)...
  • Non-blocking ~database maintainer feedback from !199508 In Registry#max_per_group , in the early return check return if self.class.for_group(group).count < self.class::MAX_REGISTRY_COUNT -> change this to return if self.class.for_group(group).limit(self.class::MAX_REGISTRY_COUNT).count < self.class::MAX_REGISTRY_COUNT. (add (limit(self.class::MAX_REGISTRY_COUNT))
  • Remove file_md5 column from virtual_registries_container_cache_entries table
  • Extract common behavior from ::VirtualRegistries::Packages::Maven::Cache::Entry and ::VirtualRegistries::Container::Cache::Entry to a common ancestor class, ::VirtualRegistries::Cache::Entry
  • Move common methods from ee/app/models/virtual_registries/container/upstream.rb to ::VirtualRegistries::Upstream
  • Extract common code for event tracking in maven and container (!192689 (diffs))
Edited by Adie (she/her)