Skip to content

Make Catalog resource load by fullPath

What does this MR do and why?

Addressing issue.

We want Resource Resolver to use Ci::Catalog::Listing to search for a catalog resource as Ci::Catalog::Listing is our catalog resource search service and only returns published records. Before this MR, also draft catalog resources could be found and returned which is not the currently expected behaviour.

Screenshots or screen recordings

How to set up and validate locally

  1. Checkout this branch and via graphQL interface run below queries for published catalog resources:
    Data is returned via both id and full_path
query getCiCatalogResourceDetails {
  ciCatalogResource(id: "gid://gitlab/Ci::Catalog::Resource/12") {
    id
    webPath
    openIssuesCount
    openMergeRequestsCount
  }
}
query getCiCatalogResourceDetails {
  ciCatalogResource(fullPath: "root/component") {
    id
    webPath
    openIssuesCount
    openMergeRequestsCount
  }
}

Screenshot_2023-12-08_at_14.03.54 Screenshot_2023-12-08_at_14.04.25

  1. Run the same query for a draft component:
    Error is returned. Screenshot_2023-12-08_at_14.07.09 Screenshot_2023-12-08_at_14.07.59

  2. Checkout master and try to access the draft component
    On master it is still possible to retrive the draft component data. Screenshot_2023-12-08_at_15.09.52 Screenshot_2023-12-08_at_15.10.15

MR acceptance checklist

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

Edited by Kasia Misirli

Merge request reports