Skip to content

Draft: Add Ci::Builds.playable scope

drew stachon requested to merge ci-builds-playable-scope into master

What does this MR do and why?

This MR is a proof of concept for turning the Ruby-heavy Ci::Build#playable? method into a scope. Original discussion in !136816 (comment 1789493923)

Rather than needing to query all Builds in a relation, instantiate them, and then run the methods, we can run playable.any? to offload all the logic of returning a boolean into a much more efficient SQL query.

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

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by drew stachon

Merge request reports