Skip to content

[PR] fix(ci): preserve live fork PR runs during janitor cleanup - #6221

Closed
Afloat16 wants to merge 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-11_janitor-fork-heads
Closed

Afloat16 wants to merge 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-11_janitor-fork-heads

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Related to the CI consolidation issue #4599.

Problem

The janitor tests every PR head branch in the upstream repository. A branch owned by a contributor fork is therefore reported as deleted even while it still exists, and its active CI run is cancelled. Any failed branch API request is also treated as deletion.

This is happening in production: janitor run https://github.com/ranxianglei/billion-context/actions/runs/42987251353/job/130411257674 cancelled multiple live fork runs with the reason head branch ... deleted. For example, run https://github.com/ranxianglei/billion-context/actions/runs/42985136714 belongs to Afloat16/billion-context, branch 2026-11-11_responses-string-recovery, but the lookup used ranxianglei/billion-context. The janitor reported queue depth 8 queued / 3 in progress, so this cancellation was not its starvation rule.

Change

Carry head_repository.full_name alongside each run, URL-encode the branch component, and check that branch in its owning repository. Treat only a branch HTTP 404 from an otherwise accessible repository as a confirmed deletion. Missing head metadata, inaccessible repositories, rate limits and server errors no longer masquerade as deleted branches. Existing age cleanup, dry-run behavior and scheduled-master protection remain in effect.

Validation

Head: d992d5dc09eca67596266b7d9e0b818894341716, based on master dc041dd1ab1a014efa352ba47a6f31fc47f55284.

  • 9 focused regression tests pass. The same tests against the original workflow produce 6 failures and 3 passing controls.
  • Tests execute the actual workflow shell with fixture API responses and real Bash/jq: live fork heads, encoded branch names, equal names in different repositories, confirmed deletion, HTTP 403/429/500, missing metadata, age cleanup, scheduled-master protection and dry-run.
  • npm run typecheck, npm run build and git diff --check pass.
  • The process-spawning test is registered in scripts/live-files.mjs. It runs on Linux, matching the workflow runner; it skips other platforms because the script uses GNU date.

Command: node --test tests/ci-janitor-fork-heads.test.ts (Node.js 24.22.1 on Linux). The test makes no network requests and cancels no real run.

This fixes the cleanup classification; it does not claim that previously cancelled upstream jobs have been rerun.

@Afloat16

Copy link
Copy Markdown
Contributor Author

The targeted janitor regressions and static checks pass. The only red job is Ubuntu / Node 24 / shard 3: tests/seq-interval-lane.test.ts:180 read zero persisted blocks after the tool reported one applied block (2,879 passed, 1 failed, 18 skipped). Failure log: https://github.com/ranxianglei/billion-context/actions/runs/42995321477/job/130438108992 .

The test uses a fixed 60 ms sleep before reading SQLite, while persistence runs on a debounced asynchronous write chain; the log does not establish the exact failing interleaving. This PR does not change that test or persistence path. The same test passed on the current #6188 head in the same Ubuntu/Node24 shard: https://github.com/ranxianglei/billion-context/actions/runs/42997474540/job/130445327525 .

Could the failed shard be rerun on unchanged head d992d5d?

@ranxianglei

Copy link
Copy Markdown
Owner

Landed via batch PR #6439 (merged) — closing as superseded.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Live state re-verified first — no active work: PR #6221 is CLOSED (not merged).

