Pipeline schedules fail to load if the "owner" account gets deleted
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=424299) </details> <!--IssueSummary end--> <!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "type::bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary Pipeline schedules fail to load if the "owner" account gets deleted ### Steps to reproduce On GitLab.com, or on a self-managed instance with the `pipeline_schedules_vue` feature flag **enabled**. - Create a pipeline schedule in a project as a regular user. - Load the pipeline schedules page. Observe we can see the schedules. - Delete the User account. - Load the pipeline schedules page. Observe the error `There was a problem fetching pipeline schedules`. - Also look at the graphql query made when loading the pipeline schedules. We should see the following: ```json "errors": [ { "message": "Cannot return null for non-nullable field PipelineSchedule.owner" } ] ``` ### What is the current *bug* behavior? Unable to view pipeline schedules when the account of an owner of a pipeline is deleted. ### What is the expected *correct* behavior? Pipeline schedules should be viewable without errors. ### Relevant logs and/or screenshots <details><summary>With `pipeline_schedules_vue` feature flag enabled on 16.1</summary> ![image](/uploads/b605711e163f3d2cf44cd6c403ca7591/image.png) </details> <details><summary>With `pipeline_schedules_vue` feature flag disabled on 16.1</summary> ![image](/uploads/14f5a89aa15e987db8512a863e717e9f/image.png) </details> ### Output of checks This bug happens on GitLab.com -- Feature flag has been enabled on SaaS: https://gitlab.com/gitlab-org/gitlab/-/issues/375139+ ### Workaround Use [the Pipeline schedules API](https://docs.gitlab.com/ee/api/pipeline_schedules.html#get-all-pipeline-schedules) to find the schedules that have a `null` owner, and [delete the schedules using the API](https://docs.gitlab.com/ee/api/pipeline_schedules.html#delete-a-pipeline-schedule) or [take ownership of the schedule](https://docs.gitlab.com/ee/api/pipeline_schedules.html#take-ownership-of-a-pipeline-schedule). ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem. -->
issue