mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-06-29 06:21:12 +02:00
c28dcc209f
Root cause (Theory A): the `needsRecreation` check compared GitHub published_at-based expected indices against Gitea's API order. Gitea mirror repos sort releases by tag-commit date, which can permanently disagree with published_at order (e.g. unaconfig_dart v0.1.0 published after v0.1.1 but tagged before). This made `currentExpectedIdx < nextExpectedIdx` evaluate true on every sync, triggering delete-all-and-recreate forever — spamming Gitea's activity feed with "released X" events (#310). Fix: replace the destructive order-check machinery with set-based reconciliation via `classifyReleasesForReconciliation`. Releases are created when missing in Gitea and skipped (or PATCH-updated if content drifted) when already present. No deletions are ever triggered by ordering. Retain the existing release-limit trimming (retention cleanup) unchanged. Also removes the 1-second per-release delay that was only needed for the creation-order dance, significantly speeding up initial mirrors. Adds unit tests covering: normal ordered repos, the unaconfig_dart inversion fixture, missing→create, present→skip, and edge cases.