Skip to content

A temporary GitHub error during delivery label repair no longer leaves the Issue stuck in ai-blocked - #2428

Merged
orbi-build[bot] merged 3 commits into
mainfrom
orbi/orbi-build-orbi-issue-2426
Nov 26, 2026
Merged

orbi-build[bot] merged 3 commits into
mainfrom
orbi/orbi-build-orbi-issue-2426

Conversation

@orbi-build

@orbi-build orbi-build Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #2426

A temporary GitHub error during delivery label repair no longer leaves the Issue stuck in ai-blocked (run_id=c8d2671d)

Built by Orbi from Issue #2426

During GitHub's 2026-11-25 incidents four deliveries were stranded: one
transition was several writes, so GitHub applied the removal and lost the
addition and the Issue held no delivery label at all. Two more scenes
followed from the same mistake — assuming a failed write changed nothing
and sending compensating writes (#3954 ended up ai-pr-opened +
ai-fix-needed + ai-blocked) and escalating a temporary error to
ai-blocked on the open-PR label repair.

Now every delivery-label change is ONE whole-set replacement
(PUT /repos/{owner}/{repo}/issues/{n}/labels) computed from the Issue's
real labels, and a failed write is settled by reading what GitHub holds:

- github.set_issue_labels settles a lost response: when the following
  read shows the intended set the change is done (no retry write, no
  compensating write); otherwise the write's own error propagates and the
  Issue is exactly as it was.
- github._replace_labels / swap_issue_labels is the one primitive:
  read the Issue, swap the labels, one write. apply_label_patch keeps the
  one transition decision and drops its current_labels parameter, so the
  patch is never computed from a stale caller snapshot (the #3954 mix).
- terminal_labels.py is gone: GitHub's whole-set PUT removes before it
  adds, so the timeline still ends on the new state and the restoring
  writes that produced three state labels disappear.
- The two hand-rolled unblocks (base_ci_fix, check_permission) use
  swap_issue_labels, so their add and remove cannot split either.
- review_merge: a repair interrupted by a GitHub temporary error (the
  #2202 `github_transient` rating) now defers the round; the Issue keeps
  the labels it had, the next tick repairs them and the review proceeds.
  A real inconsistency (open PR, no resumable delivery label, GitHub
  answering) still ends ai-blocked with the blocked comment.

Tests: the whole-set/atomicity contract in tests/test_apply_label_patch.py
(acceptance 1 and 2), the temporary-repair-error round in
tests/test_bootstrap_delivery.py (acceptance 3) and the unchanged
inconsistency stop (acceptance 4); the suites that pinned the old
multi-write sequence now assert the set each transition wrote.

Fixes #2426
orbi-build Bot added 2 commits November 26, 2026 05:26
The answer flow's two delivery-label changes -- `_amend` moving a blocked
Issue to `ai-fix-needed`/the queue label, and `_requeue` putting a blocked
triage Issue back in the queue -- still sent one `gh issue edit` with both
`--add-label` and `--remove-label`. gh performs that as a separate add and
remove request, so GitHub can apply the `ai-blocked` removal and fail the
add, which leaves the Issue with no delivery label at all: the exact
stranding (orbi-cloud#3953/#3956, glafira-ai-hub#669) this ticket removes.

Both now use `github.swap_issue_labels`, the ONE whole-set replacement the
ticket introduced, so the Issue holds the labels it had or the labels the
change intended, and `bug`/`p0` survive either way.

Also drop `block_label_inconsistency`'s label parameter: it became dead when
`post_blocked_comment` started reading the Issue's real labels itself.
…#2426)

Four comments/docstrings still described the pre-#2426 removal-then-add
sequence the ticket deleted. They now name the ONE whole-set replacement
the assertions actually check, and the release close-out test's name/doc
match what it proves: a failed terminal write applies nothing.
@orbi-build
orbi-build Bot merged commit 5731bfb into main Nov 26, 2026
2 checks passed
@orbi-build
orbi-build Bot deleted the orbi/orbi-build-orbi-issue-2426 branch November 26, 2026 05:36
@orbi-build

orbi-build Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

✅ Orbi 已交付 · 查看交付证明 →

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.

Every delivery-label change is all-or-nothing, so a temporary GitHub error never strands an Issue

0 participants