2022-06-21 17:19:12 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Projects
|
|
|
|
module PipelineHelper
|
2022-07-23 23:45:48 +05:30
|
|
|
extend ::Ci::BuildsHelper
|
|
|
|
|
2022-08-13 15:12:31 +05:30
|
|
|
def js_pipeline_tabs_data(project, pipeline, _user)
|
2022-06-21 17:19:12 +05:30
|
|
|
{
|
2022-07-23 23:45:48 +05:30
|
|
|
failed_jobs_count: pipeline.failed_builds.count,
|
|
|
|
failed_jobs_summary: prepare_failed_jobs_summary_data(pipeline.failed_builds),
|
2023-06-20 00:43:36 +05:30
|
|
|
project_path: project.full_path,
|
2022-06-21 17:19:12 +05:30
|
|
|
graphql_resource_etag: graphql_etag_pipeline_path(pipeline),
|
|
|
|
metrics_path: namespace_project_ci_prometheus_metrics_histograms_path(namespace_id: project.namespace, project_id: project, format: :json),
|
2022-07-16 23:28:13 +05:30
|
|
|
pipeline_iid: pipeline.iid,
|
2023-03-04 22:38:38 +05:30
|
|
|
pipeline_path: pipeline_path(pipeline),
|
2022-07-23 23:45:48 +05:30
|
|
|
pipeline_project_path: project.full_path,
|
2022-08-27 11:52:29 +05:30
|
|
|
total_job_count: pipeline.total_size,
|
|
|
|
summary_endpoint: summary_project_pipeline_tests_path(project, pipeline, format: :json),
|
|
|
|
suite_endpoint: project_pipeline_test_path(project, pipeline, suite_name: 'suite', format: :json),
|
|
|
|
blob_path: project_blob_path(project, pipeline.sha),
|
|
|
|
has_test_report: pipeline.has_test_reports?,
|
|
|
|
empty_state_image_path: image_path('illustrations/empty-state/empty-test-cases-lg.svg'),
|
2023-01-13 00:05:48 +05:30
|
|
|
empty_dag_svg_path: image_path('illustrations/empty-state/empty-dag-md.svg'),
|
2022-08-27 11:52:29 +05:30
|
|
|
artifacts_expired_image_path: image_path('illustrations/pipeline.svg'),
|
|
|
|
tests_count: pipeline.test_report_summary.total[:count]
|
2022-06-21 17:19:12 +05:30
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Projects::PipelineHelper.prepend_mod
|