Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Credential-file preservation and Gitea source and organization handling have confirmed defects that need correction.
5 open issues
Netrc replacement modifies commented entries and breaks credentials · New Organization imports fail for Gitea reverse-proxy subpaths · New Gitea source sync loses SSH URL and authentication · New Netrc parser misinterprets login value as password directive · New Repository named pulls breaks PR comment endpoint · New
What changed in this PR
Adds self-hosted Gitea support to TeamAI’s provider layer for team setup, sharing and PR imports.
Changes:
- Adds instance validation, authentication, Git transport and PR operations.
- Integrates Gitea with discovery, diagnostics and discussion-aware imports.
- Adds regression tests, opt-in live coverage and setup documentation.
| File | Description |
|---|---|
| src/types.ts | Adds Gitea provider schema value. |
| src/providers/registry.ts | Registers Gitea and instance detection. |
| src/providers/index.ts | Exports Gitea provider. |
| src/providers/gitea/repo-url.ts | Validates instance and repository URLs. |
| src/providers/gitea/probe.ts | Probes instances anonymously. |
| src/providers/gitea/org.ts | Implements organization operations. |
| src/providers/gitea/mr-fetch.ts | Fetches PR evidence and discussions. |
| src/providers/gitea/index.ts | Implements provider interface. |
| src/providers/gitea/gitea-api.ts | Adds authentication, transport and API operations. |
| src/init.ts | Preserves Gitea clone transport. |
| src/index.ts | Updates provider option help. |
| src/import.ts | Sanitizes batch URL diagnostics. |
| src/import-mr.ts | Routes Gitea imports and clarifies evidence guidance. |
| src/doctor.ts | Checks Gitea configuration. |
| src/clone.ts | Integrates Gitea clone/fetch authentication. |
| src/__tests__/provider-fallback.test.ts | Tests Gitea default selection. |
| src/__tests__/init.test.ts | Tests accepted provider names. |
| src/__tests__/import-mr.test.ts | Tests routing and diagnostic redaction. |
| src/__tests__/import-mr-threads.test.ts | Tests unknown-resolution guidance. |
| src/__tests__/import-mr-learnings-checkout.test.ts | Preserves real diagnostic helper exports. |
| src/__tests__/gitlab-probe.test.ts | Accounts for additional discovery probe. |
| src/__tests__/gitea-provider.test.ts | Tests Gitea provider behavior. |
| src/__tests__/e2e/gitea-provider-live.test.ts | Adds opt-in live integration coverage. |
| skill-data/setup/references/setup-admin.md | Adds Gitea onboarding guidance. |
| skill-data/core/references/commands.md | Updates generated provider help. |
| README.zh-CN.md | Lists Gitea support. |
| README.th.md | Lists Gitea support. |
| README.md | Lists Gitea support. |
| README.ko.md | Lists Gitea support. |
| README.ja.md | Lists Gitea support. |
| docs/usage-guide.zh-CN.md | Links Gitea setup guidance. |
| docs/usage-guide.md | Links Gitea setup guidance. |
| docs/guide/zh-CN/providers.md | Documents Gitea setup and limitations. |
| docs/guide/providers.md | Documents Gitea setup and limitations. |
| docs/designs/README.md | Indexes Gitea design. |
| docs/designs/gitea-provider.md | Records architecture and validation. |
Review effort: Balanced
| const retained = previous.replace(/\bmachine\s+(\S+)[\s\S]*?(?=\bmachine\s+|\bdefault\b|\bmacdef\b|$)/g, | ||
| (entry, name: string) => name.toLowerCase() === host ? '' : entry).trimEnd(); |
| } | ||
|
|
||
| function orgName(org: string): string { | ||
| return parseGiteaRepoInput(`${org}/validation`).owner; |
| */ | ||
| function resolveHostProvider(host: string): string { | ||
| return HOST_MAP[host] ?? detectSelfHostedGitLabHost(host) ?? 'git'; | ||
| return HOST_MAP[host] ?? detectSelfHostedGitLabHost(host) ?? (isConfiguredGiteaHost(host) ? 'gitea' : 'git'); |
| if (tokens[i] === 'machine') machine = tokens[++i]?.toLowerCase() ?? ''; | ||
| else if (tokens[i] === 'default' || tokens[i] === 'macdef') machine = ''; |
| // Swagger declares since/before for issue comments and no pagination for | ||
| // review comments. Only the reviews collection accepts page/limit. | ||
| try { | ||
| const comments = await giteaJson<GiteaComment[]>(route.replace('/pulls/', '/issues/') + '/comments'); |
The PR description documents sufficient built-CLI end-to-end verification. Extra provider/agent coverage is explicitly deferred to CI; no testing-record finding. Reviewed only the specified diff. No PR code was run, built, or installed. |
|
@alheart Copilot and Codex flagged a few issues in review. Mind taking a look? |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@alheart The branch at 8106be02 conflicts with main in src/init.ts, which has changed since your base (#1207, #1226, #1245, #1221, #1272, #1268). Please rebase onto current main and resolve the conflict. We'll review the rebased head. The points from our earlier comment still apply.


Adds a self-hosted Gitea provider for team init, HTTP/SSH clone and push, PR creation/recovery, and merged-PR import. Main can also import review bodies, inline comments and ordinary comments while preserving source IDs and unknown resolution state.
Uses a full GITEA_URL and PAT from GITEA_TOKEN or netrc. Validates HTTP instance boundaries before attaching credentials, preserves SSH transport/port, bounds requests, paginates lists, matches duplicate PRs by repositories/head/base, and handles reviewer failures independently.
Includes registry/schema/help/doctor/clone/import wiring, bilingual user docs, all README locales, generated command reference, and an English design listing shared-state readers/writers. The core push algorithm stays unchanged.
Validation
Focused Gitea coverage: statements/lines 97.62%, branches 84.41%, functions 89.36%. Extra provider/agent combinations are left to CI. Generated learning files remain drafts requiring content review; successful extraction does not guarantee factual accuracy.