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:
parent
92b682a1bd
commit
21f9759d3a
1 changed files with 16 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ LABEL_MAP = {
|
|||
STATUS_MAP = {
|
||||
"Open": "open",
|
||||
"In progress": "open", # + "In progress" label (id=4)
|
||||
"Done": "closed",
|
||||
"Done": "open", # stays open until Naomi ticks Verified
|
||||
}
|
||||
|
||||
IN_PROGRESS_LABEL_ID = 4
|
||||
|
|
@ -69,6 +69,7 @@ def sync_item(item, existing):
|
|||
title = item["title"].strip()
|
||||
category = item.get("category")
|
||||
status = item.get("status", "Open")
|
||||
verified = item.get("verified", False)
|
||||
notion_url = item["url"]
|
||||
has_screenshot = item.get("has_screenshot", False)
|
||||
|
||||
|
|
@ -79,12 +80,25 @@ def sync_item(item, existing):
|
|||
labels.append(IN_PROGRESS_LABEL_ID)
|
||||
|
||||
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 = (
|
||||
f"*Synced from [🌸 BloomBase Notion]({notion_url})*"
|
||||
f"{screenshot_note}"
|
||||
f"{verification_note}"
|
||||
f"\n\n<!-- {NOTION_MARKER}{notion_id} -->"
|
||||
)
|
||||
|
||||
# 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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue