Skip to content

Do not display code coverage download button

Max Orefice requested to merge morefice/fix-download-code-coverage-button into master

Ref: #241502 (closed)

What does this MR do and why?

This MR fixes a bug where the download button associated to the project code coverage data where always displayed.

It also moves part of chart.haml to code_coverage.vue.

Screenshots or screen recordings

scenario before after
with no coverage data Screen_Shot_2022-07-21_at_13.15.45 button is displayed even though it would download an empty csv Screenshot-20220513231806-1371x404 button is not displayed
with coverage data Screen_Shot_2022-07-21_at_13.13.47 button is displayed, downloads the coverage data as a csv Screen_Shot_2022-07-21_at_13.13.47 no change, button is still displayed

Testing instructions

  1. git checkout master
  2. find/clone a project that reports a coverage percentage in its pipeline
  3. run a pipeline in the project, allow it to finish so that the coverage value can be parsed and stored
  4. in the project's sidebar, navigate to Analytics => Repository
  5. there should be a coverage graph along with a Download raw data (.csv) button
  6. find another project with no coverage data, and in the project's sidebar, navigate to Analytics => Repository
  7. the Download raw data (.csv) button is also displayed here, which is confusing because there is no data to download
  8. git checkout morefice/fix-download-code-coverage-button and refresh the analytics pages for each project
  9. for the project with coverage data, the Download raw data (.csv) button should still be there
  10. for the project with no coverage data, the Download raw data (.csv) button should not be there

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Miranda Fluharty

Merge request reports