Skip to content

fix(ci): select current welcome required checks - #430

Merged
SigureMo merged 2 commits into
redai-studio:mainfrom
ShigureNyako:codex/fix-welcome-required-checks
Oct 11, 2026
Merged

SigureMo merged 2 commits into
redai-studio:mainfrom
ShigureNyako:codex/fix-welcome-required-checks

Conversation

@ShigureNyako

@ShigureNyako ShigureNyako commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

修复 welcome 评论中的 required CI 汇总:先选择每个检查身份当前有效的报告,再汇总结果,避免历史取消记录遮蔽后续成功。

仅修改 .github/actions/pr-welcome/merge-status.mjs,不修改训练代码、依赖或 welcome 发布流程。

按维护者的文件级反馈,已移除新增的版本控制测试文件;回归材料在工作树外保留并重跑,未新增 CI 或 hook 执行机制。

Why

Relates to #370。

复现时,gh pr checks --required 的 8 项检查均通过,但 head 的 GraphQL rollup 仍包含 7 条旧 CANCELLED 和 9 条 SUCCESS(Pre-commit 有两条成功报告)。原实现汇总全部同名记录,导致 welcome 的 CI 行错误显示未通过。REST filter=latest 仍保留跨 suite 的这些记录,不能单独解决问题。

本修复不是忽略所有取消:当前有效的失败、取消、等待及缺失仍如实阻塞,审批、团队要求和 GitHub 整体合入状态不因 CI 行修正而变成满足。

How

  • 完整读取分页后,CheckRun 按名称、App、workflow ID(无则名称)及 event 隔离身份;StatusContext 按 context 独立处理。同名 check/status、不同 provider/workflow/event 不互相覆盖。
  • CheckRun 取最大 databaseId 作为创建先后代理,覆盖尚无 startedAt 的新 queued/rerun;StatusContext 取最新 createdAt。不依赖 API 列表顺序,不偏好成功或非取消结果。
  • 选择有效报告之后再应用 isRequired;正 provider pin 校验 App。Legacy status 无 App 身份,同名多 provider pin 无法区分时保守保持等待。排序/provider 元数据缺失或完全相同的时序也保守保留可能阻塞的报告。
  • 保留每个 required context/provider 的 test-merge 优先与 head 回退、缺失为等待,以及 SUCCESS / NEUTRAL / SKIPPED 为通过。审批、团队及 overall 渲染逻辑保持不变。

边界:GitHub GraphQL schema 没有承诺 databaseId 跨任意 provider 的严格时间单调性;这里采用明确的创建顺序工程代理,并非完整复刻 GitHub 内部合入判定或 gh 的 startedAt 排序。多 provider legacy status 和缺失/相同时序的保守处理可能继续显示阻塞。最终合入资格仍由 GitHub 判定。

Testing

  • 外部手工回归:删除前将 50 场景 suite 保留在工作树外,测试的是与最终 merge-status.mjs 逐字节相同的副本。Node 24.21.0 与 26.11.1 各 50 passed / 0 failed / 0 skipped。该 suite 不在 PR 或版本控制中,也没有接入 CI;不将这次手工验证称为仓库自动回归覆盖。

  • pre-commit run --all-files --show-diff-on-failure:对移除测试后的最终代码在 Python 3.12 隔离工具环境执行,16 个 hooks 全部通过,没有跳过 hooks 或修改配置。先前 Python 3.14 下旧 docformatter 1.3.1 构建失败,Python 3.13 下缺少 lib2to3;切换验证工具解释器后通过,未修改项目依赖。

  • 原生产修复已通过独立只读本地审查:Node24 50/50、实际 API query/responses 离线重放、100 次 seeded 乱序、额外 17 个边界及 11 个非 CI 状态变体通过。本次仅移除测试文件,生产模块字节与该已审版本保持一致;随后重新执行上述外部手工回归和完整 hooks。原 50 场景对旧实现为 38 passed / 12 failed。

  • 手工场景覆盖旧取消后成功、旧成功后新失败/取消/等待、无开始时间的新 queued、provider/status 身份、分页、缺失检查及 head/test-merge 选择。对相同复现 snapshot,旧/新输出只有 CI 行由未通过改为通过;overall BLOCKED 和审批 0/1 等其它要求未变。

  • 未运行无关的完整 Python/GPU 集成测试、远程训练或部署;这是 JavaScript CI 汇总逻辑修改。本地结果不证明 hosted CI 或部署后 welcome UI 已更新。

  • pre-commit run --all-files passes

  • Tests pass (pytest tests/)

  • New tests added (if applicable)

  • Documentation updated (if applicable)

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD or build changes

