Revert ReleasesResolver and add Ci Catalog VersionsResolver
What does this MR do and why?
In #413129 (closed), it was discovered that a recent change to the ReleasesResolver
in !120811 (merged) caused the /releases
page to break when a project does not have releases.
This is because !120811 (merged) updated the resolver to use BatchLoader
to support multiple projects as input, and only projects that have releases are mapped to a non-null value. This resulted in the GraphQL response to return a null
value instead of the expected empty array []
.
Per #413129 (comment 1413537463):
BEFORE !120811 (merged) result
{
"data" : {
"project" : {
"name" : "Pipeline Tests",
"releases" : {
"nodes" : []
}
}
}
}
AFTER !120811 (merged) result
{
"data" : {
"project" : {
"name" : "Pipeline Tests",
"releases" : null
}
}
}
It was decided to move the ReleasesResolver
code into a new VersionsResolver
and revert the changes to ReleasesResolver
.
This both fixes the regression that was introduced by !120811 (merged) and continues to support the versions
field of CiCatalogResource
.
Screenshots
BEFORE | AFTER |
---|---|
How to set up and validate locally
- Create or find a project that does not have any Releases.
- Before checking out this branch, go to
http://gdk.test:3000/-/graphql-explorer
and observe that the following query produces anull
output. (Adjust the project'sfullPath
as necessary).
query allReleases {
project(fullPath: "group-a/project-1") {
id
releases {
nodes {
id
name
}
}
}
}
-
Also observe that when you go to the project's Releases page on the UI, the page does not load.
-
Now checkout this branch and re-run the query. Observe that now the response returns an empty array as expected.
- And observe that the project's Releases page is populated as expected.
To validate that the CiCatalogResource.versions
field is still supported, please follow the steps outlined here. Also note that the response has been updated to match the behaviour of ReleasesResolver
so that it returns an empty Array []
rather than null
when a Catalog Resource does not have versions.
Specifically, it changed from:
{
"name": "Project Catalog Resource 1",
"versions": null
}
to
{
"name": "Project Catalog Resource 1",
"versions": {
"nodes": []
}
}
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.
Related to #413129 (closed)