mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-27 05:12:50 +00:00
agent queue: apply claim checks when /reassign creates a claim
/reassign turned a ready task into a claim without the dependency and file-overlap checks /claim applies, so a maintainer reassignment could grant two overlapping claims. Run the same checks for the new holder. Refs #211 Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
This commit is contained in:
1 parent
6b479a6617
commit
b1ab08c09d
2 files changed
+16
No files matched your search
@@ -120,6 +120,10 @@ def decide(event, state, cfg):
|
||||
return _reply(n, "Reassign refused: %s is not allowed to work on area:%s." % (quote(target), task["area"]))
|
||||
if not (set(task["labels"]) & {"agent:claimed", "agent:ready"}):
|
||||
return _reply(n, "Reassign refused: the task is neither ready nor claimed.")
|
||||
# A reassignment creates a claim: the same dependency and file-overlap rules apply.
|
||||
problem = claim_problem(dict(task, labels=task["labels"] + ["agent:ready"]), tasks, cfg, target)
|
||||
if problem:
|
||||
return _reply(n, "Reassign refused: %s" % problem)
|
||||
remove = ["agent:ready"] + (["claimed-by:" + holder] if holder else [])
|
||||
return [_act(n, ["agent:claimed", "claimed-by:" + target], remove,
|
||||
"Reassigned to %s by %s. New lease starts now.\n%s" % (target, actor, L.grant_marker(n, target)))]
|
||||
|
||||
Reference in new issue
Block a user