mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-07-22 03:41:52 -05:00
[PR #318] [MERGED] fix(releases): stop delete/recreate cycle on permanent release-order mismatch #5378
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/318
Author: @arunavo4
Created: 6/12/2026
Status: ✅ Merged
Merged: 6/13/2026
Merged by: @arunavo4
Base:
main← Head:fix/310-release-recreation📝 Commits (1)
9c5dfe0fix(releases): stop delete/recreate cycle on permanent order mismatch (#310)📊 Changes
2 files changed (+186 additions, -99 deletions)
View changed files
➕
src/lib/gitea-releases.test.ts(+150 -0)📝
src/lib/gitea.ts(+36 -99)📄 Description
Fixes #310.
Problem
For specific repos, every sync emitted Gitea "released" activity events for every release — pure activity-feed spam with no actual release changes. Only ~2 of the reporter's ~150 repos were affected.
Root cause
The release sync contained a
needsRecreationheuristic (from #148) that compared the expected order (GitHubpublished_at) against the order Gitea returns. For mirror repos Gitea orders releases by tag commit date, which can permanently disagree with publish order when an automated release pipeline decouples tagging from publishing. Proven inversion inchenasraf/unaconfig_dart: v0.1.0 was tagged before v0.1.1 but published after it. For such repos the check fired on every sync, deleting ALL releases and re-creating them — each re-creation emitting a fresh Gitea activity event.Fix
Reconcile releases by set membership, not display order: create releases missing from Gitea, skip/patch existing ones, and never delete based on perceived ordering. The recreation machinery and its 1-second-per-release ordering delay are removed; the
releaseLimitretention cleanup is untouched. Cosmetic display order in Gitea is not worth destroying and re-emitting releases.Testing
chenasraf/unaconfig_dart: release snapshots (ids + timestamps) byte-identical across two consecutive syncs, zero delete/recreate log lines (v3.17.1 reproducibly deleted and recreated all 8 releases on every sync on the same bed).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.