return_reply(n,"Only the holder of a claimed task can post progress.")
iflen(arg)<3:
return_reply(n,"Progress needs a short description of what changed, for example `/progress parser done, tests next`. Lease not renewed.")
return_reply(n,"Lease renewed: %s more hours from now."%cfg["lease_hours"])
ifcmd=="/blocked":
ifactor!=holderandnotmaint:
return_reply(n,"Only the holder or a maintainer can mark a task blocked.")
ifnotarg:
return_reply(n,"Usage: /blocked <reason>")
return[_act(n,["agent:blocked"],[],"Blocked by %s: %s"%(actor,arg))]
ifcmd=="/unblock":
ifactor!=holderandnotmaint:
return_reply(n,"Only the holder or a maintainer can unblock a task.")
return[_act(n,[],["agent:blocked"],"Unblocked by %s."%actor)]
ifcmd=="/approve-acceptance":
ifnotmaint:
return_reply(n,"Only a maintainer can approve an acceptance command.")
ifnotT.normalise_acceptance(task["acceptance"]):
return_reply(n,"No acceptance command to approve.")
digest=T.acceptance_hash(task["acceptance"])
return_reply(n,"Acceptance command approved by %s for the current text (sha256 %s). Editing the issue body invalidates this approval; nothing runs it automatically.\n%s"%(
actor,digest[:12],L.acceptance_marker(digest)))
return[]
def_verified(event,state,cfg,arg):
n,actor=int(event["number"]),event["actor"]
ifevent.get("kind")!="pr":
return[]
pr=state.get("pr")or{}
sha=arg.split()[0]ifargelse""
head=pr.get("head_sha","")
ifactor==pr.get("author"):
return_reply(n,"Verification refused: the pull request author cannot verify it.")
tasks=task_index(state)
forissueinL.linked_issues(pr.get("body")):
ifissueintasksandtasks[issue]["holder"]==actor:
return_reply(n,"Verification refused: %s holds the linked task #%d."%(actor,issue))
ifnotcfgmod.is_verifier(cfg,actor):
return_reply(n,"%s may not verify: only maintainers and qa contributors can."%actor)
iflen(sha)<7ornothead.startswith(sha):
return_reply(n,"Verification refused: `%s` is not the current head %s."%(shaor"(none)",head[:12]))