Welcome to mirror list, hosted at ThFree Co, Russian Federation.

jobs_helper.rb « ci « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 37b008611e6700ff43c2619d9bb42a5534be1840 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

module Ci
  module JobsHelper
    def jobs_data(project, build)
      {
        "job_endpoint" => project_job_path(project, build, format: :json),
        "log_endpoint" => trace_project_job_path(project, build, format: :json),
        "test_report_summary_url" => test_report_summary_project_job_path(project, build, format: :json),
        "page_path" => project_job_path(project, build),
        "project_path" => project.full_path,
        "artifact_help_url" => help_page_path('user/gitlab_com/index.md', anchor: 'gitlab-cicd'),
        "deployment_help_url" => help_page_path('user/project/clusters/deploy_to_cluster.md', anchor: 'troubleshooting'),
        "runner_settings_url" => project_runners_path(build.project, anchor: 'js-runners-settings'),
        "retry_outdated_job_docs_url" => help_page_path('ci/pipelines/settings', anchor: 'retry-outdated-jobs'),
        "pipeline_test_report_url" => test_report_project_pipeline_path(project, build.pipeline)
      }
    end

    def job_statuses
      statuses = Ci::HasStatus::AVAILABLE_STATUSES

      statuses.index_with(&:upcase)
    end
  end
end

Ci::JobsHelper.prepend_mod_with('Ci::JobsHelper')