Answer prose round 1: 0 🔴, 1 🟡; decline restating the rule in the help, since the item asks it to point to work_landed; reword the rest
This commit is contained in:
@@ -7,9 +7,9 @@ from todo_table import Item, items, NoItemsTable, renames, version
|
||||
|
||||
|
||||
def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], committed: bool, renamed: set[tuple[int, int, int]]) -> list[str] | Failure:
|
||||
"""Why the plan calls a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs it ships, committed whether `committed_since_release` holds for the default branch, and renamed the releases the chunk's plan marks renamed.
|
||||
"""Why the plan calls a scoring run, empty when it does not. before is the default branch's plan, after the chunk's, ships the IDs of the items the chunk ships, committed whether `committed_since_release` holds for the default branch, and renamed the releases the chunk's plan marks renamed.
|
||||
|
||||
A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured, short of one renamed as below. A release the chunk's plan marks renamed is due none.
|
||||
A chunk that ships an item naming the floor is due one, so it can prove the floor met. So is a chunk that empties a release after work has landed towards it, so no release ends unmeasured. A release the chunk's plan marks renamed is due none.
|
||||
"""
|
||||
plan = {item.id: item for item in before + after}
|
||||
if unknown := sorted(set(ships) - set(plan)):
|
||||
@@ -24,8 +24,9 @@ def scoring_run_due(before: list[Item], after: list[Item], ships: list[int], com
|
||||
return reasons
|
||||
|
||||
|
||||
# larv-review --help points here rather than restating the rule, so the rule is written once.
|
||||
def work_landed(release: tuple[int, int, int], shipped: list[Item], next_release: tuple[int, int, int] | None, committed: bool) -> bool:
|
||||
"""Whether work has landed towards release, for the scoring-run trigger. It has when the chunk ships one of the release's items, or when the release is next_release, the earliest the default branch's plan names, and committed holds: the default branch has a commit after its newest v* tag, or any commit when it has no v* tag."""
|
||||
"""Whether work has landed towards release, for the scoring-run trigger. It has when the chunk ships one of the release's items. It has too when the release is next_release, the earliest the default branch's plan names, and committed holds: the default branch has a commit after its newest v* tag, or any commit when it has no v* tag."""
|
||||
return any(item.release == release for item in shipped) or (release == next_release and committed)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user