Skip to content

feat(pull-requests): open native Gitea revert pull requests - #15

Open
kalvenschraut wants to merge 1 commit into
gitea/trackingfrom
gitea/revert
Open

feat(pull-requests): open native Gitea revert pull requests#15
kalvenschraut wants to merge 1 commit into
gitea/trackingfrom
gitea/revert

Conversation

@kalvenschraut

@kalvenschraut kalvenschraut commented Sep 5, 2026

Copy link
Copy Markdown
Member

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

  • New Features
    • Added support for reverting pull requests on Gitea instances that provide native revert functionality.
    • The Revert action is now shown only when the viewer has write access and the server supports the feature.
    • Unsupported revert attempts now display an explicit error.

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5c79d21c-3ea2-4832-9118-909249f849f5

📥 Commits

Reviewing files that changed from the base of the PR and between 60abc41 and b70a0f9.

📒 Files selected for processing (4)
  • apps/server/src/pullRequest/GiteaPullRequestApi.test.ts
  • apps/server/src/pullRequest/GiteaPullRequestApi.ts
  • apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
  • apps/server/src/pullRequest/GiteaPullRequestProvider.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Gitea 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.

Changes

Gitea native revert support

Layer / File(s) Summary
Feature detection and revert permissions
apps/server/src/pullRequest/GiteaPullRequestProvider.ts, apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
The provider fetches Gitea features and exposes revert only when pull-revert is supported and the viewer has write access.
Native revert execution
apps/server/src/pullRequest/GiteaPullRequestApi.ts, apps/server/src/pullRequest/GiteaPullRequestApi.test.ts
The revert action validates support, posts to the native revert endpoint, and reports an explicit error when unsupported. Tests cover both server capabilities.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to b70a0

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
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: adding native Gitea revert pull requests.
Description check ✅ Passed The description clearly explains what changed, why it changed, the feature conditions, testing, and validation results. It does not use the template headings or include the checklist, but it provides …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gitea/revert

Comment @coderabbitai help to get the list of available commands.

@kalvenschraut
kalvenschraut marked this pull request as ready for review September 5, 2026 05:57
@kalvenschraut

Copy link
Copy Markdown
Member Author

@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.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Oops, something went wrong! Please try again later. 🐰 💔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant