Re-use queries in reference parsers
What does this MR do?
This MR changes the reference parsing pipeline to cache queried objects and re-use them on subsequent runs. Data is cached in the RequestStore
module so it's automatically flushed after a request.
Are there points in the code the reviewer needs to double check?
Mostly the style of things.
Why was this MR needed?
Certain references are processed multiple times. For example, for every system note we check if it's a cross reference by getting the issues, MRs and commits it references. When redacting data we may end up querying these very same objects. By caching this we can quite drastically reduce timings and SQL query counts.
What are the relevant issue numbers?
Screenshots (if relevant)
Staging timings (method calls):
Production timings (method calls):
Does this MR meet the acceptance criteria?
-
CHANGELOG entry addedFor stable release, release manager will add it -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together