Create coverage report on root ancestor pipeline when the whole hierarchy has completed
What does this MR do and why?
Create coverage report on root ancestor pipeline when the whole hierarchy has completed.
Without strategy: depend
between a parent and a child pipeline, there is no relationship between the statuses of the pipelines. So each pipeline completion will trigger its own CoverageReportWorker
. To ensure that the report is only generated after the last pipeline in the hierarchy has completed, we run CoverageReportService
on the root ancestor only when all the pipelines in the hierarchy have completed.
In addition, when a job failed and is retried, we need to create a new coverage report to account for the failed job. The pipeline's latest report will then be used for the MR widget.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
-
Clone project https://gitlab.com/alberts-gitlab/test-ruby-cobertura locally
-
Pull branch https://gitlab.com/alberts-gitlab/test-ruby-cobertura/-/tree/test-coverage-child-pipeline containing CI and test changes to generate coverage from child pipeline.
-
Create MR in GDK and wait for pipeline to succeed.
-
Verify that the
demo_child.rb
coverage generated in the child pipeline is not shown in the MR diff. -
Enable feature flag
ci_child_pipeline_coverage_reports
.Feature.enable(:ci_child_pipeline_coverage_reports)
-
Run a new pipeline on the branch and wait for it to succeed.
-
Verify that the
demo_child.rb
coverage is now shown in the MR diff.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #363301