fix(source-control): recognize encoded Gitea repository URLs - #18
fix(source-control): recognize encoded Gitea repository URLs#18kalvenschraut wants to merge 1 commit into
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: 📒 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. |
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