Skip to content

Render base path error based on report status

What does this MR do?

For #327751 (closed), case 2️⃣

This MR changes the data source for a specific warning displayed by the code quality MR widget. When there is a code quality report artifact available for the head pipeline of an MR, but there is no artifact available for its base pipeline, we display "Failed to load codeclimate reports" in the widget body with a help icon next to it. Hovering over the help icon shows a popover that says "Base pipeline codequality artifact not found" with a link to the documentation that explains common causes for this problem (such as not running the code_quality job on the default branch).

We used to use mr.codeclimate.headPath and mr.codeclimate.basePath to download the artifacts and do the comparison on the frontend, but now that the comparison is done on the backend instead, we can use the status of that response to determine when to show this warning (when it is not_found).

This warning is the last bit of the frontend that still depended on mr.codeclimate.headPath and mr.codeclimate.basePath, so we can also remove them now.

If !67176 (merged) is merged first

  • Fix merge conflicts (actions.js)

Screenshots or Screencasts

There should be no visual changes, but here is the widget displaying the warning:

Screen_Shot_2021-08-03_at_17.21.51

How to setup and validate locally (strongly suggested)

  1. find/make/clone a project that has the code quality scan set up (I have a few test projects if you need one: here and here)
  2. find/create a branch that improves and/or degrades code quality (the test projects have some branches that do this already) and create an MR for the branch
  3. make sure a pipeline ran for the head commit of the MR's branch to generate a code quality artifact
  4. delete the pipeline that ran for the base commit of the branch, which also deletes the base pipeline code quality artifact
  5. the code quality MR widget should now show the warning

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by Miranda Fluharty

Merge request reports

Loading