Per the lane rules I re-verified the live state before touching anything:

  • PR [PR] fix(ci): preserve live fork PR runs during janitor cleanup #6221 is closed, not merged — state: closed, merged: false, closed_at: 2026-11-12T14:10:18Z. The reported red check test (ubuntu-latest, 24, 3) is on the closed head d992d5dc09; it is a historical artifact, not an active blocker.
  • No replacement PR — no open PR from the same head branch 2026-11-11_janitor-fork-heads (the author's other open PRs use different branches).
  • Can't push to the fork regardless — maintainer_can_modify: false, and a direct push to Afloat16:2026-11-11_janitor-fork-heads was rejected (permission denied).

So there is no active PR to fix and no branch I'm permitted to push to. No changes were pushed.

For the record — I did diagnose the red check. It is a pre-existing test flake, unrelated to this PR's janitor changes: tests/seq-interval-lane.test.ts used a fixed 60 ms settle() that races the debounced save's fsync on loaded runners (the block read saw the pre-fold snapshot — the same #5644 win22-s2 / #5791 ubuntu-22 flake family already fixed in tests/msgid-lane-flow.test.ts). I prepared a locally-verified fix (settle on the store.afterNextFlush("conv-seq-1") landing verdict, double-drain for the debounce-overlap remainder) — passes idle and under 4× parallel load — but it cannot be landed on a closed PR. If the flake recurs on an active PR or master, the fix is ready (local commit 691ab99c59 on wt-6223-ci-engineer-r1).

Stopping — nothing further to do on a closed PR.


结构化八问(中文结论)

  1. 是什么问题:任务要求修复 PR [PR] fix(ci): preserve live fork PR runs during janitor cleanup #6221 的红灯 CI(test ubuntu 24,3),但该 PR 已关闭(未合并),红灯是关闭前的历史状态,不是活跃阻塞。
  2. 什么原因导致的:PR 于 2026-11-12T14:10:18Z 被关闭(merged=false),且 maintainer_can_modify=false,无法向 fork 分支推送。红灯本身是一个既有测试 flake(tests/seq-interval-lane.test.ts 固定 60ms settle 与防抖落盘 fsync 竞争,[PR] fix: surface failed watcher registration cause/state and report heartbeat recovery #5644/[PR] fix(kernel): recover tier-distillation merges around historical mid-turn blocks (#5789) #5791 同族),与本 PR 的 janitor 改动无关。
  3. 影响范围与严重程度:无活跃影响——PR 已关闭,无用户/CI 面受影响。flake 本身是潜在测试不稳定(高负载 runner 下偶发),不在本任务范围。
  4. 怎么修复的:未推送任何改动(PR 已关闭 + 无推送权限)。已本地诊断并备好经本地验证的修复(settle 改用 store.afterNextFlush 落盘裁决 + 二次 drain),留待 flake 复现时使用。
  5. 是否有回归问题:不涉及——未改动任何代码/行为。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:无可执行工作(PR 已关闭),收工。

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Understood — verified: batch PR #6439 ("land 50 open Afloat16 fixes") merged at 2026-11-12T14:01:25Z, carrying the janitor change; #6221 was closed as superseded ~9 min later (14:10:18Z). That matches the stale-wake state I reported (PR closed, no active work, no push access to the fork).

For the record: the red test (ubuntu-latest, 24, 3) on the old head was a pre-existing flake in tests/seq-interval-lane.test.ts (fixed 60 ms settle racing the debounced save's fsync — the #5644/#5791 family), not a regression from the janitor change. The fix I prepared (settle on store.afterNextFlush landing verdict) is kept locally as commit 691ab99c59 in case the flake recurs on an active PR or master. Nothing further needed here.

@ranxianglei

Copy link
Copy Markdown
Owner

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

Re-verified live — this is another stale wake: PR #6221 is still CLOSED (not merged).

  • state: closed, merged: false, mergeable_state: dirty (the conflict that triggered this wake), head d992d5dc09 on Afloat16/billion-context.
  • The "dirty" merge state is on a closed, superseded PR — the work already landed via batch PR [PR] chore(batch): land 50 open Afloat16 fixes in one history-preserving batch #6439 (merged 2026-11-12T14:01:25Z), as you noted when closing it as superseded.
  • Rebasin it is both impossible and pointless: maintainer_can_modify: false (no push access to the fork branch — a direct push was already rejected permission denied), and there is no open PR from this branch to rebase into.

No action taken — nothing to rebase on a closed, superseded PR.


结构化八问(中文结论)

  1. 是什么问题:系统报告 PR [PR] fix(ci): preserve live fork PR runs during janitor cleanup #6221 与 base 分支冲突(merge state: dirty),要求 rebase。但该 PR 已关闭(未合并),且已被 batch PR [PR] chore(batch): land 50 open Afloat16 fixes in one history-preserving batch #6439(已合并)取代。
  2. 什么原因导致的:PR 于关闭后 head 分支未再更新,与持续推进的 master 产生文本冲突,触发 dirty 检测;但 PR 本身已关闭、工作已落地,无活跃对象。
  3. 影响范围与严重程度:无活跃影响——PR 已关闭且被取代,无用户/CI 面受影响。
  4. 怎么修复的:未做任何改动。rebase 既不可行(maintainer_can_modify=false,无 fork 分支推送权限,此前直推已被拒)也无意义(工作已经由 [PR] chore(batch): land 50 open Afloat16 fixes in one history-preserving batch #6439 合入,该分支无对应开放 PR)。
  5. 是否有回归问题:不涉及——未改动任何代码/行为。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

判定:无可执行工作(PR 已关闭且被 #6439 取代),收工。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants