diff --git a/src/backend/ci/core/misc/biz-plugin/src/main/kotlin/com/tencent/devops/plugin/service/git/CodeWebhookService.kt b/src/backend/ci/core/misc/biz-plugin/src/main/kotlin/com/tencent/devops/plugin/service/git/CodeWebhookService.kt index 1643dfa79ff8..e37dbb7343a2 100644 --- a/src/backend/ci/core/misc/biz-plugin/src/main/kotlin/com/tencent/devops/plugin/service/git/CodeWebhookService.kt +++ b/src/backend/ci/core/misc/biz-plugin/src/main/kotlin/com/tencent/devops/plugin/service/git/CodeWebhookService.kt @@ -386,7 +386,11 @@ class CodeWebhookService @Autowired constructor( commitId = commitId, context = context, targetBranch = targetBranch - ) ?: return + ) + if (record == null) { + logger.info("Code web hook add git check record not exist, skip") + return + } updateCommitCheck( buildNum = buildNum, record = record, @@ -445,15 +449,11 @@ class CodeWebhookService @Autowired constructor( logger.info("Consume github pr event($event)") try { - val startedAt = if (event.startedAt != null) { - LocalDateTime.ofInstant(Instant.ofEpochSecond(event.startedAt!!), ZoneId.systemDefault()) - } else { - null + val startedAt = event.startedAt?.let { + LocalDateTime.ofInstant(Instant.ofEpochSecond(it), ZoneId.systemDefault()) } - val completedAt = if (event.completedAt != null) { - LocalDateTime.ofInstant(Instant.ofEpochSecond(event.completedAt!!), ZoneId.systemDefault()) - } else { - null + val completedAt = event.completedAt?.let { + LocalDateTime.ofInstant(Instant.ofEpochSecond(it), ZoneId.systemDefault()) } event.retryTime-- @@ -499,7 +499,11 @@ class CodeWebhookService @Autowired constructor( "repo=$repositoryConfig, commitId=$commitId, status=$status]" ) // 不存在检查记录直接跳过 - val record = pluginGithubCheckDao.getOrNull(dslContext, pipelineId, repositoryConfig, commitId) ?: return + val record = pluginGithubCheckDao.getOrNull(dslContext, pipelineId, repositoryConfig, commitId) + if (record == null) { + logger.info("Code web hook add pr check record not exist, skip") + return + } val buildHistoryResult = client.get(ServiceBuildResource::class).getBuildVars( userId = userId, projectId = projectId, @@ -544,8 +548,6 @@ class CodeWebhookService @Autowired constructor( val checkRunId = if (conclusion == null) { val result = scmCheckService.addGithubCheckRuns( projectId = projectId, - pipelineId = pipelineId, - buildId = buildId, repositoryConfig = repositoryConfig, name = record.checkRunName ?: "$pipelineName #$buildNum", commitId = commitId, @@ -554,15 +556,15 @@ class CodeWebhookService @Autowired constructor( status = status, startedAt = startedAt, conclusion = conclusion, - completedAt = completedAt + completedAt = completedAt, + pipelineId = pipelineId, + buildId = buildId ) result.id } else { scmCheckService.updateGithubCheckRuns( checkRunId = record.checkRunId, projectId = projectId, - pipelineId = pipelineId, - buildId = buildId, repositoryConfig = repositoryConfig, // 兼容历史数据 name = record.checkRunName ?: "$pipelineName #$buildNum", @@ -573,6 +575,8 @@ class CodeWebhookService @Autowired constructor( startedAt = startedAt, conclusion = conclusion, completedAt = completedAt, + pipelineId = pipelineId, + buildId = buildId, pipelineName = pipelineName ) record.checkRunId diff --git a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/service/scm/ScmProxyService.kt b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/service/scm/ScmProxyService.kt index ccb448867504..fee1eb1bc218 100644 --- a/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/service/scm/ScmProxyService.kt +++ b/src/backend/ci/core/process/biz-base/src/main/kotlin/com/tencent/devops/process/service/scm/ScmProxyService.kt @@ -54,7 +54,7 @@ import com.tencent.devops.repository.pojo.CodeGitlabRepository import com.tencent.devops.repository.pojo.CodeP4Repository import com.tencent.devops.repository.pojo.CodeSvnRepository import com.tencent.devops.repository.pojo.CodeTGitRepository -import com.tencent.devops.repository.pojo.GithubCheckRuns +import com.tencent.devops.repository.pojo.github.GithubCheckRuns import com.tencent.devops.repository.pojo.GithubCheckRunsResponse import com.tencent.devops.repository.pojo.GithubRepository import com.tencent.devops.repository.pojo.Repository diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/CodeWebhookService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/CodeWebhookService.kt index 36a45e63234a..5a73d6cb6230 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/CodeWebhookService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/CodeWebhookService.kt @@ -30,6 +30,7 @@ package com.tencent.devops.process.service.commit.check import com.tencent.devops.common.api.enums.RepositoryConfig import com.tencent.devops.common.api.enums.RepositoryType import com.tencent.devops.common.api.exception.RemoteServiceException +import com.tencent.devops.common.api.util.DateTimeUtil import com.tencent.devops.common.api.util.timestamp import com.tencent.devops.common.client.Client import com.tencent.devops.common.event.dispatcher.pipeline.PipelineEventDispatcher @@ -81,7 +82,6 @@ import org.springframework.stereotype.Service import java.time.Instant import java.time.LocalDateTime import java.time.ZoneId -import java.time.format.DateTimeFormatter @Service @Suppress("ALL") @@ -235,7 +235,7 @@ class CodeWebhookService @Autowired constructor( repositoryConfig = repositoryConfig, commitId = commitId, status = GITHUB_CHECK_RUNS_STATUS_COMPLETED, - startedAt = null, + startedAt = (event.startTime ?: 0L) / 1000, // 毫秒数 -> 秒数 conclusion = if (buildStatus == BuildStatus.SUCCEED) { GITHUB_CHECK_RUNS_CONCLUSION_SUCCESS } else { @@ -336,6 +336,7 @@ class CodeWebhookService @Autowired constructor( } else -> { + logger.warn("fail to consume git event", ignored) throw ignored } } @@ -493,6 +494,10 @@ class CodeWebhookService @Autowired constructor( val completedAt = event.completedAt?.let { LocalDateTime.ofInstant(Instant.ofEpochSecond(it), ZoneId.systemDefault()) } + logger.info( + "consume github pr event|startAt[${DateTimeUtil.toDateTime(startedAt)}]|" + + "completedAt[${DateTimeUtil.toDateTime(completedAt)}]" + ) addGithubPullRequestCheck( userId = event.userId, projectId = event.projectId, @@ -521,6 +526,10 @@ class CodeWebhookService @Autowired constructor( ) ) } + else -> { + logger.warn("fail to consume github pr event", ignored) + throw ignored + } } } } @@ -590,6 +599,7 @@ class CodeWebhookService @Autowired constructor( context = name, targetBranch = targetBranch ) + logger.info("get github commit check record[$record]") if (record == null) { val result = scmCheckService.addGithubCheckRuns( projectId = projectId, @@ -599,10 +609,13 @@ class CodeWebhookService @Autowired constructor( detailUrl = detailUrl, externalId = "${userId}_${projectId}_${pipelineId}_$buildId", status = status, - startedAt = startedAt?.atZone(ZoneId.systemDefault())?.format(DateTimeFormatter.ISO_INSTANT), + startedAt = startedAt, conclusion = conclusion, - completedAt = completedAt?.atZone(ZoneId.systemDefault())?.format(DateTimeFormatter.ISO_INSTANT) + completedAt = completedAt, + pipelineId = pipelineId, + buildId = buildId ) + logger.info("get github commit check run info[$result]") addGitCheckCommitRecord( pipelineId = pipelineId, buildNum = buildNum.toInt(), @@ -624,13 +637,11 @@ class CodeWebhookService @Autowired constructor( detailUrl = detailUrl, externalId = "${userId}_${projectId}_${pipelineId}_$buildId", status = status, - startedAt = startedAt?.atZone(ZoneId.systemDefault())?.format( - DateTimeFormatter.ISO_INSTANT - ), + startedAt = startedAt, conclusion = conclusion, - completedAt = completedAt?.atZone(ZoneId.systemDefault())?.format( - DateTimeFormatter.ISO_INSTANT - ) + completedAt = completedAt, + pipelineId = pipelineId, + buildId = buildId ) result.id } else { @@ -644,13 +655,12 @@ class CodeWebhookService @Autowired constructor( detailUrl = detailUrl, externalId = "${userId}_${projectId}_${pipelineId}_$buildId", status = status, - startedAt = startedAt?.atZone(ZoneId.systemDefault())?.format( - DateTimeFormatter.ISO_INSTANT - ), + startedAt = startedAt, conclusion = conclusion, - completedAt = completedAt?.atZone(ZoneId.systemDefault())?.format( - DateTimeFormatter.ISO_INSTANT - ) + completedAt = completedAt, + pipelineId = pipelineId, + buildId = buildId, + pipelineName = pipelineName ) record.checkRunId } @@ -854,9 +864,9 @@ class CodeWebhookService @Autowired constructor( status = GITHUB_CHECK_RUNS_STATUS_COMPLETED, startedAt = null, conclusion = GITHUB_CHECK_RUNS_CONCLUSION_SUCCESS, - completedAt = LocalDateTime.now().atZone(ZoneId.systemDefault())?.format( - DateTimeFormatter.ISO_INSTANT - ) + completedAt = LocalDateTime.now(), + buildId = buildId, + pipelineId = pipelineId ) } diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/QualityService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/QualityService.kt index df73c08f2863..c6a889e131af 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/QualityService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/QualityService.kt @@ -27,6 +27,7 @@ package com.tencent.devops.process.service.commit.check +import com.tencent.devops.common.api.enums.ScmType import com.tencent.devops.common.api.util.DateTimeUtil import com.tencent.devops.common.client.Client import com.tencent.devops.common.pipeline.enums.StartType @@ -36,7 +37,6 @@ import com.tencent.devops.common.web.utils.I18nUtil import com.tencent.devops.plugin.codecc.CodeccUtils import com.tencent.devops.plugin.constant.PluginMessageCode import com.tencent.devops.process.api.service.ServiceVarResource -import com.tencent.devops.process.pojo.mq.commit.check.TGitCommitCheckEvent import com.tencent.devops.process.service.PipelineListFacadeService import com.tencent.devops.quality.api.v2.ServiceQualityIndicatorResource import com.tencent.devops.quality.api.v2.ServiceQualityInterceptResource @@ -57,32 +57,48 @@ class QualityService @Autowired constructor( } fun getQualityGitMrResult( - event: TGitCommitCheckEvent + projectId: String, + pipelineId: String, + buildId: String, + eventStatus: String, + startTime: Long, + triggerType: String, + scmType: ScmType ): Pair, MutableMap>>> { - val projectId = event.projectId - val pipelineId = event.pipelineId - val buildId = event.buildId val pipelineName = pipelineListFacadeService.getPipelineNameByIds( projectId = projectId, pipelineIds = setOf(pipelineId), filterDelete = true )[pipelineId] ?: "" + // github 不需要插入链接, 仅在插件名处插入链接,链接地址用codecc插件输出变量 + val githubRepo = scmType == ScmType.GITHUB val titleData = mutableListOf( - event.status, - DateTimeUtil.formatMilliTime(System.currentTimeMillis() - event.startTime), + eventStatus, + DateTimeUtil.formatMilliTime(System.currentTimeMillis() - startTime), StartType.toReadableString( - event.triggerType, + triggerType, null, I18nUtil.getLanguage(I18nUtil.getRequestUserId()) ), pipelineName, - "${HomeHostUtil.innerServerHost()}/console/pipeline/$projectId/$pipelineId/detail/$buildId", + if (githubRepo) { + "" + } else { + "${HomeHostUtil.innerServerHost()}/console/pipeline/$projectId/$pipelineId/detail/$buildId" + }, I18nUtil.getCodeLanMessage(PluginMessageCode.BK_CI_PIPELINE) ) - + logger.info("get quality git mr result|title[$titleData]") val ruleName = mutableSetOf() - + // 插件输出变量 + val reportUrl = getBuildVar( + client = client, + projectId = projectId, + pipelineId = pipelineId, + buildId = buildId, + varName = CodeccUtils.BK_CI_CODECC_REPORT_URL + ) // key:质量红线产出插件 // value:指标、预期、结果、状态 val resultMap = mutableMapOf>>() @@ -92,10 +108,17 @@ class QualityService @Autowired constructor( val indicator = client.get(ServiceQualityIndicatorResource::class) .get(projectId, interceptItem.indicatorId).data val indicatorElementName = indicator?.elementType ?: "" - val elementCnName = getElementCnName(indicatorElementName, projectId) + val elementCnName = getElementCnName(indicatorElementName, projectId).let { + if (githubRepo) { + "$it" + } else { + it + } + } val resultList = resultMap[elementCnName] ?: mutableListOf() - val actualValue = if (CodeccUtils.isCodeccAtom(indicatorElementName)) { - getActualValue( + val actualValue = when { + githubRepo -> interceptItem.actualValue ?: "null" + CodeccUtils.isCodeccAtom(indicatorElementName) -> getActualValue( projectId = projectId, pipelineId = pipelineId, buildId = buildId, @@ -103,8 +126,7 @@ class QualityService @Autowired constructor( value = interceptItem.actualValue ?: "null", client = client ) - } else { - interceptItem.actualValue ?: "null" + else -> interceptItem.actualValue ?: "null" } resultList.add( listOf( @@ -131,13 +153,13 @@ class QualityService @Autowired constructor( value: String, client: Client ): String { - val variable = client.get(ServiceVarResource::class).getBuildVar( + val taskId = getBuildVar( + client = client, projectId = projectId, pipelineId = pipelineId, buildId = buildId, varName = CodeccUtils.BK_CI_CODECC_TASK_ID - ).data - val taskId = variable?.get(CodeccUtils.BK_CI_CODECC_TASK_ID) + ) return if (detail.isNullOrBlank() || detail.split(",").size > 1) { "$value" @@ -163,4 +185,21 @@ class QualityService @Autowired constructor( } return map[classType] ?: "" } + + private fun getBuildVar( + client: Client, + projectId: String, + pipelineId: String, + buildId: String, + varName: String + ): String? { + val variable = client.get(ServiceVarResource::class).getBuildVar( + projectId = projectId, + pipelineId = pipelineId, + buildId = buildId, + varName = varName + ).data + val taskId = variable?.get(varName) + return taskId + } } \ No newline at end of file diff --git a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/ScmCheckService.kt b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/ScmCheckService.kt index e54252e3338a..68b8b133c9e0 100644 --- a/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/ScmCheckService.kt +++ b/src/backend/ci/core/process/biz-process/src/main/kotlin/com/tencent/devops/process/service/commit/check/ScmCheckService.kt @@ -35,7 +35,9 @@ import com.tencent.devops.common.api.exception.OperationException import com.tencent.devops.common.api.exception.ParamBlankException import com.tencent.devops.common.api.util.DHUtil import com.tencent.devops.common.api.util.EnvUtils +import com.tencent.devops.common.api.util.timestampmilli import com.tencent.devops.common.client.Client +import com.tencent.devops.common.pipeline.enums.StartType import com.tencent.devops.process.pojo.mq.commit.check.TGitCommitCheckEvent import com.tencent.devops.process.utils.Credential import com.tencent.devops.process.utils.CredentialUtils @@ -46,11 +48,12 @@ import com.tencent.devops.repository.api.scm.ServiceScmOauthResource import com.tencent.devops.repository.api.scm.ServiceScmResource import com.tencent.devops.repository.pojo.CodeGitRepository import com.tencent.devops.repository.pojo.CodeTGitRepository -import com.tencent.devops.repository.pojo.GithubCheckRuns +import com.tencent.devops.repository.pojo.github.GithubCheckRuns import com.tencent.devops.repository.pojo.GithubCheckRunsResponse import com.tencent.devops.repository.pojo.GithubRepository import com.tencent.devops.repository.pojo.Repository import com.tencent.devops.repository.pojo.enums.RepoAuthType +import com.tencent.devops.repository.sdk.github.pojo.CheckRunOutput import com.tencent.devops.scm.pojo.CommitCheckRequest import com.tencent.devops.scm.pojo.RepoSessionRequest import com.tencent.devops.ticket.api.ServiceCredentialResource @@ -59,6 +62,9 @@ import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service import java.net.URLEncoder +import java.time.LocalDateTime +import java.time.ZoneId +import java.time.format.DateTimeFormatter import java.util.Base64 import javax.ws.rs.NotFoundException @@ -120,7 +126,15 @@ class ScmCheckService @Autowired constructor( description = description, block = block, mrRequestId = event.mergeRequestId, - reportData = qualityService.getQualityGitMrResult(event), + reportData = qualityService.getQualityGitMrResult( + projectId = projectId, + pipelineId = pipelineId, + buildId = buildId, + startTime = startTime, + eventStatus = status, + triggerType = triggerType, + scmType = repo.getScmType() + ), targetBranch = targetBranch ) if (isOauth) { @@ -134,15 +148,17 @@ class ScmCheckService @Autowired constructor( fun addGithubCheckRuns( projectId: String, + pipelineId: String, + buildId: String, repositoryConfig: RepositoryConfig, name: String, commitId: String, detailUrl: String, externalId: String, status: String, - startedAt: String?, + startedAt: LocalDateTime?, conclusion: String?, - completedAt: String? + completedAt: LocalDateTime? ): GithubCheckRunsResponse { logger.info("Project($projectId) add github commit($commitId) check runs") @@ -156,9 +172,9 @@ class ScmCheckService @Autowired constructor( detailsUrl = detailUrl, externalId = externalId, status = status, - startedAt = startedAt, + startedAt = startedAt?.atZone(ZoneId.systemDefault())?.format(DateTimeFormatter.ISO_INSTANT), conclusion = conclusion, - completedAt = completedAt + completedAt = completedAt?.atZone(ZoneId.systemDefault())?.format(DateTimeFormatter.ISO_INSTANT) ) return client.get(ServiceGithubResource::class).addCheckRuns( @@ -171,15 +187,18 @@ class ScmCheckService @Autowired constructor( fun updateGithubCheckRuns( checkRunId: Long, projectId: String, + pipelineId: String, + buildId: String, repositoryConfig: RepositoryConfig, name: String, commitId: String, detailUrl: String, externalId: String, status: String, - startedAt: String?, + startedAt: LocalDateTime?, conclusion: String?, - completedAt: String? + completedAt: LocalDateTime?, + pipelineName: String ) { logger.info("Project($projectId) update github commit($commitId) check runs") @@ -193,11 +212,25 @@ class ScmCheckService @Autowired constructor( detailsUrl = detailUrl, externalId = externalId, status = status, - startedAt = startedAt, + startedAt = startedAt?.atZone(ZoneId.systemDefault())?.format(DateTimeFormatter.ISO_INSTANT), conclusion = conclusion, - completedAt = completedAt + completedAt = completedAt?.atZone(ZoneId.systemDefault())?.format(DateTimeFormatter.ISO_INSTANT), + output = CheckRunOutput( + summary = "This check concluded as $conclusion.", + text = null, // github + title = pipelineName, + reportData = qualityService.getQualityGitMrResult( + projectId = projectId, + pipelineId = pipelineId, + buildId = buildId, + startTime = startedAt?.timestampmilli() ?: 0L, + eventStatus = status, + triggerType = StartType.WEB_HOOK.name, + scmType = ScmType.GITHUB + ) + ) ) - + logger.info("start update github check run|${repo.projectName}|$checkRuns") client.get(ServiceGithubResource::class).updateCheckRuns( accessToken = accessToken, projectName = repo.projectName, diff --git a/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/ServiceGithubResource.kt b/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/ServiceGithubResource.kt index 6a287bde3b27..c3c0d78109a2 100644 --- a/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/ServiceGithubResource.kt +++ b/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/api/ServiceGithubResource.kt @@ -28,7 +28,7 @@ package com.tencent.devops.repository.api import com.tencent.devops.common.api.pojo.Result -import com.tencent.devops.repository.pojo.GithubCheckRuns +import com.tencent.devops.repository.pojo.github.GithubCheckRuns import com.tencent.devops.repository.pojo.GithubCheckRunsResponse import com.tencent.devops.repository.pojo.github.GithubAppUrl import com.tencent.devops.repository.pojo.github.GithubBranch diff --git a/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/pojo/github/GithubCheckRuns.kt b/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/pojo/github/GithubCheckRuns.kt index 0beed6a55f61..e2bc1adf791d 100644 --- a/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/pojo/github/GithubCheckRuns.kt +++ b/src/backend/ci/core/repository/api-repository/src/main/kotlin/com/tencent/devops/repository/pojo/github/GithubCheckRuns.kt @@ -25,7 +25,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -package com.tencent.devops.repository.pojo +package com.tencent.devops.repository.pojo.github import com.fasterxml.jackson.annotation.JsonProperty import com.tencent.devops.repository.sdk.github.pojo.CheckRunOutput diff --git a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/ServiceGithubResourceImpl.kt b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/ServiceGithubResourceImpl.kt index 0c8beaf07399..b7733a7f4ce3 100644 --- a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/ServiceGithubResourceImpl.kt +++ b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/resources/ServiceGithubResourceImpl.kt @@ -30,7 +30,7 @@ package com.tencent.devops.repository.resources import com.tencent.devops.common.api.pojo.Result import com.tencent.devops.common.web.RestResource import com.tencent.devops.repository.api.ServiceGithubResource -import com.tencent.devops.repository.pojo.GithubCheckRuns +import com.tencent.devops.repository.pojo.github.GithubCheckRuns import com.tencent.devops.repository.pojo.GithubCheckRunsResponse import com.tencent.devops.repository.pojo.github.GithubAppUrl import com.tencent.devops.repository.pojo.github.GithubBranch @@ -40,6 +40,7 @@ import com.tencent.devops.repository.pojo.oauth.GithubTokenType import com.tencent.devops.repository.service.github.GithubOAuthService import com.tencent.devops.repository.service.github.GithubTokenService import com.tencent.devops.repository.service.github.IGithubService +import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Autowired @RestResource @@ -48,6 +49,11 @@ class ServiceGithubResourceImpl @Autowired constructor( private val githubService: IGithubService, private val githubOAuthService: GithubOAuthService ) : ServiceGithubResource { + + companion object{ + private val logger = LoggerFactory.getLogger(ServiceGithubResourceImpl::class.java) + } + override fun createAccessToken( userId: String, accessToken: String, diff --git a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/GithubService.kt b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/GithubService.kt index d7c324571b65..1622edf1c7a5 100644 --- a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/GithubService.kt +++ b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/GithubService.kt @@ -51,7 +51,7 @@ import com.tencent.devops.repository.constant.RepositoryMessageCode.OPERATION_LI import com.tencent.devops.repository.constant.RepositoryMessageCode.OPERATION_LIST_TAGS import com.tencent.devops.repository.constant.RepositoryMessageCode.OPERATION_UPDATE_CHECK_RUNS import com.tencent.devops.repository.pojo.AuthorizeResult -import com.tencent.devops.repository.pojo.GithubCheckRuns +import com.tencent.devops.repository.pojo.github.GithubCheckRuns import com.tencent.devops.repository.pojo.GithubCheckRunsResponse import com.tencent.devops.repository.pojo.github.GithubBranch import com.tencent.devops.repository.pojo.github.GithubRepo diff --git a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/IGithubService.kt b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/IGithubService.kt index 6fc85010310d..5272cbb2e94b 100644 --- a/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/IGithubService.kt +++ b/src/backend/ci/core/repository/biz-repository/src/main/kotlin/com/tencent/devops/repository/service/github/IGithubService.kt @@ -28,7 +28,7 @@ package com.tencent.devops.repository.service.github import com.tencent.devops.repository.pojo.AuthorizeResult -import com.tencent.devops.repository.pojo.GithubCheckRuns +import com.tencent.devops.repository.pojo.github.GithubCheckRuns import com.tencent.devops.repository.pojo.GithubCheckRunsResponse import com.tencent.devops.repository.pojo.github.GithubBranch import com.tencent.devops.repository.pojo.github.GithubTag