After a push dismisses reviews and the bot adds approval: review pending, when approvals reach threshold again, the bot fails to restore approval: done.
Reproduce:
- PR reaches 2 committer approvals → bot adds
approval: done
- New commit pushed → reviews dismissed → bot removes
approval: done, adds approval: review pending
- PR gets 2 new committer approvals → bot should add
approval: done but doesn't
Root cause: The webhook payload labels may be stale. When checking whether to add approval: done, the bot uses existing_labels from the event payload (which may still show the old state before removal), so it skips the add.
After a push dismisses reviews and the bot adds
approval: review pending, when approvals reach threshold again, the bot fails to restoreapproval: done.Reproduce:
approval: doneapproval: done, addsapproval: review pendingapproval: donebut doesn'tRoot cause: The webhook payload labels may be stale. When checking whether to add
approval: done, the bot usesexisting_labelsfrom the event payload (which may still show the old state before removal), so it skips the add.