repository: stop migration_mirror_interval planning an update every run #65
Reference in New Issue
Block a user
Delete Branch "benvin/branch-protection-whitelist-drift"
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?
Why
The
go-gitea/giteaprovider schema defaultsmigration_mirror_intervalto"8h0m0s", but on read it writesrepo.MirrorIntervalstraight back into state (resource_gitea_repository.go:442), and Gitea returns an emptyMirrorIntervalfor non-mirror repositories.So the stored value (
"") never matches the schema default ("8h0m0s"), andtofuplans an in-place update of everygitea_repositoryon every run even with no config change — the classic go-gitea provider perpetual diff.migration_mirror_intervalis the onlymigration_*field read back from the API; the rest are write-only migration options, so no sibling field churns.Change
lifecycle { ignore_changes = [migration_mirror_interval] }at the repository module so the provider default no longer fights Gitea's empty value, making every repository idempotent. It is a migration-only knob with no drift to track for these non-mirror repos.Why: - The go-gitea/gitea provider schema defaults migration_mirror_interval to "8h0m0s", but on read it writes repo.MirrorInterval straight back into state, and Gitea returns an empty MirrorInterval for non-mirror repositories. - So the stored value ("") never matches the schema default ("8h0m0s"), and tofu plans an in-place update of every gitea_repository on every run even with no config change, keeping terraform-git plans perpetually dirty. - migration_mirror_interval is the only migration_* field read back from the API; the rest are write-only migration options, so no sibling field churns. Change: - Add a targeted ignore_changes on migration_mirror_interval at the repository module so the provider default no longer fights Gitea's empty value, making every repository idempotent. It is a migration-only knob with no drift to track for these non-mirror repos.6bb636846ftocad35f8d9bbranch_protection: stop whitelist representation churn planning every runto repository: stop migration_mirror_interval planning an update every run