Skip to content

Remove the independent-approvals CI check and rely on native reviews - #607

Open
zengchuang-hw wants to merge 2 commits into
mainfrom
fix/count-formal-approve-reviews
Open

zengchuang-hw wants to merge 2 commits into
mainfrom
fix/count-formal-approve-reviews

Conversation

@zengchuang-hw

@zengchuang-hw zengchuang-hw commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Refs #440

Remove the advisory independent-approvals commit status. GitHub's active protect-main ruleset already requires two formal Approve reviews from distinct eligible accounts and dismisses stale approvals on reviewable changes. The sole required status check is knowledge-model-policy.

  • Remove the status writer and the dedicated review-event workflow that triggered it.
  • Remove their standalone Python evaluator, its tests, and the rollout instructions.
  • Update reviewer and integrator guidance to count formal Approve submissions regardless of their text. A comment saying LGTM contributes zero approvals. Blocking Request changes reviews follow GitHub's native rules.

Verification. Inspected the published commit tree and the ten remaining workflow definitions. Neither the retired status writer nor its trigger is referenced by those workflows. Checked the active ruleset independently. Existing runs and statuses can remain visible in GitHub history. The removal takes effect for new events once it reaches main.

Count eligible current-head Approve reviews regardless of wording and keep
approval enforcement in the native main ruleset. Update the reviewer and
integrator guidance and cover the approval-count examples in tests.

Agent-assisted-by: Codex (implementation and tests)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
Dong1017
Dong1017 previously approved these changes Nov 23, 2026

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

PR review verdict — PASS
Reviewed base 65f7149 and head 07db27c (full diff, 4 files). No prior formal reviews or Request changes are seeded on this head.

