Skip to content

Remove runner <-> projects cross-joins where possible

What does this MR do and why?

This MR refactors most existing uses of Ci::Runner#projects to use the runner_projects association instead. It does not change uses of #projects that require loading actual instances of the Project model, since doing so without modifying our current database structure would require loading project IDs into memory, which could result in performance degradation for runners with hundreds of associated projects.

Those remaining uses will be updated after !72033 (closed) is merged, since it will duplicate knowledge of the project hierarchy into the CI database.

Issue

Related to #338659 (closed)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Avielle Wolfe

Merge request reports