Skip to content

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

Merged
kalvenschraut merged 8 commits into
gitea/fork-capabilitiesfrom
gitea/workflows
Sep 8, 2026
Merged

kalvenschraut merged 8 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 9e08d42d17f2619757688b369ca4f12e1d091659 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 a0d734de307dab5b6f7d9335f4529fcf92d426b9 and 9e08d42d17f2619757688b369ca4f12e1d091659.

📒 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
kalvenschraut force-pushed the gitea/workflows branch 2 times, most recently from 095cb31 to 85dd528 Compare September 5, 2026 05:11
@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

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

@kalvenschraut

Copy link
Copy Markdown
Member Author

Merge verdict: NO-GO (review gates incomplete).

Head: 85dd5287722ae696a05cf1c5317208faba0c1715.

  • Codex: NO-GO for merging under the requested two-reviewer gate. Merge readiness and review history were checked; the full dual code review is incomplete, and this comment is not a code approval.
  • Fable 5.1 / Claude CLI: BLOCKED. The requested claude-fable-5-1 review was attempted, but the CLI reached its session limit before returning a completed verdict. Its reported reset is midnight America/Chicago. There is no fresh Fable GO from this pass.
  • CodeRabbit: No formal APPROVED review. The successful CodeRabbit status check does not satisfy the requested approval gate. This branch has not enabled reviews.request_changes_workflow; the existing CodeRabbit replies on this series identify that configuration as preventing formal approvals.
  • GitHub merge state: MERGEABLE / CLEAN against gitea/fork-capabilities.
  • Checks: the current rollup contains a successful CodeRabbit status only; it contains no build/test check result. No new tests or browser verification are claimed by this audit.

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.

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai approve

The maintainer requests formal approval for the remaining PRs. Please assess the exact current head 85dd5287722ae696a05cf1c5317208faba0c1715 and submit APPROVED only if your review has no remaining blockers. If there is a blocker, leave its concrete reason and the fix required instead. A successful status check alone does not meet this merge gate.

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.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== HEAD and refs =='
git rev-parse HEAD
git status --short
git branch --show-current
git show -s --format='HEAD=%H%nparents=%P%nsubject=%s' HEAD

echo '== PR metadata =='
gh pr view 12 --repo RTVision/t3code --json number,state,isDraft,headRefName,headRefOid,baseRefName,baseRefOid,url

echo '== merge base and changed files =='
base_ref="$(gh pr view 12 --repo RTVision/t3code --json baseRefOid --jq .baseRefOid)"
merge_base="$(git merge-base HEAD "$base_ref" 2>/dev/null || true)"
printf 'base=%s\nmerge_base=%s\n' "$base_ref" "$merge_base"
git diff --name-status "$merge_base"...HEAD
git diff --stat "$merge_base"...HEAD

echo '== outlines =='
for f in \
  apps/server/src/pullRequest/GiteaWorkflows.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
  apps/server/src/pullRequest/GiteaForkCapabilities.ts \
  apps/server/src/pullRequest/GiteaWorkflows.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts \
  apps/server/src/pullRequest/GiteaForkCapabilities.test.ts
do
  if [ -f "$f" ]; then
    echo "== $f =="
    ast-grep outline "$f" --items all || true
  fi
done

echo '== diff =='
git diff --find-renames "$merge_base"...HEAD -- apps/server/src/pullRequest

Length of output: 37238


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Gitea workflow and API implementation =='
nl -ba apps/server/src/pullRequest/GiteaWorkflows.ts
sed -n '630,930p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | nl -ba -v630
sed -n '1590,1840p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | nl -ba -v1590
sed -n '1,360p' apps/server/src/pullRequest/GiteaPullRequestProvider.ts | nl -ba
sed -n '1,100p' apps/server/src/pullRequest/GiteaForkCapabilities.ts | nl -ba

echo '== Provider contract declarations and workflow-related usages =='
rg -n -C 5 'workflowApprovalsRequired|approve-workflows|action-required' \
  apps packages -g '*.ts' -g '!apps/server/src/pullRequest/Gitea*'

echo '== Gitea request and repository helpers =='
ast-grep outline apps/server/src/sourceControl/GiteaApi.ts --items all
ast-grep outline apps/server/src/sourceControl/giteaRepository.ts --items all
rg -n -C 4 'export (const |function )?(decodeGiteaResponse|parseGiteaRepository|giteaRepositoryPath)|class GiteaApiError|request:' \
  apps/server/src/sourceControl/GiteaApi.ts apps/server/src/sourceControl/giteaRepository.ts