Screenshots / Logs

同一复现输入的变化:

CI:        ❌ 未通过 -> ✅ 已通过
GitHub:    ⏳ 合入条件未满足 -> 不变
审批人数:  ⏳ 0/1 -> 不变

没有直接编辑 #370 的 welcome 评论,也没有触发 rerun 或部署。

联合署名对应参与诊断、变更审查、测试复核及发布协调的 Codex 协作者;实现及发布由 Nyako 执行。

This PR is co-authored with @codex (gpt-6.1 sol xhigh)

Keep check and status identities separate and select effective reports before
aggregating required results. Use check creation IDs rather than nullable
provider start times, and preserve provider pins, pending checks and failures.

Cover historical cancellations, later failures and waiting reruns, status and
provider boundaries, pagination, and unchanged merge requirements.

Co-authored-by: Codex <[email protected]>
@rai-studio-bot

rai-studio-bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for contributing to Relax, @ShigureNyako! 感谢你为 Relax 做出贡献!

📚 Contribution guide / 贡献指南

Describe the problem, your changes, and how you validated them. Keep each PR focused and run pre-commit run --all-files before submitting.

请说明问题、改动和验证方式,保持 PR 聚焦,并在提交前运行 pre-commit run --all-files。

English contribution guide · 中文贡献指南

🛠️ CI commands / CI 指令
Command / 指令 Usage / 用途
/rerun Retry failed CI / 重跑失败的 CI
/rerun <target> Rerun a workflow or check / 重跑指定 workflow 或检查
/cancel <workflow> Cancel an entire workflow / 取消整个 workflow
/help Show commands and targets / 查看指令和 target
/review Request a code review / 请求代码 review

Put one command on the first line of a new PR comment. Rerun/cancel require PR authorship or repository write access.

在新 PR 评论的首行写一条指令。PR 作者或有仓库写权限的贡献者可以重跑、取消 CI。

CI usage and targets · CI 用法与 target

🔎 Merge requirements / 合入条件

GitHub:✅ 满足合入条件

Requirement / 条件 Status / 状态
审批人数 ✅ 1/1 · 至少 1 位有仓库 write 或更高权限的人 Approve · 已审批:SigureMo
团队审批(relax-block-reviewers) ✅ 1/1 · 已审批:SigureMo
CI ✅ 已通过

@rai-studio-bot

rai-studio-bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: ec73cc2

目标分支: main

