- 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 | 0004-issue-create-and-comment |
What to build
pr create and pr comment.
pr create takes --title (required), --body/--body-file, --base, --head, --assignee, --reviewer, repeatable --label (name-resolved), and --milestone (name-resolved); --draft and --project are excluded (no Gitea API support).
When --head is omitted it defaults to the current local branch from git; when --base is omitted it defaults to the repository's default branch fetched from the repo endpoint.
Idempotent: before creating, check for an existing open PR for the same base/head pair; if found, return pull_request: { number, url, already: true } instead of creating a duplicate.
Success output is the action block created: { number, url } — action block when the mutation ran, entity block when it was a no-op.
pr comment <n> posts through the shared issue-comment endpoint and returns the created comment as comment: { number, author, created, body } (800-char truncation), diverging from gh-axi's status-only block to save a follow-up view call (see ADR 0008).
Acceptance criteria
pr create --titlecreates a PR and outputscreated: { number, url }- Omitted
--headresolves to the current local branch; omitted--baseresolves to the repo's default branch - An existing open PR for the same branch pair short-circuits to
pull_request: { number, url, already: true }with no duplicate created --labeland--milestoneresolve names case-insensitively withVALIDATION_ERRORon unknown names;--assigneeand--reviewerpass throughpr comment <n> --bodyoutputscomment: { number, author, created, body }from the POST response, body truncated at 800 chars- Missing required inputs (
--titleon create, body on comment) fail withVALIDATION_ERROR(exit 2) before any API call - Fixture-server tests cover creation with defaults, the idempotent short-circuit, name resolution failures, and the comment output shape