Skip to content

Load labels because we’re going to need them

Paco Guzman requested to merge 18031-sidebar-labels-queries into master

What does this MR do?

Reduce the number of queries of the issue page in 3 queries to the labels table

Are there points in the code the reviewer needs to double check?

Just the rails documentation about the usage of the length method on collection associations

Why was this MR needed?

What are the relevant issue numbers?

#18031 (closed)

Screenshots (if relevant)

@yorickpeterse and @pcarranza I have another suggestion about this label part of the issuable sidebar template. And it's that to show the labels we first check if issuable.project.labels.any? and I think if what we render is the issuable.labels why don't we check for issuable.labels.any? at the very top? If there is no reason I can change the code for that too, maybe you see something I'm missing.

Merge request reports

Loading