Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: 修复T_PIPELINE_WEBHOOK表中PROJECT_NAME字段异常的值 #11449

Open
mingshewhe opened this issue Feb 11, 2025 · 0 comments
Open

bug: 修复T_PIPELINE_WEBHOOK表中PROJECT_NAME字段异常的值 #11449

mingshewhe opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
kind/bug 程序故障Bug,漏洞 service/process 流水线

Comments

@mingshewhe
Copy link
Collaborator

T_PIPELINE_WEBHOOK 记录代码仓库与流水线的绑定关系,表结构如下:

PROJECT_NAME PROJECT_ID PIPEILNE_ID
TencentBlueKing/bk-ci mht p-1
TencentBlueKing/bk-ci mht p-2

PROJECT_NAME 通过仓库名获取,这么写是因为工蜂svn触发时,仓库名为三层时,只需要取中间一层

  fun getProjectName(projectName: String): String {
      // 如果项目名是三层的,比如a/b/c,那对应的rep_name是b
      val repoSplit = projectName.split("/")
      if (repoSplit.size != 3) {
          return projectName
      }
      return repoSplit[1].trim()
  }

但当是git代码库,同时仓库名有三层时,只取了仓库名中间的值去查询关联的流水线,这样会查出很多无效的流水线,导致流水线匹配时间变长,希望根据仓库类型计算projectNam的值

修复数据库的值时,应该考虑触发时兼容性问题,不影响流水线触发

@mingshewhe mingshewhe added kind/bug 程序故障Bug,漏洞 service/process 流水线 labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug 程序故障Bug,漏洞 service/process 流水线
Projects
None yet
Development

No branches or pull requests

2 participants