Skip to content

add gitee backend#197

Open
jaemk wants to merge 1 commit into
masterfrom
260717.gitee-backend
Open

add gitee backend#197
jaemk wants to merge 1 commit into
masterfrom
260717.gitee-backend

Conversation

@jaemk

@jaemk jaemk commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Closes #121.

  • Add a gitee feature gating backends::gitee with ReleaseList/Update (and AsyncUpdate under async), mirroring the gitea backend. Default host https://gitee.com (api base /api/v5) with an optional host(..) setter for enterprise instances.
  • Authenticate via Authorization: Bearer <token> (auth_token), host-gated and marked sensitive so the token never reaches logs, URLs, or error output. Verified against gitee's official client (oschina/mcp-gitee).
  • Map assets leniently: an asset missing name or browser_download_url is skipped with a debug log instead of erroring. Gitee's auto-generated source archive always appears in assets without a name (the issue's report), so strict handling would make every release unusable. tag_name/created_at remain required. This deliberately diverges from the other forges' strict DTO handling.
  • Use /releases/latest directly; a non-semver or tag_prefix-mismatched latest release falls back to scanning the listing. Non-semver tags are skipped as on the other forges.
  • Add loopback stub tests (55) pinning routing, pagination, DTO leniency, auth threading, and token non-leakage; examples/gitee.rs; specs/ref-gitee-backend.md; the gitee feature in all Makefile CI lanes.

Note that CI has no live gitee instance: correctness rests on the documented v5 API and the loopback stubs. It would be good to have a gitee user validate a pre-release against a real repo before this ships in a release.

- new `gitee` feature gating `backends::gitee` with `ReleaseList`/`Update`
  (and `AsyncUpdate` under `async`), mirroring the gitea backend. Default host
  `https://gitee.com` (api base `/api/v5`) with an optional `host(..)` setter
  for enterprise instances. (#121)
- auth via `Authorization: Bearer <token>` (`auth_token`), host-gated and
  marked sensitive so the token never reaches logs, URLs, or error output.
- lenient asset mapping: an asset missing `name` or `browser_download_url`
  (gitee's auto-generated source archive has no name) is skipped with a debug
  log instead of erroring; `tag_name`/`created_at` remain required. This
  deliberately diverges from the other forges' strict DTO handling.
- `/releases/latest` is used directly; a non-semver or prefix-mismatched
  latest release falls back to scanning the listing. `tag_prefix` and
  non-semver-tag skipping work as on the other forges.
- loopback stub tests (55) pin routing, pagination, DTO leniency, auth
  threading, and token non-leakage; example `examples/gitee.rs`; spec
  specs/ref-gitee-backend.md. Note: CI has no live gitee instance; correctness
  rests on the documented v5 API.
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.

Can you add support for china's gitee ?

1 participant