Run a preflight before each fresh worker and put its facts in the worker's prompt
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from failure import Failure
|
||||
from git_repo import file_at, full_history, git
|
||||
from git_repo import file_at, full_history, git, newest_release_tag
|
||||
from comprehension_history import HISTORY, HistoryChange
|
||||
|
||||
|
||||
@@ -24,10 +24,8 @@ def history_changes(default: str) -> list[HistoryChange] | Failure:
|
||||
|
||||
def landed_since_release(default: str) -> bool | Failure:
|
||||
"""Whether the default branch holds a commit after its newest `v*` tag, or any commit when it has none."""
|
||||
# Sorts v1.0.0-rc.1 below v1.0.0.
|
||||
tags = git("-c", "versionsort.suffix=-", "tag", "--list", "v*", "--merged", default, "--sort=-v:refname")
|
||||
if isinstance(tags, Failure):
|
||||
return tags
|
||||
newest = tags.split()[:1]
|
||||
count = git("rev-list", "--count", f"{newest[0]}..{default}" if newest else default)
|
||||
newest = newest_release_tag(default)
|
||||
if isinstance(newest, Failure):
|
||||
return newest
|
||||
count = git("rev-list", "--count", f"{newest}..{default}" if newest else default)
|
||||
return count if isinstance(count, Failure) else int(count) > 0
|
||||
|
||||
Reference in New Issue
Block a user