Skip to content

Hide MRs in milestones when they're disabled

️ Moved from gitlab-foss!32031 (closed)

What does this MR do?

This hides all of the information about merge requests on milestone pages when the MR feature is disabled for a project. Use case: a project that's used only for keeping track of issues, with repository (and therefore merge requests) turned off: in this case information about merge requests on milestone pages is nothing but some extra clutter.

This change is currently only applied to project milestones, not group milestones; all of the code is there to also apply it to groups but I didn't see an obvious (bearing in mind that I'm not a Rails developer) way to check if any projects in the group have merge requests enabled without pulling every group, which has performance considerations. Since the "Merge Requests" menu item also appears in groups no matter what, I decided this was probably an OK tradeoff.

The diff is considerably easier to read if you ignore whitespace changes.

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Performance: See above for discussion about skipping the check for group milestones to avoid adding a SQL query. I don't think this will impact performance as it stands.

Edited by Wolfgang Faust

Merge request reports