Set a Jira issue's blocked-by links from todo-item edit --blocked-by on an issue the loop filed #576
@@ -2,6 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- todo-item edit --blocked-by sets the "is blocked by" links of a Jira issue the loop filed.
|
||||
- A `Touches:` list in the description of a Jira issue is read as one in `todo.md` is, a path or name that holds a backtick included: the Jira description spells it in backticks with no padding spaces, and the prediction reader takes that spelling too.
|
||||
- `todo-item edit --detail` and `project-record save` leave a Jira description or a Confluence page exactly as it is, with its block ids and spacing paragraphs, where the text saved is the text a read showed. An unedited save over a page a teammate saved since still refuses.
|
||||
- Add `compress-archives`, which gzips each transcript in loop-claude's archive and each file in the review folders 30 days after it last changed, keeping all of them. The tools that read those folders read a gzipped file by its plain name. A new crontab line in the README's Install section runs it daily.
|
||||
|
||||
@@ -132,7 +132,7 @@ A read fails, naming the issue, where a child is in another Jira project or name
|
||||
|
||||
The loop reads such a plan and files items into it, each as a Task under the epic. `todo-item add` needs the item's release among the Jira project's Fix Versions, named as `1.2.0` or `v1.2.0`. The config states the formula and the bar that a todo.md states under `## Scoring`, such as `jira-score-formula = "100 * V / (2**S + 8)"` and `jira-score-bar = 1`, and fails to load without them. `todo-item add` refuses an item that scores under the bar, unless it is exempt. It ranks the new issue among the issues the loop filed: questions first, then security findings, then by score. A person's issues keep the rank the team gave them, and `rank_todo.py` doesn't rank the plan.
|
||||
|
||||
`todo-item edit` and `move` change only an issue the loop filed. Of an issue a person filed, `edit` sets only the scores, and posts its `--comment` on the issue to tell the team why; the summary, description and Fix Version stay the team's to change in Jira, as do every issue's links. For `todo-item finish`, the config names the workflow transition that finishes an item and the status it leads to, both as Jira shows them: `jira-finish-transition = "Mark as done"` and `jira-finish-status = "Done"`. Finish then moves the item's issue by that transition. It refuses a transition that leads to another status, or to one Jira doesn't count as done, and fails where the config sets neither. The four things not supported for a plan outside the checkout, above, are not supported for a plan in Jira either.
|
||||
`todo-item edit` and `move` change only an issue the loop filed. Of an issue a person filed, `edit` sets only the scores, and posts its `--comment` on the issue to tell the team why; the summary, description and Fix Version stay the team's to change in Jira, as do its links. On an issue the loop filed, `edit --blocked-by` makes and deletes the links to the epic's open items. For `todo-item finish`, the config names the workflow transition that finishes an item and the status it leads to, both as Jira shows them: `jira-finish-transition = "Mark as done"` and `jira-finish-status = "Done"`. Finish then moves the item's issue by that transition. It refuses a transition that leads to another status, or to one Jira doesn't count as done, and fails where the config sets neither. The four things not supported for a plan outside the checkout, above, are not supported for a plan in Jira either.
|
||||
|
||||
A client that keeps its goals and audience in an epic's description names that epic as the goals file: `goals-and-audience = "jira:https://acme.atlassian.net/browse/ABC-12"`, which may be the plan's own epic. Such a config keeps its plan in Jira too, and reads both with the same `env-file`. The description needs `## Goals` and `## Audience` as headings, level-2 headings in Jira's editor. The loop only reads the description, so edit it in Jira; `project-record open goals-and-audience` prints a file holding its text. Whoever may edit that description sets the premises every worker and judge follows, so keep its edit rights to the people who own the project's goals.
|
||||
|
||||
@@ -220,7 +220,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a
|
||||
- `model_routing/` holds the shipped routing ladder (`routing-ladder.json`) and its steps (`ladder.py`), and reads a ladder from that file or a project's own (`ladder_file.py`), for loop-claude, `rule_hook`, both replay tools and `subagent-rung`. It finds a project's config folder through `project_config`. It also holds the list prices, which `routing_figures` and `transcript_archive` read.
|
||||
- `notifier/` sends the human a DM through the notifier a project's config names, for `notify` and for loop-claude through `loop_effects`. Its backends are `mattermost.py` and `slack.py`.
|
||||
- `plan/` is the plan's core, and imports neither `plan_store` nor `release_plan`. It holds an item and the items table's format (`todo_table.py`), releases (`release.py`), the ranking (`ranking.py`, with its score formula in `formula.py` and its blocker order in `blockers.py`), the paths an item's text names (`named_paths.py`) and `citations.py`, which holds `todo.md` and `docs/decisions.md` to each other. `goals_file.py` reads the goals file's sections, goals and goal weights, for the ranking and for `loop_claude`'s premises.
|
||||
- `plan_store/` reads and writes a project's plan through the store the project's config names (`stores.py`). Every backend meets `plans.py`'s `PlanStore`: a markdown file (`todo_md.py`, which also ranks and checks the file in place, with its text edits in `markdown_edits.py`) or a Jira epic (`jira_epic.py`). `scoring.py` reads the goal weights that both backends rank by. `contract.py` holds the tests every backend that writes must pass, which `jira_epic.py` doesn't yet, since it changes no link, and `fakes.py` a plan in memory.
|
||||
- `plan_store/` reads and writes a project's plan through the store the project's config names (`stores.py`). Every backend meets `plans.py`'s `PlanStore`: a markdown file (`todo_md.py`, which also ranks and checks the file in place, with its text edits in `markdown_edits.py`) or a Jira epic (`jira_epic.py`). `scoring.py` reads the goal weights that both backends rank by. `contract.py` holds the tests every backend that writes must pass; `jira_epic.py` doesn't yet, and its own tests stand in for Jira. `fakes.py` holds a plan in memory.
|
||||
- `rank_todo.py`, `settings_filter.py` and `statusline.py` are tools of one file each, tested beside them.
|
||||
- `record_store/` reads and writes a project's records, each through the store the project's config names (`stores.py`): a markdown file, a Confluence Cloud page (`confluence_page.py`), or, for the goals, a Jira epic's description (`jira_description.py`). `contract.py` holds the tests every backend must pass, and `fakes.py` a store in memory that the tests of other tools use.
|
||||
- `release_plan/` says which release is next and whether it is ready to cut (`release_standing.py`), from the plan, the changelog and the tags, and picks the item the next chunk takes first (`next_chunk.py`), for `chunk_preflight` and `loop_claude`.
|
||||
|
||||
+89
-28
@@ -2,7 +2,7 @@
|
||||
|
||||
An item is an open child issue. Its ID is the issue's number, so every child must be in the epic's own Jira project: ABC-34 is item 34 of the plan under ABC-12. The summary is the tagline, the description the detail, the earliest Fix Version the release, and an "is blocked by" link a blocker. L, E, I, S, Moves and Exempt sit in one issue property, PROPERTY, which needs no Jira admin to set up; an issue a person filed holds none, and reads as an item without scores.
|
||||
|
||||
`add` files an item as a new child issue, marked with FILED_BY, and ranks it among the issues the loop filed, by the score the config's formula gives, as `placing` says. `finish` moves an item's issue to a done status. `edit` changes an issue the loop filed, but never its links. Of an issue a person filed it sets only the scores, with a comment that tells the team why."""
|
||||
`add` files an item as a new child issue, marked with FILED_BY, and ranks it among the issues the loop filed, by the score the config's formula gives, as `placing` says. `finish` moves an item's issue to a done status. `edit` changes an issue the loop filed, and its links to the epic's other open items. Of an issue a person filed it sets only the scores, with a comment that tells the team why."""
|
||||
import dataclasses
|
||||
import pathlib
|
||||
import re
|
||||
@@ -50,6 +50,15 @@ class ReadsScoring(typing.Protocol):
|
||||
"""The scoring `add` scores an item by: the config's formula and bar, with the goal weights that the goals file, the decision log and the comprehension history give."""
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Link:
|
||||
"""One "is blocked by" link of an issue."""
|
||||
# The key of the issue that blocks.
|
||||
blocker: str
|
||||
# The link's own id, which Jira deletes it by.
|
||||
id: str
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class Issue:
|
||||
"""A child issue as Jira answered it, checked to hold what an item is read from."""
|
||||
@@ -57,8 +66,8 @@ class Issue:
|
||||
summary: str
|
||||
description: dict[str, typing.Any] | None
|
||||
fix_versions: tuple[str, ...]
|
||||
# The key of each issue this one "is blocked by".
|
||||
blockers: tuple[str, ...]
|
||||
# The issue's "is blocked by" links, one per blocker unless Jira holds a link twice.
|
||||
links: tuple[Link, ...]
|
||||
# PROPERTY's value; an empty object where the issue holds none.
|
||||
scores: dict[str, typing.Any]
|
||||
|
||||
@@ -66,6 +75,10 @@ class Issue:
|
||||
def number(self) -> int:
|
||||
return number(self.key)
|
||||
|
||||
@property
|
||||
def blockers(self) -> tuple[str, ...]:
|
||||
return tuple(link.blocker for link in self.links)
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
class JiraPlan:
|
||||
@@ -124,10 +137,8 @@ class JiraPlan:
|
||||
answered = children(self.epic, authorization, self.http)
|
||||
if isinstance(answered, Failure):
|
||||
return answered
|
||||
held = {raw.get("key") for raw in answered if isinstance(raw, dict)}
|
||||
# `item` reads only an open child as a blocker, so a link to any other issue would be lost on the next read.
|
||||
if missing := next((blocker for blocker in filing.blockers if blocker not in held), None):
|
||||
return Failure(f"{self.label} holds no item {number(missing)} to be blocked by")
|
||||
if missing := missing_blocker(filing.blockers, keys_of(answered), self.label):
|
||||
return missing
|
||||
before = placing(answered, filing.item, value, scoring)
|
||||
created = self.http("POST", f"{self.epic.site}/rest/api/3/issue", authorization, {"fields": issue_fields | {"fixVersions": [{"name": version}]}, "properties": [{"key": PROPERTY, "value": filing.scores}]})
|
||||
if isinstance(created, Failure):
|
||||
@@ -141,9 +152,7 @@ class JiraPlan:
|
||||
"""Links the filed issue named key as blocked by each of blockers, and ranks it just before the issue named before; a note for each Jira refuses."""
|
||||
notes = []
|
||||
for blocker in blockers:
|
||||
# Jira names the two ends by the link type's sides: the inward issue blocks the outward one, which then reads "is blocked by" it.
|
||||
linked = self.http("POST", f"{self.epic.site}/rest/api/3/issueLink", authorization, {"type": {"name": BLOCKS}, "inwardIssue": {"key": blocker}, "outwardIssue": {"key": key}})
|
||||
if isinstance(linked, Failure):
|
||||
if isinstance(linked := self.link(key, blocker, authorization), Failure):
|
||||
notes.append(f"filed {key}, but cannot link it as blocked by {blocker}: {linked.reason}; link it in Jira")
|
||||
if isinstance(before, Failure):
|
||||
notes.append(f"filed {key}, but cannot rank it: {before.reason}; rank it in Jira")
|
||||
@@ -151,6 +160,24 @@ class JiraPlan:
|
||||
notes.append(f"filed {key}, but cannot rank it before {before}: {refused}; rank it in Jira")
|
||||
return tuple(notes)
|
||||
|
||||
def link(self, key: str, blocker: str, authorization: str) -> object:
|
||||
"""Links the issue named key as blocked by the issue named blocker; a Failure where Jira refuses."""
|
||||
# Jira names the two ends by the link type's sides: the inward issue blocks the outward one, which then reads "is blocked by" it.
|
||||
return self.http("POST", f"{self.epic.site}/rest/api/3/issueLink", authorization, {"type": {"name": BLOCKS}, "inwardIssue": {"key": blocker}, "outwardIssue": {"key": key}})
|
||||
|
||||
def relinked(self, issue: Issue, wanted: tuple[str, ...] | None, open_keys: set[object], authorization: str) -> tuple[str, ...]:
|
||||
"""Makes issue blocked by exactly the open children named in wanted: a link for each that it lacks, and a deletion of each link to an open child that wanted drops. A link to any other issue stays, since the team may have made it. None for wanted leaves every link as it is. A note for each request Jira refuses."""
|
||||
if wanted is None:
|
||||
return ()
|
||||
notes = []
|
||||
for blocker in (blocker for blocker in wanted if blocker not in issue.blockers):
|
||||
if isinstance(linked := self.link(issue.key, blocker, authorization), Failure):
|
||||
notes.append(f"edited {issue.key}, but cannot link it as blocked by {blocker}: {linked.reason}; link it in Jira")
|
||||
for link in (link for link in issue.links if link.blocker in open_keys and link.blocker not in wanted):
|
||||
if isinstance(deleted := self.http("DELETE", f"{self.epic.site}/rest/api/3/issueLink/{link.id}", authorization, None), Failure):
|
||||
notes.append(f"edited {issue.key}, but cannot delete the link that makes it blocked by {link.blocker}: {deleted.reason}; delete it in Jira")
|
||||
return tuple(notes)
|
||||
|
||||
def rank_refusal(self, key: str, before: str, authorization: str) -> str | None:
|
||||
"""Ranks the issue named key just before the issue named before; why Jira refused, or None where it didn't. Jira answers a rank it made with no body, and one it refused with an error, or with an entry per issue that holds the errors."""
|
||||
answer = self.http("PUT", f"{self.epic.site}/rest/agile/1.0/issue/rank", authorization, {"issues": [key], "rankBeforeIssue": before})
|
||||
@@ -172,8 +199,10 @@ class JiraPlan:
|
||||
def child(self, id_: int, authorization: str) -> dict[str, typing.Any] | Failure:
|
||||
"""Item id_'s issue, as the epic's open children answer it; a Failure where none of them is item id_."""
|
||||
answered = children(self.epic, authorization, self.http)
|
||||
if isinstance(answered, Failure):
|
||||
return answered
|
||||
return answered if isinstance(answered, Failure) else self.child_in(answered, id_)
|
||||
|
||||
def child_in(self, answered: list[object], id_: int) -> dict[str, typing.Any] | Failure:
|
||||
"""Item id_'s issue among the epic's open children; a Failure where none of them is item id_."""
|
||||
key = f"{project_of(self.epic.key)}-{id_}"
|
||||
found = next((raw for raw in answered if isinstance(raw, dict) and raw.get("key") == key), None)
|
||||
return Failure(no_item(self.label, id_)) if found is None else found
|
||||
@@ -193,13 +222,16 @@ class JiraPlan:
|
||||
return isinstance(texts, list) and texts[0].strip() == detail.strip()
|
||||
|
||||
def edit(self, id_: int, fields: dict[str, str], detail: str | None, comment: str | None = None) -> Written | Failure:
|
||||
"""Sets the fields and the detail in one request, so Jira takes all of the edit or none, and then posts comment on the issue. `revision_of` says what an edit may set.
|
||||
"""Sets the fields and the detail in one request, so Jira takes all of those or none, then changes the issue's links one request at a time, and then posts comment on the issue. `revision_of` says what an edit may set.
|
||||
|
||||
A comment Jira refuses leaves the edit made, so the write counts as landed, and a note says to post the comment by hand."""
|
||||
A link change or a comment Jira refuses leaves the edit made, so the write counts as landed, and a note says what to do by hand."""
|
||||
authorization = basic_auth(self.env_file)
|
||||
if isinstance(authorization, Failure):
|
||||
return authorization
|
||||
raw = self.child(id_, authorization)
|
||||
answered = children(self.epic, authorization, self.http)
|
||||
if isinstance(answered, Failure):
|
||||
return answered
|
||||
raw = self.child_in(answered, id_)
|
||||
if isinstance(raw, Failure):
|
||||
return raw
|
||||
issue = issue_of(raw)
|
||||
@@ -209,6 +241,11 @@ class JiraPlan:
|
||||
revision = revision_of(issue, cells(fields), detail, comment)
|
||||
if isinstance(revision, Failure):
|
||||
return revision
|
||||
open_keys = keys_of(answered)
|
||||
if revision.blockers is not None and (missing := missing_blocker(revision.blockers, open_keys, self.label)):
|
||||
return missing
|
||||
if revision.blockers is not None and (looped := blocking_loop(answered, issue, revision.blockers, self.label)):
|
||||
return looped
|
||||
body = revision.body
|
||||
if detail is not None and not self.shows(issue, detail):
|
||||
description = self.description_of(detail)
|
||||
@@ -227,10 +264,11 @@ class JiraPlan:
|
||||
edited = self.http("PUT", url, authorization, body) if body else None
|
||||
if isinstance(edited, Failure):
|
||||
return Failure(f"cannot edit {key}: {edited.reason}; {PERHAPS_EDITED.format(key=key)}")
|
||||
notes = self.relinked(issue, revision.blockers, open_keys, authorization)
|
||||
if said is None:
|
||||
return Written(id_)
|
||||
return Written(id_, notes)
|
||||
posted = self.http("POST", f"{url}/comment", authorization, {"body": said})
|
||||
return Written(id_, (f"edited {key}, but cannot post the comment: {posted.reason}; post it in Jira",) if isinstance(posted, Failure) else ())
|
||||
return Written(id_, notes + ((f"edited {key}, but cannot post the comment: {posted.reason}; post it in Jira",) if isinstance(posted, Failure) else ()))
|
||||
|
||||
def finish(self, id_: int) -> Written | Failure:
|
||||
"""Moves item id_'s issue by the transition that the config names, to the status it names. Any open child of the epic may move, whoever filed it."""
|
||||
@@ -331,18 +369,18 @@ class Revision:
|
||||
body: dict[str, typing.Any]
|
||||
# The release to move the issue to; None where the edit names none.
|
||||
release: str | None
|
||||
# The key of each issue the edit makes the issue blocked by; None where the edit names no Blocked by.
|
||||
blockers: tuple[str, ...] | None
|
||||
|
||||
|
||||
def revision_of(issue: Issue, named: dict[str, str], detail: str | None, comment: str | None) -> Revision | Failure:
|
||||
"""The edit of issue that sets the cells in named, and the detail unless None, or why it cannot be made.
|
||||
|
||||
The summary, description and Fix Version of an issue a person filed are the team's, so there an edit may set only SCORED. Jira's screens don't show PROPERTY, so such an edit needs a comment, which tells the team. L, E, I and S are set together, so no issue is left partly scored. An issue the loop filed also keeps the label SECURITY in step with its Exempt. No edit changes a link."""
|
||||
The summary, description, Fix Version and links of an issue a person filed are the team's, so of such an issue an edit may set only SCORED. Jira's screens don't show PROPERTY, so such an edit needs a comment, which tells the team. L, E, I and S are set together, so no issue is left partly scored. An issue the loop filed also keeps the label SECURITY in step with its Exempt. Only an edit of an issue the loop filed may name the blockers, whose links `JiraPlan.relinked` changes; each must be an open child, which the caller checks."""
|
||||
held = issue.scores
|
||||
if BLOCKED_BY in named:
|
||||
return Failure(f"the loop doesn't change an issue's links: link {issue.key} in Jira")
|
||||
own = held.get(FILED_BY[0]) == FILED_BY[1]
|
||||
if not own and ("Item" in named or "Release" in named or detail is not None):
|
||||
return Failure(f"a person filed {issue.key}, so the loop sets only its scores: change its summary, description and Fix Version in Jira")
|
||||
if not own and ("Item" in named or "Release" in named or BLOCKED_BY in named or detail is not None):
|
||||
return Failure(f"a person filed {issue.key}, so the loop sets only its scores: change its summary, description, links and Fix Version in Jira")
|
||||
if not own and not (comment and comment.strip()):
|
||||
return Failure(f"a person filed {issue.key}, and Jira doesn't show its team the scores: pass a comment saying that it is scored, and why")
|
||||
body: dict[str, typing.Any] = {}
|
||||
@@ -354,7 +392,7 @@ def revision_of(issue: Issue, named: dict[str, str], detail: str | None, comment
|
||||
if unfit := unfit_text(named.get("Item", ""), detail or ""):
|
||||
return unfit
|
||||
release = named.get("Release")
|
||||
if isinstance(checked := item_fields({name: named[name] for name in ("Release", "Exempt") if name in named}, f"item {issue.key}"), Failure):
|
||||
if isinstance(checked := item_fields({name: named[name] for name in ("Release", "Exempt", BLOCKED_BY) if name in named}, f"item {issue.key}", id_=issue.number), Failure):
|
||||
return checked
|
||||
if any(name in named for name in SCORED):
|
||||
texts = {name: str(value) for name, value in held.items()} | {name: named[name] for name in SCORED if name in named}
|
||||
@@ -367,7 +405,7 @@ def revision_of(issue: Issue, named: dict[str, str], detail: str | None, comment
|
||||
body["properties"] = [{"key": PROPERTY, "value": value}]
|
||||
if own and (scored.exempt == SECURITY) != (held.get("Exempt") == SECURITY):
|
||||
body["update"] = {"labels": [{"add" if scored.exempt == SECURITY else "remove": SECURITY}]}
|
||||
return Revision(body, release)
|
||||
return Revision(body, release, tuple(dict.fromkeys(f"{project_of(issue.key)}-{blocker}" for blocker in checked.blocked_by)) if BLOCKED_BY in named else None)
|
||||
|
||||
|
||||
def offer_of(raw: object) -> tuple[str, str, str, str] | None:
|
||||
@@ -438,19 +476,42 @@ def issue_of(raw: object) -> Issue | Failure:
|
||||
# The answer's nested fields are read as Jira documents them; one missing or of another type ends the read here, as a Failure, so no later step meets it.
|
||||
try:
|
||||
fields = raw["fields"]
|
||||
blockers = tuple(link["inwardIssue"]["key"] for link in fields["issuelinks"] if "inwardIssue" in link and link["type"]["inward"] == "is blocked by")
|
||||
links = tuple(Link(link["inwardIssue"]["key"], link["id"]) for link in fields["issuelinks"] if "inwardIssue" in link and link["type"]["inward"] == "is blocked by")
|
||||
held = raw.get("properties", {}).get(PROPERTY, {})
|
||||
summary, description, versions = fields["summary"].strip(), fields["description"], tuple(version["name"] for version in fields["fixVersions"])
|
||||
except (AttributeError, KeyError, TypeError) as failure:
|
||||
return Failure(f"{key} is not in the shape Jira Cloud's REST API version 3 documents: {failure!r}")
|
||||
if not isinstance(held, dict):
|
||||
return Failure(f"{key}'s issue property {PROPERTY} is not a JSON object")
|
||||
issue = Issue(key, summary, description, versions, blockers, held)
|
||||
if not isinstance(issue.description, dict | None) or not all(isinstance(name, str) for name in issue.fix_versions + issue.blockers) or not all(ISSUE_KEY.fullmatch(blocker) for blocker in issue.blockers):
|
||||
return Failure(f"{key} is not in the shape Jira Cloud's REST API version 3 documents: its description, a Fix Version's name or a linked issue's key holds another kind of value")
|
||||
issue = Issue(key, summary, description, versions, links, held)
|
||||
if not isinstance(issue.description, dict | None) or not all(isinstance(name, str) for name in issue.fix_versions + issue.blockers) or not all(isinstance(link.id, str) for link in links) or not all(ISSUE_KEY.fullmatch(blocker) for blocker in issue.blockers):
|
||||
return Failure(f"{key} is not in the shape Jira Cloud's REST API version 3 documents: its description, a Fix Version's name or a link's id or linked issue's key holds another kind of value")
|
||||
return issue
|
||||
|
||||
|
||||
def keys_of(answered: list[object]) -> set[object]:
|
||||
"""The key of each issue in the search's answer."""
|
||||
return {raw.get("key") for raw in answered if isinstance(raw, dict)}
|
||||
|
||||
|
||||
def missing_blocker(blockers: tuple[str, ...], held: set[object], label: str) -> Failure | None:
|
||||
"""None where each of blockers is among the keys held, the plan's open children, else a Failure naming the first that isn't. `item` reads only an open child as a blocker, so a link to any other issue would be lost on the next read."""
|
||||
missing = next((blocker for blocker in blockers if blocker not in held), None)
|
||||
return None if missing is None else Failure(f"{label} holds no item {number(missing)} to be blocked by")
|
||||
|
||||
|
||||
def blocking_loop(answered: list[object], issue: Issue, blockers: tuple[str, ...], label: str) -> Failure | None:
|
||||
"""A Failure where issue, once blocked by blockers, which the caller has checked are open children, would block itself through the items its blockers wait for, and none of them could be taken; None otherwise. A loop the plan already holds without issue isn't this edit's."""
|
||||
issues = {found.key: found for raw in answered if isinstance(found := issue_of(raw), Issue)}
|
||||
waits_for = {found.key: found.blockers for found in issues.values()} | {issue.key: blockers}
|
||||
reached: set[str] = set()
|
||||
frontier = set(blockers)
|
||||
while frontier:
|
||||
reached |= frontier
|
||||
frontier = {blocker for key in frontier for blocker in waits_for[key] if blocker in issues} - reached
|
||||
return Failure(f"{label}: item {issue.number} would be blocked by itself through {', '.join(str(number(key)) for key in sorted(reached - {issue.key}, key=number))}; drop one of the blockers") if issue.key in reached else None
|
||||
|
||||
|
||||
def plan_of(issues: list[Issue], epic: Epic, to_markdown: ToMarkdown) -> Plan | Failure:
|
||||
"""The plan the issues hold, in their order."""
|
||||
project = project_of(epic.key)
|
||||
|
||||
@@ -29,7 +29,7 @@ class Written:
|
||||
|
||||
|
||||
class PlanStore(typing.Protocol):
|
||||
"""A project's plan. plan_store.contract holds every backend that writes to the same behaviour; `jira_epic` doesn't hold it yet: it changes no link, and its own tests stand in for Jira. A write that fails leaves the plan as it was, except where its Failure says the tracker may have taken the write all the same, as when Jira's answer to a new issue, an edit or a finish is lost."""
|
||||
"""A project's plan. plan_store.contract holds every backend that writes to the same behaviour; `jira_epic` doesn't hold it yet: its own tests stand in for Jira. A write that fails leaves the plan as it was, except where its Failure says the tracker may have taken the write all the same, as when Jira's answer to a new issue, an edit or a finish is lost."""
|
||||
|
||||
@property
|
||||
def label(self) -> str:
|
||||
|
||||
@@ -22,9 +22,14 @@ SEARCH = "https://acme.atlassian.net/rest/api/3/search/jql"
|
||||
AUTHORIZATION = "Basic " + base64.b64encode(b"me@example.com:s3cret").decode()
|
||||
|
||||
|
||||
def link_id(blocked: str, blocker: str) -> str:
|
||||
"""The id Jira gives the link that says blocked is blocked by blocker."""
|
||||
return f"{blocked}<{blocker}"
|
||||
|
||||
|
||||
def issue(key: str, summary: str = "Count the runs.", versions: tuple[str, ...] = ("0.1.0",), scores: dict[str, object] | None = None, blocked_by: tuple[str, ...] = (), description: object = None, blocks: tuple[str, ...] = ()) -> dict[str, object]:
|
||||
links = [{"type": {"inward": "is blocked by", "outward": "blocks"}, "inwardIssue": {"key": blocker}} for blocker in blocked_by]
|
||||
links += [{"type": {"inward": "is blocked by", "outward": "blocks"}, "outwardIssue": {"key": blocked}} for blocked in blocks]
|
||||
links = [{"id": link_id(key, blocker), "type": {"inward": "is blocked by", "outward": "blocks"}, "inwardIssue": {"key": blocker}} for blocker in blocked_by]
|
||||
links += [{"id": link_id(blocked, key), "type": {"inward": "is blocked by", "outward": "blocks"}, "outwardIssue": {"key": blocked}} for blocked in blocks]
|
||||
return {
|
||||
"key": key,
|
||||
"fields": {"summary": summary, "description": description, "fixVersions": [{"name": name} for name in versions], "issuelinks": links},
|
||||
@@ -171,7 +176,7 @@ class JiraPlan(unittest.TestCase):
|
||||
|
||||
def test_an_issue_in_another_shape_fails_the_read_naming_it(self):
|
||||
good = issue("ABC-1")
|
||||
for wrong in ({"key": "ABC-1"}, issue("ABC-1", summary=None), issue("ABC-1", description="text"), good | {"fields": good["fields"] | {"fixVersions": [{"name": 7}]}}, good | {"fields": good["fields"] | {"issuelinks": [{"type": {"inward": "is blocked by"}, "inwardIssue": {"key": 7}}]}}, good | {"fields": good["fields"] | {"issuelinks": [{"type": {"inward": "is blocked by"}, "inwardIssue": {"key": "ABC-x"}}]}}, good | {"properties": None}): # type: ignore[arg-type, operator]
|
||||
for wrong in ({"key": "ABC-1"}, issue("ABC-1", summary=None), issue("ABC-1", description="text"), good | {"fields": good["fields"] | {"fixVersions": [{"name": 7}]}}, good | {"fields": good["fields"] | {"issuelinks": [{"id": "1", "type": {"inward": "is blocked by"}, "inwardIssue": {"key": 7}}]}}, good | {"fields": good["fields"] | {"issuelinks": [{"id": "1", "type": {"inward": "is blocked by"}, "inwardIssue": {"key": "ABC-x"}}]}}, good | {"fields": good["fields"] | {"issuelinks": [{"type": {"inward": "is blocked by"}, "inwardIssue": {"key": "ABC-2"}}]}}, good | {"fields": good["fields"] | {"issuelinks": [{"id": 7, "type": {"inward": "is blocked by"}, "inwardIssue": {"key": "ABC-2"}}]}}, good | {"properties": None}): # type: ignore[arg-type, operator]
|
||||
with self.subTest(wrong=wrong):
|
||||
failure = self.read(wrong) # type: ignore[arg-type]
|
||||
self.assertIsInstance(failure, Failure)
|
||||
@@ -487,13 +492,19 @@ class Editing(unittest.TestCase):
|
||||
self.edited: object = None
|
||||
self.commented: object = {"id": "10100"}
|
||||
self.versions: object = [{"name": "0.1.0"}, {"name": "v0.2.0"}]
|
||||
self.linked: object = None
|
||||
self.unlinked: object = None
|
||||
|
||||
def http(self, method: str, url: str, authorization: str, body: object) -> object:
|
||||
"""Stands in for Jira: answers the epic, self.versions for the project's Fix Versions, self.open to the search, self.edited to an edit and self.commented to a new comment."""
|
||||
"""Stands in for Jira: answers the epic, self.versions for the project's Fix Versions, self.open to the search, self.edited to an edit, self.commented to a new comment, self.linked to a new link and self.unlinked to a deleted one."""
|
||||
self.calls.append((method, url, body))
|
||||
assert authorization == AUTHORIZATION
|
||||
if method == "PUT":
|
||||
return self.edited
|
||||
if method == "DELETE":
|
||||
return self.unlinked
|
||||
if url == LINKS:
|
||||
return self.linked
|
||||
return self.commented if url.endswith("/comment") else {SEARCH: {"issues": self.open}, VERSIONS: self.versions}.get(url, {"key": "ABC-12"})
|
||||
|
||||
def to_adf(self, markdown: str) -> dict[str, object] | Failure:
|
||||
@@ -504,7 +515,7 @@ class Editing(unittest.TestCase):
|
||||
|
||||
def writes(self) -> list[tuple[str, str, object]]:
|
||||
"""Each request that changes Jira, in order."""
|
||||
return [call for call in self.calls if call[0] == "PUT" or call[1].endswith("/comment")]
|
||||
return [call for call in self.calls if call[0] in ("PUT", "DELETE") or call[1].endswith(("/comment", "/issueLink"))]
|
||||
|
||||
def test_sets_the_summary_description_and_scores_of_an_issue_the_loop_filed_in_one_request(self):
|
||||
self.assertEqual(self.edit(34, {"Tagline": "**Count every run.**", "L": "2", "Moves": ""}, "Why it counts."), Written(34))
|
||||
@@ -583,7 +594,7 @@ class Editing(unittest.TestCase):
|
||||
def test_what_a_person_wrote_or_planned_is_never_edited(self):
|
||||
for fields, detail in (({"Tagline": "Count every run."}, None), ({}, "Why."), ({}, ""), ({"Release": "0.2.0"}, None), ({"Tagline": "Count.", "Release": "0.2.0", "L": "1"}, "")):
|
||||
with self.subTest(fields=fields, detail=detail):
|
||||
self.assertEqual(self.edit(36, fields, detail, COMMENT), Failure("a person filed ABC-36, so the loop sets only its scores: change its summary, description and Fix Version in Jira"))
|
||||
self.assertEqual(self.edit(36, fields, detail, COMMENT), Failure("a person filed ABC-36, so the loop sets only its scores: change its summary, description, links and Fix Version in Jira"))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_scoring_an_unscored_issue_in_part_fails_before_any_write(self):
|
||||
@@ -599,8 +610,96 @@ class Editing(unittest.TestCase):
|
||||
self.commented = Failure("HTTP 403")
|
||||
self.assertEqual(self.edit(36, {"L": "2"}, None, COMMENT), Written(36, ("edited ABC-36, but cannot post the comment: HTTP 403; post it in Jira",)))
|
||||
|
||||
def test_an_edit_of_the_blockers_fails_since_the_store_changes_no_link(self):
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35"}), Failure("the loop doesn't change an issue's links: link ABC-34 in Jira"))
|
||||
def test_links_each_new_blocker_to_an_issue_the_loop_filed(self):
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35, 36"}), Written(34))
|
||||
self.assertEqual(self.writes(), [("POST", LINKS, {"type": {"name": "Blocks"}, "inwardIssue": {"key": f"ABC-{blocker}"}, "outwardIssue": {"key": "ABC-34"}}) for blocker in (35, 36)])
|
||||
|
||||
def test_links_a_blocker_named_twice_once(self):
|
||||
self.edit(34, {"Blocked by": "35, 35"})
|
||||
self.assertEqual([body["inwardIssue"]["key"] for _, _, body in self.writes()], ["ABC-35"]) # type: ignore[index]
|
||||
|
||||
def test_deletes_the_link_of_each_blocker_the_edit_drops_and_makes_none_for_one_it_keeps(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35", "ABC-36"))
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35"}), Written(34))
|
||||
self.assertEqual(self.writes(), [("DELETE", f"{LINKS}/{link_id('ABC-34', 'ABC-36')}", None)])
|
||||
|
||||
def test_an_empty_blocked_by_deletes_every_link_the_issue_holds(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35", "ABC-36"), blocks=("ABC-35",))
|
||||
self.assertEqual(self.edit(34, {"Blocked by": ""}), Written(34))
|
||||
self.assertEqual(self.writes(), [("DELETE", f"{LINKS}/{link_id('ABC-34', blocker)}", None) for blocker in ("ABC-35", "ABC-36")])
|
||||
|
||||
def test_a_link_to_an_issue_that_is_no_open_child_is_never_deleted(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35", "OPS-9", "ABC-99"))
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "36"}), Written(34))
|
||||
self.assertEqual([(method, url) for method, url, _ in self.writes()], [("POST", LINKS), ("DELETE", f"{LINKS}/{link_id('ABC-34', 'ABC-35')}")])
|
||||
|
||||
def test_an_edit_that_names_no_blocked_by_leaves_the_links_as_they_are(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35",))
|
||||
self.edit(34, {"L": "2"})
|
||||
self.assertEqual([method for method, _, _ in self.writes()], ["PUT"])
|
||||
|
||||
def test_a_blocked_by_the_issue_already_holds_writes_nothing(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35", "ABC-36"))
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "36, 35"}), Written(34))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_a_blocker_swapped_for_another_deletes_one_link_and_makes_one(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35",))
|
||||
self.edit(34, {"Blocked by": "36"})
|
||||
self.assertEqual([(method, url) for method, url, _ in self.writes()], [("POST", LINKS), ("DELETE", f"{LINKS}/{link_id('ABC-34', 'ABC-35')}")])
|
||||
|
||||
def test_changes_the_links_after_the_edit_and_before_the_comment(self):
|
||||
self.assertEqual(self.edit(34, {"L": "2", "Blocked by": "35"}, None, COMMENT), Written(34))
|
||||
self.assertEqual([(method, url) for method, url, _ in self.writes()], [("PUT", f"{ISSUES}/ABC-34"), ("POST", LINKS), ("POST", f"{ISSUES}/ABC-34/comment")])
|
||||
|
||||
def test_a_failed_edit_makes_no_link(self):
|
||||
self.edited = Failure("HTTP 400")
|
||||
self.assertIsInstance(self.edit(34, {"L": "2", "Blocked by": "35"}), Failure)
|
||||
self.assertEqual([method for method, _, _ in self.writes()], ["PUT"])
|
||||
|
||||
def test_a_link_jira_refuses_leaves_the_edit_made_with_a_note_and_the_other_links_changed(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-36",))
|
||||
self.linked = Failure("HTTP 403")
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35"}), Written(34, ("edited ABC-34, but cannot link it as blocked by ABC-35: HTTP 403; link it in Jira",)))
|
||||
self.assertEqual([method for method, _, _ in self.writes()], ["POST", "DELETE"])
|
||||
|
||||
def test_a_link_jira_refuses_to_delete_leaves_a_note_and_the_comment_posted(self):
|
||||
self.open[0] = issue("ABC-34", scores=PROPERTY, blocked_by=("ABC-35", "ABC-36"))
|
||||
self.unlinked = Failure("HTTP 404")
|
||||
self.assertEqual(self.edit(34, {"Blocked by": ""}, None, COMMENT), Written(34, ("edited ABC-34, but cannot delete the link that makes it blocked by ABC-35: HTTP 404; delete it in Jira", "edited ABC-34, but cannot delete the link that makes it blocked by ABC-36: HTTP 404; delete it in Jira")))
|
||||
self.assertEqual(self.writes()[-1][1], f"{ISSUES}/ABC-34/comment")
|
||||
|
||||
def test_a_blocker_that_is_no_open_child_fails_before_any_write(self):
|
||||
self.assertEqual(self.edit(34, {"L": "2", "Blocked by": "35, 40"}), Failure("jira:https://acme.atlassian.net/browse/ABC-12 holds no item 40 to be blocked by"))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_a_blocker_that_makes_the_issue_wait_for_itself_fails_before_any_write(self):
|
||||
self.open[1] = issue("ABC-35", scores=PROPERTY, blocked_by=("ABC-34",))
|
||||
self.open[2] = issue("ABC-36", scores=PROPERTY, blocked_by=("ABC-35",))
|
||||
self.assertEqual(self.edit(34, {"L": "2", "Blocked by": "36"}), Failure("jira:https://acme.atlassian.net/browse/ABC-12: item 34 would be blocked by itself through 35, 36; drop one of the blockers"))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_the_loop_names_its_items_by_number_not_by_key(self):
|
||||
self.open += [issue("ABC-9", scores=PROPERTY, blocked_by=("ABC-10",)), issue("ABC-10", scores=PROPERTY, blocked_by=("ABC-34",))]
|
||||
failure = self.edit(34, {"Blocked by": "9"})
|
||||
self.assertTrue(failure.reason.endswith("through 9, 10; drop one of the blockers")) # type: ignore[union-attr]
|
||||
|
||||
def test_a_loop_the_plan_holds_without_the_issue_does_not_stop_its_edit(self):
|
||||
self.open[1] = issue("ABC-35", scores=PROPERTY, blocked_by=("ABC-36",))
|
||||
self.open[2] = issue("ABC-36", scores=PROPERTY, blocked_by=("ABC-35",))
|
||||
self.assertEqual(self.edit(34, {"Blocked by": "35"}), Written(34))
|
||||
self.assertEqual([method for method, _, _ in self.writes()], ["POST"])
|
||||
|
||||
def test_a_blocked_by_out_of_format_or_naming_the_issue_itself_fails_before_any_write(self):
|
||||
for cell in ("ABC-35", "35,36", "34"):
|
||||
with self.subTest(cell=cell):
|
||||
self.assertIsInstance(self.edit(34, {"Blocked by": cell}), Failure)
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_the_links_of_an_issue_a_person_filed_are_never_changed(self):
|
||||
for id_ in (35, 36):
|
||||
with self.subTest(id_=id_):
|
||||
self.assertEqual(self.edit(id_, {"Blocked by": "34"}, None, COMMENT), Failure(f"a person filed ABC-{id_}, so the loop sets only its scores: change its summary, description, links and Fix Version in Jira"))
|
||||
self.assertEqual(self.writes(), [])
|
||||
|
||||
def test_an_issue_that_is_no_open_child_of_the_epic_is_not_edited(self):
|
||||
@@ -669,11 +768,14 @@ class Finishing(unittest.TestCase):
|
||||
self.open = [issue("ABC-34"), issue("ABC-35")]
|
||||
self.transitions: object = {"transitions": [transition("11", "Start", "In Progress", "indeterminate"), transition("31", "Mark as done", "Done")]}
|
||||
self.moved: object = None
|
||||
self.search_refused: Failure | None = None
|
||||
|
||||
def http(self, method: str, url: str, authorization: str, body: object) -> object:
|
||||
"""Stands in for Jira: answers the epic, self.open to the search, self.transitions for ABC-34's transitions and self.moved to a transition of it."""
|
||||
"""Stands in for Jira: answers the epic, self.open to the search, or self.search_refused where set, self.transitions for ABC-34's transitions and self.moved to a transition of it."""
|
||||
self.calls.append((method, url, body))
|
||||
assert authorization == AUTHORIZATION
|
||||
if url == SEARCH and self.search_refused:
|
||||
return self.search_refused
|
||||
if url == TRANSITIONS:
|
||||
return self.transitions if method == "GET" else self.moved
|
||||
return {SEARCH: {"issues": self.open}}.get(url, {"key": "ABC-12"})
|
||||
@@ -688,6 +790,11 @@ class Finishing(unittest.TestCase):
|
||||
self.assertEqual(self.finish(), Written(34))
|
||||
self.assertEqual(self.posts(), [("POST", TRANSITIONS, {"transition": {"id": "31"}})])
|
||||
|
||||
def test_a_search_jira_refuses_fails_the_finish_before_any_move(self):
|
||||
self.search_refused = Failure("HTTP 500")
|
||||
self.assertEqual(self.finish(), Failure("HTTP 500"))
|
||||
self.assertEqual(self.posts(), [])
|
||||
|
||||
def test_a_config_that_names_no_transition_fails_before_any_request(self):
|
||||
self.assertEqual(self.finish(by=None), Failure("the config names no transition to finish an item by: set `jira-finish-transition` and `jira-finish-status`, as `project-config --help` shows"))
|
||||
self.assertEqual(self.calls, [])
|
||||
|
||||
@@ -42,15 +42,18 @@ empties the cell. --detail replaces the detail with the text on stdin, and --cle
|
||||
Text on stdin without --detail, and --detail without text on stdin, are refused, so no detail is
|
||||
dropped or wiped by mistake. It prints `Edited item <ID> in <plan>.` It doesn't write anything where
|
||||
ranking fails or scores the item under the bar.
|
||||
In a Jira epic, edit changes an issue the loop filed: its summary, description and scores, and
|
||||
the label `security` with --exempt. It doesn't change a link, so --blocked-by fails.
|
||||
Of an issue a person filed it sets only the scores, --moves and --exempt, and only with --comment.
|
||||
In a Jira epic, edit changes an issue the loop filed: its summary, description and scores, the label
|
||||
`security` with --exempt, and its "is blocked by" links with --blocked-by: it makes a link for each
|
||||
blocker added and deletes the link of each blocker dropped. Each blocker must be an open child of the
|
||||
epic that doesn't wait for the issue itself, directly or through others. A link to any other issue stays.
|
||||
Of an issue a person filed it sets only the scores, --moves and --exempt, and only with --comment;
|
||||
--blocked-by fails there, since its links are the team's.
|
||||
The four scores are set together where the issue holds none yet.
|
||||
--comment is posted as a comment on the Jira issue, for the client's team, in the project's
|
||||
language. Jira doesn't show the team the scores, so say that the issue is scored, and why.
|
||||
A todo.md keeps no comment, so there the flag doesn't do anything.
|
||||
Where Jira takes the edit and then refuses the comment, edit still prints `Edited item <ID> …`,
|
||||
and says on stderr to post the comment in Jira.
|
||||
Where Jira takes the edit and then refuses a link, a deletion or the comment, edit still prints `Edited item <ID> …`,
|
||||
and says on stderr what to do in Jira.
|
||||
|
||||
move sets the item's release, as edit sets a cell. It prints `Moved item <ID> to release <version> in <plan>.`
|
||||
In a Jira epic, move sets the Fix Version of an issue the loop filed; a person moves their own.
|
||||
|
||||
+1
-1
@@ -376,7 +376,7 @@ Messages keep each file's usual name, such as `todo.md`, as its label, since the
|
||||
- **The release is the earliest Fix Version named as a semver version**, and an issue with none fails the read, naming it.
|
||||
- **The loop files an item as a Task under the epic, and marks it as its own** (lilleman's calls of 2026-11-12). `"Filed by": "loop"` in the `plan-item` property tells such an issue from one a person filed, whose summary and description the loop never edits. Task is an issue type every Jira Software project template has; a project without it refuses the issue, saying so. The issue takes the project's Fix Version named as the release, with a leading v or without, and the store refuses an item whose release the project has no Fix Version for, before it files anything. A security finding also gets the label `security`, and its text never holds a secret's value. Jira takes a blocker's link only after the issue exists, so the store first checks that each blocker is an open child. A link Jira still refuses leaves the issue filed: the write counts as landed, with a note naming the link to make by hand. A failed create says the issue may exist all the same, since a lost answer doesn't tell.
|
||||
- **The config states the formula and the bar, and the store ranks a new issue among the loop's own** (lilleman, 2026-11-12 and 2026-11-15). A plan in Jira has no `## Scoring`, so a config whose `plan` names an epic must set `jira-score-formula` and `jira-score-bar`. It fails to load without them, or with a formula that doesn't parse, since no setting a config needs has a default. A bench of readers picked the spelling: three fresh readers, seated as the person who writes a client's `config.toml`, each picked those keys over `jira-score` and `jira-bar`, `score-formula` and `score-bar`, and bare `score` and `bar`. The prefix matches the other Jira-only settings, "formula" says the value is no score, and "score-bar" says what the bar applies to. The store scores the item as `rank_todo.py` scores a row, with the goal weights from the goals file, the decision log and the comprehension history. It refuses an item under the bar that isn't exempt, or one whose Moves names a goal the goals file lacks, before it files anything. Then it ranks the issue just before the first issue the loop filed that ranks after it. A person's issues don't count, so the team's rank of each stays as it is. The order is todo.md's within a release: a question first, then a security finding, then the higher score, with a tie after the older issue. Questions go first because `rank_todo.py` ranks them ahead of security findings, since an answer may change other items (the loop's choice, 2026-11-16). Release doesn't count, since lilleman's call ranks by score among the loop's issues. A rank Jira refuses, or an issue of the loop's that no longer scores, leaves the new issue filed and last, with a note to rank it by hand.
|
||||
- **The store edits and moves only an issue the loop filed, and of an issue a person filed it sets only the scores** (lilleman's calls of 2026-11-12). On its own issue it sets the summary, description, scores and Fix Version in one request, so Jira takes all of an edit or none, and it keeps the label `security` in step with Exempt. Of a person's issue it writes only the `plan-item` property, and a comment: the team's screens don't show the property, so the comment tells the team why the scores changed, and the store refuses the edit without one. The comment's text comes from whoever scores, in the project's `language`. Where Jira takes the edit and then refuses the comment, the edit counts as made, and a note says to post the comment by hand. No edit changes a link, until `todo.md` item 389.
|
||||
- **The store edits and moves only an issue the loop filed, and of an issue a person filed it sets only the scores** (lilleman's calls of 2026-11-12). On its own issue it sets the summary, description, scores and Fix Version in one request, so Jira takes all of an edit or none, and it keeps the label `security` in step with Exempt. It also sets the "is blocked by" links, in requests of their own after that one: a link per blocker added and a deletion per blocker dropped, each blocker an open child, as `add` checks, and none that waits for the item itself, directly or through others. A link to any other issue stays as it is, since a read doesn't show it and the team may have made it. Of a person's issue it writes only the `plan-item` property, and a comment: the team's screens don't show the property, so the comment tells the team why the scores changed, and the store refuses the edit without one. Its links stay the team's, which Jira shows on its board where it doesn't show a score. The comment's text comes from whoever scores, in the project's `language`. Where Jira takes the edit and then refuses a link or the comment, the edit counts as made, and a note says what to do by hand.
|
||||
- **The loop may re-score a person's issue that already holds scores, and never moves it.** lilleman's calls of 2026-11-12 cover an issue nobody scored, and say nothing of one that holds scores; larv-review chose on 2026-11-16, through todo item 382. A re-score changes only the loop's own reading of the issue, and not what the person wrote, so it is allowed, with a comment as the first scores need. L, E, I and S are set together, so no issue is left partly scored. The Fix Version says when the team ships the issue, and a release is its team's, so the store refuses the move and `CLAUDE.md` has the worker ask the human to move the issue.
|
||||
- **`todo-item edit --comment` carries the comment, and a plan in a file takes the flag and keeps no comment**, so one command works in every project, as goal 1.3 asks. A bench of readers picked the spelling: three fresh readers, seated as the consultant who runs the loop in a client's project, each picked `--comment` over `--reason`, `--why` and `--because`. Only it says the text is posted where the team reads it, and `--reason` read as `--exempt`'s reason.
|
||||
- **The store finishes an item with the transition that the config's `jira-finish-transition` names**, which must lead to the status `jira-finish-status` names, since each Jira workflow differs (lilleman's call, 2026-11-12); any open child of the epic may move. It refuses a status outside Jira's done status category: the read counts an issue as finished only in that category, so the item would stay in the plan. Where the issue's present status has no direct transition to the status `jira-finish-status` names, `todo-item finish` fails and a person moves the issue in Jira: the store never walks an issue through other statuses to reach it. lilleman answered on 2026-11-15: "If it is possible to move it to done without a transisiont, that should happen. If not, fail." The implementer read "without a transition" as "without a transition in between". `rank_todo.py` refuses to rank a plan in Jira, and its `--check` passes, since Jira's backlog ranks it; rule-hook's rank check skips it. Each read first asks Jira for the epic itself, since a search under an epic the account cannot see answers no issues, as a finished plan does.
|
||||
|
||||
@@ -2430,3 +2430,20 @@ Read most (opens and searches):
|
||||
- `bin/reading_cost/test_reading_cost.py` 3
|
||||
- `bin/review_replay/replay.py` 3
|
||||
- `bin/routing_figures/archive.py` 3
|
||||
|
||||
## Reading cost, chunk 996aefc2924f, finished 2026-11-17T03:46:23Z
|
||||
|
||||
73430 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `docs/decisions.md` 17
|
||||
- `bin/touch_predictions/prediction.py` 4
|
||||
- `bin/touch_predictions/test_touch_predictions.py` 4
|
||||
- `bin/adf_codec/convert.py` 2
|
||||
- `bin/adf_codec/test_adf_codec.py` 2
|
||||
- `README.md` 1
|
||||
- `bin/plan_store/jira_epic.py` 1
|
||||
- `bin/touch_predictions/main.py` 1
|
||||
- `reviewer-merge-trials/README.md` 1
|
||||
- `rules/todo-items.md` 1
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
| 393 | 0.12.0 | | decision | **Step an L 3 worker one rung up and an L 4 worker two up from the project's rung, as lilleman ruled on 2026-11-14.** | 2 | 1 | 3 | 4 | 4 | 1.4 by 3 | 0.9 |
|
||||
| 298 | 0.12.0 | | | **Send the judge only the decision entries and the transcript tail a verdict needs, and keep the cut only where `judge-replay` changes no verdict kind.** | 3 | 3 | 3 | 7 | 4 | 1.4 by 2, 1.5 by 1 | 0.9 |
|
||||
| 327 | 0.12.0 | | | **Have `larv-review` print a round commit's title prefix, counted from the round's report, and have rule-hook refuse a round title whose counts differ from it.** | 3 | 2 | 3 | 6 | 4 | 1.1 by 1, 1.4 by 1 | 0.6 |
|
||||
| 389 | 0.12.0 | | decision | **Set a Jira issue's "is blocked by" links from `todo-item edit --blocked-by`, on an issue the loop filed.** | 2 | 2 | 2 | 4 | 4 | 1.6 by 2 | 0.5 |
|
||||
| 365 | 0.13.0 | | | **Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
|
||||
| 368 | 0.13.0 | | | **Call a release review due, call a release ready to cut, and tell whether a chunk owes a scoring run, for a plan outside the checkout, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.1 by 2 | 1.2 |
|
||||
| 366 | 0.13.0 | | | **Count the chunks of a project whose plan sits outside the checkout in the routing figures, from the project repo's history or from Jira.** | 3 | 2 | 2 | 5 | 4 | 1.6 by 2, 1.4 by 2 | 1.1 |
|
||||
@@ -262,15 +261,6 @@ Touches:
|
||||
- `skills/larv-review/SKILL.md`: `## 3. Passes` (small)
|
||||
- `README.md`: `## Tools` (small)
|
||||
|
||||
### 389. Set a Jira issue's "is blocked by" links from `todo-item edit --blocked-by`, on an issue the loop filed.
|
||||
|
||||
Filed by item 382's chunk on 2026-11-16. `JiraPlan.edit` refuses an edit of Blocked by, saying to link the issue in Jira, so a worker cannot mark an item it filed as blocked once it exists. Read each link's id from the search's `issuelinks`, make a link per new blocker as `add` does, and delete one per blocker removed, after `missing_blocker`'s check. Say in `docs/decisions.md` whether the loop may link an issue a person filed; the decision on the Jira epic as a plan says the loop writes only the scores of such an issue.
|
||||
|
||||
Touches:
|
||||
- `bin/plan_store/jira_epic.py`: `Issue`, `issue_of`, `JiraPlan.edit`, `revision_of`
|
||||
- `bin/plan_store/test_jira_epic.py`: `Editing`
|
||||
- `bin/todo_item/main.py`: lines 1-77 (small)
|
||||
|
||||
### 365. Have `score-outcomes` read the finished and dropped items of a plan outside the checkout, from the project repo's history or from Jira's issue changelogs.
|
||||
|
||||
lilleman's call, 2026-11-12: 0.10.0 and 0.11.0 switch the history tools off for a plan outside the checkout, and 0.13.0 holds only their ports. In Jira a dropped item, which `Drop item` commit titles mark today, is an issue resolved by a resolution the config names.
|
||||
|
||||
Reference in New Issue
Block a user