Verified against the governing issue (#440, body updated 2026-11-23T09:29Z)

  • The #440 acceptance matrix says review text has no role in the approval count. It gives these results: two Approves with any body count 2, one Approve plus one LGTM comment counts 1, and two Comment reviews count 0. The new parametrized test test_only_formal_approvals_count_regardless_of_body covers exactly those three rows.
  • tools/check_independent_approvals.py (read at head):
    • body is dropped from the GraphQL selection and from review_candidates.
    • The remaining gates are unchanged. They are state == APPROVED, authorCanPushToRepository, a current-head commit.oid, __typename == "User" and no [bot] suffix. PR-author and commit author/committer exclusion still runs in evaluate.
    • A COMMENTED review cannot count, because the state check runs first.
  • The status description is now prefixed "Advisory:". The docstring and comments no longer imply an enforcing gate. This matches #440's decision that the native protect-main ruleset (2 approvals) stays authoritative.
  • docs/agent-collaboration.md and .agents/skills/review-pr/SKILL.md now agree with the code on three points. Approve is counted by state, not wording. Comment reviews with LGTM or PASS contribute zero. DO NOT PASS still uses Request changes.
  • Dropping the "rollout (not active)" section is consistent with the #440 decision that superseded the cutover plan. The new "Advisory approval status" section keeps the important limits. Those are the count-only report, the fact that two approvals can coexist with an open Request changes, and the instruction to use the merge box.

Non-blocking notes

  • Dong1017's 07:30Z proposal in #440 suggested a safety net that would not count an Approve whose body says DO NOT PASS or NO PASS. This PR omits it. The current #440 body says review text has no role, so I read that as superseded. The author or owner should say so explicitly if it is meant to be dropped.
  • I did not check whether other files outside this diff still mention the exact LGTM first-line rule. Examples are docs/contributing.md, PR templates and workflow comments. A quick repo-wide search before merge would settle it. The excerpt shipped with Dong-bot's own review skill still carries the old wording, but that is not part of this repo diff.

Not verified here: I did not run tests or Ruff. I am relying on the PR's claim of 19 passing tests and a clean Ruff run, and repo CI was pending when the PR was opened. I did not exercise the live GitHub GraphQL latestOpinionatedReviews behavior.

Eligibility: this Approve comes from Dong-bot, the authorized delegate acting under Dong1017's account. Dong1017 proposed the design in #440. Whether this vote counts as one of the two independent approvals is for the integrator to decide under the recorded #441 and #597 handling. The ruleset still needs two eligible approvals and green required checks.


@Dong1017 Dong1017 added area:process Repo-wide process, governance, privacy and security rules kind:task Bounded delivery task with a delegated slice labels Nov 23, 2026

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改了什么

这份 PR 对齐 #440 的最新决定:合入 main 仍靠 GitHub 原生 ruleset(分支保护规则集)要求 2 个正式 Approve(批准审查);旁边的 independent-approvals 观察器只做统计提示,不再盯审查正文里有没有写死的 LGTM。

具体变动:

  1. tools/check_independent_approvals.py:GraphQL(GitHub 的查询接口)不再拉 body;review_candidates 只按「当前 head 上的 APPROVED + 有写权限的真人账号 + 排除作者/提交者」计数。状态描述加上 Advisory:,标明这是建议性状态,不是硬门槛。
  2. tests/test_independent_approvals.py:用参数化用例覆盖 #440 验收表三行(两个任意正文的 Approve → 2;Approve + 评论式 LGTM → 1;两个 Comment → 0),并去掉旧的「首行必须是 LGTM」断言。
  3. docs/agent-collaboration.md / .agents/skills/review-pr/SKILL.md:审查指南改为「PASS 就提交 Approve」;删掉已过时的「observer 升格为强制检查」rollout 段,改成「Advisory approval status」说明。

问题或风险

未发现影响正确性、安全或声明行为的实质缺陷。

资格过滤(APPROVED、当前 head、可推送、User 且非 bot、排除贡献者)仍在 review_candidates / evaluate 里,逻辑与 #440 验收矩阵一致。我在本地把本 PR 的两份 Python 文件跑了 tests/test_independent_approvals.py:与本次改动相关的用例全部通过(缺仓库 workflow YAML 导致的那 1 个环境性失败可忽略)。

非阻塞建议:合入前可再扫一眼仓库外是否还有私有 agent 模板仍写「首行 LGTM」——本仓库 AGENTS.md / docs/contributing.md / README.md 在本 head 上已无该表述。

结论

Approve。 改动范围小、与 #440 决策一致,观察器与文档不再和原生 ruleset 打架;无阻塞问题。未合并。

Reviewed base 65f7149f17f4759b459340a5f64746b6d747f2fd and head 07db27ce4940e855ab68c5aefd1768a1ba6ecf86(4 files)。

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — PASS
Reviewed base 65f7149f17f4759b459340a5f64746b6d747f2fd and head 07db27ce4940e855ab68c5aefd1768a1ba6ecf86.

改了什么

这次是在对齐「正式批准」和观察器(observer,用来统计谁批准了 PR 的小工具)的计数规则。

  1. tools/check_independent_approvals.py:统计时不再要求审查正文第一行必须是精确的 LGTM;只要是对当前提交的正式 Approve、账号有写权限、且不是作者/提交者/机器人,就算一票。GraphQL 查询也去掉了用不上的 body 字段;状态描述改成以 Advisory: 开头,明确它只是参考,真正拦合并的还是仓库的 native ruleset(分支保护规则)。
  2. 文档与审查技能(docs/agent-collaboration.md、.agents/skills/review-pr/SKILL.md):审查通过时直接点 Approve 即可,不再要求正文写 LGTM;说明普通评论或 Comment 审查即使写了 LGTM/PASS 也不算批准。
  3. 测试:补了 PR 说明里的三组回归(两票空/自由正文 Approve=2;一票 Approve + 一票 Comment=1;两票 Comment=0),并去掉只针对旧 LGTM 正文规则的用例。

明显问题或风险

未发现影响正确性、安全或声明行为的实质缺陷。

review_candidates 仍先过滤 state == APPROVED、当前 head、写权限与 User 类型,去掉的只是正文门槛,不会把 Comment 审查误计为批准。本地跑通 tests/test_independent_approvals.py 共 19 项。knowledge-model-policy 已是 success;部分 full-check / host-compatibility 当时仍在跑,属 CI 进度,不构成对本 diff 的否决理由。

小建议(非阻塞):合入后观察器描述会带上 Advisory: 前缀;合入前 main 上的工作流仍会打出旧文案,属预期。

结论

批准。 改动范围清楚,行为与文档一致,正式 Approve 与 ruleset 计数对齐,观察器仍保持顾问角色。

Retire the review-event signal and status writer together with their
standalone evaluator and tests. Keep the native two-review requirement
and the guidance for submitting formal approvals.

Agent-assisted-by: Codex (implementation and verification)
Signed-off-by: zengchuang <zengchuang3@huawei.com>
@zengchuang-hw zengchuang-hw changed the title Count formal Approve reviews regardless of review text Remove the independent-approvals CI check and rely on native reviews Nov 23, 2026

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — PASS
Reviewed base 65f7149f17f4759b459340a5f64746b6d747f2fd and head 887d4d865e5d9de6d6dbbf07a4f106c197905f24.

改了什么

相对上一版(只改「正式 Approve 怎么计数」),这次按 #440 的最新决定,直接拆掉旁路观察器,合入门槛只留 GitHub 原生 ruleset(分支保护规则集:要 2 个正式 Approve)。

具体变动(6 个文件,+11/−416):

  1. 删除 .github/workflows/independent-approvals.yml 与 approval-review-event.yml(写 commit status 的工作流,以及触发它的审查事件信号)。
  2. 删除 tools/check_independent_approvals.py 与 tests/test_independent_approvals.py(独立审批统计脚本和测试)。
  3. 文档/技能对齐:docs/agent-collaboration.md、.agents/skills/review-pr/SKILL.md 改为「PASS 就提交 Approve,正文写不写都行」;普通评论或 Comment 审查即使写了 LGTM/PASS 也不算批准;删掉已过时的 observer rollout(观察器升格为强制检查)段落。

我在当前 head 上核对过:工作流目录里已无上述两个 YAML(还剩 10 个),tools/ 里也没有 check_independent_approvals.py。knowledge-model-policy 已是 success。

明显问题或风险

未发现影响正确性、安全或声明行为的实质缺陷。

  • 与 #440 决策正文一致:「Remove the advisory observer… in #607」;原生 ruleset 仍要求 2 票,Request changes 仍走 GitHub 原生规则。
  • 合入前 main 上的旧工作流仍可能给这个 head 打出 independent-approvals 状态(当前可见 failure: 0/2),合入后对新事件才会停写;PR 说明也写了历史 status 可留在 GitHub 里。这不构成对本 diff 的否决理由,因为该 context 本来就不是唯一必过检查(必过的是 knowledge-model-policy)。
  • 删测试后,仓库里不再有旁路计数的回归网;依赖的是 ruleset 本身,与 #440 接受矩阵一致。

结论

批准(Approve)。 范围清楚,行为与 #440 决策一致:旁路观察器整套移除,正式批准只认原生 Approve。未合并。

@jiangkuaixue123 jiangkuaixue123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — PASS
Reviewed base 65f7149f17f4759b459340a5f64746b6d747f2fd and head 887d4d865e5d9de6d6dbbf07a4f106c197905f24.

改了什么

这次是在落实 #440 的最新决定:合入 main 的批准要求只由 GitHub 原生 ruleset(分支保护规则集)执行,要求两个合格审查者各提交一次正式 Approve(批准审查);原来那个只做统计提示的 independent-approvals 观察器(observer,用来打 commit status 的辅助检查)整套拆掉。

具体变动(相对前一版头 07db27ce 是更大的方向调整):

  1. 删除 .github/workflows/independent-approvals.yml、.github/workflows/approval-review-event.yml(触发与状态写入工作流)。
  2. 删除 tools/check_independent_approvals.py 及 tests/test_independent_approvals.py(评估器与单测)。
  3. 更新 docs/agent-collaboration.md、.agents/skills/review-pr/SKILL.md:PASS 直接提交 Approve 即可;正文不再要求首行 LGTM;普通评论 / Comment 审查写 LGTM/PASS 也不算批准;删掉已过时的 observer rollout 段落。

当前 head 上 workflows 目录剩 10 个定义,已无上述两个工作流;tools/ 下也无 check_independent_approvals.py。

明显问题或风险

未发现影响正确性、安全或声明行为的实质缺陷。

与 #440 Decision/验收表一致:批准计数只看正式 Approve 状态,不看审查正文;Request changes(要求修改)仍由 GitHub 原生规则处理。必需状态检查仍是 knowledge-model-policy(本 head 已 success)。

非阻塞说明:在本 PR 合入 main 之前,main 上旧的观察器工作流仍会对新事件写出 independent-approvals status(本 head 上仍能看到 failure:0/2);PR 说明已指出历史 status 可保留、合入后新事件才停止写入,这属预期行为,不构成否决理由。部分 full-check / host-compatibility 当时仍在跑,属 CI 进度。

结论

批准。 删除范围清晰、文档与 #440 决策一致,批准执行回归到原生 ruleset,无阻塞问题。未合并。

Copy link
Copy Markdown
Contributor Author

@Dong1017 could you re-review 887d4d86 and submit a formal Approve if it looks good? This revision removes the independent-approvals workflow and its trigger. The native main ruleset still requires two approving reviews.

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR review verdict — PASS

Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

Reviewed base 65f7149f17f4759b459340a5f64746b6d747f2fd and head 887d4d865e5d9de6d6dbbf07a4f106c197905f24. I read the full diff, which is complete (6 files). This PR touches .github/workflows/approval-review-event.yml and .github/workflows/independent-approvals.yml, so a human maintainer's Approve is still required. This review posts as a COMMENT. It is not an Approve and not an independent vote, in line with the earlier #371 and #597 records.

Verified

  • Removals: the diff deletes both workflows, tools/check_independent_approvals.py and tests/test_independent_approvals.py. That is the whole status-writer chain: the pull_request_review signal, the workflow_run / pull_request_target / push writer, the evaluator and its tests.
  • No dangling references: .github/workflows/ at head has 10 entries (ci-draft, ci-merge, ci-nightly, ci-ready, knowledge-model-policy, release, and four skill-eval files). None is the removed writer or its trigger. I did not grep the whole tree, but the deleted test was the only file in the diff that imported the evaluator.
  • Guidance: docs/agent-collaboration.md and .agents/skills/review-pr/SKILL.md now say:
    • PASS means submit Approve, and the body wording is irrelevant.
    • Conversation comments and Comment reviews count as zero approvals, even if they say LGTM or PASS.
    • Request changes follows GitHub's native rules.
    • The integrator checks eligibility, blocking reviews and required checks.
  • Stale text: the stale "exact LGTM first line" and "body rules" wording is gone from the SKILL file (read at head, 77 lines). The docs/agent-collaboration.md hunk replaces the "eligibility and body rules" phrase, and the "Independent-approval check rollout (not active)" section is removed.
  • Merge gate: it is unchanged. The PR body cites the protect-main ruleset (2 approvals, stale-approval dismissal), with knowledge-model-policy as the only required status check. I did not re-query the ruleset myself.
  • Prior reviews: @jiangkuaixue123 has two APPROVED reviews on this exact head. They count as one reviewer. There is no outstanding CHANGES_REQUESTED.

Non-blocking

  • Until this reaches main, the old workflow can still write independent-approvals statuses (a 0/2 failure is visible on this head). Historical statuses stay in GitHub's history. That context is not a required check, so it does not block merge.
  • Deleting the tests removes the regression net for the observer. That follows from retiring it.
  • I did not run tests or CI. CI status was not seeded, so I make no claim about it.

Remaining before merge: a human maintainer's formal Approve on 887d4d86, a second eligible independent approval to meet the ruleset's 2, and green required checks. I'll re-read if the author pushes again.


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

Labels

area:process Repo-wide process, governance, privacy and security rules kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants