Commit e5a6501
feat: add create_project and create_iteration_field methods to projects_write
Adds two new methods to the consolidated projects_write tool:
- create_project: creates a new GitHub ProjectsV2 for a user or org
- create_iteration_field: adds an iteration field to an existing project
Changes addressing review feedback:
- Validate owner_type is exactly 'user' or 'org' in create_project
- Use resolveProjectNodeID (GraphQL) instead of getProjectNodeID (REST)
to avoid HTTP response body leaks
- Add omitempty to Iterations JSON tag
- Rename iterations item field startDate to start_date for consistency
- Validate iteration elements instead of silently skipping invalid ones
- Use explicit response structs with snake_case JSON tags
- Add test for auto-detected owner_type in create_iteration_field
- Use stubExporters() in test deps for nil-safety
Co-authored-by: João Doria de Souza <jdoria@github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent c0dca1f commit e5a6501
6 files changed
Lines changed: 832 additions & 22 deletions
File tree
- pkg/github
- __toolsnaps__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
1031 | | - | |
| 1031 | + | |
1032 | 1032 | | |
1033 | 1033 | | |
| 1034 | + | |
1034 | 1035 | | |
1035 | 1036 | | |
1036 | 1037 | | |
1037 | 1038 | | |
1038 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
1039 | 1042 | | |
1040 | 1043 | | |
1041 | | - | |
1042 | | - | |
| 1044 | + | |
| 1045 | + | |
1043 | 1046 | | |
1044 | | - | |
| 1047 | + | |
1045 | 1048 | | |
1046 | 1049 | | |
| 1050 | + | |
1047 | 1051 | | |
1048 | 1052 | | |
1049 | 1053 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| |||
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
37 | 72 | | |
38 | 73 | | |
39 | 74 | | |
40 | 75 | | |
41 | 76 | | |
42 | 77 | | |
43 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
44 | 81 | | |
45 | 82 | | |
46 | 83 | | |
| |||
49 | 86 | | |
50 | 87 | | |
51 | 88 | | |
52 | | - | |
| 89 | + | |
53 | 90 | | |
54 | 91 | | |
55 | 92 | | |
56 | 93 | | |
57 | 94 | | |
58 | 95 | | |
59 | 96 | | |
60 | | - | |
| 97 | + | |
61 | 98 | | |
62 | 99 | | |
63 | 100 | | |
64 | 101 | | |
65 | 102 | | |
66 | 103 | | |
67 | 104 | | |
68 | | - | |
| 105 | + | |
69 | 106 | | |
70 | 107 | | |
71 | 108 | | |
| |||
83 | 120 | | |
84 | 121 | | |
85 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
86 | 127 | | |
87 | 128 | | |
88 | 129 | | |
89 | 130 | | |
90 | 131 | | |
91 | 132 | | |
92 | 133 | | |
93 | | - | |
94 | | - | |
| 134 | + | |
95 | 135 | | |
96 | 136 | | |
97 | 137 | | |
| |||
0 commit comments