mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
Merge branch 'standalone_develop' of https://gitlink.org.cn/Trustie/forgeplus into standalone_develop
This commit is contained in:
@@ -92,7 +92,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
|
||||
tip_exception("参数错误") if params[:owner].blank? || params[:repo].blank? || params[:run_id].blank?
|
||||
@project, @owner = Project.find_with_namespace(params[:owner], params[:repo])
|
||||
tip_exception("项目不存在") if @project.blank?
|
||||
result = Action::PipelineResult.find_or_initialize_by(run_id: params[:run_id], project_id: @project.id)
|
||||
result = Action::PipelineResult.find_or_initialize_by(run_id: params[:run_id], step_id: params[:step_id], project_id: @project.id)
|
||||
result.step_id = params[:step_id]
|
||||
result.job_name = params[:job_name]
|
||||
result.job_show_type = params[:job_show_type] || "html"
|
||||
@@ -131,6 +131,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
|
||||
next_edge_nodes = pipeline_json["edges"].select { |edge| edge["source"]["cell"].include?(job["id"]) }
|
||||
node_ids = next_edge_nodes.map { |t| t["target"]["cell"] }
|
||||
next_step_node = pipeline_json["nodes"].select { |node| node_ids.include?(node["id"]) && !node["data"]["name"].to_s.include?("job") }&.first
|
||||
parent_node = pipeline_json["edges"].select { |edge| edge["target"]["cell"].include?(job["id"]) }.first
|
||||
node.parent_node_id = parent_node.present? ? parent_node["source"]["cell"] : ""
|
||||
node.sub_nodes = []
|
||||
get_all_child_nodes(pipeline_json, node, next_step_node) if next_step_node.present?
|
||||
@job_nodes.push(node)
|
||||
|
||||
Reference in New Issue
Block a user