Repository navigation
Conversation
The master translator uses oceanbase/github-translate-action@ob-1.1.2, which calls @tomsun28/google-translate-api@1.1.2. Its legacy token lookup and long-input POST request fail without useful status reporting. PRs 2630, 2633, 2637 and 2639 report HTTPError; rerunning 2630 also failed. Locally the exact dependency returned HTTP 429 on translate_a/single, while direct token-free requests for the same four public descriptions returned 200. Hosted logs do not expose a status, so their precise HTTP failure cannot be equated with the local 429. The three green PR jobs skipped translation after language misclassification, not recovery. The old action also replaces the original PR body with translated text, despite APPEND_TRANSLATION. That breaks the required Chinese description. Its use at this version is present in merged PR 985 / commit 2b0f30e; this identifies the configuration provenance, not the date the public translation service started failing. For pull_request_target, replace that action with SHA-pinned github-script, read-only permissions and no checkout. Read event content as data, never interpolate it into executable script. Call the same public service with client=gtx, sl=auto, tl=en and dt=t, without the obsolete token dependency. Chunk at 2000 Unicode code points. Bound requests to 15 seconds, retry transport/429/5xx failures at most three total attempts, honor Retry-After within a four-minute total budget, and fail on permanent errors or bad responses. Do not turn service failures into green checks. Reject private repository translation, and never send a GitHub token to the service. Write HTML-escaped translations into the Actions summary, never updating PR titles or descriptions. This intentionally moves PR translations out of PR bodies to preserve author formatting and avoid edit races. Keep issue/discussion/comment handling unchanged under translate-other; its legacy dependency is outside the failing PR-check scope. Add a read-only workflow_dispatch entry for validation against a public PR number. Validation: parsed workflow with js-yaml; compiled the actual inline async script; git diff --check. Executed that exact script with real @actions/core, live fetch and the original four PR snapshots, not mocked translation responses. All four exited 0 and wrote summaries: 2630 6364 code points/4 requests; 2633 7404/4; 2637 4956/3; 2639 6088/4. The local harness first omitted the pre-existing summary file supplied by Actions; creating that file corrected the local setup and full reruns passed. No database code or developer-tool self-tests added. GitHub-hosted validation and the original four checks still require separate evidence. Because pull_request_target reads the base workflow, product-head changes cannot fix the existing jobs until this workflow reaches master.
Remove 5 full-line explanatory comments that repeat the adjacent code or the public API contract. Keep required copyright, lifecycle, lock-order, cancellation/rollback and workflow security documentation where present. Only complete standalone comment lines are deleted. No statements, strings, preprocessor directives, workflow keys or executable script are changed. Verified the diff contains only these deletions, no added lines and no line continuations; git diff --check passes. Existing functional evidence belongs to the previous product tree; this cleanup does not claim a new runtime test.
footka
pushed a commit
that referenced
this pull request
Nov 16, 2026
### Task Description Temporarily pause the translator CI for issues, pull requests, discussions, and their comments. ### Solution Description Comment out all automatic event triggers in `.github/workflows/translate.yml`, preserving their configuration for easy restoration. Keep `workflow_dispatch` as the only active trigger so the workflow remains valid and can be run manually. ### Passed Regressions - YAML parsing passed; verified that `workflow_dispatch` is the only active trigger and the translation job is unchanged. - Verified that uncommenting the saved event configuration restores the original triggers exactly. - `git diff --check` passed. Only the translation workflow changed. ### Other Information Related: #2660. Automatic translation is paused once this change is merged into `master`; the existing base-branch workflow can still run before then. ### Release Note Temporarily pause automatic translation of GitHub community content. Co-authored-by: Brain Wong <hnwyllmm@gmail.com>
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.
Summary
修复中文 PR 的翻译检查报 HTTPError 且可能覆盖作者正文的问题,通过有超时和重试限制的请求完成翻译,并将英文译文写入 Actions 摘要,保留中文原文。
背景: #2630、#2633、#2637 和 #2639 更新中文概要后,翻译检查均失败;#2630 正常重跑后仍然失败。目前确认的是翻译自动化故障,没有证据表明这些失败来自数据库构建。
根因: master 工作流调用 oceanbase/github-translate-action@ob-1.1.2,其中的 GoogleTranslate(text, {to: 'en'}) 依赖 @tomsun28/google-translate-api@1.1.2。该依赖仍使用旧的 token 获取方式,并对较长输入发送 POST 请求。请求失败后,异常包装又丢失了消息,导致 Actions 日志只显示 HTTPError,无法直接判断 HTTP 状态。本地使用相同依赖访问 /translate_a/single 时收到了 HTTP 429,但线上日志没有状态码,因此不能断言线上也是同一状态。另外,源码表明,即使配置了 APPEND_TRANSLATION: true,成功路径仍会调用 PR 更新接口,用英文译文替换原正文,这违反了保留中文格式的要求。
修复与取舍: PR 翻译改用固定提交 SHA 的 github-script,直接请求同一公开翻译服务,不再依赖旧 token。代码会按 2000 个 Unicode 码点分段,每次请求最多等待 15 秒,最多尝试三次,并在处理 HTTP 429 或服务器错误时遵守 Retry-After;整个翻译过程的预算为四分钟,持续失败仍会明确报错。译文经过 HTML 转义后写入 Actions 运行摘要,流程不再调用 PR 写接口,也不检出或执行 PR 代码,所用权限仅为只读。这样既保留翻译能力,也避免修改作者正文。此次没有通过改写为英文、跳过检查或忽略错误来制造通过结果;Issue、discussion 和评论仍使用既有实现,不在本次修复范围内。
转折: 另外三个绿色检查实际上因为将内容识别为英文而跳过了翻译,不能证明服务已经恢复。对四份失败正文直接发送翻译请求后均获得成功,因此后续验证改为执行新工作流中的实际脚本,并调用真实服务。
验证: 本地执行新内联脚本、真实 @actions/core 和真实翻译请求时,四份原始 PR 输入全部以退出码 0 完成并生成非空摘要,共成功发送 15 次请求。YAML 解析、脚本语法和 git diff --check 均通过。GitHub runner 也已在固定修复提交上完成一次真实验证:#2630 的 6364 个码点被分为四次请求,翻译步骤及整次运行均成功,译文写入了 Actions 摘要;原 PR 的标题和正文未被修改。这只能证明新分支的这次执行成功,不能说明原四个 PR 的检查已经恢复。
影响平台与版本: GitHub 实测运行目标为 ubuntu-latest 和 github-script v7,本地实测环境为 Linux 和 Node 24。配置基线为 00f88ac,已验证的修复提交为 eac7128。此次不修改数据库产品代码、存储格式或发布版本,Windows 和 macOS runner 尚未验证。现有配置来自已合入的 #985,但这不能用于推断外部翻译服务从何时开始失败。
遗留与验证边界: 流程仍依赖外部公开翻译服务,无法保证服务永不限流;持续失败会在预算内明确报错。目前没有执行故障注入,也没有提交工具自测。由于 pull_request_target 使用目标分支上的工作流,修复必须先进入 master,再触发原四个失败 PR 的新运行;仅修改产品分支无法改变原检查使用的工作流。其他事件的旧翻译实现也不在本次验证范围内。
改动概览
当前分支提交为
cd838d63c5058457706a4fcd18f4f33102f9e060。最近一次提交仅删除非必要注释,没有修改可执行代码;既有运行结果仍对应下方列出的历史验证构建。eac712841789cd333b606a522913d25ce4eb0a0b,基于 master;仅修改.github/workflows/translate.yml,不混入七个产品分支。合入理由
四个修复 PR 受到同一翻译流程故障影响,正常重跑未能解决。新路径已使用四份实际输入完成本地真实服务调用,并在 GitHub runner 上完成一次真实执行,同时消除了旧 token 依赖和正文覆盖行为。改动只涉及 PR 翻译流程,是否合入仍应结合实际审核和剩余验证边界判断,不能将新分支的一次成功当作原四个 PR 已经恢复。
Related links
展开详细复现与验证记录
复现旧行为:查看上列运行的失败日志,首错为
HTTPError。对 #2630 执行gh run rerun 43801012487 --failed -R oceanbase/seekdb后第二次运行仍失败。CLI、CLA 成功与翻译服务成功分别判断。本地安装固定版本
@tomsun28/google-translate-api@1.1.2,使用公开 PR 正文作为输入;仅为本地出口配置现有 HTTPS proxy 和请求超时,不更换身份或绕过限流。原依赖 homepage 请求 200,后续翻译 POST 为 429。无 token 的真实直接请求对四份正文全部 200。新路径验证:从本提交 YAML 提取完整
script,用原始公开 PR JSON 作为事件数据,执行真实 fetch 和@actions/core摘要写入。仅本地运行器适配,不纳入提交、不模拟翻译返回。首次本地摘要文件未预建导致写入失败,补齐 Actions 本来提供的文件后完整重跑,结果如下:请求固定使用
client=gtx&sl=auto&tl=en&dt=t;正文只作为 URL 参数,不插入脚本,不发送 GitHub token。译文为摘要中的 HTML 转义文本,原始 PR 标题、正文没有写操作。故障路径的重试上限、期限及响应结构检查已静态核对,尚未在 GitHub runner 注入 429/5xx/超时。GitHub runner 实测:手动运行固定分支
fix/seek-1414-translation-ci、提交eac712841789cd333b606a522913d25ce4eb0a0b,事件为workflow_dispatch,输入公开 PR #2630。运行43802711786的翻译任务于2026-11-16 04:26:25–04:26:33 UTC执行,步骤日志记录Translated 6364 code points in 4 requests,任务和运行均为成功。其它事件任务按条件跳过;主翻译步骤确实执行,没有把跳过当翻译成功。另一个运行43802704318来自
pull_request_target,日志明确使用旧 master 的oceanbase/github-translate-action,仍报HTTPError;它不能作为修复脚本失败,也未被手工改成绿色。当前CodeQL仍有排队/进行中的任务,未声称本PR全部检查通过。正文更新可能再次触发旧base工作流,因此发布后回读格式,并保留合入前旧自动化仍可影响正文的边界。未经正常审核合入master,原四个失败PR的恢复仍未完成。