Skip to content

feat(pull-requests): approve native Gitea workflow runs - #12

Open
kalvenschraut wants to merge 2 commits into
gitea/fork-capabilitiesfrom
gitea/workflows
Open

feat(pull-requests): approve native Gitea workflow runs#12
kalvenschraut wants to merge 2 commits into
gitea/fork-capabilitiesfrom
gitea/workflows

Conversation

@kalvenschraut

@kalvenschraut kalvenschraut commented Sep 5, 2026

Copy link
Copy Markdown
Member

T3 can discover and approve waiting Gitea Actions runs for a pull request when the server exposes native approval metadata. Matching uses the contributor revision recorded in the workflow event, and each approval rechecks the PR head before sending the request. Stock servers do not advertise this action.

Requires RTVision/gitea#3. Focused coverage passes for current and stale heads, unsupported servers, lower page caps, and incomplete pagination. Integrated focused checks, 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.

Summary by CodeRabbit

  • New Features

    • Added support for approving eligible Gitea pull request workflow runs.
    • Pull requests now show pending workflow runs as action-required checks, including required approval counts.
    • Approval actions are available only when supported by the server and permitted for the viewer.
  • Bug Fixes

    • Approval requests now validate the pull request state, current commit, and workflow identity.
    • Unsupported approval and revert actions are no longer advertised.
    • Workflow approval lookup failures safely fall back to an unsupported state.

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

Please evaluate correctness, regressions, security boundaries, and test coverage against the existing source-control and pull-request integrations. For this fork, main is the clean upstream mirror and rtvision is the integration branch. Review the changes in this PR against its current base; report actionable findings with file references.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

@kalvenschraut I will review PR #12 against its current base branch. I will check correctness, regressions, security boundaries, and focused test coverage across the source-control and pull-request integrations.

✅ 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

Warning

Review limit reached

Next included review available in 2 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 54496ad5-5732-4dd6-b12a-7a191ba34d1d

📥 Commits

Reviewing files that changed from the base of the PR and between 9e08d42 and 85dd528.

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

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: bc961f11-3450-4c07-b869-673c117432df

📥 Commits

Reviewing files that changed from the base of the PR and between a0d734d and 9e08d42.

📒 Files selected for processing (8)
  • apps/server/src/pullRequest/GiteaForkCapabilities.test.ts
  • apps/server/src/pullRequest/GiteaForkCapabilities.ts
  • 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
  • apps/server/src/pullRequest/GiteaWorkflows.test.ts
  • apps/server/src/pullRequest/GiteaWorkflows.ts

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


📝 Walkthrough

Walkthrough

Gitea now discovers approval-required workflow runs for the current pull-request head, exposes them as checks, and approves them when supported. Permissions and fork capabilities depend on detected features and viewer write access. Tests cover matching, pagination, state changes, and unsupported servers.

Changes

Gitea workflow approval

Layer / File(s) Summary
Workflow validation and listing
apps/server/src/pullRequest/GiteaWorkflows.ts, apps/server/src/pullRequest/GiteaWorkflows.test.ts
Validates workflow responses, paginates workflow runs, and filters runs to the current pull-request head.
Approval API and execution
apps/server/src/pullRequest/GiteaPullRequestApi.ts, apps/server/src/pullRequest/GiteaPullRequestApi.test.ts
Adds workflow approval retrieval and approval execution. The API rejects unsupported, closed, changed, or stale pull-request states.
Pull-request checks and permissions
apps/server/src/pullRequest/GiteaPullRequestProvider.ts, apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts
Adds workflow runs as action-required checks and grants approval only when the server supports it and the viewer can write.
Fork capability filtering
apps/server/src/pullRequest/GiteaForkCapabilities.ts, apps/server/src/pullRequest/GiteaForkCapabilities.test.ts
Filters feature-dependent actions while preserving other capabilities and the original action list.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 9e08d

Workflow approval discovery and execution are gated by server support and write access, with current pull-request state rechecked before approval. No unresolved merge-blocking risk remains.

🚥 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 5 functions across 8 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.
Description check ✅ Passed The description clearly explains what changed, why it changed, scope, dependencies, and validation results. It does not use the template headings or checklist, but the required information is mostly p…
Title check ✅ Passed The title clearly and concisely identifies the main change: support for approving native Gitea workflow runs.
✨ 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/workflows

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

@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

@kalvenschraut I will review PR #12 at its current head against its current base in stack #6. I will report actionable findings with file references.

⚠️ Action not completed

Review rate limited.

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.

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