Remove #find_object override in CI job mutations
What does this MR do and why?
Remove #find_object override in CI job mutations
This override does not gracefully handle a RecordNotFound exception, which causes a 500 response when a non-existing ID is provided.
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Response before:
{
"errors": [
{
"name": "ServerError",
"response": {},
"statusCode": 500,
"result": {
"errors": [
{
"message": "Internal server error: Couldn't find Ci::Build with 'id'=-1 [WHERE \"p_ci_builds\".\"type\" = $1]",
"raisedAt": "..."
}
]
},
"message": "Response not successful: Received status code 500",
"stack": "ServerError: Response not successful: Received status code 500\n at throwServerError ..."
}
]
}
Response after:
{
"errors": [
{
"graphQLErrors": [
{
"message": "The resource that you are attempting to access does not exist or you don't have permission to perform this action",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"jobRetry"
]
}
],
"clientErrors": [],
"networkError": null,
"message": "The resource that you are attempting to access does not exist or you don't have permission to perform this action",
"stack": "Error\n at new ApolloError2 ..."
}
]
}
How to set up and validate locally
Visit https://gdk.test:3443/-/graphql-explorer and execute the following query:
mutation jobRetry {
jobRetry(input: {id:"gid://gitlab/Ci::Build/-1"}) {
errors
}
}
Edited by Tiger Watson