Reduce noisy code quality diff errors on MR page
What does this MR do?
For #334116 (closed)
This MR makes these noisy, unnecessary error messages on the merge request page go away:
Specifically, this MR :
- on the backend, passes the merge request's
head_pipeline
into the call thatcodequality_mr_diff_reports
makes toreports_response
so that we get a204
status while the pipeline is running (instead of a400
) - on the frontend, makes the polling process:
- react to
400
responses by retrying a few times with a slight delay, because this status might show up temporarily when the merge request and its pipeline are in a transitional state - silently stop polling if we get six
400
status responses in a row (we can assume that there will be no reports in this case)
- react to
... in order to provide data to show code quality issues inline in merge request diffs without unnecessary error messages.
And this MR changes the wording of the fallback error message slightly to An unexpected error occurred while loading the code quality diff
because non-400
responses should be "unexpected" now, the bulk of the messages that were showing up were caused by non-problematic 400
status responses, and this helps us differentiate between the case we're handling silently here and any errors we'll potentially encounter in the future.
Screenshots (strongly suggested)
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Edited by Lucas Charles