用途:分析 dotnet 仓库中 VMR codeflow PR 的健康状况,覆盖两个方向——回流(dotnet/dotnet → dotnet/sdk 等产品仓库)与正向流动(产品仓库 → dotnet/dotnet)。
主要能力:脚本本身只收集数据,由使用者据此自行给出建议。支持两种模式:PR 分析模式(默认)与流动健康检查模式(-CheckMissing)。PR 分析会自动识别 PR 是否为空 diff、是否有 force push、是否合并或关闭,给出 NO-OP / IN PROGRESS / STALE / ACTIVE / MERGED / CLOSED 判定,并提取 VMR 提交、订阅 ID、构建信息、校验快照元数据、比较源新鲜度、区分自动更新与手动提交、解析 Maestro 历史评论,最后输出 [CODEFLOW_SUMMARY] JSON 供推理。流动健康模式检查官方构建新鲜度、查找缺失的回流 PR、扫描正向流动 PR 的过时与冲突。
使用方式(需已安装并认证 gh,即 gh auth login;在技能目录运行脚本或使用完整路径): ./scripts/Get-CodeflowStatus.ps1 -PRNumber 52727 -Repository "dotnet/sdk" ./scripts/Get-CodeflowStatus.ps1 -PRNumber 52727 -Repository "dotnet/sdk" -TraceFix "dotnet/runtime#123974" ./scripts/Get-CodeflowStatus.ps1 -PRNumber 52727 -Repository "dotnet/sdk" -ShowCommits ./scripts/Get-CodeflowStatus.ps1 -Repository "dotnet/roslyn" -CheckMissing ./scripts/Get-CodeflowStatus.ps1 -Repository "dotnet/sdk" -CheckMissing -Branch "main" 常用参数:-PRNumber、-Repository(默认 dotnet/sdk)、-TraceFix(格式 owner/repo#number)、-ShowCommits、-CheckMissing、-Branch。注意 -PRNumber 与 -CheckMissing 不可同时使用。
修复动作可使用 darc: darc trigger-subscriptions --id <subscription-id> --force darc trigger-subscriptions --id <subscription-id> darc get-subscriptions --target-repo dotnet/sdk --source-repo dotnet/dotnet darc get-build --id <bar-build-id> darc vmr resolve-conflict --subscription <subscription-id> darc 可通过任一 arcade 仓库中的 eng\common\darc-init.ps1 安装。
限制:严禁使用 gh pr review --approve 或 --request-changes,仅允许 --comment,批准与阻断需人工完成。当 gh API 调用失败(认证、限流)时脚本返回 Unknown,不可视为健康。aka.ms 短链仅接受 301 重定向,非 301 多为无效链接。若触发后数分钟仍无 PR,可能需检查 Maestro 健康或在 dotnet/arcade 提 issue。