Skip to content

Store full include path for CI components

Avielle Wolfe requested to merge 433515-store-component-include-path into master

What does this MR do and why?

The path field on the ci_components table currently holds the file path of the component within the component project repository. However, we aren't using that data. Instead, we need ComponentType to provide the include path for the component so we can display it on the catalog resource details page. This MR stores the include path instead of the file path, and updates the path field on ComponentType to be named include_path

Existing component records will still have the file path stored. We'll decide later whether it is necessary to update them with a data migration.

How to set up and validate locally

  1. Create a new version of any catalog resource
  2. Fetch any component created from the new version
  3. See that the path field contains a full include path for the component - HOST/PROJECT_FULL_PATH/COMPONENT_NAME@VERSION
  4. Make a GraphQL query for the component:
query getCiCatalogResourceDetails {
  ciCatalogResource(id: "RESOURCE-GID") {
    latestVersion {
      components {
        nodes {
          includePath
        }
      }
    }
  }
}
  1. See that you get the same include path in the return

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #433515 (closed)

Merge request reports