ambiguous-pointer opened a new issue, #1644:
URL: https://github.com/apache/dubbo-admin/issues/1644
## 概要
`ai` 分支上**从未跑过流水线**。`.github/workflows/ci.yml` 的触发条件里只有 `develop`,因此:
- 往 `ai` 分支推 commit → 没有任何 workflow 触发;
- 以 `ai` 为 base 的 PR → **同样不触发**(GitHub 的 `pull_request.branches` 过滤的是 PR 的
**base** 分支,不是 head)。
结果是整个 `dubbo-admin-ai` 模块(`ai/`,独立 Go module,含它的 CLI
`ai/cmd/index.go`)从未被构建、单元测试、gofmt 校验、prettier 校验和许可证头校验覆盖过。
`ai` 分支「看起来是绿的」,只是因为上面什么都没跑。
## 1. 问题
### 1.1 触发条件漏掉了 `ai`
`.github/workflows/ci.yml`(`ai` 分支版本):
```yaml
on:
push:
branches:
- develop
pull_request:
branches:
- develop
```
`riscv-build.yml` 同样只有 `develop`。也就是说 `ai` 分支上**没有任何一个** workflow 会跑。
### 1.2 即便触发,`ai` 模块也只被测、不被格式化
`ai/` 是独立 Go module(`ai/go.mod`,`module dubbo-admin-ai`),根目录的 `go build
./...` / `go test ./...` 不会触及它。
`Makefile` 里:
```make
test: clean
go test ./... -short -gcflags=-l -coverprofile=coverage.txt
-covermode=atomic
cd ai && go test ./... -short -gcflags=-l # ← ai 模块的测试其实已经接好了
fmt:
go fmt ./... # ← 只有根模块,ai 模块从不做 gofmt
检查
```
`ai` 模块的单元测试**已经接进 Makefile 了**,缺的只是一个触发条件;而 `fmt` 目标至今不覆盖 `ai` 模块。
### 1.3 许可证校验把 `ai` 的一部分代码排除在外
`.licenserc.yaml` 的 `header.paths.ignore` 里有 `- '**/tools/**'`,它同时命中
`pkg/mcp/tools/**` 和 `ai/component/tools/**`。核实 `ai` 分支上的实际文件头:
```
$ git show origin/ai:ai/cmd/index.go | head -1
package main
$ git show origin/ai:ai/component/tools/engine/mcp_tools.go | head -1
package engine
$ git show origin/ai:ai/component/tools/engine/mock_tools.go | head -1
package engine
```
这三个文件**完全没有许可证头**。
### 1.4 流水线第一次真正跑起来时暴露的既有缺陷
这些缺陷在 `ai` 分支上静默存在,直到流水线第一次真跑才被看见:
| # | 缺陷 | 触发点 |
|---|---|---|
| 1 | `ui-vue3/yarn.lock` 中 **63** 个包指向
`registry.debugmode.cn`(该镜像已无法解析),而同文件其余 **848** 个包用的是 `registry.npmmirror.com`
| CI 步骤 `yarn install --frozen-lockfile` 在构建开始前就失败 |
| 2 | 前端构建前执行 `prettier --write src/`,重写后工作树变脏 | 与 CI 的 `make fmt && git
status && [[ -z $(git status -s) ]]` 判空直接冲突 |
| 3 | 3 个 console 文件不是 gofmt 干净状态 | 这些文件只存在于 `ai` 分支,流水线的格式检查从未见过它们 |
| 4 | `ai` 模块 + `ai` chat 组件大量文件无许可证头;`ai/testutils` 三个文件的头部引号缺失 |
`skywalking-eyes/header` 校验 |
## 2. 为什么重要
1. **评审者拿不到任何自动信号。** 当前所有以 `ai` 为 base 的
PR(#1585、#1616、#1618)都是**零自动检查**状态,等于让人肉去替代本该自动化的门禁。
2. **「绿」是假象。** 分支上的质量状态从未被任何流水线测量过,缺陷只能靠人偶然发现。
3. **投入已经存在但没被使用。** `Makefile` 里 `cd ai && go test ./... -short` 说明作者早就为
`ai` 模块准备好了测试入口,只是缺触发条件——补上触发条件,`ai` 模块(含 CLI `ai/cmd/index.go`)立刻获得全套 `go
test` 覆盖,**几乎零成本**。
4. **审计口径。** ASF 项目要求合并前有流水线验证。`ai` 分支上所有 PR 合并进 `ai` 时都绕过了这一点,而 `ai` 分支本身是
AI 助手能力的主线。
## 3. 证据
### 3.1 `ai` 分支上的 PR 没有任何 CI 运行
```
$ gh pr checks 1618 --repo apache/dubbo-admin
no checks reported on the 'feat/ai_trace_diagnosis' branch
$ gh pr checks 1616 --repo apache/dubbo-admin
SonarCloud pass 3s
SonarCloud Code Analysis pass 6s
```
只有 SonarCloud(GitHub App),**没有 `dubbo-admin ci`**。而 base 为 `develop` 的 PR 都有
`dubbo-admin ci` 运行记录。
### 3.2 上游仓库近期运行记录中没有任何 `ai` 分支
```
$ gh run list --repo apache/dubbo-admin --limit 20 --json
workflowName,headBranch
... dubbo-admin ci branch=fix-idl-generic-invoke pull_request
... RISC-V Build branch=fix-zk-service-catalog pull_request
... dubbo-admin ci branch=fix-obs-metric-dashboard-var pull_request
```
`headBranch` 里没有一条是 `ai`。
### 3.3 触发条件
```
$ gh api repos/apache/dubbo-admin/contents/.github/workflows/ci.yml?ref=ai
--jq '.content' | base64 -d | rg -n 'branches|develop'
18:on:
20: branches:
21: - develop
22: pull_request:
23: branches:
24: - develop
```
### 3.4 依赖镜像已失效
```
$ git show origin/ai:ui-vue3/yarn.lock | rg -o 'https?://[^/]+/' | sort |
uniq -c | sort -rn
848 https://registry.npmmirror.com/
84 https://registry.npmjs.org/
63 https://registry.debugmode.cn/ ← 已不能解析
6 https://registry.yarnpkg.com/
```
## 4. 影响范围
- 受影响代码:`ai/` 整个模块(`ai/cmd/index.go`
CLI、`ai/component/**`、`ai/runtime`、`ai/store`
等)、`pkg/mcp/tools/**`、`ui-vue3/src/components/ai-chat/**`。
- 受影响流程:所有以 `ai` 为 base 的 PR 的评审与合并。
- 已有可用修复(尚未提交 PR):见本 Issue 的解决方案评论。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]