Enable ciCatalogResource endpoint to accept a fullpath argument
What does this MR do and why?
Currently ciCatalogResource
accepts GID
to query for resources by id. This MR enables the endpoint to also accept full_path
(project's full path) argument to query for resource.
This MR resolves #429100 (closed)
Screenshots or screen recordings
Query via GID (exisiting behaviour) Query via full_path (introduced by this MR) Query via full_path for a catalog resource where the project is not a catalog resource (introduced by this MR) Query without any arguments passed (introduced by this MR) Query with both arguments
- Checkout this branch and restart your server.
- Create a catalog resource e.g.:
Typeahead.Js
- Run the following queries from your local host
http://127.0.0.1:3000/-/graphql-explorer
Query via GID (exisiting behaviour)
query getCiCatalogResource($id: CiCatalogResourceID = "gid://gitlab/Ci::Catalog::Resource/1")
{
ciCatalogResource(id: $id) {
id
icon
name
description
openIssuesCount
openMergeRequestsCount
}
}
Query via full_path (introduced by this MR)
query getCiCatalogResource($full_path: ID = "twitter/Typeahead.Js")
{
ciCatalogResource(fullPath: $full_path) {
id
icon
name
description
openIssuesCount
openMergeRequestsCount
}
}
Query without any arguments passed (introduced by this MR)
query getCiCatalogResource
{
ciCatalogResource {
id
icon
name
description
openIssuesCount
openMergeRequestsCount
}
}
Query via full_path for a catalog resource where the project is not a catalog resource (introduced by this MR)
query getCiCatalogResource($full_path: ID = "kasia-group/kasia-pro")
{
ciCatalogResource(fullPath: $full_path) {
id
icon
name
description
openIssuesCount
openMergeRequestsCount
}
}
Query with both arguments should return an error.
query getCiCatalogResource($id: CiCatalogResourceID = "gid://gitlab/Ci::Catalog::Resource/1", $full_path: ID = "Typeahead.Js")
{
ciCatalogResource(id: $id, fullPath: $full_path) {
id
icon
name
description
openIssuesCount
openMergeRequestsCount
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.