feat: assign issues to milestones on create/update (#22) #25
Reference in New Issue
Block a user
Delete Branch "feat/issue-milestone-assignment"
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?
Implements the milestone-assignment part of #22.
Changes
create_issue/update_issuenow accept amilestoneargument: a numeric milestone id or a milestone title (resolved case-insensitively against open and closed milestones; unknown titles return a clear error). Onupdate_issue,milestone: 0clears the milestone.GiteaClient._resolve_milestone_idmirrors the existing label name->id resolver.BeforeValidatorrejects booleans so they are not silently coerced to an id.docs/api-reference.mdanddocs/write-mode.mdupdated (the write-mode tool list was stale — 6 listed vs 16 implemented — now complete).make lint(ruff/black/mypy) and full suite green at 83% coverage.Projects investigation (also part of #22)
Gitea 1.26.2 (this instance) exposes no project endpoints in its REST API (verified via
swagger.v1.json). Project/board support is therefore not implementable and is documented as intentionally unsupported. Closes the actionable scope of #22.Guardrails
All new behaviour stays behind the existing write-mode + policy gating (
write_operation=True); no new default-on surface.Refs #22
Gitea may return JSON null for an issue's `labels`, `assignees`, or `user` fields. `dict.get(key, [])` returns None when the key is present with a null value (the default is only used for missing keys), so the list comprehensions raised `'NoneType' object is not iterable` for otherwise-valid issues. Coalesce with `or []` / `or {}` so empty/null collections normalize to empty results. Adds a regression test covering all three null fields.