Repository navigation
fix(source-control): recognize encoded Gitea repository URLs - #18
Conversation
|
@coderabbitai review |
✅ Action performedReview finished.
|
00592fc to
010e69b
Compare
|
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 eb6af25c4a783604804430879ebac28cf69a5dd7 and 00592fc3dc36d63f064fcc7029b660bd94b0e67b. 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe change updates Gitea pull-request URL matching to encode repository path segments. A test covers percent-encoded non-ASCII owner and repository names. ChangesGitea URL matching
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to Gitea pull-request URL matching now supports percent-encoded Unicode repository paths while retaining existing repository validation behavior. The targeted regression coverage supports merge readiness with no identified active risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
@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. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== PR metadata =="
gh pr view 18 --repo RTVision/t3code --json number,state,isDraft,baseRefName,baseRefOid,headRefName,headRefOid,url
echo
echo "== Current HEAD and merge-base =="
git rev-parse HEAD
git merge-base "origin/$(gh pr view 18 --repo RTVision/t3code --json baseRefName --jq .baseRefName)" HEAD
echo
echo "== Diff against current merge-base =="
BASE="$(git merge-base "origin/$(gh pr view 18 --repo RTVision/t3code --json baseRefName --jq .baseRefName)" HEAD)"
git diff --no-ext-diff --unified=80 "$BASE"...HEAD -- \
apps/server/src/sourceControl/giteaRepository.ts \
apps/server/src/sourceControl/giteaRepository.test.ts
echo
echo "== Source outline =="
ast-grep outline apps/server/src/sourceControl/giteaRepository.ts --items all
echo
echo "== Test outline =="
ast-grep outline apps/server/src/sourceControl/giteaRepository.test.ts --items all
echo
echo "== Relevant source and test sections =="
rg -n -C 25 -e '\bgiteaPullRequestNumber\b' -e '\bencodeURIComponent\b' \
apps/server/src/sourceControl/giteaRepository.ts \
apps/server/src/sourceControl/giteaRepository.test.ts
echo
echo "== Call sites and comparable provider implementations =="
rg -n -C 8 -P '\bgiteaPullRequestNumber\s*\(' apps/server
rg -n -C 12 -P '\b(?:github|gitlab|gitea)PullRequestNumber\s*\(' apps/server/src/sourceControlLength of output: 2107 🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="RTVision/t3code"
BASE_SHA="d41838efd1fe8341cc3a8a9216e6f14ab150f6dd"
HEAD_SHA="010e69b9c7cf866baae51f2255090eb559a61060"
echo "== PR changed files and patches from GitHub =="
gh api --paginate "repos/$REPO/pulls/18/files?per_page=100" \
--jq '.[] | {filename, status, additions, deletions, patch}'
for path in \
apps/server/src/sourceControl/giteaRepository.ts \
apps/server/src/sourceControl/giteaRepository.test.ts
do
echo
echo "== $path at current head =="
cat -n "$path"
echo
echo "== $path at PR base =="
gh api \
-H 'Accept: application/vnd.github.raw+json' \
"repos/$REPO/contents/$path?ref=$BASE_SHA" | cat -n
done
echo
echo "== Source-control directory map =="
ast-grep outline apps/server/src/sourceControl --items all --type function,class,interface,type
echo
echo "== URL parsing and encoding references in source-control code =="
rg -n -C 10 -P '\b(?:new URL|URL\(|encodeURIComponent|decodeURIComponent|pullRequestNumber)\b' \
apps/server/src/sourceControl
echo
echo "== Gitea tests: URL and error cases =="
rg -n -C 12 -P '(?:pull request|pullRequest|giteaPullRequestNumber|https?://|encodeURIComponent)' \
apps/server/src/sourceControl/giteaRepository.test.tsLength of output: 16360 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== giteaPullRequestNumber call sites =="
rg -n -C 15 -P '\bgiteaPullRequestNumber\s*\(' apps/server
echo
echo "== Gitea repository parsing and integration call sites =="
rg -n -C 12 -P '\b(?:parseGiteaRepository|giteaRepositoryFromRemote|giteaRepositoryPath)\s*\(' \
apps/server
echo
echo "== Source-control file map =="
fd -t f . apps/server/src/sourceControl | sort
echo
echo "== Comparable pull-request URL matching implementations =="
rg -n -C 20 -P 'function\s+\w*PullRequestNumber\b|export\s+function\s+\w*PullRequestNumber\b' \
apps/server/src/sourceControl
echo
echo "== Test configuration references =="
rg -n -C 5 -P '(?:`@effect/vitest`|vitest|giteaRepository\.test)' \
package.json apps package.json 2>/dev/null || true
echo
echo "== WHATWG URL pathname checks =="
node --input-type=module <<'NODE'
const base = "https://forge.example.test/gitea";
for (const reference of [
`${base}/%C3%A9quipe/r%C3%A9po/pulls/43/files`,
`${base}/%c3%a9quipe/r%c3%a9po/pulls/43`,
`${base}/%C3%A9quipe/r%C3%A9po/pulls/43`,
`${base}/%C3%A9quipe/r%C3%A9po/pulls/43%2Fother`,
]) {
const url = new URL(reference);
console.log(JSON.stringify({ reference, pathname: url.pathname, origin: url.origin }));
}
console.log(
JSON.stringify({
encodedRepository: "équipe/répo".split("/").map(encodeURIComponent).join("/"),
}),
);
NODELength of output: 201917 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Exact checked-out head =="
git rev-parse HEAD
gh pr view 18 --repo RTVision/t3code --json headRefOid,baseRefOid --jq '{headRefOid, baseRefOid}'
echo
echo "== Production imports of the Gitea repository helper module =="
rg -n -C 8 -g '*.ts' -g '!*.test.ts' \
'from ["'\''][^"'\'']*giteaRepository(?:\.ts)?["'\'']' \
apps/server
echo
echo "== Production calls to giteaPullRequestNumber =="
rg -n -C 12 -g '*.ts' -g '!*.test.ts' \
'\bgiteaPullRequestNumber\s*\(' \
apps/server || true
echo
echo "== All direct calls, limited to the helper test and source-control module =="
rg -n -C 8 -g '*.ts' \
'\bgiteaPullRequestNumber\s*\(' \
apps/server/src/sourceControl
echo
echo "== Repository validation boundary in Gitea integration code =="
rg -n -C 12 -g '*.ts' -g '!*.test.ts' \
'\bparseGiteaRepository\s*\(|\bgiteaRepositoryFromRemote\s*\(' \
apps/server/srcLength of output: 37937
No actionable findings. The change encodes each validated repository path segment before comparison with I did not execute repository tests because the review sandbox does not permit execution of repository files. You are interacting with an AI system. |
|
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. |
|
The review found no remaining blockers. The approval applies only to this exact head and its reviewed base. ✅ Action performedComments resolved. Approval is disabled; enable |
|
Merge verdict: NO-GO. This supersedes the earlier quota-only readiness comment. Reviewed head:
Validation: 339 focused integrated PR tests plus 502 cross-provider tests passed at integration 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. This PR also belongs to the native Gitea stack: merging it would merge lower open members, including blocked #4/#5. Those predecessor gates must pass too. |
|
NO-GO now — inherited type failures Reviewed commit: The encoded repository URL recognition fix is sound. This head inherits the type failures fixed by #22. Fable gives conditional GO with #22; Codex holds the current merge candidate. Include the 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"
PR="18"
REQUESTED_HEAD="5a6676584393019120123a771d1ca71a77ce78bb"
echo "== Pull request metadata =="
gh pr view "$PR" --repo "$REPO" \
--json number,state,isDraft,url,baseRefName,baseRefOid,headRefName,headRefOid \
--jq .
echo
echo "== Checked-out commit and requested commit =="
git rev-parse HEAD
git show -s --format='%H%n%P%n%s' "$REQUESTED_HEAD"
git merge-base --is-ancestor "$REQUESTED_HEAD" HEAD \
&& echo "requested head is an ancestor of checked-out HEAD" \
|| echo "requested head is NOT an ancestor of checked-out HEAD"
BASE_REF="$(gh pr view "$PR" --repo "$REPO" --json baseRefName --jq .baseRefName)"
BASE="$(git merge-base "origin/$BASE_REF" "$REQUESTED_HEAD")"
echo
echo "== Review range =="
printf 'base=%s\nhead=%s\n' "$BASE" "$REQUESTED_HEAD"
echo
echo "== Changed files and summary =="
git diff --stat "$BASE...$REQUESTED_HEAD"
git diff --name-status "$BASE...$REQUESTED_HEAD"
echo
echo "== Full patch =="
git diff --no-ext-diff --unified=80 "$BASE...$REQUESTED_HEAD"
echo
echo "== Affected TypeScript source and test outlines =="
fd -t f -e ts . apps/server/src | sort | while read -r file; do
if git diff --quiet "$BASE...$REQUESTED_HEAD" -- "$file"; then
continue
fi
echo "--- $file"
ast-grep outline "$file" --items all || true
done
echo
echo "== Gitea URL parser, test coverage, and type-error-related context =="
rg -n -C 20 -g '*.ts' \
-e '\bgiteaPullRequestNumber\b' \
-e '\bparseGiteaRepository\b' \
-e '\bencodeURIComponent\b' \
-e '\b(?:Type error|typecheck|type check)\b' \
apps/server/src
echo
echo "== CodeRabbit configuration =="
fd -HI '^\.coderabbit\.ya?ml$|^coderabbit\.ya?ml$' . -x sh -c \
'echo "--- $1"; cat "$1"' sh {} \; || true
echo
echo "== GitHub reviews at requested head =="
gh api "repos/$REPO/pulls/$PR/reviews?per_page=100" --paginate \
--jq --arg head "$REQUESTED_HEAD" \
'[.[] | select(.commit_id == $head) | {user: .user.login, state, submitted_at, commit_id, body}]'Length of output: 3007 🏁 Script executed: #!/bin/bash
set -euo pipefail
REPO="RTVision/t3code"
PR="18"
BASE="d6ba09547259a76bbaa2449fca41e65b4eec0369"
HEAD="5a6676584393019120123a771d1ca71a77ce78bb"
if ! git cat-file -e "${BASE}^{commit}" 2>/dev/null; then
git fetch --no-tags origin "$BASE"
fi
echo "== Exact range =="
git show -s --format='base: %H%nsubject: %s' "$BASE"
git show -s --format='head: %H%nparents: %P%nsubject: %s' "$HEAD"
echo
echo "== Changed files =="
git diff --stat "$BASE...$HEAD"
git diff --name-status "$BASE...$HEAD"
echo
echo "== Exact patch =="
git diff --no-ext-diff --unified=100 "$BASE...$HEAD"
echo
echo "== PR file patches from GitHub =="
gh api --paginate "repos/$REPO/pulls/$PR/files?per_page=100" \
--jq '.[] | "=== \(.filename) (\(.status)) ===\n\(.patch // "(no textual patch)")"'
echo
echo "== Changed file contents at requested head =="
git diff --name-only "$BASE...$HEAD" | while read -r file; do
echo "--- $file"
ast-grep outline "$file" --items all || true
cat -n "$file"
done
echo
echo "== Gitea URL matching definitions and tests =="
rg -n -C 35 -g '*.ts' \
-e 'function giteaPullRequestNumber\b' \
-e 'const giteaPullRequestNumber\b' \
-e '\bgiteaPullRequestNumber\s*\(' \
-e '\bencodeURIComponent\b' \
-e '\bdecodeURIComponent\b' \
apps/server/src/sourceControl
echo
echo "== Configuration and exact-head GitHub review records =="
fd -HI -t f -g '.coderabbit.yml' -g '.coderabbit.yaml' -g 'coderabbit.yml' -g 'coderabbit.yaml' . \
-x sh -c 'echo "--- $1"; cat "$1"' sh {} \; || true
gh api --paginate "repos/$REPO/pulls/$PR/reviews?per_page=100" \
--jq --arg head "$HEAD" \
'[.[] | select(.commit_id == $head) | {user: .user.login, state, submitted_at, body}]'Length of output: 81007
No actionable findings.
I did not execute repository tests in this sandbox. [approve] You are interacting with an AI system. |
|
Re-review: GO on the URL fix; NO-GO for merging now Reviewed head: Encoded repository path segments retain exact-origin and repository-boundary checks. CodeRabbit approves the 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. |
|
GO — merged after Codex, Fable 5.1, and CodeRabbit review. Reviewed head: Encoded repository URL handling 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: |
Gitea pull request links containing Unicode repository names now resolve to the configured repository. The URL matcher compares the encoded repository path while preserving its origin and repository checks.
The focused Unicode URL regression, final integrated 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-5.6 Luna and GPT-6 Astra. Harness: Codex.
Summary by CodeRabbit