From 21f9759d3a374e3d1900581c41d7ecc0aedeaf25 Mon Sep 17 00:00:00 2001 From: Stephan Kerkman Date: Sun, 31 May 2026 12:57:17 +0200 Subject: [PATCH] feat: require Naomi verification before closing Forgejo issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- scripts/sync_notion_to_forgejo.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/sync_notion_to_forgejo.py b/scripts/sync_notion_to_forgejo.py index e3681e7..6441b17 100644 --- a/scripts/sync_notion_to_forgejo.py +++ b/scripts/sync_notion_to_forgejo.py @@ -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,13 +80,26 @@ 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" ) - 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: issue_num = existing[notion_id]