The source project of this merge request has been removed.
Fix loading of events
What does this MR do?
The EventCollection can load events from the database, for example for the activity log or the RSS feed. It can take an ActiveRecord::Relation of projects to restrict loading of events to those projects. If this Relation contained a limit clause, the query returned wrong results.
This change removes any limit clause from the project Relation before using it to filter events.
Fixes #51596 (moved) Fixes #64346 (moved)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry for user-facing changes, or community contribution. Check the link for other scenarios. -
Documentation created/updated or follow-up review issue created -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
The same query (without the limit) is already run when rendering https://gitlab.com/dashboard/activity, so we can be reasonably sure this does not affect performance.