Skip to content

Commit

Permalink
pref:优化流水线项目下已安装插件关联流水线查询 #11307
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Dec 16, 2024
1 parent 00c32f5 commit a0a37d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,13 @@ class CodeCCAutoConfiguration {
codeccHost: String = "",

@Value("\${codecc.gray.projectId:}")
codeccGrayProjectId: String? = null,

@Value("\${codecc.projectId:}")
codeccProjectId: String? = null
codeccGrayProjectId: String? = null

): CodeccApi =
CodeccApi(
codeccApiUrl = codeccApiGateWay,
codeccApiProxyUrl = codeccApiProxyGateWay,
codeccHost = codeccHost,
codeccGrayProjectId = codeccGrayProjectId,
codeccProjectId = codeccProjectId
codeccGrayProjectId = codeccGrayProjectId
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class CodeccApi(
private val codeccApiUrl: String,
private val codeccApiProxyUrl: String,
private val codeccHost: String,
private val codeccGrayProjectId: String? = null,
private val codeccProjectId: String? = null
private val codeccGrayProjectId: String? = null
) {

@Value("\${codecc.openapi.token:#{null}}")
Expand Down Expand Up @@ -193,8 +192,8 @@ class CodeccApi(
fun getCodeccOpensourceMeasurement(atomCodeSrc: String): Result<Map<String, Any>> {
val url = "http://$codeccHost/ms/openapi/api/open/v2/defect/opensource/measurement?url=$atomCodeSrc"
val headers = mutableMapOf<String, String>()
if (!codeccProjectId.isNullOrBlank()) {
headers[AUTH_HEADER_PROJECT_ID] = codeccProjectId
if (!codeccGrayProjectId.isNullOrBlank()) {
headers[AUTH_HEADER_PROJECT_ID] = codeccGrayProjectId
headers[AUTH_HEADER_CODECC_OPENAPI_TOKEN] = codeccOpenApiToken
}
val httpReq = Request.Builder()
Expand Down

0 comments on commit a0a37d7

Please sign in to comment.