Answer product-owner round 2: 0 🔴, 0 🟡 (0 misread); read the epic again where a read fails during the wait, and reword two lines
CI / tests (pull_request) Successful in 3m56s
CI / tests (pull_request) Successful in 3m56s
This commit is contained in:
@@ -156,7 +156,7 @@ The last line prints each setting's path once the config is complete.
|
||||
|
||||
- `config.toml` sets `jira-url`, the site, such as `https://acme.atlassian.net`; `env-file`, the file holding `ATLASSIAN_EMAIL` and `ATLASSIAN_API_TOKEN`, a path that starts with `/` or `~/`, outside the clone folder and every folder of `~/.claude-projects`; and `repoless-model`, the model that works an item with no repo. It may also set `clone-folder`, where a missing repo is cloned, `~/code` if left out; `language`, the language of Jira text, English if left out; and `jira-finish-transition` with `jira-finish-status`, which name the workflow transition that moves a finished chunk's issue, and closes a finished epic, and the status it leads to, such as `"Mark as done"` and `"Done"`. Set both or neither: without them do-epic moves no issue to done and closes no epic, and a chunk that finishes stops with that reason.
|
||||
- `config.toml` fits do-epic to a team whose own automation moves issues, such as a CI job that moves an issue when its pull request merges. Two settings do:
|
||||
- `jira-unblocking-statuses` lists the statuses at which an issue's work has landed though Jira doesn't count it done yet, such as `["Release Ready"]`, in any case. An issue in one of them takes no chunk and no longer blocks the issues it blocks, and `--status` names the statuses beside each blocker. A status Jira counts as done always does both. The release reviews, which are the epic's last chunk, still wait until Jira counts every issue done: run `do-epic <EPIC-KEY>` then, to start them.
|
||||
- `jira-unblocking-statuses` lists the statuses at which an issue's work has landed though Jira doesn't count it done yet, such as `["Release Ready"]`, in upper or lower case. An issue in one of them takes no chunk and no longer blocks the issues it blocks, and `--status` names the statuses beside each blocker. A status Jira counts as done always does both. The release reviews, which are the epic's last chunk, still wait until Jira counts every issue done: run `do-epic <EPIC-KEY>` then, to start them.
|
||||
- `jira-automation-moves-issues = true` keeps do-epic from moving the issue of a finished chunk in a repo: the automation moves it, and do-epic waits for that move before it starts what the issue blocks. An issue without a repo has no pull request, so do-epic still moves it, with `jira-finish-transition`. The setting needs `jira-unblocking-statuses`, which names the status the automation gives an issue whose pull request merged.
|
||||
- `config.toml` may end with a `[label-repos]` table, for a team that already labels its issues by repo. Give it one line for each such label: the label, then the repo's name, such as `twu-4 = "tenant-web-ui-4"`. do-epic reads such a label as it reads its own `repo:<name>`. Where the label is the repo's name, map the name to itself, as in `core-4 = "core-4"`. Write every other setting above the table.
|
||||
- `repo-rule.md` is prose that says how to tell an item's repo, such as "a label that equals a repo's name names that repo". It may not be blank. `do-epic <EPIC-KEY>` uses it to pick where each open issue without such a label is worked, and records the pick as a label: `repo:<name>` for its repo, `do-epic-claude` for work of Claude's that changes no repo, and `do-epic-human` for a task of yours. Where the rule leaves an issue unclear, do-epic asks you on the terminal. Answer with the label, or with Enter alone to leave the issue waiting. Change a pick by editing the label in Jira.
|
||||
|
||||
@@ -17,7 +17,7 @@ One pair per machine, the same for every epic (docs/decisions.md → `do-epic: d
|
||||
- `clone-folder` is the folder a missing repo is cloned into: a path that starts with / or ~/. `~/code` where left out.
|
||||
- `language` is the default language of Jira text, by its English name. English where left out.
|
||||
- `jira-finish-transition` and `jira-finish-status` name the workflow transition that moves a finished chunk's issue and closes a finished epic, such as "Mark as done", and the status it leads to, such as "Done". A project's config names a plan item's the same way. Set both or neither; without them do-epic moves no issue to done and closes no epic.
|
||||
- `jira-unblocking-statuses` lists the statuses at which an issue's work has landed though Jira doesn't count it done yet, such as `["Release Ready"]`, in any case. An issue in one of them takes no chunk and no longer blocks the issues it blocks. A status Jira counts as done always does both, listed or not.
|
||||
- `jira-unblocking-statuses` lists the statuses at which an issue's work has landed though Jira doesn't count it done yet, such as `["Release Ready"]`, in upper or lower case. An issue in one of them takes no chunk and no longer blocks the issues it blocks. A status Jira counts as done always does both, listed or not.
|
||||
- `jira-automation-moves-issues = true` says the team's own automation moves an issue when its pull request merges. do-epic then moves only the issue of a chunk without a repo, which has no pull request, and waits for the automation to move each other. It needs `jira-unblocking-statuses`, which then names the status the automation gives an issue whose pull request merged. false where left out.
|
||||
- `[label-repos]` has one line for each label of the team's own that names a repo: the label, then that repo's name, such as `twu-4 = "tenant-web-ui-4"`. do-epic reads such a label as it reads its own `repo:<name>`. A team whose label is the repo's name maps the name to itself.
|
||||
- `repo-rule.md` is prose that says how to tell an item's repo, and mustn't be blank."""
|
||||
@@ -84,7 +84,7 @@ def workflow_faults(values: dict[str, object]) -> list[str]:
|
||||
"""What is wrong with the UNBLOCKING_STATUSES list and the AUTOMATION_MOVES switch in values."""
|
||||
statuses, moves = values.get(UNBLOCKING_STATUSES, ["Done"]), values.get(AUTOMATION_MOVES, False)
|
||||
return [
|
||||
*([f"`{UNBLOCKING_STATUSES}` is {statuses!r}, not a list of the status names Jira shows, such as [\"Release Ready\", \"Done\"]"] if not (isinstance(statuses, list) and statuses and all(name_of(status) for status in statuses)) else []),
|
||||
*([f"`{UNBLOCKING_STATUSES}` is {statuses!r}, not a list of the status names Jira shows, such as [\"Release Ready\"]"] if not (isinstance(statuses, list) and statuses and all(name_of(status) for status in statuses)) else []),
|
||||
*([f"`{AUTOMATION_MOVES}` is {moves!r}, not true or false"] if not isinstance(moves, bool) else []),
|
||||
# With no status listed, an issue whose pull request merged would read as open, and its chunk would start again.
|
||||
*([f"`{AUTOMATION_MOVES}` is set, so `{UNBLOCKING_STATUSES}` must name the status the automation gives an issue whose pull request merged"] if moves is True and UNBLOCKING_STATUSES not in values else []),
|
||||
|
||||
+9
-5
@@ -428,7 +428,7 @@ def handed_on(key: str, epic: EpicRun, by_others: bool = False) -> Stop:
|
||||
"""The stop of a do-epic whose chunk finished. It first moves the chunk's issue to done (the epic's finishing has none), and its split item too where that was the last of the item's sub-tasks, so that no finished chunk starts again and what they block may start, then starts each chunk that may start now. by_others says someone else moves the issue where the team's automation moves issues: the automation from a chunk's pull request, or the human whose task it is. There it waits for that move (`moved_by_automation`) and moves only a split item, once Jira counts each of its sub-tasks done; a chunk without a repo has no pull request, so its issue moves to done as ever. Its window closes as it exits."""
|
||||
# The epic's finishing has no issue to move: the epic is closed by `--close-epic`.
|
||||
if key == epic.key:
|
||||
issues = epic.store.read()
|
||||
issues: list[EpicIssue] | Failure = epic.store.read()
|
||||
elif by_others and epic.config.automation_moves:
|
||||
issues = moved_by_automation(key, epic)
|
||||
else:
|
||||
@@ -450,13 +450,17 @@ def handed_on(key: str, epic: EpicRun, by_others: bool = False) -> Stop:
|
||||
return Stop(0, "")
|
||||
|
||||
|
||||
def moved_by_automation(key: str, epic: EpicRun) -> list[EpicIssue] | Failure:
|
||||
"""The epic's issues once the issue called key no longer holds up another: read every POLL_SECONDS until the team's automation, or a person, has moved it. Until then a read would show it open, and its chunk would start again."""
|
||||
told = False
|
||||
def moved_by_automation(key: str, epic: EpicRun) -> list[EpicIssue]:
|
||||
"""The epic's issues once the issue called key no longer holds up another: read every POLL_SECONDS until the team's automation, or a person, has moved it. Until then a read would show it open, and its chunk would start again. A read that fails is made again."""
|
||||
told, unread = False, ""
|
||||
while True:
|
||||
issues = epic.store.read()
|
||||
if isinstance(issues, Failure):
|
||||
return issues
|
||||
if issues.reason != unread:
|
||||
say(f"cannot read the epic, so cannot tell whether {key} has moved; trying again every {POLL_SECONDS} seconds: {issues.reason}", epic.effects, stdout=True)
|
||||
unread = issues.reason
|
||||
epic.effects.sleep(POLL_SECONDS)
|
||||
continue
|
||||
by_key = {each.key: each for each in issues}
|
||||
if key not in by_key or scheduler.settled(by_key[key], by_key, epic.config.unblocking):
|
||||
return issues
|
||||
|
||||
@@ -93,7 +93,7 @@ class ConfigTest(unittest.TestCase):
|
||||
with self.subTest(value=value):
|
||||
self.write(SETTINGS + f"jira-unblocking-statuses = {value}\n")
|
||||
self.assertIn('`jira-unblocking-statuses` is ', self.failure())
|
||||
self.assertIn(', not a list of the status names Jira shows, such as ["Release Ready", "Done"]', self.failure())
|
||||
self.assertIn(', not a list of the status names Jira shows, such as ["Release Ready"]', self.failure())
|
||||
self.write(SETTINGS + "jira-automation-moves-issues = true\n")
|
||||
self.assertIn("`jira-automation-moves-issues` is set, so `jira-unblocking-statuses` must name the status the automation gives an issue whose pull request merged", self.failure())
|
||||
self.write(SETTINGS + 'jira-automation-moves-issues = "yes"\n')
|
||||
|
||||
@@ -785,11 +785,13 @@ class AChunkWhosePullRequestWaitsOnAGate(DoEpicTest):
|
||||
|
||||
def sleep(seconds: float) -> None:
|
||||
slept.append(seconds)
|
||||
if len(slept) == 2:
|
||||
store.fails = "Jira answered 503" if len(slept) == 1 else None
|
||||
if len(slept) == 3:
|
||||
store.change("ABC-20", status="Release Ready")
|
||||
fake.effects = lambda made=fake.effects(): dataclasses.replace(made, sleep=sleep) # type: ignore[method-assign]
|
||||
code, out, err, _ = self.parked_run(fake)
|
||||
self.assertEqual((code, slept), (0, [60, 60]), err)
|
||||
self.assertEqual((code, slept), (0, [60, 60, 60]), err)
|
||||
self.assertIn("cannot read the epic, so cannot tell whether ABC-20 has moved; trying again every 60 seconds: Jira answered 503\n", out)
|
||||
self.assertEqual([(each.status, each.done) for each in store.issues if each.key == "ABC-20"], [("Release Ready", False)])
|
||||
self.assertEqual(out.count("ABC-20 is To Do: it waits for the team's automation to move it to Release Ready; move it in Jira if the automation doesn't\n"), 1, out)
|
||||
self.assertIn("the chunk finished; started ABC-22\n", out)
|
||||
|
||||
Reference in New Issue
Block a user