feat: assign issues to milestones on create/update (#22) #25

Merged
Latte merged 6 commits from feat/issue-milestone-assignment into main 2026-06-22 16:00:30 +00:00

6 Commits

Author SHA1 Message Date
Latte e08ba42697 feat: assign issues to milestones on create/update (#22)
docker / test (pull_request) Successful in 29s
docker / lint (pull_request) Successful in 35s
lint / lint (pull_request) Successful in 35s
test / test (pull_request) Successful in 35s
docker / docker-test (pull_request) Successful in 8s
docker / docker-publish (pull_request) Has been skipped
test / test (push) Successful in 23s
lint / lint (push) Successful in 23s
Add a `milestone` argument to `create_issue` and `update_issue` accepting
either a numeric milestone id or a title (resolved case-insensitively against
open and closed milestones, with a clear error for unknown titles). On
`update_issue`, `milestone: 0` clears the milestone. A BeforeValidator rejects
booleans so they are not silently coerced to an id.

Gitea Projects (Kanban boards) were investigated for #22 and are intentionally
left unsupported: Gitea 1.26.2 exposes no project endpoints in its REST API.
Documented this in api-reference.md and refreshed the (stale) write-mode tool
list to cover all 16 write tools.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 17:36:01 +02:00
Latte 10a307ac02 Merge pull request 'feat: structured logging helpers + get_issue instrumentation (#14)' (#24) from feat/get-issue-debug-logging into dev
docker / test (pull_request) Successful in 27s
docker / lint (pull_request) Successful in 34s
lint / lint (pull_request) Successful in 36s
docker / docker-test (pull_request) Successful in 7s
test / test (pull_request) Successful in 35s
docker / docker-publish (pull_request) Has been skipped
lint / lint (push) Successful in 36s
docker / test (push) Successful in 28s
docker / lint (push) Successful in 35s
test / test (push) Successful in 36s
docker / docker-test (push) Successful in 11s
docker / docker-publish (push) Successful in 5s
Reviewed-on: #24
2026-06-22 15:09:58 +00:00
Latte 538d6d964a test: cover write-tool auth and backend error branches
lint / lint (push) Successful in 36s
docker / test (pull_request) Successful in 32s
test / test (push) Successful in 38s
docker / lint (pull_request) Successful in 38s
docker / docker-test (pull_request) Successful in 12s
docker / docker-publish (pull_request) Has been skipped
test / test (pull_request) Successful in 25s
lint / lint (pull_request) Successful in 27s
Every write tool's `except (Auth...)` re-raise and `except GiteaError ->
RuntimeError` wrapping was previously untested, leaving write_tools at 60%
coverage and the repo below the 80% gate. Adds parametrized error-path tests
for all 15 write tools (backend error wrapping + auth propagation), raising
write_tools coverage to 99% and total coverage above the gate.
2026-06-22 15:58:59 +02:00
Latte f53e1a3a5a feat: add structured logging helpers and instrument get_issue (#14)
docker / test (pull_request) Successful in 29s
test / test (push) Successful in 38s
lint / lint (push) Successful in 39s
docker / lint (pull_request) Successful in 39s
docker / docker-test (pull_request) Successful in 12s
docker / docker-publish (pull_request) Has been skipped
lint / lint (pull_request) Successful in 28s
test / test (pull_request) Successful in 22s
Adds reusable, secret-safe logging helpers to `logging_utils`:
- `log_event(logger, level, event, **context)` emits a named event with a
  sanitized `context` mapping (sensitive keys masked as `***`).
- `log_nullable_field(...)` records whether a parsed field is None plus its
  runtime type, without dumping its contents.
- `sanitize_context(...)` is the shared masking primitive.

The JSON formatter now serializes a record's `context` into the payload.

`get_issue_tool` is instrumented at DEBUG (`get_issue.start`,
`get_issue.payload_shape`, `get_issue.field_check` for labels/assignees/user)
so the nullable-field parsing that caused #13 is diagnosable going forward.

Adds tests for the helpers, the formatter, and the get_issue instrumentation,
and documents the pattern in docs/observability.md.
2026-06-22 15:40:36 +02:00
Latte cd309ee290 Merge pull request 'fix: tolerate null labels/assignees/user in get_issue (#13)' (#23) from fix/get-issue-none-iterable into dev
docker / test (push) Successful in 29s
docker / lint (push) Successful in 36s
test / test (push) Successful in 36s
lint / lint (push) Successful in 36s
docker / docker-test (push) Successful in 7s
docker / docker-publish (push) Successful in 5s
Reviewed-on: #23
2026-06-22 12:50:08 +00:00
Latte 478aee9bed fix: tolerate null labels/assignees/user in get_issue (#13)
test / test (push) Successful in 25s
lint / lint (push) Successful in 27s
docker / test (pull_request) Successful in 32s
docker / lint (pull_request) Successful in 39s
lint / lint (pull_request) Successful in 34s
test / test (pull_request) Successful in 32s
docker / docker-test (pull_request) Successful in 11s
docker / docker-publish (pull_request) Has been skipped
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.
2026-06-22 10:43:43 +02:00