Support report from child pipeline for MR metrics report
#362876 (closed).
Implement support for report for child pipeline for MR metrics report, as part ofProposal
In http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/ee/app/serializers/ee/merge_request_widget_entity.rb#L52-L54, we expose test reports path to the frontend using merge_request.has_metric_reports?
, which in turn checks if the head pipeline has metric reports in latest_report_builds
. http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/app/models/ci/pipeline.rb#L1068-L1070
This in turn is used to return the actual metric report in http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/ee/app/services/ci/compare_metrics_reports_service.rb#L14-L14, http://gitlab.com/gitlab-org/gitlab/blob/dde3a70e1d9c21f0f5698d16f3f0f239b0836a4a/ee/app/models/ee/ci/pipeline.rb#L129-L135.
So to support the reports from child pipeline, we need to
- Use
Pipeline#has_reports_in_self_and_descendants?
introduced in #363301 (closed) to expose the metric reports path - Use
Pipeline#latest_report_builds_in_self_and_descendants
introduced in #363301 (closed) to fetch the metric terraform reports from the pipeline and its descendants.