diff --git a/CHANGELOG.md b/CHANGELOG.md index 9379d07a..d515f4fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- do-epic names the team's own label for each repo, from the `[label-repos]` table, when it tells a chunk's worker how to file a finding or a release review, and keeps `repo:` for a repo the table doesn't name. - do-epic records a repo pick, and the summary of each sub-task it files, in the team's own spelling: a label from the `[label-repos]` table of its config, and a `sub-task-summary` template with `{label}` and `{Summary}`. - Add `do-epic --dry-run`, which prints every Jira write planning would make and each chunk that would start, and makes none of them. - The stability reviewer checks each parser that splits text on a separator or strips a suffix against a value that holds the separator, and reports a row the parse misplaces or drops. diff --git a/bin/do_epic/findings.py b/bin/do_epic/findings.py index 53bdbce0..7a87bf2a 100644 --- a/bin/do_epic/findings.py +++ b/bin/do_epic/findings.py @@ -7,7 +7,7 @@ import fcntl import pathlib import typing -from do_epic.repo_pick import also, CLAUDE_LABEL, HUMAN_LABEL, LabelRepos, of_label, REPO_PREFIX, REVIEW_LABEL +from do_epic.repo_pick import CLAUDE_LABEL, HUMAN_LABEL, label_of, LabelRepos, of_label, REPO_PREFIX, REVIEW_LABEL, team_label from do_epic.backend.protocol import EpicIssue, EpicStore from do_epic.epic_record import EpicRecord from failure import Failure @@ -20,15 +20,22 @@ LABEL = "--label" BLOCKED_BY = "--blocked-by" PARENT = "--parent" RECORD_DECISION = "--record-decision" -# The labels that say where an issue is worked, as do-epic's scheduler reads them. -LABELS = f"`{REPO_PREFIX}` for the repo that works it, `{CLAUDE_LABEL}` for work of Claude's that changes no repo, or `{HUMAN_LABEL}` for a task of the human's" + + +def worked_by(team: LabelRepos) -> str: + """The labels that say where an issue is worked, as do-epic's scheduler reads them: for each repo the team's table names, the label on its first line for that repo, and `repo:` for any other repo.""" + named = [f"`{label}` for the repo {name}" for name in sorted(set(team.values())) if (label := team_label(name, team))] + repos = ", ".join([*named, f"`{REPO_PREFIX}` for {'any other repo' if named else 'the repo'} that works it"]) + return f"{repos}, `{CLAUDE_LABEL}` for work of Claude's that changes no repo, or `{HUMAN_LABEL}` for a task of the human's" + + # Under the epic's folder, the file a do-epic holds locked while it appends a decision. DECISIONS_LOCK = "decisions.lock" USAGE = f"""do-epic {FILE} [{LABEL}