Skip to content

Backend: Construct component path from parts (stop fetching it from the database)

Problem

Currently, we save the full path ( gitlab.com/group/project/component-name@version ) to use a CI component in the path field of catalog_resource_components . We then pass that path to the frontend as the include_path field on the CiCatalogResourceComponent GraphQL type.

However, now that catalog resources can be moved, it's easy for the value in the database to get out of date. We need a solution that still works when a catalog resource project is moved.

Proposed solution

  1. Add an include_path method to the Component model that builds the path
  2. Update the GraphQL include_path field to use that method
  3. Update Ci::Catalog::Resources::Versions::CreateService to stop populating the path field
  4. Remove the path field from the database since it will no longer be used

The last dot point from the above list needs to be broken down into a few milestones. I have created child items on this issue to carry out this work.

Edited by Kasia Misirli