Pipeline page does not load Needs when using needs:optional=true and optional job is not triggered

Summary

Pipeline and Needs tabs of an individual Pipeline fails to load, when optional job is not triggered

Steps to reproduce

Create a Job in the CI pipeline using needs:optional:true, for example

.e2e: stage: test needs: - job: deploy artifacts: false - job: build-image artifacts: false optional: true

Set off a Pipeline that does not trigger the optional job

What is the current bug behavior?

On a Pipeline's page, both the Pipeline and Needs section of the page fail to load. The Needs page displays the error - There was an error parsing the data for this graph.

What is the expected correct behavior?

Show the Pipeline and Needs page with the correct trigger Jobs and dependencies

Relevant logs and/or screenshots

Capture

Edited by Ben Reschke