mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-07-21 06:52:11 -05:00
[PR #319] [MERGED] fix: scheduler auto-start gate, backup clone URL, cancel-pending action, actionable 405 #4666
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/319
Author: @arunavo4
Created: 6/12/2026
Status: ✅ Merged
Merged: 6/13/2026
Merged by: @arunavo4
Base:
main← Head:fix/309-308-quick-wins📝 Commits (4)
53d0f0efix(scheduler): make enabled flag authoritative for auto-start74a4be0fix(backup): always derive clone URL from user-configured Gitea URL7732148feat(jobs): cancel-pending endpoint + fix misleading Delete All copy14febbbfix(sync): actionable 405 error for non-pull-mirror repos📊 Changes
5 files changed (+255 additions, -20 deletions)
View changed files
📝
src/components/activity/ActivityLog.tsx(+97 -7)📝
src/lib/gitea-enhanced.ts(+32 -3)📝
src/lib/scheduler-service.test.ts(+22 -0)📝
src/lib/scheduler-service.ts(+15 -10)➕
src/pages/api/job/cancel-pending.ts(+89 -0)📄 Description
Part of #309. Improves diagnostics for #308. Four independent fixes, one commit each:
Auto-start respects the enabled toggle (#309): boot-time auto-start fired when
scheduleEnabled || hasMirrorInterval, so a configured mirror interval overrode an explicitly disabled scheduler.scheduleConfig.enabledis now the single authoritative gate. The documentedGITEA_MIRROR_INTERVALcontract is preserved — the env loader already setsenabled=truewhen that variable is present at startup.Backup clone URL derived from the configured Gitea URL (#309): the pre-sync backup preferred
repoInfo.clone_urlfrom the Gitea API, which reflects Gitea'sROOT_URLand can be unreachable from the app (e.g. Tailscale MagicDNS deployments). The clone URL is now always built fromconfig.giteaConfig.url. (Issue/PR metadata mirroring was already using the configured URL and was unaffected.)Honest "Delete All" copy + a real cancel action (#309): the activity-page action only clears history rows while the scheduler re-derives pending work from repo status, so the log refilled. The dialog is renamed "Clear Activity History" with accurate copy, and a new
POST /api/job/cancel-pending("Stop Pending Mirrors" button) sets this user'simported/failedrepos toignored(re-enable from the Repositories page). In-flight work is left alone.Actionable HTTP 405 on mirror-sync (#308): Gitea returns a bodyless 405 when a repo isn't a pull-mirror in its database (e.g. Gitea auto-disabled the mirror). Previously surfaced as a raw "HTTP 405: Method Not Allowed"; now the repo's error message tells the user to check Gitea → Settings → Mirror Settings and re-mirror if the mirror section is missing.
Testing
Unit tests for the auto-start gate; full suite green. Cancel-pending verified live on a Gitea 1.24 test bed (745 repos flipped to Ignored, single summary activity entry).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.