update_issue cannot clear a milestone, assignees, or body #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
update_issueinsrc/tools/issues.jscan only set values, never unset them.milestoneIdtherefore staysundefinedand is dropped from the JSON body. There is no input that producesmilestone: 0, which is what the Forgejo API expects in order to detach a milestone.Assignees:
assignees: z.array(z.string()).optional(). Passing[]does reach the API, so that path may work, but it is untested and undocumented. Worth confirming with a real call and adding a test.Same shape of gap for clearing the body text - an empty string is falsy in the resolve helpers but does pass through here, so behaviour differs field to field and nothing pins it down.
Suggested fix
milestone: ""meaning detach) and map it tomilestone: 0in the request body.Object.hasOwn(args, "milestone")rather than truthiness.Severity
Low - missing capability rather than incorrect behaviour, but it fails silently (the call returns HTTP 200 and the milestone is simply still attached), which is the annoying kind.