Repository navigation
ci(dependabot): 入队改用「重试到必需检查通过」,修 #207 的自锁死 - #208
Merged
Merged
Conversation
#207 用 `mergeStateStatus == CLEAN` 判断“检查跑完”,但**本 job 自身也是一个 check** (job 名 `dependabot`):只要它还在轮询,状态就永远不是 CLEAN —— 实测 #205 / #206 的 唯一 pending 检查正是 `dependabot` 自己,等于等到超时才告警,PR 依旧不合入。 改为不猜状态,直接反复调 `enqueuePullRequest`,由 GitHub 用它自己的必需检查清单裁决: - 成功 → 打印队列位置并退出; - `required status checks have not succeeded` / `not mergeable` / `still in progress` → 45s 后重试,最多 40 次(30 分钟); - `is closed` / `already in the merge queue` → 无需处理; - 其它错误 → `::warning::` 带上原文退出,不静默。 这样既避开了自锁死,也不依赖对 mergeStateStatus 语义的猜测。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#207 的自锁死
#207 用
mergeStateStatus == CLEAN判断“必需检查跑完”,但 job 自身也是一个 check(job 名就叫dependabot):只要它还在轮询,状态就永远到不了CLEAN。实测 #205 / #206(run 45106782960 / 45106805540,已手动 cancel):
—— 唯一还没完成的检查就是 workflow 自己。结果是等到 30 分钟超时才告警,PR 依旧不合入。
改动
不再猜
mergeStateStatus的语义,直接反复调enqueuePullRequest,让 GitHub 用它自己的必需检查清单裁决(它返回的required status checks have not succeeded才是权威答案):required status checks have not succeeded/not mergeable/still in progressis closed/already in the merge queue::warning::带上原文退出,不静默成功入队的 PR 会由 merge queue 自己跑 merge group CI,通过才落库;major 升级依旧不自动入队。
验证计划
合入后对 #205 / #206 再发一次
@dependabot rebase→ 新 workflow 应在 CI 跑完后自动入队(日志出现已加入 merge queue(第 N 次尝试)+state:QUEUED),全程无人工enqueuePullRequest。