Add declarative fork support to repository config #96
Reference in New Issue
Block a user
Delete Branch "benvin/gitea-fork-from"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The config has no way to declare a fork, so forked repos sit outside Terraform. gitea_fork carries only the source repo and the owning organisation, so a fork's yaml cannot also set description, private, merge or mirror keys.
fork_from: "<owner>/<repo>"key to the repository yamlgitea_forkinstead ofgitea_repositorywhen it is setfork_fromalongside keys a fork cannot express, naming the offending config[0]viamovedand reindex their import targetsfork_fromhas no validation against also settingprivate/description/default_branch/mirror/merge-setting keys;gitea_forkonly supports owner/repo/organization so those values are silently dropped with no error → add a validation block rejectingfork_fromcombined with any repo-shaping key, or document the drop explicitly.gitea_fork.thishas noarchive_on_destroyequivalent (unavailable in the provider schema), so removing afork_fromentry deletes the repo outright instead of archiving it like the non-fork path → call this out as accepted risk or guard withlifecycle.prevent_destroy.fork_from/gitea_forkfeature with (b) thecount+movedaddress migration of all ~101 existinggitea_repository.thisresources and the 34-blockimports.tfrewrite. (b)/(c) are mechanical and independently verifiable (0 destroy) but carry materially higher blast radius than (a) — could ship as its own PR (migration only, no behavior change) with the feature as a follow-up.No findings.