Skip to content

Add gitee pr edit for end-to-end pull request updates #50

@hex2dec

Description

@hex2dec

Parent PRD

#2

PRD addendum comment: #2 (comment)

What to build

Implement gitee pr edit as a thin vertical slice that updates an existing pull request end-to-end through the CLI. The command should support explicit --repo or local repository inference, use the official Gitee pull request update endpoint, and return the updated pull request with the same stable text and --json contract used by pr view.

The initial slice should cover the high-frequency edit operations defined in the parent PRD addendum: updating the title, updating or clearing the body via --body or --body-file, changing state with --state open|closed, and controlling draft readiness with --draft or --ready.

Acceptance criteria

  • gitee pr edit <number> supports --title, --body, --body-file, --state open|closed, --draft, and --ready, and requires at least one explicit mutation flag.
  • The command preserves unspecified fields, supports --body-file - for stdin, allows an explicitly empty body to clear the remote PR body, and validates conflicting or unsupported flag combinations with stable usage errors.
  • The implementation works with explicit --repo and inferred local repository context, reuses the existing authentication, canonical repository fallback, exit-code mapping, and pull-request rendering behavior, and surfaces remote validation errors clearly.
  • gitee pr edit --json returns the same field contract as gitee pr view, and default text output remains readable and stable.
  • Integration coverage exercises success and failure paths for title/body edits, state transitions, draft readiness changes, stdin/body-file behavior, missing authentication, repository or PR not found, and invalid argument combinations.

Blocked by

None - can start immediately.

User stories addressed

Reference from the gitee pr edit addendum on parent PRD #2:

  • User story 1
  • User story 2
  • User story 3
  • User story 4
  • User story 5
  • User story 6
  • User story 7
  • User story 8
  • User story 9
  • User story 10
  • User story 11
  • User story 12
  • User story 13
  • User story 14
  • User story 15
  • User story 16
  • User story 17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions