Repository navigation
A temporary GitHub error during delivery label repair no longer leaves the Issue stuck in ai-blocked - #2428
Merged
Conversation
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
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.
Contributor
Author
|
✅ Orbi 已交付 · 查看交付证明 → |
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.
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