Repository navigation
feat(pull-requests): open native Gitea revert pull requests - #15
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 60abc41e19da1c632461d68237e37968f7159aa6 and b70a0f92d28a98304f278e5f019755492fac6915. 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughGitea now detects native pull-request revert support, exposes the revert action only to eligible viewers, and sends the native revert request when supported. Tests cover supported servers and stock Gitea behavior. ChangesGitea native revert support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Eligible Gitea users can now create native revert pull requests when their server supports the capability, while unsupported servers and users without write access do not receive the action. No current merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant Viewer
participant GiteaPullRequestProvider
participant GiteaPullRequestApi
participant GiteaServer
Viewer->>GiteaPullRequestProvider: request pull-request permissions
GiteaPullRequestProvider->>GiteaServer: fetch feature list
GiteaServer-->>GiteaPullRequestProvider: return pull-revert support
GiteaPullRequestProvider-->>Viewer: expose revert for eligible viewer
Viewer->>GiteaPullRequestApi: request revert action
GiteaPullRequestApi->>GiteaServer: POST pull request revert endpoint
GiteaServer-->>Viewer: return created revert pull request
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
b70a0f9 to
10005f8
Compare
|
@coderabbitai review Please review this PR at its exact current head in stack pingdotgg#6. Verify correctness, regressions, security boundaries, and focused coverage against its current base, and report any actionable findings with file references. |
|
Oops, something went wrong! Please try again later. 🐰 💔 |
|
Merge verdict: NO-GO (review gates incomplete). Head:
No merge performed. Resume the independent code reviews when Fable is available, obtain the missing/current CodeRabbit approval where applicable, and recheck the exact head and base before merging. |
|
@coderabbitai approve The maintainer requests formal approval for the remaining PRs. Please assess the exact current head If branch configuration prevents formal approval, please state that explicitly. Independent Codex/Fable code verdicts are being refreshed separately; this request does not authorize merging or bypassing their findings. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Checked-out commit =='
git rev-parse HEAD
git status --short
echo '== PR metadata =='
gh pr view 15 --repo RTVision/t3code --json number,url,headRefName,headRefOid,baseRefName,baseRefOid,mergeable,state
echo '== Changed files against merge base =='
base="$(git merge-base HEAD "origin/$(gh pr view 15 --repo RTVision/t3code --json baseRefName --jq .baseRefName)")"
printf 'merge-base=%s\n' "$base"
git diff --name-status "$base"...HEAD
git diff --stat "$base"...HEAD
echo '== Changed source and test diff =='
git diff --unified=80 "$base"...HEAD -- \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== Module outlines =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestProvider.ts --items all
echo '== Related implementations and contracts =='
rg -n -C 5 -P '\b(revert|pull-revert|giteaViewerPermissions|viewerPermissions|feature[s]?)\b' \
apps/server/src/pullRequestLength of output: 1966 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Base-to-head comparison from GitHub =='
gh api 'repos/RTVision/t3code/compare/911169f7118984b739bfcf41bca680b64d954ceb...10005f87b25cedd28255c1751f396f6e8fd4f44e' \
--jq '{status,merge_base_commit:.merge_base_commit.sha,files:[.files[]|{filename,status,additions,deletions,patch}]}'
echo '== Changed module contents =='
for f in \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
do
echo "===== $f ====="
cat -n "$f"
done
echo '== Pull-request module map =='
ast-grep outline apps/server/src/pullRequest --items all \
--type class,function \
--match 'Gitea|Github|GitHub|PullRequest'
echo '== Revert, feature discovery, and permission call paths =='
rg -n -C 8 -P '\b(revert|pull-revert|getFeatures|features|ViewerPermissions|viewerPermissions)\b' \
apps/server/src/pullRequestLength of output: 157745 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Exact changed hunks from the local head commit =='
git show --format=fuller --find-renames --unified=30 HEAD -- \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== API helpers and revert implementation =='
sed -n '650,790p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '900,970p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1400,1465p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1615,1660p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1815,1860p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
echo '== Focused test setup and changed tests =='
sed -n '1,190p' apps/server/src/pullRequest/GiteaPullRequestApi.test.ts
sed -n '1,195p' apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== API request types and repository validation =='
rg -n -C 8 -P '\b(function|const)\s+(write|validateHost|basePath|encodeObject)\b|\bconst\s+gitea\b|\brequest:\s*\(' \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/giteaLength of output: 56496 🤖 web_search executed:
Length of output: 11478
I reviewed head I found no blocking correctness, regression, or security issue. The implementation gates the action on I inspected the tests but did not execute them because the sandbox does not permit repository code execution. [approve] You are interacting with an AI system. |
|
Merge verdict: NO-GO. This supersedes the earlier quota-only readiness comment. Reviewed head:
No merge is authorized while any blocker or required approval is outstanding. Recheck the resulting head and current base after corrections or stack merges. |
|
NO-GO now — inherited type failures Reviewed commit: The revert gating is sound, but this head inherits the type failures fixed by #22. Fable gives conditional GO with #22; Codex holds the current merge candidate. Include the downstream type fixes and rerun the scoped server typecheck. Clear the native-stack predecessors before merging. Validation by Codex: the exact #36 integration head Reviewers: Codex and Claude Fable 5.1 (Claude CLI). |
|
@coderabbitai review Please independently review the newly pushed fixes at |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="RTVision/t3code"
expected_head="15392b5d95cdcc5dd411dff5ce31ca1165e19960"
echo '== Current checkout and pull request metadata =='
git rev-parse HEAD
git status --short
gh pr view 15 --repo "$repo" \
--json number,url,state,headRefName,headRefOid,baseRefName,baseRefOid,mergeable
echo '== Resolve merge base =='
base_ref="$(gh pr view 15 --repo "$repo" --json baseRefName --jq .baseRefName)"
git fetch origin "$base_ref" --quiet
base="$(git merge-base "$expected_head" "origin/$base_ref")"
printf 'expected_head=%s\nmerge_base=%s\n' "$expected_head" "$base"
echo '== Commits and changed files from merge base =='
git log --oneline "$base..$expected_head"
git diff --name-status "$base...$expected_head"
git diff --stat "$base...$expected_head"
echo '== Focused diff =='
git diff --find-renames --unified=60 "$base...$expected_head" -- \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== Changed module outlines =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestProvider.ts --items all
echo '== Prior finding and relevant contracts =='
rg -n -C 8 -P '\b(revertSupported|pull-revert|giteaViewerPermissions|viewerPermissions|getFeatures|features|revert)\b' \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== Revert implementations in peer providers =='
rg -n -C 6 -P '\brevert\s*\(' apps/server/src/pullRequestLength of output: 2596 🏁 Script executed: #!/bin/bash
set -euo pipefail
head="15392b5d95cdcc5dd411dff5ce31ca1165e19960"
base="ef87852cbe023439b3bb60eb59eb0ab0028135f1"
echo '== Verify commit objects =='
git cat-file -e "${head}^{commit}"
git cat-file -e "${base}^{commit}"
printf 'head=%s\nbase=%s\n' "$head" "$base"
echo '== Commits and changed files from current base =='
git log --oneline "${base}..${head}"
git diff --name-status "${base}...${head}"
git diff --stat "${base}...${head}"
echo '== Focused diff =='
git diff --find-renames --unified=60 "${base}...${head}" -- \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== Changed module outlines =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestProvider.ts --items all
echo '== Feature, permission, and revert contracts =='
rg -n -C 10 -P '\b(revertSupported|pull-revert|giteaViewerPermissions|viewerPermissions|getFeatures|features|revert)\b' \
apps/server/src/pullRequest/GiteaPullRequestApi.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== Revert implementations in peer providers =='
rg -n -C 6 -P '\brevert\s*\(' apps/server/src/pullRequestLength of output: 122882 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== Mutation and repository-path helpers =='
sed -n '360,420p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1525,1580p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1755,1785p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
echo '== Capability filtering =='
ast-grep outline apps/server/src/pullRequest/GiteaForkCapabilities.ts --items all
cat -n apps/server/src/pullRequest/GiteaForkCapabilities.ts
echo '== Provider test integration setup =='
sed -n '1,155p' apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
sed -n '145,195p' apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
sed -n '260,285p' apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
echo '== Test and typecheck script definitions =='
fd -a '^package\.json$|^turbo\.json$' . -E node_modules -E dist -E build \
-x sh -c 'echo "===== $1 ====="; jq "{name,scripts}" "$1"' sh {}Length of output: 23841 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '== basePath and request validation definitions =='
rg -n -C 12 -P '\b(const|function)\s+(basePath|validateHost|request)\b' \
apps/server/src/pullRequest/GiteaPullRequestApi.ts
echo '== All basePath mutation call sites =='
rg -n -C 4 -P '\b(basePath\(input\.repository\).*(POST|PATCH|PUT|DELETE)|method:\s*"(POST|PATCH|PUT|DELETE)")\b' \
apps/server/src/pullRequest/GiteaPullRequestApi.ts
echo '== Revert change commits only =='
git show --format=fuller --find-renames --unified=40 a714159e
git show --format=fuller --find-renames --unified=40 7f8eff14Length of output: 3850 🤖 web_search executed:
Length of output: 15370
I found no actionable blocker. The prior type-safety issue is fixed. The implementation removes Focused tests cover native-server dispatch, stock-server rejection without a mutation, and the write-access permission boundary. I did not run tests or typecheck because this environment does not permit repository code execution. A formal GitHub approval requires a separate top-level You are interacting with an AI system. |
|
Re-review: GO on the revert repair; NO-GO for merging now Reviewed head: Feature discovery and optional flags are typed correctly. Revert still requires the native feature and repository write access. CodeRabbit reports no remaining blocker in this incremental change. Fable 5.1: GO on the individual change. Clear the inherited #9/#10/#12 behavior defects and the #5 integration conflict before merging the native-stack prefix. Validation by Codex: 308 focused tests across 9 files passed on integration head The remaining native-stack merges must clear their predecessors and the actual target branch. CodeRabbit’s commit-specific comments are distinguished from formal GitHub review records; rate-limited requests are not approvals. |
# Conflicts: # apps/server/src/pullRequest/GiteaPullRequestApi.test.ts # apps/server/src/pullRequest/GiteaPullRequestProvider.ts
|
GO — merged after Codex, Fable 5.1, and CodeRabbit review. Reviewed head: Revert behavior is retained; this head adds no new tree changes over its predecessor. CodeRabbit reviewed every exact head and cleared the combined integration. Its commit-specific approval is recorded in that comment; this is not a claim of a new formal GitHub APPROVED review on each PR. All three reviewers require #26 to land with #27 or later; they merged together in the dependency batch. Validation by Codex: 490 focused tests across 13 files passed on integration head Merged: |
Merged Gitea pull requests can open a native revert PR through T3’s existing action menu. The action is available only when the server advertises native revert support and the viewer can write to the repository. Stock servers omit it.
Uses the companion Gitea revert endpoint RTVision/gitea#12, which creates a new branch and PR while preserving the target branch. Focused cases cover feature discovery and native endpoint dispatch. Final integrated focused tests, server typecheck, and targeted lint pass.
Final stack validation at
256fd6fe5: 228 focused tests passed, followed by 61 API/workflow cases and the final team-recovery regression; server typecheck and targeted lint passed. The live settle-on-merge E2E previously passed with fixture cleanup. Companion Gitea backend and focused integration tests passed, including native revert across all five merge styles.Model: GPT-6 Astra. Harness: Codex; reviewed with Fable 5.1.
Summary by CodeRabbit