Avoid creating too long system note with added commit references
Problem
I've just gain the prod db access and here is what I've found.
We have this commit note.
added 10824 commits
and references all 10824 commits in that system note which slows it down significantly.
I'm not too sure why we have to list all of those commits in the first place. That may have been caused by a rebase. Should we think about adding a limit there to avoid creating more issues like this in the future? Also, I'm not sure if we should continue to improve performance for that MR given that this is an unusual note.
🤔
As mentioned in #355838 (comment 1039880794), !73756 (merged) has a problematic note that references over 10k commits which fails to load.
We need to understand if that was an edge case we haven't considered and decide what we are going to do to avoid creating more system notes like that.
We may need some guidance from UX team if we change how we treat these system notes.
Solution
Limit the number of commits in the system note to the most recent 10 commits, linking to a compare page with the truncated/hidden commits:
User added 30 commits 1 month ago
Related to #355838 (closed)