审查完成并已 APPROVE(ec73cc23)。生产文件与 f7a76f5 已审版本逐字节一致,修复行为经生产路径实测验证(#370 真实 rollup 上旧实现 ❌ → 本实现 ✅,PR 自身数据无回归)。增量变更仅剩按维护者请求删除回归测试(原 P2 跟进项随之失效,已在原线程说明;merge-status 回到无回归覆盖的明确取舍)。

审查阶段进度范围与结果
常规审查 ✅ 已完成 复核增量:merge-status.mjs 与 f7a76f5 已审版本逐字节一致(git diff 为空),既有实测结论(#370 新旧对比、REST filter=latest 不足、#430 无回归)全部沿用;删除的测试文件在仓库内无残留引用;CI 在当前 head 无失败项。
深度审查 ✅ 已完成 必要性结论沿用已审版本:身份元组选择机制保留(REST filter=latest 与按 name 单桶去重均被实测/测试证据排除);databaseId 创建序代理与保守回退的取舍有实测与边界测试支撑。生产精简审查完成;测试范围在本 head 已不存在(测试文件按维护者决定移除),见 tests 审计说明。

审查发现

待处理
编号 严重性 问题状态规则来源
暂无待处理的记录。
已解决或已取代
编号 严重性 问题状态规则来源
F1 Medium severity 回归测试未被任何 CI 或 hook 执行 ➖ 已被后续变更取代 —
提交范围 · 接收 1 · 建议移出 0 · 待确认 0

接收 1 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。

文件结论仓库维护必要性依据替代去向或方案
.github/actions/pr-welcome/merge-status.mjs
接收 与 f7a76f5 已审版本逐字节一致(git diff 为空),复用既有准入决定:修复 #427 引入的 welcome CI 行汇总缺陷,是 pr-welcome composite action 的生产路径(index.mjs::run → pr-welcome.yml,已实测验证)。 PR #430 描述(Relates to #370);生产调用方 .github/actions/pr-welcome/index.mjs:43 与 .github/workflows/pr-welcome.yml。 改用 REST check-runs filter=latest 不可行(已在 #370 head 实测仍返回跨 suite 双记录);按 name 单桶去重会混淆不同 workflow/event/app 的同名检查;现有身份元组是保留 per-provider 语义的最小机制。
精简审查与验证依据
审查范围进度结论
生产代码 ✅ 已完成 选择机制与保守回退均有保留依据,未发现可删除或合并的机制。
测试 ➖ 无需执行 本 head(ec73cc23)的变更范围已无测试文件:merge-status.test.mjs 按 @SigureMo 的移除请求在 f7a76f5 之后删除,仓库内无残留引用。测试套件在 f7a76f5 轮的审计(50 用例直接测真实模块、对旧实现 12/50 失败的变异检测力)已留档;移除后的无回归覆盖现状是维护者明确决定,见已发布的审查记录与原线程。

生产代码的必要性与替代方案

范围必须保留的契约更简单的方案结论依据与限制
currentChecks 的身份分组与 databaseId/createdAt 排序代理,及 ciStatus 的 provider pin 匹配 welcome CI 行须反映每个 required 检查身份(name+app+workflow+event)当前有效的报告;不同 provider/workflow/event 的同名报告不得互相覆盖;当前失败/取消/等待仍阻塞(PR #430 描述,Relates to #370)。 更小的替代:REST check-runs filter=latest、按 name 单桶去重、或改用 startedAt 排序。 保留 REST filter=latest 在 #370 head 实测仍返回 cancelled+success 双记录;按 name 去重会混淆不同 workflow/event/app 的同名检查;startedAt 对无开始时间的 queued/rerun 失效,且分组内单 app 使 databaseId 单调性只需组内成立。作者已在 PR 边界声明这是创建序代理而非 GitHub 判定复刻。限制:合并资格最终由 GitHub 判定,无法直接观测 GitHub 内部选择。
Powered by Nyanpasu with glm-5.3-flash max, please check the suggestions carefully.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

移除掉

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review 结论

常规与必要性行审查完成(2/2 文件全部接收)。CI 行修复的行为已在生产路径上实测验证;一个 P2 跟进项(测试执行机制),并请留意 @SigureMo 对测试文件的移除请求。

实测验证(通过 gh CLI 驱动真实模块 + 真实 GitHub 数据,pinned head f7a76f50):

  • 缺陷与修复:在 #370 head 的真实 rollup(7 组同名 required 报告为旧 CANCELLED + 新 SUCCESS、Pre-commit 两条 SUCCESS)上,merge-base 实现输出 CI ❌ 未通过,本 PR 实现输出 CI ✅ 已通过;PR #430 自身(当前无重复报告)新旧输出一致,无回归。审批/团队/overall 行保持不变,GitHub 整体仍 ⏳。
  • 方案取舍成立:REST filter=latest 实测仍返回 #370 的 cancelled + success 双记录,不能单独解决(与 PR 描述一致);按 name 单桶去重会让不同 workflow/event/app 的同名检查互相覆盖。身份分组 + databaseId 创建序代理是保留 per-provider 语义的最小机制(每组单一 app,单调性只需组内成立);先选最新再应用 isRequired/provider pin 的顺序同样有测试约束。缺失元数据与同时序的保守回退方向正确(宁可继续显示阻塞)。
  • 测试:50/50 通过(Node 24.21.0);对旧实现 38/12 失败,与 PR Testing 声明一致;expectEitherOrder 消除列表顺序依赖,渲染不改写快照的断言齐备。

待决:测试文件的去留(维护者已留言)。行级评论补齐了决定所需的证据:目前没有任何 CI/hook 执行该测试;移除则 merge-status 回到无回归覆盖,保留则需接入 CI。

范围、必要性与证据明细:Nyanpasu 审查看板。

Powered by Nyanpasu with glm-5.3-flash max, please check the suggestions carefully.

Comment on lines +1 to +3
import assert from 'node:assert/strict'
import { test } from 'node:test'
import { loadMergeStatus, renderMergeStatus } from './merge-status.mjs'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Medium severity P2 · 回归测试未被任何 CI 或 hook 执行

补充一项与 #discussion_r4241962221(移除该测试文件)去留决定相关的实测证据,两条路径都成立:

  • 执行机制缺失:.github/workflows/(ci.yml 只跑 pytest)与 .pre-commit-config.yaml 均无 node --test;根 package.json 只有 docs 脚本;这也是仓库中唯一的 *.test.* 文件。回归会静默通过 CI——本次要修的汇总缺陷正是 ci: show live PR merge requirements #427 落地时没有测试兜底才进入主干的。
  • 检测力已验证:这 50 个用例直接测真实模块(renderMergeStatus / loadMergeStatus),对 merge-base 旧实现跑出 38 通过 / 12 失败,恰好对应本次修复的行为差异;loading paginates... 对 GraphQL 查询字段的断言还能防止选择逻辑与查询脱节。

因此:若按维护者意见移除该文件,则 merge-status 回到无回归覆盖的现状(可接受,但属明确取舍);若保留,建议在 ci.yml 增加轻量 job(ubuntu-latest 自带 Node 20+,零新依赖):

  merge-status-tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: node --test .github/actions/pr-welcome/merge-status.test.mjs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

测试文件已在 ec73cc23 按维护者意见移除,该跟进项随之失效(“无执行机制”不再存在)。取舍已记录在审查记录中:merge-status 回到无回归覆盖的现状,属明确决定而非遗漏。

Remove the newly committed test file as requested in PR redai-studio#430.
Keep the reviewed production merge-status module unchanged and preserve the
regression suite outside the checkout for manual verification.

Co-authored-by: Codex <[email protected]>

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review 结论(更新至 ec73cc23)

上一轮审查(f7a76f50)的全部结论在当前 head 继续成立,本轮复核了增量变更并随即可关闭:

  • 生产代码逐字节未变:git diff f7a76f50..ec73cc23 -- .github/actions/pr-welcome/merge-status.mjs 为空。已验证的行为不变:在 #370 head 的真实 rollup 上旧实现输出 CI ❌ 未通过、本 PR 实现输出 CI ✅ 已通过;PR #430 自身数据无回归;REST filter=latest 不足、身份元组 + 创建序代理的取舍均已在上一轮以生产路径实测确认。
  • 增量变更只有一项:按 @SigureMo 的移除请求删除 merge-status.test.mjs(402 行)。仓库内已无对该文件的任何引用。上一轮的 P2 跟进项(测试未被任何 CI 执行)随文件删除而失效,已在原线程说明;取舍是 merge-status 回到无回归覆盖的现状,属明确决定。
  • CI 在当前 head 无失败项。

完整范围、必要性与证据明细:Nyanpasu 审查看板。

Powered by Nyanpasu with glm-5.3-flash max, please check the suggestions carefully.

@SigureMo
SigureMo merged commit 5b0f39e into redai-studio:main Oct 11, 2026
20 of 21 checks passed
Mukayi added a commit to Mukayi/Relax that referenced this pull request Oct 12, 2026
…er-profiler

Brings in upstream/main 653c43c..dce533b (redai-studio#257, redai-studio#258, redai-studio#285, redai-studio#323, redai-studio#330,
redai-studio#335, redai-studio#408, redai-studio#409, redai-studio#412, redai-studio#414, redai-studio#416, redai-studio#417, redai-studio#419-redai-studio#421, redai-studio#424, redai-studio#426, redai-studio#427,
redai-studio#430, and 42 commits synced on 10-12 without PR numbers).

The only conflict is relax/utils/env.py: cc4b052 adds the DeepSeek-V4
MXFP4 QAT variables at the same spot where this branch adds the straggler
profiler variables. Resolved by keeping both blocks, straggler first.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants