fix: keep unread trees in the source paths record

A sitesources run that GitLab rate-limited dropped about twenty trees it
never read from website/src/data/source-paths.json. A tree key names a
pinned sha, so the last record's entry for an unread tree still holds and
is carried over, in sitesources and in profile_sync's refresh.
This commit is contained in:
Abdessamad Derraz committed 2026-10-26 22:52:23 +01:00
1 parent 02fb76b850
commit f3a161b60e
3 files changed
+40

No files matched your search

+13
View File
@@ -4667,6 +4667,19 @@ class AWriteRefreshesTheSourcePaths(unittest.TestCase):
profile_sync._WRITTEN.clear()
class AnUnreadTreeKeepsItsRecord(unittest.TestCase):
"""sitesources --fetch, rate-limited by GitLab, dropped about twenty
trees it never read from source-paths.json."""
def test_unread_trees_carry_over(self):
import sitesources # noqa: PLC0415
kept = sitesources.keep_unread(
{"a@1": ["x.c"]}, ["b@2", "c@3"], {"b@2": ["y.c"], "a@1": ["old.c"]}
)
self.assertEqual(kept, {"a@1": ["x.c"], "b@2": ["y.c"]})
class FreshRefusesOffline(unittest.TestCase):
def test_the_pair_is_refused(self):
saved = sys.argv