GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [自动合并 P2-7] merge queue 接入 · Issue #92 · Cloudbird-Software/.github

[自动合并 P2-7] merge queue 接入 #92

New issue
Copy link
New issue
Copy link
Closed
Closed
[自动合并 P2-7] merge queue 接入#92
Copy link
Labels
auto-merge自动合并计划(#81)工作卡gateGate 工作流相关rulesetRuleset 配置相关

Description

@randypanding
randypanding
opened on Aug 20, 2026
Issue body actions

目标

启用 merge queue:多 agent 并发时"各自对 main 绿、合起来红"的问题由队列串行化验证解决,同时消除"分支需 up-to-date"导致的反复手动 update branch。

背景(源自 #81 §6)

多 agent 并发提 PR 后,每个 PR 都基于旧 main 验证通过,合并顺序不同时语义冲突直接进 main。merge queue 把 PR 排队、按"队列前缀 + 本 PR"的虚拟合并重新验证,绿才落地。硬性前提:gate workflow 必须订阅 merge_group 事件,否则 required check 在队列中永不上报、合并直接失败。

涉及文件

  • governance/rulesets/main-protection.json(增加 merge_queue rule)
  • .github/workflows/gate.yml(on: 增加 merge_group)——本仓及各业务仓所有 required check workflow
  • CI-Workflows 各 reusable workflow 的触发声明(caller 侧事件传递)
  • governance/expected-state.json(merge queue 参数进期望状态对账)

执行步骤

  1. 所有 required check 链路上的 workflow 增加 merge_group 触发(types: [checks_requested])。逐个仓排查,漏一个 = 该仓队列卡死。
  2. main-protection.json 增加 merge_queue rule(参数:merge_method squash,max_entries_to_merge / 并发参数取保守默认值)。
  3. expected-state.json 与 drift-check 对账 merge queue 配置。
  4. 注意与 P1-3 的一致性:merge_group 场景下 aggregator 的 needs 断言同样严格。
  5. 先在高活跃仓(agent-registry / template-service)启用,观察一周再全量。

验收标准

  • 语义冲突的两个 PR:各自对 main 绿,先入队者合并,后入队者被队列重验拦下(踢出队列并标注冲突),而不是红进 main。
  • 队列中 required check 正常上报(无永久 pending)。
  • drift-check 覆盖 merge queue 配置。

测试方法(预先指定)

T1 语义冲突拦截(核心,端到端):在测试仓:

  1. PR-A:把函数 foo() 的返回值从 int 改为 str(含其测试更新)→ 绿,加入 merge queue。
  2. PR-B(基于不含 A 的 main):新增调用 foo() 并按 int 处理的代码 → 对 main 绿,加入 merge queue。
  3. 断言:A 合并后,队列用"A+main+B"重验 B → B 的 check 变红、B 被踢出队列并收到失败通知;main 始终保持绿。

T2 merge_group 上报(核心,负向预防):

  1. 在测试仓临时移除某 required workflow 的 merge_group 触发,开 PR 入队。
  2. 断言:队列在超时时间内未收到 check → PR 被踢出(此用例证明"漏配 merge_group = 卡死"的侦测有效性;随后立即还原配置)。
  3. 还原后重跑正常入队流程 → 断言合并成功。

T3 并发吞吐(正向):连续 3 个无冲突 PR 同时入队 → 断言按序全部合并,无人工干预,main 全程绿。

T4 对账:手动改动队列参数(如 merge_method)→ 断言 drift-check 报漂移;apply 还原。

依赖

  • P1-1 / P1-2(auto-merge 全链路已通)
  • P1-3(aggregator 严格断言在 merge_group 场景下同样成立)

Activity

  1. randypanding
    added
    gateGate 工作流相关
    rulesetRuleset 配置相关
    auto-merge自动合并计划(#81)工作卡
    on Aug 20, 2026
  2. randypanding
    added a parent issue on Aug 20, 2026
    • 自动合并计划 #81
  3. randypanding commented on Aug 20, 2026

    @randypanding
    randypanding
    on Aug 20, 2026
    ContributorAuthor
    More actions

    诊断:merge-queue ruleset 无法应用——org 级 API 不支持 merge_queue 规则类型

    PR #117 合并后 apply.sh 报 ruleset 'merge-queue': FAIL Invalid request. Invalid property /rules/0: data matches no possible input(HTTP 422)。已实证排除参数形态问题(有无 merge_method 的最小 payload 均被拒);查证 org ruleset API 文档:org 级 ruleset 支持的规则类型清单中没有 merge_queue——它只在 repo 级 ruleset API 提供。

    修复方向(供实现者参考,需 ADR-0042 修订):

    1. 改走 repo 级:POST /repos/{r}/rulesets 对 agent-registry/template-service 各建 merge_queue 规则——drift-check §1 目前只对账 org ruleset,需同步增加 repo 级 ruleset 的对账段(expected-state 声明按仓的规则);
    2. 或等 GitHub 支持(不建议阻塞)。

    另:当前 drift-check 每小时报 ruleset 'merge-queue' 不存在(issue #107 跟踪中)——修复后自动消除。测试期间建议临时把 enforcement 调 disabled 落地,验证 merge_group 事件链路后再 active。

  4. randypanding commented on Aug 20, 2026

    @randypanding
    randypanding
    on Aug 20, 2026
    ContributorAuthor
    More actions

    P3-1 落地后的互操作缺陷补充(详见 #95 评论):required workflow(org-gate)不在 merge_group 上下文上报 → merge-queue 仓的 auto-merge PR 因 required org-gate 永不满足而无法入队/合并(agent-registry PR#65 实测)。merge-queue ruleset 的 repo-level PUT 还需剥 integration_id: null 才可重放。建议 #92 收尾时与 org-gate required 的范围做联合决策。

  5. randypanding commented on Aug 21, 2026

    @randypanding
    randypanding
    on Aug 21, 2026
    ContributorAuthor
    More actions

    复核验证记录(2026-08-21,独立复测)

    ruleset 活体:agent-registry(21076429)/ template-service(21076438)的 merge-queue ruleset 均 enforcement=active(repo 级——org API 不支持 merge_queue 规则的实测结论已按 ADR-0042 修订落盘),参数保守串行(SQUASH、max_entries_to_merge=1、check 超时 60min)。

    端到端(T2/T3):#135 修复(org-gate v1.4.2 EXPECTED_SKIP)后,agent-registry PR#66/#67 经 merge queue 正常合并,队列分支 check 正常上报;此前 #61/#62 亦经队列合并(merge_group 上报实证)。

    T1 语义拦截机制(活体观察):#135 事件本身实证了核心机制——队列分支以「队列前缀 + 本 PR」组合树重验,check 红 → PR 被弹回(PR#65 实测弹回)。字面意义的双冲突 PR fixture 未单独留痕,按 ADR-0042「decisions/ 文档冲突形态等价执行」存档说明。

    T4 对账:drift-check §14 已上线(PR #117/#118/#119,含 GraphQL 枚举大小写归一修复)。

    互操作缺陷闭环:merge queue × required workflows 缺陷由 #135 跟踪并已修复关闭(v1.4.2)。

    范围说明:两仓试点为 ADR-0042 明确的观察期设计,全量扩围须修订 ADR(另行跟踪)。本卡验收标准已满足,关闭。

  6. randypanding
    closed this as completedon Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    auto-merge自动合并计划(#81)工作卡gateGate 工作流相关rulesetRuleset 配置相关

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.