- CONVENTIONAL-COMMITS.md: vendored spec (v1.0.0); CLAUDE.md requires agent-written commits to follow it - tasks 0002-0020: remaining task breakdown of the gitea-axi spec (0019 reframed around the three-tier test taxonomy: unit, integration, end-to-end) - spec, CONTEXT.md, and ADRs 0006/0007/0011: pending design refinements from the planning sessions
2.0 KiB
spec, blocked-by
| spec | blocked-by |
|---|---|
| gitea-axi | 0003-issue-view-and-truncation |
What to build
The first mutations: issue create and issue comment, introducing the shared machinery for --body-file, name→ID resolution, and mutation output blocks.
issue create takes --title (required), --body/--body-file, --assignee, repeatable --label (resolved to label ID via the case-insensitive label lookup), and --milestone (resolved via the milestone name query); --project and --type are excluded.
Create output is the entity block issue: { number, title, state, url } with extra fields (labels, assignees, milestone, body) available via --fields.
issue comment <n> requires --body/--body-file and returns the created comment directly from the POST response as comment: { number, author, created, body } with the body truncated at 800 chars — no follow-up view call needed; the comment's own id is not output.
issue comment stays permissive toward PR numbers (PRs genuinely share the comment endpoint).
Acceptance criteria
issue create --titlecreates an issue and outputsissue: { number, title, state, url }whereurlishtml_url- Missing
--titlefails immediately withVALIDATION_ERROR(exit 2) before any API call --body-file <path>reads the body from a file;--bodyand--body-filetogether are rejected--labelresolves each name to an ID via case-insensitive lookup against the repo's labels; an unknown name yieldsVALIDATION_ERROR--milestoneresolves the name via the milestone query; an unknown name yieldsVALIDATION_ERRORissue comment <n> --bodyposts and outputscomment: { number, author, created, body }built from the POST response, body cleaned and truncated at 800 chars, wherenumberis the issue numberissue commentaccepts a PR number without a type-guard error- Fixture-server tests cover create with labels/milestone, both body sources, comment output shape, and each validation failure