refactor(gitea-pr): modernize pull request lifecycle from tea to gt pr (#14)

Co-authored-by: kiskaadee <fcortesbio@gmail.com>
This commit was merged in pull request #14.
This commit is contained in:
kiskaadee authored and Fabian Andres Cortes committed 2026-11-04 11:36:12 -05:00
1 parent 03ceeca156
commit 67c89ce7fd
4 files changed
+134 -108

No files matched your search

+9 -7
View File
@@ -34,15 +34,17 @@ description: >-
- Static Review Provenance: Base/head SHAs, diff SHA256, and 4-axis disposition.
- Runtime Verification Ledger: Markdown table of executed checks and outcomes.
- Residual Risks and Rollback: Operational considerations and reversibility.
4. **Present for human approval.** Present the proposed title, target base branch, milestone,
4. **Present for human approval.** Present proposed title, target base branch, milestone,
and description body to the user per `profile/AGENTS.md`. Stop for confirmation before
creating or editing the pull request.
5. **Create or update pull request via `tea`.** Run verified commands from
[references/tea-pulls.md](references/tea-pulls.md) (`tea pulls create --description-file -`).
Pass `--draft` if work remains in progress.
6. **Track review feedback and merge readiness.** Inspect incoming review comments
(`tea pulls review-comments <index>`) and mergeability status. Synthesize actionable
feedback. When all checks pass and review feedback is resolved, report `Ready for Merge`.
5. **Create or update pull request via `gt pr`.** Run verified commands from
[references/gt-pulls.md](references/gt-pulls.md):
`gt pr create -t "<title>" -B "<base>" -H "<branch>" -F <body-file> --json number,url`.
Pass `--draft` if work remains in progress. Extract verified PR number and URL.
6. **Track review feedback and merge readiness.** Inspect status checks (`gt pr checks <number>`),
mergeability (`gt pr view <number> --json mergeable,review_decision`), and review comments
(`gt pr review comments <number>`). When all checks pass and review feedback is resolved,
report `Ready for Merge`.
Release and merge authority belongs exclusively to the human owner: never merge automatically.
## Your call
+107
View File
@@ -0,0 +1,107 @@
# Verified `gt pr` Pull Request Subroutines
Reference for `gitea-pr`. Canonical, verified syntax for managing pull requests, status checks, and review threads via `gt`.
## 1. Inspecting Pull Requests
### List Pull Requests
```bash
# List open PRs with structured fields
gt pr list --json number,title,state,url
# List all PRs including closed/merged
gt pr list --state all --json number,title,state,url
```
### View Pull Request Details & Status Checks
```bash
# View basic PR details
gt pr view <number>
# Inspect mergeability and review decision
gt pr view <number> --json number,title,state,mergeable,review_decision,url
# Show status of CI checks on the head commit
gt pr checks <number>
# Wait for CI checks to complete
gt pr checks <number> --watch
```
---
## 2. Creating and Updating Pull Requests
### Create a Pull Request
- Create standard PR with multi-line body from file:
```bash
gt pr create -t "<title>" -B "<base-branch>" -H "<feature-branch>" -F <body-file> --json number,url
```
- Create as a Draft / WIP PR:
```bash
gt pr create -t "WIP: <title>" --draft -B "<base-branch>" -H "<feature-branch>" -F <body-file> --json number,url
```
- Assign milestone and project:
```bash
gt pr create -t "<title>" -B "<base>" -H "<branch>" -m <milestone-id> -p <project-id> -F <body-file> --json number,url
```
### Edit a Pull Request
```bash
# Update title or base branch
gt pr edit <number> --title "<new-title>"
# Mark a draft PR as ready for review
gt pr ready <number>
```
---
## 3. Review Comments and Discussions
### List Review Comments
```bash
# List inline review comments
gt pr review comments <number>
# View PR activity and top-level comments
gt pr timeline <number>
```
### Reply to Review Comments
```bash
# Reply to an inline comment
gt pr review reply <number> <comment-id> "Fixed in <sha>"
# Add top-level comment
gt pr comment <number> -b "<comment-text>"
```
### Resolve Review Comments
```bash
# Mark an inline thread as resolved
gt pr review resolve <comment-id>
# Reopen an inline thread
gt pr review unresolve <comment-id>
```
---
## 4. Closing and Merging Pull Requests
### Close or Reopen PR
```bash
gt pr close <number>
gt pr reopen <number>
```
### Merge Pull Request (Requires Explicit Human Authorization)
Release and merge authority belongs exclusively to the human owner.
```bash
# Fast-forward / merge commit
gt pr merge <number>
# Squash and merge
gt pr merge <number> --squash --delete-branch
```
+5 -5
View File
@@ -62,7 +62,7 @@ When comments or change requests arrive on a PR:
1. **Extract review comments**:
```sh
tea pulls review-comments <index>
gt pr review comments <number>
```
2. **Categorize comments**:
- *Defects & Invariants*: Logic errors, broken tests, edge-case crashes (require code fix).
@@ -74,9 +74,9 @@ When comments or change requests arrive on a PR:
4. **Re-verify after changes**:
- Run `code-review` to confirm the updated diff fingerprint is clean.
- Run `verify-slice` to substantiate runtime assertions.
5. **Reply and resolve threads via `tea`**:
- Reply to comment: `tea pulls reply <index> <comment-id> "Fixed in <sha>"`
- Resolve thread: `tea pulls resolve <comment-id>`
5. **Reply and resolve threads via `gt pr`**:
- Reply to comment: `gt pr review reply <number> <comment-id> "Fixed in <sha>"`
- Resolve thread: `gt pr review resolve <comment-id>`
6. **Push updates to remote**:
- `git push origin <branch>`
@@ -85,5 +85,5 @@ When comments or change requests arrive on a PR:
## 4. Release Authority Guardrail
Automated skills and checks inform the human owner; they never make the merge decision independently:
- Neither passing unit tests nor a `Ready` code review implies permission to execute `tea pulls merge`.
- Neither passing unit tests nor a `Ready` code review implies permission to execute `gt pr merge`.
- The human owner reviews the consolidated ledger, assesses residual risks, and explicitly authorizes merge execution.
+13 -96
View File
@@ -1,111 +1,28 @@
# Verified Tea CLI Pull Request Subroutines
# [DEPRECATED] Tea CLI Pull Request Subroutines
Reference for `gitea-pr`. Canonical, verified syntax for managing pull requests and review threads via `tea`.
> **Notice**: Upstream `tea` CLI is archived and officially deprecated in favor of `gt` (`gitea/cli`).
> For verified command patterns and JSON recipes, use **`skills/gitea-pr/references/gt-pulls.md`**.
## 1. Inspecting Pull Requests
This document is preserved for historical reference and legacy instance migrations only.
### List Pull Requests
- List open PRs:
---
## Legacy Commands Reference (Archived)
### 1. Inspecting Pull Requests (Legacy)
```sh
tea pulls list
```
- List all PRs including closed:
```sh
tea pulls list --state all
```
### View Pull Request Details
- View basic PR details:
```sh
tea pulls <index>
```
- Inspect mergeability and CI status:
### 2. Creating Pull Requests (Legacy)
```sh
tea pulls <index> --fields index,title,state,mergeable,ci,base,head
tea pulls create --title "<title>" --base "<base>" --head "<head>" --description-file -
```
---
## 2. Creating and Updating Pull Requests
### Create a Pull Request
- Create standard PR with multi-line description via heredoc:
```sh
tea pulls create --title "<title>" --base "<base-branch>" --head "<feature-branch>" --description-file - <<'EOF'
Closes #<issue-index>
## Summary of Changes
...
EOF
```
- Create as a Draft / WIP PR:
```sh
tea pulls create --title "WIP: <title>" --draft --base "<base-branch>" --head "<feature-branch>" --description-file - <<'EOF'
...
EOF
```
- Assign milestone or labels:
```sh
tea pulls create --title "<title>" --base "<base>" --milestone "<milestone-name>" --labels "<label1,label2>" --description-file -
```
### Edit a Pull Request
- Update title or milestone:
```sh
tea pulls edit <index> --title "<new-title>" --milestone "<milestone-name>"
```
---
## 3. Review Comments and Discussions
### List Review Comments
- View all inline review comments:
### 3. Review Comments (Legacy)
```sh
tea pulls review-comments <index>
```
- View general PR comments:
```sh
tea comments list <index>
```
### Reply to Review Comments
- Reply to an inline review comment:
```sh
tea pulls reply <index> <comment-id> "<reply-text>"
```
- Add a top-level comment to the PR:
```sh
tea comment <index> "<comment-text>"
```
### Resolve Review Comments
- Mark an inline review comment as resolved:
```sh
tea pulls resolve <comment-id>
```
- Unresolve a comment if follow-up is needed:
```sh
tea pulls unresolve <comment-id>
```
---
## 4. Closing and Merging Pull Requests
### Close or Reopen PR
- Close without merging:
```sh
tea pulls close <index>
```
- Reopen closed PR:
```sh
tea pulls reopen <index>
```
### Merge Pull Request (Human Release Authorization Required)
- Merge using specified merge style (`merge`, `rebase`, `squash`, `rebase-merge`):
```sh
tea pulls merge <index> --style rebase --title "<commit-title>" --message "<commit-body>"
```
- **Operator Safety Rule**: Skills report merge readiness. Only execute `tea pulls merge` when the human owner has explicitly authorized merging.