Backend/Frontend: Add new previousStagesJobs field to combine with needs field.

Summary

Currently, the builds page (See example here) and the show pipelines page (See example here) take an extraordinarily long time to load (between 9-13sec) when there is a significant amount of data that is needing to be shown in the pipeline. This makes it extremely difficult to work with and review from a user perspective when attempting to pinpoint a problem that needs attention quickly.

Proposal

On the backend, create new previousStageJobs which returns all the jobs of a previous stage. On the frontend, this will be combined with needs field to replace previousStageJobsOrNeeds field.

Additional details

Some relevant technical details, if applicable, such as:

  • Does this need a feature flag?
  • Is there an example response showing the data structure that should be returned (new endpoints only)?
  • What permissions should be used?
  • Is this EE or CE?
    • EE
    • CE
  • Additional comments:

Implementation Table

Group Issue Link
backend Backend: Fix N+1 in previousStageJobs (#424255 - closed)
backend 👈 You are here
backend Backend: Fix N+1 in previousStageJobsAndNeeds (#422079 - closed)
backend Backend: Remove GraphQL field - previousStageJo... (#424417)

Links/References

Edited by Mark Nuzzo