Skip to content

Commit

Permalink
Merge pull request #20 from Yuanruitao/feature_stream_support
Browse files Browse the repository at this point in the history
feat: 支持Stream环境直接跳转CodeCC后台 #19
  • Loading branch information
Yuanruitao authored Aug 30, 2022
2 parents 3f3640a + e1ee035 commit 82e4508
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class CodeccCheckAtom : TaskAtom<CodeccCheckAtomParamV3> {
CodeccSdkUtils.executeAsyncTask(asyncTaskId, atomContext.param.pipelineStartUserName)
atomContext.param.codeCCTaskId = asyncTaskId.toString()
print("启动异步CodeCC任务成功,")
CodeccReportUtilsV2.asyncReport(atomContext, detailLink(atomContext.param.projectName, atomContext.param.codeCCTaskId))
CodeccReportUtilsV2.asyncReport(atomContext, detailLink(atomContext.param.projectName,
atomContext.param.codeCCTaskId, atomContext.param.channelCode))
return
}
println("asyncTask is false")
Expand Down Expand Up @@ -89,7 +90,7 @@ class CodeccCheckAtom : TaskAtom<CodeccCheckAtomParamV3> {
LogUtils.printDebugLog("atomContext.result.message: ${atomContext.result.message}")
LogUtils.printDebugLog("atomContext.result.status: ${atomContext.result.status}")
with(atomContext.param) {
println("CodeCC任务详情:<a href='${detailLink(projectName, codeCCTaskId)}' target='_blank'>查看详情</a>")
println("CodeCC任务详情:<a href='${detailLink(projectName, codeCCTaskId, atomContext.param.channelCode)}' target='_blank'>查看详情</a>")
}

//开源项目上报commitId
Expand All @@ -103,8 +104,9 @@ class CodeccCheckAtom : TaskAtom<CodeccCheckAtomParamV3> {
}
}

private fun detailLink(projectName: String, codeCCTaskId: String?): String {
return if (projectName.startsWith("git_")) {
private fun detailLink(projectName: String, codeCCTaskId: String?, channelCode: String?): String {
return if (projectName.startsWith("git_") || projectName.startsWith("github_")
|| (!channelCode.isNullOrBlank() && "GIT" == channelCode)) {
"${codeccDetail}/codecc/$projectName/task/$codeCCTaskId/detail"
} else {
"${codeccFrontHost}/console/codecc/$projectName/task/$codeCCTaskId/detail"
Expand Down

0 comments on commit 82e4508

Please sign in to comment.