Skip to content

ci: restrict approval of automation inputs - #22134

Open
lilin90 wants to merge 1 commit into
pingcap:masterfrom
lilin90:protect-automation-input-owners
Open

lilin90 wants to merge 1 commit into
pingcap:masterfrom
lilin90:protect-automation-input-owners

Conversation

@lilin90

@lilin90 lilin90 commented Dec 6, 2026 •

Copy link
Copy Markdown
Member

What is changed, added, or deleted? (Required)

Require automation maintainers to approve changes to dependency manifests, CDN purge inputs, review prompts, bot and agent configuration, and translation cursor files on master. Keep CODEOWNERS aligned with Prow. Tide is a required check on master, and GitHub does not currently require code-owner approval.

Add regression checks for the approval boundaries and for registry sources and integrity fields across the npm lockfile. Validate PDF purge URLs before the credential-bearing step, and require a full commit SHA for the translation cursor before the existing commit lookup.

The scheduled sync reads the cursor from release-8.5. Applying the ownership policy to that branch is a separate follow-up. All eight local regression scripts and git diff --check passed. No cloud purge or production workflow was run.

Which TiDB version(s) do your changes apply to? (Required)

Tips for choosing the affected version(s):

By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.

For details, see tips for choosing the affected versions (in Chinese).

  • master (the latest development version)
  • v9.0 (TiDB 9.0 versions)
  • v8.5 (TiDB 8.5 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)

What is the related PR or file link(s)?

  • Related code change PR links (if applicable):
  • This PR is translated from:
  • Other reference link(s):

AI agent involvement

  • The changes in this PR were primarily made by an AI agent on behalf of the PR author.

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

Summary by CodeRabbit

  • 维护
    • 更新了内容审查与审批规则,明确不同文件类型的审核安排。
    • PDF 清理流程现在会先校验链接格式,再执行刷新;无效链接将导致流程报错。
    • 翻译同步流程现在要求提交标识符合完整哈希格式。
  • 测试
    • 增加了对依赖包下载来源与完整性信息的检查,以及对审查规则和 PDF 链接校验流程的验证。

@ti-chi-bot

ti-chi-bot Bot commented Dec 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign qiancai for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 6, 2026
@coderabbitai

coderabbitai Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

本次变更调整 OWNERS 和 CODEOWNERS 审批规则,并添加对应检查。自动化校验还覆盖 PDF 清理 URL、翻译游标 SHA,以及 npm 锁文件中的 registry URL 和完整性字段。

Changes: 审批所有权规则

Layer / File(s) Summary
配置审批所有权规则
OWNERS, .agents/OWNERS, resources/OWNERS, .github/CODEOWNERS
调整根目录及维护文件的 approvers 规则,新增 agents 和 resources 目录的 OWNERS 配置,并更新 CODEOWNERS 路径映射。
检查审批规则映射
scripts/test-workflow-dependencies.py
新增测试,解析分层 OWNERS 规则,并检查维护文件的 approvers 与 CODEOWNERS 映射。

自动化输入校验

Layer / File(s) Summary
校验 PDF 清理 URL
.github/workflows/flush.yaml, scripts/test-workflow-dependencies.py
工作流校验 URL 清单并生成 cdnfresh.json,刷新步骤读取该文件。测试覆盖有效清单、外部域名及包含分号的 URL。
校验翻译游标 SHA
.github/workflows/sync-ai-docs-en-to-zh.yml
工作流要求游标 SHA 匹配完整的 40 位十六进制格式,否则输出错误并退出。
检查 npm 锁文件完整性
scripts/test-install-scripts.py
新增测试,检查非根 npm 包的 registry URL、主机名和完整性字段,并允许指定版本的 wrappy 使用 SHA-1 格式。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related PRs

  • pingcap/docs-cn#22043:同样调整 PDF CDN flush 工作流的授权规则,并为相关工作流和策略配置添加检查。
Merge Risk: Minimal · up to 1e3d4

This PR tightens approval rules and adds input validation for the PDF purge workflow, the translation cursor and the npm lockfile. No concrete defect was found, so the risk of merging is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“ci: restrict approval of automation inputs”与变更主题一致。变更要求自动化维护者批准依赖清单、CDN 清理输入、审查提示、机器人与代理配置及翻译游标文件,并同步 CODEOWNERS 与 OWNERS 规则。标题简洁,指出主要变更。
Description check Passed 描述基本完整。已填写“变更内容”部分,说明审批策略、回归检查、PDF 清理 URL 校验、翻译游标 SHA 校验,并列出本地验证结果与未执行的云端操作。版本选择已勾选 master。AI 代理参与声明已勾选。“相关 PR 或文件链接”部分仍为空白,“首次贡献者检查清单”已被删除(模板注明可删除,故不影响结果)。建议补充相关链接字段,或注明无相关链接。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c7c68df and 1e3d4f6.

Files selected for processing: 8

  • .agents/OWNERS
  • .github/CODEOWNERS
  • .github/workflows/flush.yaml
  • .github/workflows/sync-ai-docs-en-to-zh.yml
  • OWNERS
  • resources/OWNERS
  • scripts/test-install-scripts.py
  • scripts/test-workflow-dependencies.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@lilin90 lilin90 self-assigned this Dec 6, 2026
@lilin90

lilin90 commented Dec 6, 2026

Copy link
Copy Markdown
Member Author

/test pull-verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant