mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-21 15:11:22 -05:00
[PR #206] [MERGED] feat: smart force-push protection with backup strategies #584
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/206
Author: @arunavo4
Created: 3/2/2026
Status: ✅ Merged
Merged: 3/2/2026
Merged by: @arunavo4
Base:
main← Head:feat/smart-force-push-protection📝 Commits (7)
ba7789cfeat: smart force-push protection with backup strategies (#187)12e58b4fix: resolve four bugs in smart force-push protection4da8645test(e2e): migrate backup tests from backupBeforeSync to backupStrategy6bb109cdocs: add backup strategy UI screenshotf1175d6refactor(ui): move Destructive Update Protection to GitHub config tab3663e91docs: add force-push protection documentation and Beta badge901050ffix(ui): match Beta badge style to Git LFS badge📊 Changes
24 files changed (+1706 additions, -145 deletions)
View changed files
➕
.github/screenshots/backup-strategy-ui.png(+0 -0)📝
README.md(+2 -0)➕
docs/FORCE_PUSH_PROTECTION.md(+179 -0)📝
src/components/config/ConfigTabs.tsx(+12 -1)📝
src/components/config/GitHubConfigForm.tsx(+146 -7)📝
src/components/config/GiteaConfigForm.tsx(+1 -73)📝
src/components/repositories/Repository.tsx(+76 -0)📝
src/components/repositories/RepositoryTable.tsx(+74 -2)📝
src/lib/db/schema.ts(+11 -1)📝
src/lib/gitea-enhanced.ts(+128 -40)📝
src/lib/repo-backup.test.ts(+134 -1)📝
src/lib/repo-backup.ts(+92 -2)📝
src/lib/scheduler-service.ts(+19 -1)📝
src/lib/utils.ts(+2 -0)📝
src/lib/utils/config-defaults.ts(+2 -1)📝
src/lib/utils/config-mapper.ts(+2 -0)➕
src/lib/utils/force-push-detection.test.ts(+319 -0)➕
src/lib/utils/force-push-detection.ts(+286 -0)➕
src/pages/api/job/approve-sync.ts(+202 -0)📝
src/types/Repository.ts(+1 -0)...and 4 more files
📄 Description
Summary
Closes #187
backupBeforeSync: booleanwithbackupStrategyenum:disabled,always,on-force-push(default),block-on-force-pushpending-approvalrepo status with approve/dismiss buttons forblock-on-force-pushmodeUI: Destructive Update Protection
Backup strategy modes
disabledalwayson-force-pushblock-on-force-pushFiles changed
backupStrategyenum,pending-approvalstatussrc/lib/utils/force-push-detection.tsbackupBeforeSync: true→always)POST /api/job/approve-syncwith approve/dismiss actionsbackupStrategypersisted through save/load round-tripTest plan
bun test— 161 pass, 0 failbun run build— no type errorsblock-on-force-push— verify repo showspending-approval, approve/dismiss workbackupBeforeSync: trueresolves toalways🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.