forked from Gitlink/forgeplus
fix #468
|
|
@ -15,12 +15,12 @@ class Api::V1::Projects::CodeChecksController < Api::V1::BaseController
|
|||
end
|
||||
|
||||
def run_task
|
||||
@result = @client.run_task(params["branch"])
|
||||
@result = @client.run_task(params["branch"],params["task_id"])
|
||||
render :index
|
||||
end
|
||||
|
||||
def query_task
|
||||
@result = @client.query_task
|
||||
@result = @client.query_task(params["task_id"])
|
||||
render :index
|
||||
end
|
||||
#----- 缺陷管理 ------
|
||||
|
|
|
|||
|
|
@ -11,25 +11,27 @@ class Api::V1::Projects::CodecheckService < ApplicationService
|
|||
"TYPESCRIPT"
|
||||
end
|
||||
|
||||
result = @client.create_task(
|
||||
@client.create_task(
|
||||
git_url: @project.repository.url,
|
||||
git_branch: branch,
|
||||
languages: [language],
|
||||
username: @project.owner.login,
|
||||
access_token: "this is opensource"
|
||||
)
|
||||
@project.update(huawei_code_check_task_id: result["task_id"])
|
||||
end
|
||||
|
||||
def run_task(branch,task_id)
|
||||
@client.run_task(task_id,git_branch: branch)
|
||||
end
|
||||
|
||||
def query_task(task_id)
|
||||
result = @client.query_task(task_id)
|
||||
if result["task_status"] == 2
|
||||
@project.update(huawei_code_check_task_id: task_id)
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
def run_task(branch)
|
||||
@client.run_task(@project.huawei_code_check_task_id,git_branch: branch)
|
||||
end
|
||||
|
||||
def query_task
|
||||
@client.query_task(@project.huawei_code_check_task_id)
|
||||
end
|
||||
|
||||
def defects_summary(query)
|
||||
@client.defects_summary(@project.huawei_code_check_task_id,query)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue