fix(notion-sync): keep expired-only jobs update-only (#666)

* fix(notion-sync): include expired entries in sync set as update-only (#597)

* changelog: place the #666 entry under [Unreleased]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Mads Lorentzen <madslorentzen_17@hotmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-19 20:09:23 +02:00
1 parent e7778f58ed
commit 58f04bc463
3 files changed
+38 -10

No files matched your search

+17
View File
@@ -63,6 +63,23 @@ class NotionSyncCommandSpec(unittest.TestCase):
"spec lost the rule that CV/cover-letter content never syncs to Notion",
)
def test_expired_jobs_are_update_only_and_never_create_or_rebuild_pages(self):
text = COMMAND.read_text(encoding="utf-8")
step2 = text.split("## Step 2:", 1)[1].split("## Step 3:", 1)[0]
step3 = text.split("## Step 3:", 1)[1].split("## Step 4:", 1)[0]
step4 = text.split("## Step 4:", 1)[1].split("## Step 5:", 1)[0]
step5 = text.split("## Step 5:", 1)[1].split("## Step 6:", 1)[0]
self.assertIn("entries with status `expired` join the sync set regardless of score as update-only candidates", step2)
self.assertIn("An entry selected only because it is `expired` and has no matching tracker row", step2)
self.assertIn("If a matching tracker row exists, it remains an ordinary sync item and tracker status precedence applies.", step2)
self.assertIn("sync set contains only expired-only entries", step3)
self.assertIn("stop without asking where to create a database", step3)
self.assertIn("without creating the database or writing `job_scraper/notion_sync.json`", step3)
self.assertIn("if the job is an expired-only entry, skip it - do not create a page or write a body", step4)
self.assertIn("Match, expired-only entry** → update **Status only** to `expired`", step4)
self.assertIn("Never write or rebuild a body for an expired-only entry, including when `--rebuild` is set.", step5)
@unittest.skipUnless(
_HAVE_YAML,
"PyYAML not installed (the CI Python-test job omits it; the lint job runs lint_skills.py directly)",