diff --git a/.github/PROJECT_SYNC.md b/.github/PROJECT_SYNC.md index 958ddbfcdd5..3973346fc6d 100644 --- a/.github/PROJECT_SYNC.md +++ b/.github/PROJECT_SYNC.md @@ -46,7 +46,7 @@ or deletes source Issues/PRs. skip unchanged values and clear stale text. Paginate every GraphQL connection, reject stalled cursors, and serialize runs. Apply mode prints the plan first; on failure it reports confirmed, outcome-unknown and unattempted mutation counts, - with affected item/field, so partial writes can be reconciled. Apply uses eight + with affected item/field, so partial writes can be reconciled. Apply uses four workers across distinct Project items; mutations within each item stay ordered. This is bounded concurrency, not a guarantee against GitHub rate limits. The synchronization job has a 120-minute total execution budget, including diff --git a/scripts/sync_github_project.py b/scripts/sync_github_project.py index c60abdd6aab..5deb0dcb50b 100644 --- a/scripts/sync_github_project.py +++ b/scripts/sync_github_project.py @@ -23,7 +23,7 @@ "Closed unmerged", ) DELIVERY_OPTIONS = ("未关联实现", "尚未合入", "已合入待发布", "已发布") -APPLY_WORKERS = 8 +APPLY_WORKERS = 4 def connection(query, path, *, initial=None, progress=None, **variables): diff --git a/tests/test_project_delivery.py b/tests/test_project_delivery.py index 2d7eee0e369..69e68e943b2 100644 --- a/tests/test_project_delivery.py +++ b/tests/test_project_delivery.py @@ -648,7 +648,7 @@ def test_dry_run_does_not_mutate_and_apply_skips_equal_fields(self): api.call_args_list[1].args[1]["value"], {"singleSelectOptionId": "D"} ) - def test_apply_uses_eight_workers_and_keeps_each_item_mutations_sequential(self): + def test_apply_uses_four_workers_and_keeps_each_item_mutations_sequential(self): plan = [ { "content": f"C{index}", @@ -664,7 +664,7 @@ def test_apply_uses_eight_workers_and_keeps_each_item_mutations_sequential(self) } active, maximum, active_per_item, maximum_per_item = 0, 0, {}, {} queries, lock = [], threading.Lock() - first_mutations = threading.Barrier(8) + first_mutations = threading.Barrier(4) def api(query, variables): nonlocal active, maximum @@ -689,8 +689,8 @@ def api(query, variables): with patch.object(sync, "graphql", side_effect=api): sync.apply_plan("P", fields, plan, apply=True) - self.assertEqual(sync.APPLY_WORKERS, 8) - self.assertEqual(maximum, 8) + self.assertEqual(sync.APPLY_WORKERS, 4) + self.assertEqual(maximum, 4) self.assertEqual(set(maximum_per_item.values()), {1}) self.assertEqual(len(queries), 16)