feat: require Naomi verification before closing Forgejo issues

Done items stay open in Forgejo until Naomi ticks the new Verified
checkbox in Notion. Shows ' Awaiting Naomi's verification' or
' Verified by Naomi' in the issue body accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Stephan Kerkman 2026-05-31 12:57:17 +02:00
parent 92b682a1bd
commit 21f9759d3a

View file

@ -29,7 +29,7 @@ LABEL_MAP = {
STATUS_MAP = { STATUS_MAP = {
"Open": "open", "Open": "open",
"In progress": "open", # + "In progress" label (id=4) "In progress": "open", # + "In progress" label (id=4)
"Done": "closed", "Done": "open", # stays open until Naomi ticks Verified
} }
IN_PROGRESS_LABEL_ID = 4 IN_PROGRESS_LABEL_ID = 4
@ -69,6 +69,7 @@ def sync_item(item, existing):
title = item["title"].strip() title = item["title"].strip()
category = item.get("category") category = item.get("category")
status = item.get("status", "Open") status = item.get("status", "Open")
verified = item.get("verified", False)
notion_url = item["url"] notion_url = item["url"]
has_screenshot = item.get("has_screenshot", False) has_screenshot = item.get("has_screenshot", False)
@ -79,13 +80,26 @@ def sync_item(item, existing):
labels.append(IN_PROGRESS_LABEL_ID) labels.append(IN_PROGRESS_LABEL_ID)
screenshot_note = "\n\n📎 Screenshot attached in Notion" if has_screenshot else "" screenshot_note = "\n\n📎 Screenshot attached in Notion" if has_screenshot else ""
if status == "Done" and not verified:
verification_note = "\n\n⏳ *Awaiting Naomi's verification*"
elif status == "Done" and verified:
verification_note = "\n\n✅ *Verified by Naomi*"
else:
verification_note = ""
body = ( body = (
f"*Synced from [🌸 BloomBase Notion]({notion_url})*" f"*Synced from [🌸 BloomBase Notion]({notion_url})*"
f"{screenshot_note}" f"{screenshot_note}"
f"{verification_note}"
f"\n\n<!-- {NOTION_MARKER}{notion_id} -->" f"\n\n<!-- {NOTION_MARKER}{notion_id} -->"
) )
state = STATUS_MAP.get(status, "open") # Only close the Forgejo issue once Naomi has verified
if status == "Done" and verified:
state = "closed"
else:
state = STATUS_MAP.get(status, "open")
if notion_id in existing: if notion_id in existing:
issue_num = existing[notion_id] issue_num = existing[notion_id]