tenseleyflow/shithub / e68b4a1

Browse files

docs/api: document milestones, assignees, extended issue PATCH

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
e68b4a1f49b912e7f9c138e1beef7e4ab01ec9bf
Parents
752717b
Tree
37e9426

1 changed file

StatusFile+-
M docs/public/api/issues.md 66 7
docs/public/api/issues.mdmodified
@@ -96,7 +96,10 @@ modified; everything else stays.
9696
   "title":     "first bug — root cause found",
9797
   "body":      "see comment #3",
9898
   "state":     "closed",
99
-  "state_reason": "completed"
99
+  "state_reason": "completed",
100
+  "labels":    ["bug", "needs-triage"],
101
+  "assignees": ["alice"],
102
+  "milestone": 7
100103
 }
101104
 ```
102105
 
@@ -107,6 +110,17 @@ Permission rules:
107110
 - **State / state_reason** — any caller with `ActionIssueClose`
108111
   on the repo. `state_reason` must be one of `completed`,
109112
   `not_planned`, `duplicate`, `reopened` (or empty).
113
+- **Labels** — caller needs `ActionIssueLabel`. The payload is a
114
+  *full replace*: `["bug"]` strips every other label;
115
+  `[]` clears them all. Omit the field to leave labels untouched.
116
+  Unknown label names return `422`.
117
+- **Assignees** — caller needs `ActionIssueAssign`. Same
118
+  full-replace semantics, names are usernames; unknown usernames
119
+  return `422`.
120
+- **Milestone** — caller needs `ActionIssueAssign`. Pass the
121
+  milestone `id` (see [Milestones](#milestones) below); `0`
122
+  clears the milestone. The milestone must belong to the same
123
+  repo; cross-repo ids return `422`.
110124
 
111125
 Returns the freshly-loaded issue.
112126
 
@@ -173,8 +187,53 @@ on the repo (moderation affordance, matches the gh shape).
173187
 
174188
 Returns `204`.
175189
 
190
+## Milestones
191
+
192
+```
193
+GET    /api/v1/repos/{owner}/{repo}/milestones[?state=open|closed|all]
194
+POST   /api/v1/repos/{owner}/{repo}/milestones
195
+GET    /api/v1/repos/{owner}/{repo}/milestones/{id}
196
+PATCH  /api/v1/repos/{owner}/{repo}/milestones/{id}
197
+DELETE /api/v1/repos/{owner}/{repo}/milestones/{id}
198
+```
199
+
200
+Required scope: `repo:read` on GETs, `repo:write` on mutations.
201
+Mutations gate on `ActionIssueLabel` (write collaborator role
202
+on the repo).
203
+
204
+Create payload:
205
+
206
+```json
207
+{
208
+  "title":       "v1.0",
209
+  "description": "first stable release",
210
+  "due_on":      "2026-06-01T00:00:00Z",
211
+  "state":       "open"
212
+}
213
+```
214
+
215
+`due_on` is RFC3339; omit or pass `null` to leave it unset. The
216
+response shape mirrors GitHub's milestone with the repo-local
217
+`id`, the `state` (`open` / `closed`), and live `open_issues` /
218
+`closed_issues` counters.
219
+
220
+Identifier: the path takes the milestone primary key `id`
221
+(returned by list / create), not a per-repo number — shithub's
222
+schema doesn't carry a number column. The CLI gets the id back
223
+from `POST` or list responses.
224
+
225
+## Assignees
226
+
227
+```
228
+GET /api/v1/repos/{owner}/{repo}/assignees
229
+```
230
+
231
+Required scope: `repo:read`. Returns the users eligible to be
232
+assigned: the repo owner (when user-owned) plus every direct
233
+repo collaborator. Org-level expansion of org-owned repos is a
234
+follow-up.
235
+
176236
 ## Not yet shipped
177237
 
178
-`POST /api/v1/repos/{o}/{r}/issues/{n}/transfer`, pinning,
179
-applying labels / assignees / milestones over the issue PATCH —
180
-all queued for a follow-up batch.
238
+`POST /api/v1/repos/{o}/{r}/issues/{n}/transfer` and issue
239
+pinning are queued for a follow-up batch.