Answer stability round 1: 0 🔴, 1 🟡 (0 misread); leave an item a person split to be closed by its team, and refuse a setting below the label table
This commit is contained in:
@@ -60,7 +60,7 @@ class Split:
|
||||
|
||||
|
||||
def is_split(item: EpicIssue, issues: list[EpicIssue]) -> bool:
|
||||
"""Whether the item is worked through its sub-tasks: it is marked SPLIT_LABEL, or a person filed a sub-task under it. A sub-task do-epic filed doesn't count without the mark, since a run that failed between the two leaves the next run to file the lacking ones."""
|
||||
"""Whether the item is worked through its sub-tasks: it is marked SPLIT_LABEL, or a person filed a sub-task under it. A sub-task do-epic filed doesn't count without the mark: a run that failed after filing some of an item's sub-tasks, before marking it, leaves the next run to file the rest."""
|
||||
return SPLIT_LABEL in item.labels or any(task.parent == item.key and not task.by_loop for task in issues)
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ def split(store: EpicStore, issue: EpicIssue, team: LabelRepos, by_person: bool,
|
||||
have = {pick.name for task in read if task.parent == issue.key for label in task.labels if isinstance(pick := of_label(label, team), Repo)}
|
||||
repos = tuple(dict.fromkeys([*sorted(have), *(part.repo for part in predicted.parts)]))
|
||||
if len(repos) < 2:
|
||||
# Left as it is even where an earlier, failed run filed one sub-task and this prediction names only that repo. The stray sub-task is labelled for its repo and harmless.
|
||||
# Left unmarked even where an earlier, failed run filed one sub-task and this prediction names only that repo: the item changes one repo, so it gets its pick as any issue does.
|
||||
return Split((), ())
|
||||
if by_person and not predicted.comment:
|
||||
return Failure("the repo split gave no comment for the team on a person's issue")
|
||||
@@ -111,12 +111,12 @@ def task_summary(repo: str, summary: str) -> str:
|
||||
|
||||
|
||||
def finished(issues: list[EpicIssue], key: str) -> bool:
|
||||
"""Whether the item named key is done. A split item (is_split) that has sub-tasks is done once each of them is, whatever its own status; any other item is done by its own status, and a key no issue has isn't done."""
|
||||
"""Whether the item named key is done. An item marked SPLIT_LABEL that has sub-tasks is done once each of them is, whatever its own status. Any other item is done by its own status, also one a person's sub-tasks split: do-epic filed those for every repo the item changes, and a person's may cover only a part of it. A key no issue has isn't done."""
|
||||
item = next((issue for issue in issues if issue.key == key), None)
|
||||
tasks = [issue for issue in issues if issue.parent == key]
|
||||
if item is None:
|
||||
return False
|
||||
return all(task.done for task in tasks) if is_split(item, issues) and tasks else item.done
|
||||
return all(task.done for task in tasks) if SPLIT_LABEL in item.labels and tasks else item.done
|
||||
|
||||
|
||||
def prediction(issue: EpicIssue, by_person: bool, rule: str, language: str, checkouts: tuple[str, ...], rung: Rung, claude: Claude, cwd: str) -> Prediction | Failure | Limited:
|
||||
|
||||
Reference in New Issue
Block a user