Skip to content

feat(review-platform): add Gitee support - #2840

Open
guantw wants to merge 1 commit into
GCWing:mainfrom
guantw:feat/gitee-review-platform
Open

feat(review-platform): add Gitee support#2840
guantw wants to merge 1 commit into
GCWing:mainfrom
guantw:feat/gitee-review-platform

Conversation

@guantw

@guantw guantw commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add Gitee to the existing review-platform service, Pull Requests panel, Agent tools, and Deep Review flow.

  • Recognize gitee.com remotes and support PR lists/details, files and diffs, commits, comments, check output, and Issue evidence.
  • Support PR creation, including drafts and fork heads, comments, approval, and resetting only the current user's approval through the existing write-permission boundary.
  • Apply repository-wide state filters before pagination. Switching from All page 2 to Merged loads Merged page 1; refresh retains the active filter, and delayed list or detail responses cannot overwrite a newer selection.
  • Separate Open and Draft within Gitee's open collection before pagination. Report exact totals only when the collection is complete, and fail explicitly if the bounded scan cannot establish the requested page.
  • Populate file and line counts before returning the visible page, using the same bounded concurrency as GitLab and GitCode. A failed statistics request preserves the PR and its available metadata.
  • Distinguish unknown counts from real zero, keep list/detail statistics consistent for matching revisions, and avoid displaying stale statistics after revision changes.
  • Bind review evidence to immutable base/head revisions, report provider collection limits, and preserve coverage warnings across detail sections.
  • Support saved tokens and GITEE_TOKEN, with a separate credential file for downgrade compatibility and query-token redaction in transport errors.

Fixes #

Type and Areas

Type: Feature

Areas: Rust review-platform integration, desktop/Tauri, Agent tools, Deep Review, Web UI, i18n, documentation, tests.

Motivation / Impact

Repositories hosted on Gitee can use the existing review workflow with provider-native identities. Public repositories can be read anonymously; authenticated access and writes use the configured Gitee token and repository permissions.

State chips query the repository's matching PRs instead of filtering the ten rows on the current page. The panel keeps state-specific pagination and caches and prevents stale asynchronous detail work from following a previous selection. Older hosts retain the All request shape; hosts without the advertised filtering capability show an explicit unsupported state for other Gitee filters.

Users can see available file/addition/deletion counts on the initial list without selecting each PR. Unknown statistics display a dash, while confirmed zero remains zero. Missing, invalid, overflowing, or incomplete file counts cannot become authoritative totals, and valid PR metadata is retained when enrichment cannot establish a complete result. Legacy provider overviews can still replace nonzero totals with zero.

The adapter conservatively marks collections of 200 files or 250 commits as potentially incomplete. Live large-PR file responses stopped at 200 and ignored pagination parameters despite the schema's advertised 300-file limit. Deep Review retains limited coverage instead of claiming a complete review. If approval succeeds but its accompanying comment fails, the result identifies the applied approval and directs the caller to retry only the comment.

Verification

Focused automated checks passed on Windows:

Command Result
cargo test --locked -p openbitfun-services-integrations --no-default-features --features review-platform --lib review_platform 125 passed; two live network tests ignored by default
cargo test --locked -p openbitfun-agent-runtime --no-default-features --features agent-runtime --lib deep_review::target_evidence:: 16 passed
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,tools-git --lib review_platform_tool:: 3 passed
cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,tools-git --lib pull_request_diff_route_uses_prepared_provider_identity_not_remote_id 1 passed
pnpm --dir src/web-ui exec vitest run src/infrastructure/api/service-api/ReviewPlatformAPI.test.ts 7 passed, including legacy All requests and older hosts that ignore filters
pnpm --dir src/web-ui exec vitest run src/app/components/panels/review-platform/ReviewPlatformPanel.test.ts src/app/components/panels/review-platform/ReviewPlatformPanel.test.tsx 23 passed, including initial list counts before details resolve, zero refreshes, revision isolation, and delayed responses
pnpm run check:web Passed
pnpm run i18n:audit Passed with zero warnings
pnpm run check:repo-hygiene Passed
pnpm run fmt:rs and git diff --check Passed
Desktop cargo build --no-default-features with tauri.dev.conf.json and development codegen settings; pnpm run build:web Passed; native regression used this desktop binary and the current built frontend

