mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 23:30:44 +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
@@ -89,9 +89,12 @@ class Workflows(unittest.TestCase):
|
||||
|
||||
def test_rerun_needs_an_accepted_verification(self):
|
||||
text = self.job("agent-pr-checks.yml", "verify")
|
||||
gate = text.index("agent_queue should-rerun")
|
||||
self.assertLess(gate, text.index("gh run rerun"))
|
||||
self.assertIn('if ! python3 -m agent_queue should-rerun --actions "$RUNNER_TEMP/actions.json"; then exit 0; fi', text)
|
||||
self.assertLess(text.index("agent_queue should-rerun"), text.index("agent_queue pr-check"))
|
||||
# The check is evaluated in this job: pull_request_target runs cannot be found by head SHA.
|
||||
self.assertNotIn("gh run", text)
|
||||
self.assertNotIn("actions: write", text)
|
||||
self.assertIn("::warning title=Agent PR check (advisory)::", text)
|
||||
|
||||
def test_should_rerun_exit_codes(self):
|
||||
with tempfile.TemporaryDirectory() as d:
|
||||
|
||||
Reference in new issue
Block a user