Commit 983d5f4
Replace update_project_items REST loop with chunked aliased GraphQL mutations
Rewrite update_project_items to resolve the project, every distinct
field, and every item once up front, then write via chunked, aliased
updateProjectV2ItemFieldValue / clearProjectV2ItemFieldValue GraphQL
mutations built at runtime with reflect.StructOf, instead of one REST
PATCH per item.
- Extend ResolvedField/projectFieldsCache with GraphQL node IDs and
numeric-ID lookup, alongside existing name-based lookup.
- Add node_id as a third item-reference form (alongside item_id and
item_owner/item_repo/issue_number), bypassing REST lookup entirely.
- Deduplicate numeric item_id lookups with bounded-concurrency REST
GETs; extend the #2914 paginated issue resolver to also return the
item's node ID.
- Convert updated_field.value to the correct ProjectV2FieldValue member
for TEXT, NUMBER, DATE, SINGLE_SELECT, and ITERATION; route null
values to the clear mutation instead of an empty update.
- Reject duplicate item+field targets before any writes.
- Isolate the reflection mechanics in projects_batch_mutation.go: a
cached-by-(kind,size) reflected struct type with positional aliases
(item0..itemN-1) and positional input variables (, ,
...), matching the first-input workaround required by the pinned
githubv4.Client.Mutate signature.
- Execute updates then clears in sequential chunks of 20 (provisional,
documented headroom rationale), tracking tri-state per-item results
(succeeded/failed/unknown); abort remaining chunks after an ambiguous
transport-level failure or context cancellation without retrying.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d7dc302d-e6f2-41e9-a2c8-ed598de470671 parent b8f5ca9 commit 983d5f4
12 files changed
Lines changed: 2360 additions & 821 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
1104 | | - | |
| 1104 | + | |
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
0 commit comments