Move Code Quality comparison logic to backend
Summary
The Code Quality MR widget current creates a diff on the frontend from two full code quality reports. In order to get to a place where we can implement Code Quality Notices on MR diffs in a performant way we should move that comparison logic to the backend and serve it cached. Once that is in place we can then create a PipelineArtifact of the diff.
Proposal
- Figure out what the base amount of information required for the MR Widget to exist is, and what format is required
- Move the report Diffing logic into a backend function
- Ensure the report diffs are cached for an MR
- Change the MR Widget to use the about PipelineArtifact instead of performing the diff each time and caching it
Improvements
This will enable the future steps in our iteration plan towards &4609. This should improve initial load times of the MR widget and also make the data more flexible.
Risks
This may introduce a delay initially between when the MR widget will be prepared to display as now it must wait on the background processing to finish before displaying. I'm not sure that this will be better or worse than it is right now though.