Real read-only verification:

  • pnpm --dir tests/e2e exec wdio run ./config/wdio.gitee-native.ts: all 3 native Windows desktop scenarios passed on 2026-09-07, against dromara/sa-token, using an isolated profile and GITEE_TOKEN from the process environment. WebdriverIO controlled the actual desktop WebView through the embedded WebDriver, and the runner compared the UI with independent Gitee API reads.
  • Covered All page 2 to Merged page 1, Merged page 2 and refresh, Closed/Open/Draft, and rapid state switching with an in-flight All refresh followed by selecting the second Merged PR.
  • PR refactor(core): drop redundant current_working_directory from ToolUseContext #359 displayed 2 files, +4, -4 before selection. After selection and completion of the earlier refresh, both its list row and detail header still displayed 2 files, +4, -4, with detail state Merged.
  • Observed totals: All 376, Merged 269, Closed 84, Open 23, Draft 0. The application trace recorded 9 successful list requests and 19 successful detail-section requests, with zero failures. All eight screenshots, result.json, and the runner log were retained locally; the before-selection and selected-detail screenshots were inspected.
  • cargo test --locked -p openbitfun-services-integrations --no-default-features --features review-platform --lib public_gitee_initial_list_statistics -- --ignored: passed for all five states, comparing initial list counts with independent file responses without requesting PR details.
  • cargo test --locked -p openbitfun-services-integrations --no-default-features --features review-platform --lib public_gitee_readonly_smoke -- --ignored: passed against openeuler/go-gitee#69, covering complete detail, commits/comments, review target, exact file diff, and the CI section.

Write requests, approval partial failures, provider pagination, stale revisions, credential isolation, and old-payload compatibility are covered by local tests. No real Gitee write operation was performed.

Reviewer Notes

  • AI-assisted implementation. Native desktop E2E evidence covers the Gitee list/filter/detail/statistics workflows above; it does not claim live write or full Deep Review execution coverage.
  • Native change requests, replies to a specific thread, thread resolution, draft reviews, merging, and arbitrary self-hosted Gitee instances remain unsupported.
  • Check output/error excerpts are exposed; complete CI execution logs remain at the provider's check details page.
  • Gitee credentials use a separate file so older hosts can continue reading the existing GitLab/GitCode token store. Added capability, limitation, and optional statistics-validity fields retain old-payload compatibility.
  • Remote scenarios: existing workspace transport, host-owned credentials, and tool permission routing are retained. Live SSH workspaces, remote control, Peer Device Mode, and Detached Dispatch were not exercised.
  • The live E2E runner retains only local evidence and can use an environment token when anonymous quota is exhausted. No token or machine-specific credential path is included in the source.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@guantw
guantw marked this pull request as draft September 6, 2026 11:37
@guantw
guantw force-pushed the feat/gitee-review-platform branch from 64de03e to 172ccf2 Compare September 6, 2026 20:17
@guantw
guantw marked this pull request as ready for review September 6, 2026 20:18
@guantw
guantw marked this pull request as draft September 6, 2026 20:23
Add a Gitee API v5 provider for pull requests, issue evidence, check output,
comments, approval, and resetting the current user's approval. Integrate
provider identity with the existing review tools and Deep Review routing.

Filter Gitee pull requests before pagination, distinguish open requests from
drafts, and populate statistics for the visible page with bounded concurrency.
Keep unknown counts distinct from zero, preserve valid metadata on enrichment
failure, and bind list/detail statistics and caches to matching PR revisions.

Bind review diffs to immutable revisions, report potentially capped file and
commit collections, and preserve section coverage warnings. Keep Gitee
credentials in a separate store for downgrade compatibility and redact URLs
from transport errors. Advertise state filtering support for older hosts.

Document supported operations and add HTTP contract, compatibility, frontend,
public read-only smoke, and native desktop workflow coverage.
@guantw
guantw force-pushed the feat/gitee-review-platform branch from 172ccf2 to 5aa1075 Compare September 6, 2026 22:05
@guantw
guantw marked this pull request as ready for review September 6, 2026 22:06
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