echo '== all tests for new paths =='
rg -n -C 3 'approveWorkflows|approve-workflows|getWorkflowApprovals|listWorkflowApprovals|workflowApprovalsRequired' \
  apps/server/src/pullRequest -g '*.test.ts'

Length of output: 1697


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Gitea workflow implementation =='
cat -n apps/server/src/pullRequest/GiteaWorkflows.ts

echo '== Gitea API definitions around new behavior =='
sed -n '630,930p' apps/server/src/pullRequest/GiteaPullRequestApi.ts
sed -n '1590,1840p' apps/server/src/pullRequest/GiteaPullRequestApi.ts

echo '== Gitea provider and capability filter =='
cat -n apps/server/src/pullRequest/GiteaPullRequestProvider.ts
cat -n apps/server/src/pullRequest/GiteaForkCapabilities.ts

echo '== Provider contract declarations and workflow-related usages =='
rg -n -C 5 'workflowApprovalsRequired|approve-workflows|action-required' \
  apps packages -g '*.ts' -g '!apps/server/src/pullRequest/Gitea*' || true

echo '== Gitea request and repository helper definitions =='
ast-grep outline apps/server/src/sourceControl/GiteaApi.ts --items all || true
ast-grep outline apps/server/src/sourceControl/giteaRepository.ts --items all || true
rg -n -C 4 'export (const |function )?(decodeGiteaResponse|parseGiteaRepository|giteaRepositoryPath)|class GiteaApiError|request:' \
  apps/server/src/sourceControl/GiteaApi.ts apps/server/src/sourceControl/giteaRepository.ts || true

echo '== all tests for new paths =='
rg -n -C 3 'approveWorkflows|approve-workflows|getWorkflowApprovals|listWorkflowApprovals|workflowApprovalsRequired' \
  apps/server/src/pullRequest -g '*.test.ts' || true

Length of output: 97818


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Existing GitHub workflow action behavior =='
sed -n '2040,2145p' apps/server/src/pullRequest/GitHubPullRequestCli.ts
sed -n '120,180p' apps/server/src/pullRequest/GitHubPullRequestProvider.ts
sed -n '280,385p' apps/server/src/pullRequest/GitHubPullRequestProvider.ts

echo '== New Gitea API tests, including request order =='
sed -n '1,280p' apps/server/src/pullRequest/GiteaPullRequestApi.test.ts

echo '== Diff hygiene =='
base="$(git merge-base HEAD 4ca2ad5c6a99e8e284ed3444ff2089f431905870)"
git diff --check "$base"...HEAD
git status --short

echo '== Current PR checks and reviews =='
gh pr view 12 --repo RTVision/t3code --json headRefOid,baseRefOid,reviewDecision,reviews,statusCheckRollup,isDraft,state,url

echo '== Repository approval settings that are publicly visible =='
gh api repos/RTVision/t3code/branches/gitea/fork-capabilities/protection 2>&1 || true

Length of output: 23410


@kalvenschraut I reviewed commit 85dd5287722ae696a05cf1c5317208faba0c1715 against current base 4ca2ad5c6a99e8e284ed3444ff2089f431905870.

I found no remaining blocker. The workflow approval action is gated by Gitea feature discovery and write access. The mutation path validates the host and rechecks the pull request state and head before each approval request. The run filter requires a waiting pull_request workflow for the current contributor head and pull request number.

git diff --check passed. Repository tests could not run in this sandbox.

[approve]

You are interacting with an AI system.

feat(pull-requests): bound repository relationship reads
@kalvenschraut

kalvenschraut commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

Merge verdict: NO-GO. This supersedes the earlier quota-only readiness comment.

