Skip to content

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:

image

Specifically, this MR :

  • on the backend, passes the merge request's head_pipeline into the call that codequality_mr_diff_reports makes to reports_response so that we get a 204 status while the pipeline is running (instead of a 400)
  • 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)

... 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

Availability and Testing

Edited by Lucas Charles

Merge request reports

Loading