mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 20:50:44 +00:00
agent queue: re-run the check only after an accepted verification
The verify job re-ran the pull request check after any /verified comment, including refused ones: the author's own, a non-verifier's, a stale or unknown head or a malformed SHA. decide now marks only an accepted verification of the current head, and the job re-runs the check only when should-rerun confirms it. A test checks that what re-runs the check is exactly what the check counts. Replay decides a comment listed twice only once. Tests cover duplicate and out-of-order listings, and every arrival order of a five-claim burst grants exactly one of two overlapping claims. Fixes #210, fixes #211 Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
This commit is contained in:
1 parent
e37c8566c6
commit
9fda5aab18
8 files changed
+96
-5
No files matched your search
@@ -150,4 +150,10 @@ def _verified(event, state, cfg, arg):
|
||||
return _reply(n, "%s may not verify: only maintainers and qa contributors can." % actor)
|
||||
if len(sha) < 7 or not head.startswith(sha):
|
||||
return _reply(n, "Verification refused: `%s` is not the current head %s." % (sha or "(none)", head[:12]))
|
||||
return _reply(n, "Verification of %s recorded for %s." % (head[:12], actor))
|
||||
# Only an accepted verification of the current head re-runs the pull request check.
|
||||
return [dict(_act(n, comment="Verification of %s recorded for %s." % (head[:12], actor)), rerun_check=True)]
|
||||
|
||||
|
||||
def rerun_check(actions):
|
||||
"""True when the decided actions record an accepted verification of the current head."""
|
||||
return any(a.get("rerun_check") for a in actions)
|
||||
Reference in new issue
Block a user