Reviewed head: 85dd5287722ae696a05cf1c5317208faba0c1715; declared destination: gitea/fork-capabilities.

  • Codex: NO-GO. The exact reviewed head fails the server typecheck: GiteaPullRequestProvider.ts:135 forwards boolean | undefined into an exact optional boolean, line 327 passes actions-run-approve to a never parameter, and GiteaWorkflows.test.ts:36,46 violates the enabled Effect JSON rule. The API also inherits four feature-array errors. Apply the relevant fix(pull-requests): preserve Gitea schema inference #22 corrections and rerun the server typecheck.
  • Fable 5.1 / Claude CLI: GO, completed independent review of 85dd5287722a.
  • CodeRabbit: No formal GitHub APPROVED review on this head. Approval was requested. Some bot replies say “Approved” or contain [approve], but the GitHub review records do not contain an approval; this does not pass the requested gate. The original reviewed branch did not enable reviews.request_changes_workflow; the merged chore(ci): enable CodeRabbit approvals for stack reviews #34 configuration now enables it on the new head.

Validation: 339 focused integrated PR tests plus 502 cross-provider tests passed at integration head 6114cf39; the integrated server typecheck passed. These checks validate the integrated implementation, not every earlier PR snapshot. The original #12 compiler failure was reproduced separately.

No merge is authorized while any blocker or required approval is outstanding. Recheck the resulting head and current base after corrections or stack merges.

Post-merge update: current head is 200b0578349f8c176626a9de1f8f6d089678200f, base gitea/fork-capabilities. This head incorporates the approved #34/#24/#25 stack prefix. It is not the earlier standalone workflow slice and does not have a new Fable approval. The earlier compiler result must not be represented as a compiler run on this new head. Merge verdict remains NO-GO.

@coderabbitai review

Please review the current head above and formally approve only if your code review has no remaining blockers; otherwise explain the required correction. The maintainer’s independent-review and predecessor gates remain in force.

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RTVision/t3code"
pr="12"

echo '== PR metadata =='
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,headRefName,headRefOid,baseRefName,baseRefOid,reviewDecision,statusCheckRollup,url

echo '== local HEAD =='
git rev-parse HEAD
git status --short
git show -s --format='HEAD=%H%nparents=%P%nsubject=%s' HEAD

base_oid="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"
merge_base="$(git merge-base HEAD "$base_oid")"
printf 'base_oid=%s\nmerge_base=%s\n' "$base_oid" "$merge_base"

echo '== changed files =='
git diff --name-status "$merge_base"...HEAD
git diff --stat "$merge_base"...HEAD
git diff --check "$merge_base"...HEAD

