[PR #224] [MERGED] feat: import repo topics and description into Gitea #595

Closed
opened 2026-04-13 14:17:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/224
Author: @arunavo4
Created: 3/14/2026
Status: Merged
Merged: 3/15/2026
Merged by: @arunavo4

Base: mainHead: codex/issue-222-topics-description


📝 Commits (2)

  • dd87ddf lib: sync repo topics and descriptions
  • 62c97ca lib: harden metadata sync for existing repos

📊 Changes

1 file changed (+290 additions, -56 deletions)

View changed files

📝 src/lib/gitea.ts (+290 -56)

📄 Description

Summary

  • sync repository descriptions to Gitea after mirroring
  • sync repository topics from GitHub to Gitea
  • apply metadata sync in both mirror creation paths (personal + org)
  • backfill metadata when the destination repository already exists
  • add description to the org migration payload for parity

Implementation Details

  • Added a shared metadata sync helper in src/lib/gitea.ts.
  • Description is synced via PATCH /api/v1/repos/{owner}/{repo}.
  • Topics are fetched from GitHub (GET /repos/{owner}/{repo}/topics) and applied in Gitea via PUT /api/v1/repos/{owner}/{repo}/topics.
  • Topics are sanitized for Gitea compatibility, de-duplicated, and optional topicPrefix is applied.
  • Topic sync respects giteaConfig.addTopics (disabled when set to false).
  • Metadata sync is best-effort and will not fail the mirror job if metadata endpoints fail.

Validation

  • bun test src/lib/gitea.test.ts src/lib/gitea-enhanced.test.ts src/lib/gitea-starred-repos.test.ts
  • bun run build

Closes #222


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RayLabsHQ/gitea-mirror/pull/224 **Author:** [@arunavo4](https://github.com/arunavo4) **Created:** 3/14/2026 **Status:** ✅ Merged **Merged:** 3/15/2026 **Merged by:** [@arunavo4](https://github.com/arunavo4) **Base:** `main` ← **Head:** `codex/issue-222-topics-description` --- ### 📝 Commits (2) - [`dd87ddf`](https://github.com/RayLabsHQ/gitea-mirror/commit/dd87ddfa3de252ef3d2b1da549cf93b8e0324c42) lib: sync repo topics and descriptions - [`62c97ca`](https://github.com/RayLabsHQ/gitea-mirror/commit/62c97ca04c8a1661bae2916e1b4ae8f17a8cbc67) lib: harden metadata sync for existing repos ### 📊 Changes **1 file changed** (+290 additions, -56 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/gitea.ts` (+290 -56) </details> ### 📄 Description ## Summary - sync repository descriptions to Gitea after mirroring - sync repository topics from GitHub to Gitea - apply metadata sync in both mirror creation paths (personal + org) - backfill metadata when the destination repository already exists - add description to the org migration payload for parity ## Implementation Details - Added a shared metadata sync helper in `src/lib/gitea.ts`. - Description is synced via `PATCH /api/v1/repos/{owner}/{repo}`. - Topics are fetched from GitHub (`GET /repos/{owner}/{repo}/topics`) and applied in Gitea via `PUT /api/v1/repos/{owner}/{repo}/topics`. - Topics are sanitized for Gitea compatibility, de-duplicated, and optional `topicPrefix` is applied. - Topic sync respects `giteaConfig.addTopics` (disabled when set to `false`). - Metadata sync is best-effort and will not fail the mirror job if metadata endpoints fail. ## Validation - `bun test src/lib/gitea.test.ts src/lib/gitea-enhanced.test.ts src/lib/gitea-starred-repos.test.ts` - `bun run build` Closes #222 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 14:17:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea-mirror#595