Skip to content

feat(import): gitea handler to import repositories from Gitea/Forgejo - #249

Merged
ionos-landgraf-vin merged 2 commits into
mainfrom
feat/gitea-importer
Nov 10, 2026
Merged

ionos-landgraf-vin merged 2 commits into
mainfrom
feat/gitea-importer

Conversation

@ionos-landgraf-vin

Copy link
Copy Markdown
Collaborator

Summary

  • New gitea import handler (handlers/gitea.rb), modelled on github: lists repositories and emits one repository child import per repo (clone over SSH, analysis as for GitHub/GitLab).
  • Config: host (required), optional org (without it all repositories the token can see via /repos/search), scheme, verifySSL, rateLimitMs, plus the usual team/visibility/cache keys. Token from GITEA_TOKEN (Authorization: token).
  • Gitea caps the page size, so the listing runs until an empty page (guarded against servers that ignore page). Stale clones are pruned per owner directory (cacheRoot/gitea/<host>/<owner>).
  • Gitea-aware links: /src/branch|commit/ source links in GitSource, icon/category in Helpers and the frontend, "Gitea"/"Forgejo" link labels (also matches Forgejo and Codeberg hosts).
  • Docs: docs/import.md (new gitea section), configuration and importing-data pages.

Test plan

  • test/import/handlers/gitea_handler_test.rb (token/host errors, org and search listing, pagination, repeat-page guard, HTTP errors, team propagation, pruning, clone path), git_source and helpers tests
  • Full suite (2719 runs, 0 failures), rubocop, steep
  • Smoke test: archsight import against a local fake Gitea API generated the child repository import; archsight lint passes
  • Not done: .gitea/workflows detection in git analytics (follow-up)

🤖 Generated with Claude Code

ionos-landgraf-vin and others added 2 commits November 10, 2026 10:18
Lists the repositories of an organization (or everything the token can see)
and emits one repository import per repo, like the GitHub and GitLab
handlers. Gitea hosts get the right icon, category and source links.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…g import

The github, gitlab and gitea listing imports pass gitService (default
Git:Github, Git:Gitlab, Git:Gitea) to their repository child imports.
The repository handler uses it for suppliedBy and falls back to guessing
from the clone URL only for hand-written repository imports, so Gitea
repositories are no longer attributed to Git:Gitlab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ionos-landgraf-vin
ionos-landgraf-vin merged commit afaff51 into main Nov 10, 2026
8 checks passed
@ionos-landgraf-vin
ionos-landgraf-vin deleted the feat/gitea-importer branch November 10, 2026 12:46
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