Commit 67b8bf2
Add ProjectV2 status update tools (list, get, create) (#1987)
* Add ProjectV2 status update tools (list, get, create)
Closes #1963
Add three new individual tools and wire them into the consolidated
project tools for managing GitHub ProjectV2 status updates:
- list_project_status_updates / projects_list: List status updates for
a project with pagination, ordered by creation date descending
- get_project_status_update / projects_get: Fetch a single status
update by node ID
- create_project_status_update / projects_write: Create a status update
with optional body, status, start_date, and target_date
New GraphQL types and queries (statusUpdateNode, statusUpdatesUserQuery,
statusUpdatesOrgQuery, statusUpdateNodeQuery) support both user-owned
and org-owned projects. The CreateProjectV2StatusUpdateInput type is
defined locally since the shurcooL/githubv4 library does not include it.
Also includes quality improvements discovered during implementation:
- Extract resolveProjectNodeID helper to deduplicate ~70 lines of
project ID resolution logic shared between addProjectItem and
createProjectStatusUpdate
- Add client-side YYYY-MM-DD date format validation for start_date
and target_date fields before sending to the API
- Fix brittle node type check in getProjectStatusUpdate that relied
on stringifying a githubv4.ID and comparing to "<nil>"
- Refactor createProjectStatusUpdate to accept typed parameters
instead of raw args map
- Add deprecated tool aliases for all three new individual tools
- Add ProjectResolveIDFailedError constant for consistent error
reporting
Test coverage includes 21 subtests covering both user and org paths,
pagination, error handling, input validation, field verification, and
consolidated tool dispatch.
* Fix projects_get required params and harden status update tools
Loosen projects_get schema to only require "method", since
get_project_status_update only needs status_update_id and never uses
owner or project_number. Also use pointer types for optional
statusUpdateNode fields, add owner_type validation for list/create
status updates, clamp negative per_page values, and fix
resolveProjectNodeID to return "" instead of nil on error.
* Resolve conflicts
* Update doc
* Update aliases
* Dont update tool renaming docs
---------
Co-authored-by: e-straight <elijahstr@users.noreply.github.com>
Co-authored-by: JoannaaKL <joannaakl@github.com>1 parent 543a1fa commit 67b8bf2
File tree
8 files changed
+667
-78
lines changed- pkg/github
- __toolsnaps__
8 files changed
+667
-78
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
983 | 983 | | |
984 | 984 | | |
985 | 985 | | |
986 | | - | |
| 986 | + | |
987 | 987 | | |
988 | | - | |
| 988 | + | |
| 989 | + | |
989 | 990 | | |
990 | 991 | | |
991 | 992 | | |
| |||
997 | 998 | | |
998 | 999 | | |
999 | 1000 | | |
1000 | | - | |
| 1001 | + | |
1001 | 1002 | | |
1002 | 1003 | | |
1003 | 1004 | | |
1004 | 1005 | | |
| 1006 | + | |
1005 | 1007 | | |
1006 | 1008 | | |
1007 | 1009 | | |
| |||
1012 | 1014 | | |
1013 | 1015 | | |
1014 | 1016 | | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
1015 | 1020 | | |
1016 | 1021 | | |
1017 | 1022 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
| |||
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
62 | 86 | | |
63 | 87 | | |
64 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
230 | 240 | | |
231 | 241 | | |
232 | 242 | | |
| |||
0 commit comments