echo '== outlines for changed pull-request sources =='
git diff --name-only "$merge_base"...HEAD -- '*.ts' |
  while IFS= read -r file; do
    case "$file" in
      apps/server/src/pullRequest/*|apps/server/src/sourceControl/*)
        echo "== $file =="
        ast-grep outline "$file" --items all || true
        ;;
    esac
  done

echo '== pull-request and source-control diff =='
git diff --find-renames --unified=80 "$merge_base"...HEAD -- \
  apps/server/src/pullRequest \
  apps/server/src/sourceControl

echo '== cross-provider workflow approval references =='
rg -n -C 4 \
  'approve-workflows|workflowApprovalsRequired|action-required|getWorkflowApprovals|approveWorkflows' \
  apps packages -g '*.ts' || true

echo '== current reviews =='
gh pr view "$pr" --repo "$repo" --json reviews \
  --jq '.reviews[] | {author: .author.login, state, commit: .commit.oid, submittedAt}'

Length of output: 118687


🏁 Script executed:

#!/bin/bash
set -euo pipefail

log="/tmp/coderabbit-shell-logs/shell-output-UApIyY"

echo '== metadata and changed files from prior inspection =='
sed -n '1,260p' "$log"

echo '== locate prior diff boundaries for Gitea files =='
rg -n '^diff --git a/apps/server/src/pullRequest/Gitea|^diff --git a/apps/server/src/sourceControl/' "$log" | head -n 100

echo '== current Gitea source outlines =='
for file in \
  apps/server/src/pullRequest/GiteaWorkflows.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
  apps/server/src/pullRequest/GiteaForkCapabilities.ts \
  apps/server/src/pullRequest/GiteaWorkflows.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts \
  apps/server/src/pullRequest/GiteaForkCapabilities.test.ts
do
  echo "== $file =="
  ast-grep outline "$file" --items all || true
done

echo '== current Gitea workflow code =='
cat -n apps/server/src/pullRequest/GiteaWorkflows.ts
sed -n '440,840p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | nl -ba -v440
sed -n '1,255p' apps/server/src/pullRequest/GiteaPullRequestProvider.ts | nl -ba
cat -n apps/server/src/pullRequest/GiteaForkCapabilities.ts

echo '== current Gitea workflow tests =='
cat -n apps/server/src/pullRequest/GiteaWorkflows.test.ts
sed -n '130,310p' apps/server/src/pullRequest/GiteaPullRequestApi.test.ts | nl -ba -v130
cat -n apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

echo '== compiler-related settings and current type patterns =='
fd -a 'tsconfig.*json|biome.json*|eslint.config.*' . -E node_modules -E dist -E build | sort
rg -n -C 3 'exactOptionalPropertyTypes|preferSchemaOverJson' \
  -g 'tsconfig*.json' -g 'biome.json*' -g 'eslint.config.*' -g '*.ts' \
  apps/server packages | head -n 220

Length of output: 30971


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Gitea approval API and provider: current source =='
sed -n '740,835p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | cat -n
sed -n '1870,1930p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | cat -n
sed -n '121,245p' apps/server/src/pullRequest/GiteaPullRequestProvider.ts | cat -n
cat -n apps/server/src/pullRequest/GiteaForkCapabilities.ts

echo '== Gitea workflow tests: current source =='
cat -n apps/server/src/pullRequest/GiteaWorkflows.test.ts
sed -n '160,305p' apps/server/src/pullRequest/GiteaPullRequestApi.test.ts | cat -n
cat -n apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts

echo '== Gitea API host, feature, and request helpers =='
rg -n -C 4 \
  'const validateHost|function validateHost|const getFeatures|function getFeatures|const request|function request|function basePath|const basePath' \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts

echo '== changed production source: bounded diffs =='
base="$(git merge-base HEAD 4ca2ad5c6a99e8e284ed3444ff2089f431905870)"
for file in \
  apps/server/src/pullRequest/AzureDevOpsPullRequestCli.ts \
  apps/server/src/pullRequest/AzureDevOpsPullRequestProvider.ts \
  apps/server/src/pullRequest/BitbucketPullRequestApi.ts \
  apps/server/src/pullRequest/BitbucketPullRequestProvider.ts \
  apps/server/src/pullRequest/GitHubPullRequestCli.ts \
  apps/server/src/pullRequest/GitHubPullRequestProvider.ts \
  apps/server/src/pullRequest/GitLabPullRequestCli.ts \
  apps/server/src/pullRequest/GitLabPullRequestProvider.ts \
  apps/server/src/pullRequest/PullRequestProvider.ts \
  apps/server/src/pullRequest/azureDevOpsPullRequestJson.ts \
  apps/server/src/pullRequest/bitbucketPullRequestJson.ts \
  apps/server/src/pullRequest/gitHubPullRequestJson.ts \
  apps/server/src/pullRequest/gitLabMergeRequestJson.ts \
  apps/server/src/sourceControl/AzureDevOpsSourceControlProvider.ts \
  apps/server/src/sourceControl/GitLabCli.ts \
  apps/server/src/sourceControl/GitLabSourceControlProvider.ts \
  apps/server/src/sourceControl/azureDevOpsPullRequests.ts \
  apps/server/src/sourceControl/bitbucketPullRequests.ts \
  apps/server/src/sourceControl/gitLabMergeRequests.ts
do
  echo "== $file =="
  git diff --unified=12 "$base"...HEAD -- "$file"
done

echo '== risky suppressions and new helper call sites =='
rg -n -C 2 \
  '`@ts-ignore`|`@ts-expect-error`|effect-diagnostics-next-line|repositoryFromRemoteUrl|azureDevOpsHeadRepositoryNameWithOwner|decodeGitLabMergeRequest(Json|ListJson)' \
  apps/server/src packages -g '*.ts'

Length of output: 167063


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Gitea provider workflow result handling =='
sed -n '175,230p' apps/server/src/pullRequest/GiteaPullRequestProvider.ts | cat -n
echo '== Gitea API workflow lookup error mapping =='
sed -n '755,825p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | cat -n
echo '== Gitea workflow failure path =='
sed -n '37,75p' apps/server/src/pullRequest/GiteaWorkflows.ts | cat -n

echo '== focused Gitea provider tests and error-path coverage =='
rg -n -C 12 \
  'getWorkflowApprovals|workflowApprovalsRequired|Awaiting approval|workflow.*(fail|error|incomplete|unsupported)' \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaWorkflows.test.ts || true

echo '== GitHub workflow lookup unavailable behavior =='
sed -n '130,175p' apps/server/src/pullRequest/GitHubPullRequestProvider.ts | cat -n
sed -n '300,385p' apps/server/src/pullRequest/GitHubPullRequestProvider.ts | cat -n

echo '== current diff hygiene and current head =='
git diff --check "$(git merge-base HEAD 4ca2ad5c6a99e8e284ed3444ff2089f431905870)"...HEAD
git rev-parse HEAD

Length of output: 15742


@kalvenschraut I reviewed current head 200b0578349f8c176626a9de1f8f6d089678200f against current base 4ca2ad5c6a99e8e284ed3444ff2089f431905870.

I found one blocker. I cannot approve this head.

  • Workflow approval lookup failures are hidden. apps/server/src/pullRequest/GiteaPullRequestProvider.ts, Line 194, converts every getWorkflowApprovals failure into { supported: false, runs: [] }. This includes incomplete pagination, decode failures, and transient API failures. apps/server/src/pullRequest/GiteaWorkflows.ts deliberately fails when it cannot read the complete listing. The provider then removes both the action-required check and workflowApprovalsRequired. A pull request can appear ready while the server cannot determine if a workflow is waiting for approval. Keep the unsupported-server result distinct from a failed lookup. For lookup failures, add an action-required status check that states approval status is unknown, and do not advertise approve-workflows. Add focused coverage for an advertised actions-run-approve feature where workflow discovery fails or pagination is incomplete.

The GitHub provider already uses this fail-safe behavior for unavailable workflow approval discovery.

git diff --check passed.

You are interacting with an AI system.

@kalvenschraut

Copy link
Copy Markdown
Member Author

NO-GO now — type fixes required

Reviewed commit: 200b0578349f8c176626a9de1f8f6d089678200f.

This head inherits the adapter type errors corrected by #22. Fable gives conditional GO with that fix; Codex holds the standalone head. The workflow run walk can also make many API requests per detail load, which merits a performance follow-up.

Include the inference fixes and rerun the scoped server typecheck. The native-stack prefix must also be cleared before merging.

Validation by Codex: the exact #36 integration head 6114cf39dac017bd665908effd538e5f4f8d5764 passed 1,002 tests across 39 affected files, scoped server/web/desktop typechecks, and targeted lint (warnings, no errors). These are integration results, not a claim that this standalone head passed those checks. Fable independently reviewed source and diffs via Claude CLI; it did not run the tests.

Reviewers: Codex and Claude Fable 5.1 (Claude CLI).

@kalvenschraut

Copy link
Copy Markdown
Member Author

@coderabbitai review

Please independently review the newly pushed fixes at 82154ac96ad614e68d1fd177f18c45d82a8802e5 and submit a formal GitHub approval on this head only if no blockers remain. Otherwise report the remaining actionable findings. The maintainer requested fresh CodeRabbit approval before merging; an older approval or a green skipped-review status does not satisfy that gate. Codex and Claude Fable 5.1 are separately re-reviewing the changes, including the prior no-go findings in this PR.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="RTVision/t3code"
pr="12"
expected_head="82154ac96ad614e68d1fd177f18c45d82a8802e5"

echo '== Pull request metadata =='
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,headRefName,headRefOid,baseRefName,baseRefOid,reviewDecision,statusCheckRollup,url

echo '== Checkout identity =='
git rev-parse HEAD
git status --short
git show -s --format='HEAD=%H%nparents=%P%nsubject=%s' HEAD
printf 'expected_head=%s\n' "$expected_head"

base_oid="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"
merge_base="$(git merge-base HEAD "$base_oid")"
printf 'base_oid=%s\nmerge_base=%s\n' "$base_oid" "$merge_base"

echo '== Changed files and diff hygiene =='
git diff --name-status "$merge_base"...HEAD
git diff --stat "$merge_base"...HEAD
git diff --check "$merge_base"...HEAD

echo '== Changed TypeScript outlines =='
git diff --name-only "$merge_base"...HEAD -- '*.ts' |
while IFS= read -r file; do
  echo "== $file =="
  ast-grep outline "$file" --items all || true
done

echo '== Pull-request and source-control diff =='
git diff --find-renames --unified=50 "$merge_base"...HEAD -- \
  apps/server/src/pullRequest \
  apps/server/src/sourceControl

echo '== Current reviews =='
gh pr view "$pr" --repo "$repo" --json reviews \
  --jq '.reviews[] | {author: .author.login, state, commit: .commit.oid, submittedAt}'

Length of output: 90628


🏁 Script executed:

#!/bin/bash
set -euo pipefail

log="/tmp/coderabbit-shell-logs/shell-output-KZ69cl"
repo="RTVision/t3code"
pr="12"

echo '== Metadata and changed-file summary from the prior output =='
sed -n '1,180p' "$log"
rg -n '^== Changed files|^M\s|^A\s|^D\s|^R[0-9]*\s|^base_oid=|^expected_head=|^[0-9a-f]{40}$' "$log" | head -n 300

echo '== Current PR identity =='
gh pr view "$pr" --repo "$repo" --json headRefOid,baseRefOid,baseRefName,headRefName,state,isDraft,reviewDecision,url
git rev-parse HEAD
base_oid="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq .baseRefOid)"
merge_base="$(git merge-base HEAD "$base_oid")"
printf 'merge_base=%s\n' "$merge_base"

echo '== Gitea workflow approval implementation =='
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestProvider.ts --items all
ast-grep outline apps/server/src/pullRequest/GiteaPullRequestApi.ts --items all
ast-grep outline apps/server/src/pullRequest/GiteaWorkflows.ts --items all
sed -n '100,255p' apps/server/src/pullRequest/GiteaPullRequestProvider.ts | nl -ba -v100
sed -n '720,850p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | nl -ba -v720
cat -n apps/server/src/pullRequest/GiteaWorkflows.ts

echo '== Gitea focused tests =='
rg -n -C 12 \
  'getWorkflowApprovals|workflowApprovalsRequired|Awaiting approval|unknown|incomplete|pagination|approveWorkflows|approve-workflows' \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaWorkflows.test.ts

echo '== Error suppression and repository identity call sites =='
rg -n -C 4 \
  '\.catch(All|Tag|Tags)|Effect\.(orElse|recover)|repositoryFromRemoteUrl|repositoryForMergeRequest|azureDevOpsHeadRepositoryNameWithOwner|normalizeBitbucketPullRequestRecord|normalizeGitLabMergeRequestRecord' \
  apps/server/src/pullRequest apps/server/src/sourceControl -g '*.ts'

echo '== Current diff for Gitea paths =='
git diff --unified=30 "$merge_base"...HEAD -- apps/server/src/pullRequest/GiteaPullRequestProvider.ts apps/server/src/pullRequest/GiteaPullRequestApi.ts apps/server/src/pullRequest/GiteaWorkflows.ts apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts apps/server/src/pullRequest/GiteaPullRequestApi.test.ts apps/server/src/pullRequest/GiteaWorkflows.test.ts

Length of output: 21881


🏁 Script executed:

#!/bin/bash
set -euo pipefail

current="82154ac96ad614e68d1fd177f18c45d82a8802e5"
prior="200b0578349f8c176626a9de1f8f6d089678200f"
base="3a6df238e24c1e0edd6ae097d335a25331a97c5b"

echo '== Commits introduced after the prior reviewed head =='
git log --oneline --decorate "${prior}..${current}"
git diff --name-status "${prior}...${current}"
git diff --check "${prior}...${current}"
git diff --unified=40 "${prior}...${current}" -- \
  apps/server/src/pullRequest/GiteaPullRequestProvider.ts \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaWorkflows.ts \
  apps/server/src/pullRequest/GiteaWorkflows.test.ts

echo '== Current Gitea provider workflow handling =='
sed -n '60,250p' apps/server/src/pullRequest/GiteaPullRequestProvider.ts | cat -n
echo '== Current Gitea API workflow handling =='
sed -n '730,860p' apps/server/src/pullRequest/GiteaPullRequestApi.ts | cat -n
echo '== Current workflow listing =='
cat -n apps/server/src/pullRequest/GiteaWorkflows.ts

echo '== Gitea workflow-related tests =='
rg -n -C 14 \
  'getWorkflowApprovals|workflowApprovalsRequired|Awaiting approval|unknown|unavailable|incomplete|pagination|approveWorkflows|approve-workflows' \
  apps/server/src/pullRequest/GiteaPullRequestProvider.test.ts \
  apps/server/src/pullRequest/GiteaPullRequestApi.test.ts \
  apps/server/src/pullRequest/GiteaWorkflows.test.ts || true

echo '== All changed error-to-success conversions =='
rg -n -C 4 \
  '\.catch(All|Tag|Tags)\s*\(|Effect\.(orElse|recover)\s*\(' \
  apps/server/src/pullRequest apps/server/src/sourceControl -g '*.ts' || true

echo '== Source-control and pull-request changes since prior head =='
git diff --unified=25 "${prior}...${current}" -- \
  apps/server/src/pullRequest \
  apps/server/src/sourceControl

Length of output: 214935


@kalvenschraut I reviewed current head 82154ac96ad614e68d1fd177f18c45d82a8802e5 against current base 3a6df238e24c1e0edd6ae097d335a25331a97c5b.

I cannot approve this head. One blocker remains.

  • Workflow approval discovery still fails open. In apps/server/src/pullRequest/GiteaPullRequestProvider.ts, Line 135, Effect.orElseSucceed converts every getWorkflowApprovals failure to { supported: false, runs: [] }. GiteaWorkflows.list intentionally fails when pagination is incomplete. Decode failures and transient request failures follow the same path. The detail response then omits both the action-required check and workflowApprovalsRequired. A pull request can appear ready when the server could not determine its workflow approval state.

    Keep an unsupported server distinct from a failed workflow lookup. For a lookup failure, expose an action-required check that reports an unknown workflow approval state. Do not advertise approve-workflows for that result. Add provider coverage for an advertised actions-run-approve feature where workflow discovery fails, including incomplete pagination.

git diff --check passed for the newly pushed changes.

You are interacting with an AI system.

@kalvenschraut

Copy link
Copy Markdown
Member Author

Re-review: NO-GO — failed workflow discovery is reported as unsupported

Reviewed head: 82154ac96ad614e68d1fd177f18c45d82a8802e5. This updates my earlier go/no-go comment for the newly pushed repairs.

The type errors are repaired. However, GiteaPullRequestProvider.getChangeRequest catches every getWorkflowApprovals failure as supported:false with no runs. An advertised feature whose lookup fails, including incomplete pagination, loses both the workflow approval check and the approval-state metadata. CodeRabbit withholds approval; Codex confirmed the error path.

Fable 5.1: GO; considers the fallback an acceptable degradation. Codex and CodeRabbit disagree about the missing unknown state.

Represent failed discovery separately from unsupported functionality. Surface an unknown/unavailable approval state without offering an approval action for unknown runs, and add provider coverage for supported-but-failed discovery. Also clear #10's search continuation defect.

Validation by Codex: 308 focused tests across 9 files passed on integration head 73dd9c33ab15db71748beb6f0485ec212e6682f8; scoped server, web, and client-runtime typechecks passed, and targeted lint of 21 changed files passed with warnings. A separate single-worker reproduction exposed the native comment-reaction bug (100 reads and no reactions for a 50-reaction comment). These are integration results, not a claim that every standalone head passed the checks. Fable reviewed source and diffs through Claude CLI; it did not run tests.

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.

@kalvenschraut

kalvenschraut commented Sep 8, 2026 •

Copy link
Copy Markdown
Member Author

GO — merged after Codex, Fable 5.1, and CodeRabbit review.

Reviewed head: 66e1f2640e6ab3706796eca901a7788f24397d9a. This supersedes my previous decision on the older head.

Failed or incomplete workflow discovery now produces an action-required unknown-status check and does not offer an unsupported approval action.

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 2e156ad621fb32b241abd4614a367aea7943d12e, including the previously failing native comment-reaction reproduction. Scoped server, web, and client-runtime typechecks passed; targeted lint of 24 changed files passed with warnings. Checks ran sequentially with one test worker. These validate the integration, not separate test runs on every component head. Fable independently reviewed source and diffs via Claude CLI.

Merged: f787a611cffccbdf0fd5e593bba8f615c607f532 at 2026-09-08T04:42:49Z. This PR merged in the 17-member Gitea batch into rtvision; the six dependency PRs followed as one reviewed batch. Final rtvision commit is 20926b20ed4ea72618f7608f70b1d4cea8e40053; its tree 9a0e0253b515456f6a117be5ebccf2cd8e911b01 exactly matches tested integration head #36.

@kalvenschraut
kalvenschraut merged commit f787a61 into rtvision Sep 8, 2026
1 check passed
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