Show Cobertura Coverage Report from a Child pipeline in a MR
Proposal
In http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/app/controllers/projects/merge_requests_controller.rb#L132-L132, we expose coverage path to the frontend using merge_request.has_coverage_reports?
, which in turn checks if the head pipeline has code coverage pipeline artifacts. http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/app/models/ci/pipeline.rb#L1072-L1074
This in turn is used to return the actual coverage report in http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/app/services/ci/generate_coverage_reports_service.rb#L15-L15.
So to support the reports from child pipeline, we need to
- Introduce
Pipeline#has_reports_in_self_and_descendants?
andPipeline#latest_report_builds_in_self_and_descendants
which accounts for reports in the descendant pipelines. - Generate coverage report pipeline artifact from pipeline and descendants in http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/app/services/ci/pipeline_artifacts/coverage_report_service.rb#L4-L4. using the inclusive methods added above.
Edited by Rutvik Shah