To fix this issue, we use a similar approach used by that older merge
request and preload the statuses dynamically using a
This dynamic preloading is necessary to filter out
GenericCommitStatus, which does not have a tags association.
Note that we the newly-introduced
scope in the
Ci::Stage model was just making extraneous queries that
weren't being used. This happend because
retried_statuses scopes, which actually
wiped out any included assocations for stages.
Relates to #329417 (closed)