Repository navigation
feat(triage): assign one accountable owner when a PR opens, and when deferring - #9813
Conversation
b58d991 to
bafef3e
Compare
|
Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. 中文请勿对活跃的 PR 执行 rebase 或 force-push,因为这会使已有的评审评论失效。另外,供日后参考:作为集成流程的一部分,机器人始终会自动将所有改动压缩(squash)为单个提交。 |
|
Closeout — cap-4 round on the four Criticals of the 18:36Z review, pushed R1-1 — coverage no-op FIXED ( R1-2 — missing token scope FIXED ( R1-3 — 100-file cap FIXED ( R1-6 — size ratchet FIXED ( Verification: The 7 Suggestions from this review round are deliberately deferred to a follow-up round (cap budget). |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
|
Closeout — round-1 cap (4 of the 7 standing Suggestions fixed, one non-force push
Verification: Deferred to a future cap round (unchanged, still open): R1-9 (prefix-shape validation), R1-10 2/2 (case-insensitive idempotency test), R1-14 ( |
|
Closeout — remaining 3 round-1 Suggestions fixed (one non-force push
Verification: both guard suites |
|
@qwen-code /triage |
|
Closeout update:
|
75d93aa to
5f3a251
Compare
The defer path resolves the maintainer deterministically from the existing owner map (same area/labels/load/rotation logic as issue assignment) and assigns the PR to them, instead of an ambiguous $QWEN_MAINTAINER_HANDLE / most-recent-reviewer chain. Replaces the reviewer-request routing prototype entirely.
5f3a251 to
d2c4cd6
Compare
|
Closeout update: fixed the exact-head CI workflow-size failure by updating the |
|
@qwen-code /triage |
Maintainer verification: real Actions runs + live-queue replayI verified this on a real stack rather than by reading the diff: six real GitHub Actions runs of Headline: the mechanism works — the one thing I could not settle locally (does Harness — what was real and what was substituted
What holds up1. Real The PR really does end up assigned: 2. 3. Idempotent on repeated pushes. The next 4. Every skip branch reproduces on live production data (
5. Dry-run writes nothing. The wire-tee ledger recorded 141 real 6. 7. No regression to issue assignment. Replaying 8. The new tests are load-bearing. 8/8 mutations went red:
FindingsF1 — A failed assign shows up as a red ✗ on the contributor's PR (please fix before merge)Two real runs failed, both surfacing as a failed check on the PR:
Neither message matches the graceful-skip filter, which only recognises Two asymmetries worth closing:
Severity note: F2 — "Longest matching prefix wins" becomes "longest directory name wins" between siblingsLongest-prefix is a specificity rule only when one prefix nests inside the other ( The extreme case: #9812 touches 2656 files across every core module and routes to F3 — The load metric counts issues only, so PR assignment has no feedback loopProven against the live API: Consequence on today's queue: Compounding it: 7 of the 9 areas have exactly one owner, so load and rotation do nothing there at all. Replaying the whole open queue:
F4 — The module → owner map does not match the history it was drafted fromThe PR says the map came from six months of per-directory commits and asks for correction in review, so here is that data (
Two things stand out:
Commit count is of course a proxy — if these owners were chosen for review load rather than authorship, that is a fine answer; it just is not what the PR description says the map was derived from. F5 — Part 2 (the defer path) cannot fire today
Running the
So all four branches are correct — but in production the deterministic owner-map branch is unreachable until PRs start carrying area labels. The new (Also verified: the relative F6 — A review counts as coverage, so the existing backlog stays ownerless
New PRs are unaffected — at F7 — Minor
VerdictRecommend merge once F1 is addressed. It is the only finding that puts a red ✗ on a contributor's PR, and both halves of the fix are small and match patterns already in the file ( F2–F4 are tuning rather than correctness, but F4 is worth correcting before this starts routing — the PR explicitly asks reviewers to fix the map, and Everything the description claims about safety checks out at the wire: trusted-base checkout, no PR-authored text read, sparse credential-free checkout, push access re-verified live, pre-write re-fetch, base64 filename decoding. 中文版报告(点击展开)维护者验证:真实 Actions 运行 + 全量队列回放我没有停留在读 diff,而是搭了真实环境:在 fork 上真跑了 6 次 GitHub Actions(真实 结论先说:机制是work的。本地唯一无法回答的问题—— 验证手段说明
站得住的部分
问题清单F1 — assign 失败会在贡献者 PR 上留下红叉(建议合并前修) 两次真实运行失败,且都表现为 PR 上的失败检查:
两条错误都不匹配 有两处不对称值得补齐:
严重性说明: F2 —「最长前缀优先」在兄弟模块之间退化成「目录名更长者胜」 只有当一个前缀嵌套在另一个里面时( 极端案例:#9812 改动 2656 个文件、横跨 core 全部模块,最终路由到 F3 — 负载口径只数 issue,PR 分配没有反馈闭环 线上实证: 今天队列上的后果: 叠加问题:9 个 area 里有 7 个只有一位 owner,负载与轮转在那里完全不起作用。全量回放分布:
F4 — 模块 owner 映射与它自称的依据(提交历史)对不上 PR 说这份映射来自最近半年的分目录提交记录并请求 review 校正,那就把这份数据摆出来(
两点最突出:
当然提交数只是代理指标——如果这些 owner 是按 review 负担而非编码量选的,那完全合理;只是 PR 描述里说的依据不是这个。 F5 — 第二部分(defer 路径)今天根本触发不了
逐字执行
四条分支逻辑都正确——但在生产环境里,"确定性 owner 地图"这条分支在 PR 开始带 area label 之前是不可达的。新增的 (另外已验证: F6 — review 被当作"已覆盖",导致存量积压永远拿不到责任人
新 PR 不受影响—— F7 — 次要
结论建议在处理 F1 后合并。 它是唯一会在贡献者 PR 上留下红叉的问题,而两半修复都很小,且与文件里已有的写法一致( F2–F4 属于调优而非正确性,但 F4 值得在它开始真正路由之前修正——PR 自己就请求 review 校正这份映射,而 描述中关于安全性的每一条都在协议层面得到确认:可信 base 检出、不读取任何 PR 正文、稀疏且无凭据的 checkout、写入前复核 push 权限、写入前重新拉取、文件名 base64 解码。 Actions runs used as evidence / 作为证据的 Actions 运行
|
# Conflicts: # .github/workflows/.size-baseline # .github/workflows/ci.yml
The triage lane's permissions.deny blocks any run_shell_command whose text contains a backtick, so the template literal in canWrite() and the backticked "author": null comment made the whole resolver command EXECUTION_DENIED before approval. Use string concatenation, de-backtick the comment, and pin the invariant with a witness test that turns red if a backtick is reintroduced into the resolver block. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
CI failure classification for run 33157589820 at head a78d5d5: not caused by this PR.
Failed-jobs rerun triggered. |
|
@qwen-code /triage |
1 similar comment
|
@qwen-code /triage |
gh pr edit --add-assignee goes through replaceActorsForAssignable, which
GitHub refuses for GitHub App installation tokens when the PR already
carries a coding-agent assignee ("Assigning agents is not supported with
GitHub App installation tokens"). The graceful-skip filter did not match
that refusal, so main() rethrew and the assignment check ran red on the
contributor's own PR. Recognize the refusal and skip like the other
token-limit cases; the PR already has an accountable actor.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
The load lookup fans out one gh issue list per eligible owner (up to 15 for the core pool) with no guard; one transient failure — secondary rate limit, 5xx, issues disabled — threw straight up and ran the assignment check red, while the sibling canWrite() lookup deliberately warns and continues. Wrap the lookup in the same pattern: retry once, then warn and degrade to a zero load so the rotation still lands an owner — the load metric is a tie-break heuristic, not a gate on assigning. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
Addressing F1 from review #5051916037 — both halves fixed at the commit level, one checkpoint each:
Verification at 回应评审 #5051916037 的 F1,两半各一个检查点提交:
验证于 |
|
@qwen-code /triage |
Ratchet the ci.yml size baseline to the post-merge 91453 bytes; the HELPER_TESTS list keeps both the main-side additions and assign-pr-owner.test.mjs. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
CI classification for head 5f04fd2 (merge-main; conflict resolved by user):
|
A dismissed review is a removed review in GitHub's model. Filtering it out of alreadyCovered() keeps a PR whose only mapped-owner involvement is a dismissed review eligible for assignment, instead of skipping the gate and staying ownerless on every later trigger. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
|
@qwen-code /resolve |
Runtime verification report — built a real harness for this PR and ran itI did not review this by reading. I built an execution harness around the code this PR ships and drove it: the real Verdict: the mechanism is sound and I found no correctness bug. Every guard the PR adds is load-bearing, and the PR's own suite has real teeth. Everything I'd want changed is about whom it picks, not whether or how it picks. 1. The harness
2. What holds under execution
3. TeethAll 7 reverted guards flip behaviour, and 16 of 17 mutants turn the PR's own suite red. One survives. FindingsF1 — longest prefix wins by string length, not by where the diff lives
Concretely:
The PR description says "a PR goes to the owner of the specific module it touches". On real diffs it goes to whichever touched module happens to have the longest path string. Suggestion: rank by how many of the PR's changed files each area owns (falling back to prefix length only to break a tie), or require the winning module to hold a plurality of the mapped files. F2 — the load metric has no feedback loop on the PR side
With today's live counts ( This is a genuinely new problem rather than an inherited one: for issues the metric self-corrects, because the assignment it makes raises the very count it read. For PRs it never does. Suggestion: count open PRs where the owner is assignee or requested reviewer, or add assigned-PR count to the metric. F3 — removing a mis-routed assignee is undone by the next push"no-ops once a mapped owner is already an assignee" holds only while the assignee stays. A maintainer who is wrongly routed a PR and removes themselves without leaving a review gets it re-assigned on the very next F4 — the initial module owner map vs six months of real historyYou asked for this to be corrected in review, so here is the data. Resolving commit authors to GitHub logins through the commits API, 6 of the 8 module owners are not the top committer of the module they own:
Also worth a look: F5 — one blind spot in the new suite (test-only, no product bug)The case-insensitivity assertion in F6 — minor: a dead run and an empty pool look identicalIf every Notes
Recommendation: mergeable as a mechanism. F1 and F2 are the two I would fix before this starts assigning for real, since together they mean a large share of core PRs land on the wrong module owner and a single person absorbs the generic pool. F4 is a config edit and can land with the PR. 中文版报告运行时验证报告 —— 为这个 PR 搭了一套真实执行环境并跑了起来我没有靠读代码来 review。我围绕这个 PR 交付的代码搭了一套执行环境并驱动它:真实的 结论:机制是可靠的,没有发现正确性缺陷。 PR 新增的每一道防线都是有效的(去掉就会翻车),PR 自带的测试也确实有牙。我想改的全部集中在"选谁",而不是"要不要分配"和"怎么分配"。 1. 验证环境
因为 2. 执行下站得住的部分
3. 有没有牙7 处防线回退后行为全部翻转;17 个变异里 16 个能把 PR 自带套件打红,1 个存活。 问题清单F1 —— 最长前缀比的是字符串长度,不是改动实际落在哪
具体例子:
PR 描述写的是"PR 分配给它实际触碰的那个模块的负责人";在真实 diff 上,它分给的是"被触碰的模块里路径字符串最长的那个"。建议:按每个领域拥有该 PR 多少个改动文件来排序(并列时再用前缀长度兜底),或要求胜出模块至少占已映射文件的相对多数。 F2 —— PR 侧的负载指标没有反馈闭环
用今天的真实数据( 这不是继承来的老问题,而是新引入的:对 issue 来说这个指标能自我修正,因为它做出的分配会抬高它刚读过的那个计数;对 PR 来说永远不会。建议:把"该 owner 作为 assignee 或 requested reviewer 的 open PR 数"计入负载。 F3 —— 手动移除错配的 assignee 会被下一次 push 撤销"一旦某位映射 owner 已在 PR 上就 no-op"只在 assignee 一直留着时成立。被错配到的 maintainer 如果没有留下 review 就把自己移除,下一次 F4 —— 初始模块 owner 映射 vs 最近半年真实提交历史你在描述里请求 review 时校正这一项,数据如下。通过 commits API 把提交作者解析成 GitHub login 后,8 个模块 owner 里有 6 个不是自己模块的头号提交者:
另外值得一看: F5 —— 新增测试里的一个盲点(只是测试问题,代码没 bug)
F6 —— 次要:跑死了和"确实没人"长得一模一样如果所有 说明
结论建议:机制层面可以合并。 真正开始自动分配之前我建议先修 F1 和 F2——这两条叠加起来意味着相当比例的 core PR 会落到错误的模块负责人身上,同时大池子会被一个人全部吸收。F4 只是配置改动,可以随本 PR 一起进。 |
|
Qwen Code attempted to resolve merge conflicts but the run did not complete successfully. Check the workflow run for full logs. |
|
@qwen-code /triage |
Resolve the workflow-size ratchet conflict for ci.yml by keeping the baseline recorded on main (95501); the merged file is within the growth allowance, so no extra bump is needed in this PR. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>











What this PR does
Assigns exactly one accountable maintainer to PRs that touch a mapped area.
A trusted
pull_request_targetworkflow routes changed paths through.github/issue-owners.json. The longest matching module prefix wins; if no module is eligible, routing falls back to the area pool. The script reuses the issue-assignment load metric and rotation, verifies push access before writing, ignores PR-authored title/body/comment text, and becomes a no-op once a mapped owner is assigned or has reviewed.When automated triage defers a PR, the fallback now resolves one maintainer deterministically (environment override, label owner map, then most recent human reviewer) and assigns that person instead of only mentioning them. Only the core area initially opts into path routing.
Why it's needed
A mention is easy to lose and does not place the PR in anyone's Assigned view. Assignment previously happened only in the AI-uncertain fallback, leaving most mapped core PRs without one accountable owner.
Reviewer Test Plan
Verify that a PR touching
packages/core/receives exactly one eligible owner, subsequent synchronize events do not stack assignments, module-specific ownership wins over the area pool, and unmatched paths remain untouched. Confirm that fork PR content cannot influence routing because checkout and configuration come from the trusted base ref.How to verify
Run
GITHUB_REPOSITORY=QwenLM/qwen-code PR_NUMBER=<n> DRY_RUN=true node .github/scripts/assign-pr-owner.mjsfor a mapped PR, an already-owned PR, and an unmatched PR. Expect one deterministic owner, an idempotent skip, and no assignment respectively. The current implementation was dry-run against #9926, #9940, and #9943 for those paths.Evidence (Before & After)
Before: mapped PRs could receive only a mention and remain absent from every maintainer's Assigned view.
After: mapped PRs get one deterministic eligible assignee on open/synchronize, while deferred triage uses the same accountability outcome.
Tested on
Risk & Scope
paths.pathsfield is ignored by issue assignment; other areas opt in explicitly.Linked Issues
No linked issue was provided.
中文说明
本 PR 做什么
让每个命中已配置领域的 PR 恰好拥有一位明确责任人。可信的
pull_request_target工作流根据变更路径和.github/issue-owners.json路由;最长模块前缀优先,模块 owner 不可用时回落到领域池。写入前复核 push 权限;一旦映射 owner 已被 assign 或已 review 就不再重复分配。triage defer 时也会按环境覆盖、label owner 映射、最近人类 reviewer 的顺序确定并 assign 一位 maintainer。为什么需要
仅 @mention 容易淹没在通知中,也不会进入任何人的 Assigned 视图。此前 assignment 只存在于 AI 无法判断的兜底路径,多数 core PR 没有明确责任人。
Reviewer Test Plan / How to verify
验证
packages/core/变更只分配一位合格 owner、重复 synchronize 不叠加、模块 owner 优先、未命中路径保持不变,并确认 fork PR 的不可信正文不能影响路由。可用英文部分的 DRY_RUN 命令检查命中、幂等和未命中三条路径;当前已对 #9926、#9940、#9943 dry-run。Evidence / Tested on
此前只 mention;现在 open/synchronize 和 defer 都产生一位确定 assignee。本地 Node.js dry-run 与 GitHub workflow 路径已验证。
Risk & Scope
主要风险是 owner map 不准确导致路由给错误但合格的 maintainer;确定性的最长前缀规则让结果可审计。issue assignment、模型路由以及未声明
paths的其他领域不在范围内;可选paths不影响 issue assignment。Linked Issues
未提供关联 issue。