mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 18:10:43 +00:00
agent queue: fix review findings in replies, verification and issue forms
From independent review of the queue follow-up: - Bot replies echoed user text (/blocked reasons, /reassign logins, file patterns) verbatim. Markers count when the bot posts them, so a reason containing an approval or done marker became a bot marker and could approve an acceptance command or hide another user's claim. Echoed text now has angle brackets and backticks escaped. - /verified accepted a 7-character prefix and ignored extra arguments; a commit with the same short prefix is cheap to make. Require exactly one full 40-character SHA, with one parser shared by decide and the check. - After a verification, the job looked up the check run by the pull request head SHA, but pull_request_target runs carry the base branch SHA, so it found nothing and || true hid it. The verify job now evaluates the same advisory check itself and no longer needs actions: write. - The issue form renders Files inside a ```text fence and the parser took "text" as a path, so any two form-created tasks overlapped. Fence lines are skipped. - A command still unanswered after lease_hours now gets a "Not decided" reply (window 2 x lease_hours) instead of being dropped silently. Each fix has a test shown to fail with the fix reverted. Refs #210, #211 Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
This commit is contained in:
1 parent
e70780f30a
commit
6b479a6617
13 files changed
+143
-55
No files matched your search
@@ -35,7 +35,7 @@ def main(argv):
|
||||
p.add_argument("--now", default="", help="UTC time YYYY-MM-DDTHH:MM:SSZ (tests)")
|
||||
sub = p.add_subparsers(dest="cmd", required=True)
|
||||
s = sub.add_parser("gather"); s.add_argument("--repo", required=True); s.add_argument("--no-prs", action="store_true"); s.add_argument("--pr", type=int, default=0)
|
||||
s.add_argument("--recent-commands", action="store_true", help="include comments from the last lease_hours for replay")
|
||||
s.add_argument("--recent-commands", action="store_true", help="include comments from the last 2 x lease_hours for replay")
|
||||
s = sub.add_parser("replay"); s.add_argument("--state", required=True)
|
||||
s = sub.add_parser("decide"); s.add_argument("--event", required=True); s.add_argument("--state", required=True)
|
||||
s = sub.add_parser("should-rerun"); s.add_argument("--actions", required=True)
|
||||
@@ -70,7 +70,7 @@ def main(argv):
|
||||
elif a.cmd == "gather":
|
||||
since = ""
|
||||
if a.recent_commands:
|
||||
since = (_now(a.now) - timedelta(hours=cfg["lease_hours"])).strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||
since = (_now(a.now) - timedelta(hours=replay.window_hours(cfg))).strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||
st = ghio.gather(a.repo, with_prs=not a.no_prs, recent_since=since)
|
||||
if a.pr:
|
||||
st["pr"] = ghio.pr_data(a.repo, a.pr)
|
||||
|
||||
Reference in new issue
Block a user