Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PROJECT_SYNC.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/sync_github_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"Closed unmerged",
)
DELIVERY_OPTIONS = ("未关联实现", "尚未合入", "已合入待发布", "已发布")
APPLY_WORKERS = 8
APPLY_WORKERS = 4


def connection(query, path, *, initial=None, progress=None, **variables):
Expand Down
8 changes: 4 additions & 4 deletions tests/test_project_delivery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
Expand All @@ -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
Expand All @@ -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)

Expand Down
Loading