Problem
PR #4798 was merged into main with all CI checks failing (Lint ❌, Test ubuntu/macos/windows ❌), introducing a TypeScript syntax error that broke tsc --build on main. The root cause was a missing }); in a test file, which the PR's own CI had already caught — but there was no branch protection rule preventing the merge.
Impact
Proposal
Enable "Require status checks to pass before merging" in the branch protection rules for main. The following checks should be marked as required:
| Check |
Reason |
Lint |
Catches syntax errors, formatting, eslint violations |
Test (ubuntu-latest, Node 22.x) |
Core test suite |
Test (macos-latest, Node 22.x) |
Platform-specific behavior |
Test (windows-latest, Node 22.x) |
Platform-specific behavior |
Bypass Strategy
开启 required checks 后,仍然可以保留紧急情况下的 bypass 能力:
| Scenario |
Approach |
| Hotfix that needs to skip CI |
Grant core maintainers bypass permission — GitHub shows a warning "merging without required checks" on merge |
| Doc-only / typo changes |
Admin bypass; or configure paths-ignore in workflows so CI auto-skips (skip status counts as pass) |
| Bot auto-merge (e.g. release sync) |
Add bot account to the bypass list |
Recommended config: enable required checks + grant bypass permission to core maintainers only. Normal PRs must have green CI to merge, but emergencies can still be handled with human judgment.
Action Items
This is a settings change in GitHub → Settings → Branches → Branch protection rules for main. It requires admin access to the repository.
- Enable "Require status checks to pass before merging" with the four checks above
- Add core maintainer team to bypass list (NOT "Do not allow bypassing" — keep the escape hatch)
- Optionally enable "Require branches to be up to date before merging"
中文说明
问题
PR #4798 在 CI 全部失败(Lint ❌,Test ubuntu/macos/windows ❌)的情况下被合入 main,引入了一个 TypeScript 语法错误,导致 tsc --build 失败,main 分支 CI 全线挂掉。该 PR 自身的 CI 已经检测到了这个错误,但由于没有分支保护规则阻止合并,仍然被合入了。
影响
建议
在 main 分支保护规则中启用 "Require status checks to pass before merging",将以下 check 设为必需:
| Check |
用途 |
Lint |
语法错误、格式、eslint 检查 |
Test (ubuntu-latest, Node 22.x) |
核心测试 |
Test (macos-latest, Node 22.x) |
平台兼容性 |
Test (windows-latest, Node 22.x) |
平台兼容性 |
Bypass 策略
开启 required checks 后,仍然可以保留紧急情况下的绕过能力:
| 场景 |
方案 |
| 紧急 hotfix 需要跳过 CI |
给核心 maintainer 设 bypass 权限,合并时 GitHub 会提示警告 |
| 纯文档/typo 改动 |
Admin bypass;或在 workflow 中配 paths-ignore 让 CI 自动 skip |
| Bot 自动合并(如 release sync) |
把 bot 账号加到 bypass list |
推荐配置: 开启 required checks + 仅给核心 maintainer 保留 bypass 权限。常规 PR 必须 CI 绿灯才能合入,紧急情况仍可人工判断后绕过。
操作步骤
需要仓库 admin 在 GitHub → Settings → Branches → Branch protection rules 中操作:
- 启用 "Require status checks to pass before merging",勾选上述四个 check
- 将核心 maintainer 团队加入 bypass list(不要勾选 "Do not allow bypassing"——保留紧急通道)
- 可选:启用 "Require branches to be up to date before merging"
Problem
PR #4798 was merged into
mainwith all CI checks failing (Lint ❌, Test ubuntu/macos/windows ❌), introducing a TypeScript syntax error that broketsc --buildon main. The root cause was a missing});in a test file, which the PR's own CI had already caught — but there was no branch protection rule preventing the merge.Impact
Proposal
Enable "Require status checks to pass before merging" in the branch protection rules for
main. The following checks should be marked as required:LintTest (ubuntu-latest, Node 22.x)Test (macos-latest, Node 22.x)Test (windows-latest, Node 22.x)Bypass Strategy
开启 required checks 后,仍然可以保留紧急情况下的 bypass 能力:
paths-ignorein workflows so CI auto-skips (skip status counts as pass)Recommended config: enable required checks + grant bypass permission to core maintainers only. Normal PRs must have green CI to merge, but emergencies can still be handled with human judgment.
Action Items
This is a settings change in GitHub → Settings → Branches → Branch protection rules for
main. It requires admin access to the repository.中文说明
问题
PR #4798 在 CI 全部失败(Lint ❌,Test ubuntu/macos/windows ❌)的情况下被合入
main,引入了一个 TypeScript 语法错误,导致tsc --build失败,main 分支 CI 全线挂掉。该 PR 自身的 CI 已经检测到了这个错误,但由于没有分支保护规则阻止合并,仍然被合入了。影响
建议
在
main分支保护规则中启用 "Require status checks to pass before merging",将以下 check 设为必需:LintTest (ubuntu-latest, Node 22.x)Test (macos-latest, Node 22.x)Test (windows-latest, Node 22.x)Bypass 策略
开启 required checks 后,仍然可以保留紧急情况下的绕过能力:
paths-ignore让 CI 自动 skip推荐配置: 开启 required checks + 仅给核心 maintainer 保留 bypass 权限。常规 PR 必须 CI 绿灯才能合入,紧急情况仍可人工判断后绕过。
操作步骤
需要仓库 admin 在 GitHub → Settings → Branches → Branch protection rules 中操作: