Group label events in deterministic order

What does this MR do and why?

Add ordering by ID when querying resource label events so that they are returned in deterministic order. This prevents situations where the order of labels in a system note changes.

Example flaky failure:

  1) Issuable::DiscussionsListService fetching notes for epics behaves like listing issuable discussions when user can read issuable with paginated results returns next page notes
     Failure/Error:
       expect(discussions.first.notes.map(&:note)).to match_array(
         ["added #{label.to_reference} #{label_2.to_reference} labels"]
       )
       expected collection contained:  ["added ~99 ~100 labels"]
       actual collection contained:    ["added ~100 ~99 labels"]
       the missing elements were:      ["added ~99 ~100 labels"]
       the extra elements were:        ["added ~100 ~99 labels"]

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.

Related to #446093 (closed)

Edited by Heinrich Lee Yu

Merge request reports

Loading