Skip to content

Commit e4a03d2

Browse files
hotlongclaude
andauthored
ci(workflows): objectui-pin-freshness 补 merge_group 触发器,队列世代走 advisory 车道 (#6121) (#6252)
该 workflow 的注释明文邀请维护者把 `Console Pin Freshness` 加进 main 的 required 集,而它只订阅 pull_request + workflow_dispatch。合并队列在 gh-readonly-queue/** 世代上重新求值 required checks,一个在队列世代上不产生 check run 的 required context 会让每个世代永久等待(#3622 原型)。本仓队列是 活的(event=merge_group 共 2745 次运行,最近一批在今天 12:00 前后)。 三处改动,全部在同一文件内: 1. on: 增加裸键 merge_group:(与 ci.yml / lint.yml / spec-liveness-check.yml 同族写法)。 2. 邀请注释改写为带前置条件的邀请:加入 required 集之所以安全,正是因为 merge_group 触发器现在存在;后来的编辑者在保留/加入 required 前必须确认 该触发器仍在。 3. 车道判据由 `[ "$EVENT" != "pull_request" ]` 改为按事件显式分类。这一处是 加触发器的必要组成:该否定式在 on: 只有两项的年代等价于 workflow_dispatch, 加入 merge_group 后会把每个队列世代扫进 BLOCKING 车道,而脚本在 enforcing 模式下只要 pin != objectui main HEAD 就 exit 1 —— 即本文件自述的"两次 pin bump 之间的常态"。只加触发器会得到一个系统性飘红的队列检查,设为 required 后每个 PR 都被踢出队列,等于把 pending 死锁换成红色死锁,issue 想要的 "之后加 required 才安全"并不成立。新判据落实的是文件里已写下的既有政策 (blocks only on the release lane),不是新政策。 Claude-Session: https://claude.ai/code/session_01BDmDsu2575gDxeMCxXhDE3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent f7d80f4 commit e4a03d2

1 file changed

Lines changed: 45 additions & 5 deletions

File tree

.github/workflows/objectui-pin-freshness.yml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,35 @@ name: Console Pin Freshness
3131
# either way, so a green run on an ordinary PR still shows how far the pin has
3232
# drifted.
3333
#
34-
# REQUIRED-CHECK ENFORCEMENT IS NOT SELF-DECLARED
35-
# -----------------------------------------------
34+
# REQUIRED-CHECK ENFORCEMENT IS NOT SELF-DECLARED — AND IT HAS A PRECONDITION
35+
# ----------------------------------------------------------------------------
3636
# A workflow cannot make itself required. A maintainer must add the
3737
# `Console Pin Freshness` context to the branch-protection rule for `main`
3838
# (Settings → Branches → main → Require status checks to pass). Until then this
3939
# workflow REPORTS on the release PR without blocking the merge button.
40+
#
41+
# ⚠️ THE PRECONDITION IS THE `merge_group:` TRIGGER BELOW (#6121). Adding this
42+
# context to a required set is safe ONLY BECAUSE that trigger now exists. The
43+
# paragraph above states the PR half of the rule — "a required context that
44+
# reports nothing leaves every PR stuck" — and until #6121 this file invited
45+
# maintainers into the required set while missing the QUEUE half: branch
46+
# protection is evaluated AGAIN on the `gh-readonly-queue/**` generation, so a
47+
# required context that produces no run THERE parks every queue generation
48+
# forever (#3622 is the prototype for that deadlock).
49+
#
50+
# FUTURE EDITORS: before this context is added to — or left in — any required
51+
# set, confirm `merge_group:` is still in `on:` below. Deleting that trigger
52+
# does not fail loudly; it deadlocks the merge queue for every PR in the repo.
4053

4154
on:
4255
pull_request:
4356
branches: [main]
57+
# Merge queue (see ci.yml for the full note): a required context must report
58+
# on queue generations too, or queue builds wait forever on a check that never
59+
# arrives. This is the precondition documented above (#6121). Which LANE the
60+
# event lands in — blocking vs reporting — is decided in the pin-freshness
61+
# step below, not here.
62+
merge_group:
4463
workflow_dispatch:
4564

4665
concurrency:
@@ -87,12 +106,33 @@ jobs:
87106
# with the title configured in release.yml. Either identifies the lane;
88107
# both are checked so a future rename of one does not silently disarm
89108
# the gate.
90-
if [ "$EVENT" != "pull_request" ] \
109+
#
110+
# LANE BY EVENT — classify every new trigger HERE, explicitly (#6121).
111+
# This test used to read `[ "$EVENT" != "pull_request" ]`, a negation
112+
# that meant "workflow_dispatch" back when `on:` had exactly two
113+
# entries. Adding `merge_group:` is the moment that proxy breaks: the
114+
# negation would sweep every queue generation into the BLOCKING lane,
115+
# where this gate goes red whenever the pin lags — the repo's normal
116+
# state between bumps (see WHERE IT BLOCKS at the top) — and a required
117+
# context that is systematically red EJECTS every PR from the queue.
118+
# That would trade one deadlock for another rather than fix it.
119+
#
120+
# workflow_dispatch → BLOCKS. A human asked for the full check.
121+
# merge_group → reports. The queue generation of an ordinary PR
122+
# is an ordinary PR; the Version Packages PR is
123+
# enforced on its own `pull_request` run, and
124+
# release.yml runs this same script on the publish
125+
# path — the backstop with no override input.
126+
# pull_request → BLOCKS on the release lane only.
127+
#
128+
# HEAD_REF and PR_TITLE are empty on merge_group (no `pull_request` in
129+
# the payload), so the two release-lane tests are false there anyway.
130+
if [ "$EVENT" = "workflow_dispatch" ] \
91131
|| [ "$HEAD_REF" = "changeset-release/main" ] \
92132
|| [ "$PR_TITLE" = "chore: version packages" ]; then
93-
echo "::notice::Release lane — the objectui pin-freshness gate BLOCKS here (#3340)."
133+
echo "::notice::Release lane or manual run — the objectui pin-freshness gate BLOCKS here (#3340)."
94134
node scripts/check-objectui-pin-fresh.mjs
95135
else
96-
echo "::notice::Not the Version Packages PR — pin freshness is reported but does not block (a pin lagging between bumps is normal). It blocks on the release PR."
136+
echo "::notice::Not the release lane — pin freshness is reported but does not block (a pin lagging between bumps is normal). It blocks on the Version Packages PR and on the publish path."
97137
node scripts/check-objectui-pin-fresh.mjs --advisory
98138
fi

0 commit comments

Comments
 (0)