Repository navigation
ci: run the pipeline on the ai branch and fix what it finds - #1657
Open
ambiguous-pointer wants to merge 4 commits into
Open
ambiguous-pointer wants to merge 4 commits into
ambiguous-pointer wants to merge 4 commits into
Conversation
The workflows only triggered on develop, so everything that happens on the ai branch was never built, tested or license checked by the pipeline. The ai branch looked green because nothing ran on it. This adds the ai branch to the trigger of ci.yml and riscv-build.yml and fixes the defects the pipeline reports on its first run: - The frontend lockfile pointed 63 packages at registry.debugmode.cn, a mirror that no longer resolves, so yarn install failed before the build could start. Those entries now use the same mirror as the rest of the file. - The ai module and the ai chat components carried no license header, and three files of the test utilities had a header with a missing quote. - Four files were not gofmt clean. They only exist on this branch, so the format check of the pipeline had never seen them. - The frontend sources were not prettier clean, and the build runs "prettier --write src/" before it bundles. The rewrite left the working tree dirty and failed the format check of the pipeline. - The license configuration ignored every path below a "tools" directory, which also covered the MCP tool layer and the AI tools component. Three files in there had no header at all. The rule is removed and they carry a header now, so the MCP tool layer and the AI tools component are under the check. Fixes apache#1644
The ai branch moved on by four merged pull requests while this branch was open, so the pull request no longer applied cleanly. Merging upstream/ai brings the branch up to date and resolves the two conflicts in the chat components: the upstream version of those files carries the retry support of apache#1600, so it is taken as the base and the license header and the formatting of this branch are applied on top of it. The merge also brings in six files of the upstream pull requests that carry no license header, two of them a truncated one. Without the fix the pipeline this pull request enables would fail on the license check as soon as the trigger reaches the ai branch.
…without Merging upstream `ai` pulls in the seven files that apache#1609 added, and all seven of them landed with no license header at all. The moment this PR turns the License Check on for the `ai` branch, those seven are exactly what turns the branch red. `ai/providerusage/usage.go` carries the repository's only package doc comment, so the header goes above it and the doc comment stays attached to the `package` clause.
|
AlexStocks
approved these changes
Dec 4, 2026
robocanic
reviewed
Dec 5, 2026
robocanic
left a comment
Contributor
There was a problem hiding this comment.
优点
- 触发条件改动(
.github/workflows/ci.yml、.github/workflows/riscv-build.yml)准确:pull_request.branches过滤的是 PR 的 base 分支,因此需要同时在push与pull_request中加入ai,PR 描述对此解释清楚。 .licenserc.yaml删除**/tools/**忽略规则后,对应补齐pkg/mcp/tools/**、ai/component/tools/**的许可证头,范围收敛合理。- 逐文件核对 diff:新增头与
.licenserc.yaml中的header.license.content一致,注释形式与各文件类型匹配(.go/go.mod用//,.yaml/.env.example用#,.css/.js用/* */);ai/providerusage/usage.go的 ASF 头与 package doc 之间有空行,doc 注释仍紧贴package,不影响 godoc;ai/testutils/*中原先缺引号的头已修正。 - gofmt(
pkg/mcp/**、etcdserver.go)与 prettier(App.vue、IdempotencyUtil.ts)仅为格式调整,无语义变化;yarn.lock仅替换resolved镜像域名,integrity未变;Makefile的test目标本身已包含cd ai && go test ./... -short,与 PR 描述一致。
Critical
未发现。
Important
未发现。
备注(非阻塞)
- PR 描述中
Fixes #1644,而同时声明Makefile的fmt目标不覆盖ai/module(仍有 13 个文件未 gofmt)属于 out of scope。若 #1644 还包含该诉求,合并时会自动关闭该 issue,建议确认是否改为Relates to,或另开 issue 跟踪。
总体评估
Ready to merge?Yes
改动以流水线触发条件、许可证头、格式化为主,均为机械性修改,未发现 bug、逻辑或兼容性问题,未发现明显问题。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



概要
让
ai分支第一次真正跑上流水线:把ai加进 CI 的触发条件,并修掉流水线跑起来后立刻暴露的那批缺陷(失效的 npm 镜像、缺失的许可证头、gofmt / prettier 不干净)。为什么需要
ai分支上从未跑过流水线:.github/workflows/ci.yml的push/pull_request只过滤develop,所以ai分支推 commit → 没有任何 workflow 触发;ai为 base 的 PR(feat(ai): add provider compatibility layer for OpenAI-compatible endpoints #1585、feat(ai): make the agent observable through OTel GenAI conventions #1616、feat(ai): add trace discovery and diagnosis tools for the AI assistant #1618 等)→ 同样不触发:它们 head 上的ci.yml依然只过滤develop,而pull_request.branches过滤的正是 PR 的 base 分支名。结果是整个
dubbo-admin-ai模块(独立 Go module,含 CLIai/cmd/index.go)从未被构建、单元测试、gofmt 校验、prettier 校验和许可证头校验覆盖过。ai分支「看起来是绿的」,只是因为上面什么都没跑。更重要的是:光加触发条件不会让流水线变绿。流水线第一次真跑就会失败——失效的镜像让
yarn install在构建开始前就挂掉,许可证头和格式问题则集中在只存在于ai分支的文件上。本 PR 把这些一并修掉,避免「加了触发条件,反而把ai分支变红」。还有一点:上游
ai分支自己也在往里带新缺陷。本 PR 合并上游的过程中,上游 #1609(fc00d27)带进来 7 个完全没有许可证头的文件;一旦ai分支开始跑 License Check,这 7 个文件就会把分支染红。所以本 PR 一并把它们补齐。改了什么
ci.yml触发条件push与pull_request的branches各加一行airiscv-build.yml触发条件ai分支上没有任何一个 workflow 会跑ui-vue3/yarn.lockregistry.debugmode.cn的resolved换回registry.npmmirror.com(文件里其余 848 个包本来就是这个镜像,改后共 911 个),integrity全部保持不变ai/providerusage/usage.go是全仓库唯一带 package doc 注释的文件,ASF 头放在 doc 注释之上,doc 注释仍紧贴package子句.licenserc.yaml**/tools/**这条忽略规则——它同时命中pkg/mcp/tools/**和ai/component/tools/**,让 30 个文件此前落在校验范围之外。其中mcp_tools.go/mock_tools.go/tools.yaml完全没有头,已补上pkg/mcp/component.go、pkg/mcp/tools/cluster.go、pkg/mcp/tools/instance.go、ai/stub/etcd-server-v3/server/v3/etcdserver.go四个文件格式化。这四个文件只存在于ai分支(upstream/develop上都没有),流水线的格式检查从未见过它们ui-vue3/src/components/ai-chat/**(含两个__tests__下的 spec)与src/App.vue、src/utils/IdempotencyUtil.ts按仓库 prettier 配置重排。yarn build会先跑prettier --write src/,重排后工作树变脏,与 CI 的make fmt && git status判空直接冲突aiupstream/ai从e6cef77一路合到fc00d27(#1600 / #1594 / #1596 / #1608 / #1609),并修掉合并后流水线新报出来的全部问题——含 #1609 带进来的那 7 个缺许可证头的文件合计 4 个提交、65 个文件(+1217 / −382),相对当前 base(
upstream/ai@fc00d27)。两个容易被误读的点
ai/module 里还剩 13 个文件不是 gofmt 干净状态,这不是本 PR 引入的。Makefile的fmt目标只有go fmt ./...,只作用于根模块;ai/是独立 module(ai/stub/etcd-server-v3更是第三个嵌套 module),根目录的go fmt不会下钻进去。这 13 个文件在upstream/ai上是 14 个,本 PR 只修掉了etcdserver.go这一个。它们既不是本 PR 引入的,也不在当前流水线的检查范围内——要把ai/真正纳入格式校验,需要改Makefile的fmt目标,是另一件事。pkg/mcp/**的改动是 gofmt,不是许可证头。 这几个文件本来就有 ASF 头,需要改的只是 import 顺序和 map 字面量的对齐。验证
触发条件生效后,CI 在
ai分支上跑的就是下面这些命令,本地逐条跑过:cd ui-vue3 && yarn install --frozen-lockfilecd ui-vue3 && yarn build(prettier --write src/ && vite build)git status -s为空)make fmt后git status -sgo test ./... -short(根模块:81 个包,24 个含测试)cd ai && go test ./... -short(aimodule:41 个包,27 个含测试)CGO_ENABLED=0 GOARCH=riscv64 GOOS=linux go build ./...(riscv-build.yml的构建步骤).licenserc.yaml复现 skywalking-eyes 的paths-ignore与头匹配规则)upstream/ai@fc00d27上 50 个文件缺头(或头不完整),本 PR 后为 0;剩下 5 个是二进制资源(dubbo.ico、iconfont.*、login.jpg),与upstream/develop完全一致(develop 的流水线是绿的)这个 PR 本身就跑 CI,而且跑绿了。 因为
pull_request事件用的是 head 分支上的 workflow 文件,本 PR 把自己加进了触发条件,于是它触发了自己:不在本 PR 范围
release.yaml调用了Makefile里不存在的build-dubboctl/build-dubbo-cp目标。这是同一个「CI 断裂」问题的另一面,但与触发条件无关,另开 PR。Makefile的fmt目标不覆盖ai/module(见「改了什么」)。本 PR 只保证ai分支的流水线能跑起来,不改Makefile的语义。ai/module 的依赖版本不动(genkit 保持 v1.2.0)。ai/module 内部的功能改动。关联
English version
Summary
Make the
aibranch run in the pipeline for the first time: addaito the CI trigger and fix the defects that surface the moment it does (a dead npm mirror, missing license headers, gofmt / prettier drift).Why
The pipeline has never run on the
aibranch:.github/workflows/ci.ymlfilterspushandpull_requestondeveloponly, soaitriggers no workflow at all;ai(such as feat(ai): add provider compatibility layer for OpenAI-compatible endpoints #1585, feat(ai): make the agent observable through OTel GenAI conventions #1616, feat(ai): add trace discovery and diagnosis tools for the AI assistant #1618) triggers none either — theci.ymlon their heads still filters ondeveloponly, andpull_request.branchesfilters on the PR's base branch name.As a result the whole
dubbo-admin-aimodule (a separate Go module, including the CLI inai/cmd/index.go) has never been built, unit-tested, gofmt-checked, prettier-checked or license-checked. Theaibranch "looked green" only because nothing ran on it.More importantly, adding the trigger alone does not turn the pipeline green. The first real run fails: the dead mirror breaks
yarn installbefore the build even starts, and the license-header and formatting problems all sit in files that exist only on theaibranch. This PR fixes them together, so that adding the trigger does not instead turnaired.One more thing: upstream keeps bringing new defects into
ai. While merging upstream into this branch, #1609 (fc00d27) added 7 files with no license header at all. The momentaistarts running the License Check, those 7 files turn the branch red — so this PR adds their headers too.What changed
ci.ymltriggeraito thebrancheslist of bothpushandpull_requestriscv-build.ymltriggeraibranchui-vue3/yarn.lockregistry.debugmode.cnnow point atregistry.npmmirror.com(the other 848 packages in the file already used it, 911 after this change). Allintegrityhashes are unchangedai/providerusage/usage.gocarries the repository's only package doc comment, so the header goes above it and the doc comment stays attached to thepackageclause.licenserc.yaml**/tools/**ignore rule is removed — it matched bothpkg/mcp/tools/**andai/component/tools/**, which kept 30 files outside the check.mcp_tools.go,mock_tools.goandtools.yamlhad no header at all and now carry onepkg/mcp/component.go,pkg/mcp/tools/cluster.go,pkg/mcp/tools/instance.goandai/stub/etcd-server-v3/server/v3/etcdserver.goare formatted. All four exist only on theaibranch (none of them is onupstream/develop), so the pipeline's format check had never seen themui-vue3/src/components/ai-chat/**(including the two specs under__tests__),src/App.vueandsrc/utils/IdempotencyUtil.tsare reformatted per the repository's prettier config.yarn buildrunsprettier --write src/first, so the rewrite left the working tree dirty and collided with the CI checkmake fmt && git statusaiupstream/aiis merged frome6cef77all the way tofc00d27(#1600 / #1594 / #1596 / #1608 / #1609), and everything the pipeline newly reports after the merge is fixed — including the 7 files that #1609 brought in without a license header4 commits, 65 files (+1217 / −382) against the current base (
upstream/ai@fc00d27).Two things that are easy to misread
13 files in the
aimodule are still not gofmt-clean, and this PR did not introduce them. Thefmttarget of theMakefileisgo fmt ./..., which covers the root module only;ai/is a separate module (andai/stub/etcd-server-v3a third nested one), so the rootgo fmtdoes not descend into them. Those 13 files are 14 onupstream/ai— this PR repairs exactly one of them (etcdserver.go). They are neither introduced here nor within the current pipeline's reach; bringing theaimodule under format checking means changing thefmttarget, which is a separate change.The
pkg/mcp/**changes are gofmt, not license headers. Those files already carried ASF headers; only the import order and the map literal alignment needed fixing.Verification
Once the trigger is in place, these are the commands CI will run on the
aibranch. Each was run locally:cd ui-vue3 && yarn install --frozen-lockfilecd ui-vue3 && yarn build(prettier --write src/ && vite build)git status -sis empty)make fmtfollowed bygit status -sgo test ./... -short(root module: 81 packages, 24 with tests)cd ai && go test ./... -short(aimodule: 41 packages, 27 with tests)CGO_ENABLED=0 GOARCH=riscv64 GOOS=linux go build ./...(theriscv-build.ymlbuild step)paths-ignoreand header matching of.licenserc.yaml, reproducing skywalking-eyes)upstream/ai@fc00d27, 0 after this PR. The 5 that remain are binary assets (dubbo.ico,iconfont.*,login.jpg), exactly as onupstream/develop, whose pipeline is greenThis PR does run CI, and it passes. Because the
pull_requestevent uses the workflow file on the head branch, this PR added itself to the trigger and therefore triggered itself:Out of scope
release.yamlcalls the Makefile targetsbuild-dubboctlandbuild-dubbo-cp, which do not exist. This is the other side of the same broken-CI problem, but it is unrelated to the trigger and gets its own PR.fmttarget of theMakefiledoes not cover theaimodule (see "What changed"). This PR only makes the pipeline run onai; it does not change the semantics of theMakefile.aimodule are untouched (genkit stays at v1.2.0).aimodule.Related