Add declarative fork support to repository config #96

Merged
benvin merged 2 commits from benvin/gitea-fork-from into main 2026-09-19 16:13:07 +10:00

2 Commits

Author SHA1 Message Date
unkin-agent 8bc04e2c7d Reject fork_from alongside unsupported repository keys
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
gitea_fork can only express the source repo and owning organisation, so any
other setting in a fork's yaml is silently dropped.

- validate fork_from entries carry no other repository attributes, naming the
  offending config key and attributes
- note that gitea_fork has no archive_on_destroy
2026-09-19 16:03:44 +10:00
unkin-agent 9ab540719e Add fork_from to repository config
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
Express a fork as an optional fork_from key on the repository yaml, so a
forked repo is declared the same way as any other repo.

- add fork_from "<owner>/<repo>" to the repository module and object type
- create gitea_fork instead of gitea_repository when fork_from is set
- validate the source repo name matches the config file name, since a fork
  inherits the source name
- move gitea_repository.this to index 0 for the count refactor
- index existing repository import targets to match
2026-09-19 15:55:12 +10:00