Answer prose round 1: 0 🔴, 4 🟡 (0 misread); take the reviewer's rewrites
This commit is contained in:
@@ -3,14 +3,14 @@ import dataclasses
|
||||
|
||||
from failure import Failure
|
||||
from forge.commands import Forge, Run
|
||||
from forge.pulls import ready_pulls
|
||||
from git_cli.git_repo import Git, git
|
||||
from plan_store import stores
|
||||
from plan_store.plans import Plan, PlanStore
|
||||
from forge.pulls import ready_pulls
|
||||
from plan_store import stores
|
||||
|
||||
|
||||
def awaiting(ref: str, plan: PlanStore, root: str, forge: Forge, forge_run: Run, run: Git = git) -> dict[int, str] | Failure:
|
||||
"""Each plan item, by ID, that awaits a person's merge, with its pull request as `#<number> <URL>`: an item the plan held where the pull request's branch left ref, the default branch, and no longer holds at its head. A pull request whose head the checkout hasn't fetched, or whose plan can't be read, names none."""
|
||||
"""Each plan item, by ID, that awaits a person's merge, with its pull request as `#<number> <URL>`: an item that the plan held at the commit where the pull request's branch left ref, the default branch, and that the plan at the pull request's head no longer holds. A pull request whose head the checkout hasn't fetched, or whose plan can't be read, names none."""
|
||||
pulls = ready_pulls(forge, forge_run)
|
||||
if isinstance(pulls, Failure):
|
||||
return pulls
|
||||
@@ -26,5 +26,5 @@ def awaiting(ref: str, plan: PlanStore, root: str, forge: Forge, forge_run: Run,
|
||||
|
||||
|
||||
def marked(plan: Plan, awaited: dict[int, str]) -> Plan:
|
||||
"""plan with each item awaited names marked as awaiting its pull request's merge, so it waits."""
|
||||
"""plan, with each item whose ID awaited holds marked as awaiting that pull request's merge, so the item waits."""
|
||||
return dataclasses.replace(plan, items=[dataclasses.replace(item, awaits_merge=awaited.get(item.id, "")) for item in plan.items])
|
||||
|
||||
Reference in New Issue
Block a user