[PR #207] [CLOSED] Force push protection via backup branches #2094

Closed
opened 2026-05-03 03:03:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/207
Author: @Xyndra
Created: 3/2/2026
Status: Closed

Base: mainHead: force-push-protection


📝 Commits (10+)

  • 5b7e81b feat: add force-push protection with backup-branch and block modes (#190)
  • 133e832 fix: protect deleted branches and default to backup-branch mode
  • 6f7eb52 fix: respect GH_API_URL/GITHUB_API_URL in listGitHubBranches for E2E compatibility
  • fdb5020 test: add comprehensive E2E tests for backup-branch force-push protection
  • 485424e Add debug since branch backup failed
  • 29cba1d Add logging to debug backup branch creation and sync-repo 404s
  • 7d94463 Fix myProjectId being empty on test retries by adding ensureMyProjectId helper
  • a1ca759 Add more detailed logging for backup branch creation troubleshooting
  • 90aa118 Increase activity log details truncation limit to see full error messages
  • 3647142 try to use a backup-org

📊 Changes

17 files changed (+4210 additions, -618 deletions)

View changed files

📝 .github/workflows/e2e-tests.yml (+23 -0)
📝 src/components/config/GiteaConfigForm.tsx (+105 -31)
📝 src/lib/db/schema.ts (+511 -411)
src/lib/force-push-detection.test.ts (+352 -0)
src/lib/force-push-detection.ts (+681 -0)
src/lib/fork-backup.ts (+536 -0)
📝 src/lib/gitea-enhanced.ts (+235 -110)
📝 src/lib/utils/config-defaults.ts (+33 -14)
📝 src/lib/utils/config-mapper.ts (+67 -35)
src/pages/api/job/approve-sync.ts (+196 -0)
📝 src/pages/api/job/sync-repo.ts (+4 -0)
📝 src/types/Repository.ts (+2 -1)
📝 src/types/config.ts (+4 -2)
tests/e2e/06-backup-branch.spec.ts (+1296 -0)
📝 tests/e2e/fake-github-server.ts (+72 -0)
📝 tests/e2e/helpers.ts (+92 -14)
📝 tests/e2e/playwright.config.ts (+1 -0)

📄 Description

No description provided


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RayLabsHQ/gitea-mirror/pull/207 **Author:** [@Xyndra](https://github.com/Xyndra) **Created:** 3/2/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `force-push-protection` --- ### 📝 Commits (10+) - [`5b7e81b`](https://github.com/RayLabsHQ/gitea-mirror/commit/5b7e81bcc5bed5287f1f90c84bafa9d910b38084) feat: add force-push protection with backup-branch and block modes (#190) - [`133e832`](https://github.com/RayLabsHQ/gitea-mirror/commit/133e832313aae2934693570ec92f900d9ab6ff8c) fix: protect deleted branches and default to backup-branch mode - [`6f7eb52`](https://github.com/RayLabsHQ/gitea-mirror/commit/6f7eb520bfeb337790a3af81947a158570924983) fix: respect GH_API_URL/GITHUB_API_URL in listGitHubBranches for E2E compatibility - [`fdb5020`](https://github.com/RayLabsHQ/gitea-mirror/commit/fdb5020df8bdb8fb2de42250b8be108c2a6f74dd) test: add comprehensive E2E tests for backup-branch force-push protection - [`485424e`](https://github.com/RayLabsHQ/gitea-mirror/commit/485424e4d685fb5749d633c5b677f34cde3f908e) Add debug since branch backup failed - [`29cba1d`](https://github.com/RayLabsHQ/gitea-mirror/commit/29cba1d9db2af275f5799cc29032523c044cc91c) Add logging to debug backup branch creation and sync-repo 404s - [`7d94463`](https://github.com/RayLabsHQ/gitea-mirror/commit/7d94463e3e37517eecf021131001c6eafc19cfb7) Fix myProjectId being empty on test retries by adding ensureMyProjectId helper - [`a1ca759`](https://github.com/RayLabsHQ/gitea-mirror/commit/a1ca75910e9691425885da68c4dc607ffa30844b) Add more detailed logging for backup branch creation troubleshooting - [`90aa118`](https://github.com/RayLabsHQ/gitea-mirror/commit/90aa118c1a3d0aed1e411d51179b5f74d55c9eb8) Increase activity log details truncation limit to see full error messages - [`3647142`](https://github.com/RayLabsHQ/gitea-mirror/commit/3647142e6d1be53c7e2b14cbcec880de28a32696) try to use a backup-org ### 📊 Changes **17 files changed** (+4210 additions, -618 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/e2e-tests.yml` (+23 -0) 📝 `src/components/config/GiteaConfigForm.tsx` (+105 -31) 📝 `src/lib/db/schema.ts` (+511 -411) ➕ `src/lib/force-push-detection.test.ts` (+352 -0) ➕ `src/lib/force-push-detection.ts` (+681 -0) ➕ `src/lib/fork-backup.ts` (+536 -0) 📝 `src/lib/gitea-enhanced.ts` (+235 -110) 📝 `src/lib/utils/config-defaults.ts` (+33 -14) 📝 `src/lib/utils/config-mapper.ts` (+67 -35) ➕ `src/pages/api/job/approve-sync.ts` (+196 -0) 📝 `src/pages/api/job/sync-repo.ts` (+4 -0) 📝 `src/types/Repository.ts` (+2 -1) 📝 `src/types/config.ts` (+4 -2) ➕ `tests/e2e/06-backup-branch.spec.ts` (+1296 -0) 📝 `tests/e2e/fake-github-server.ts` (+72 -0) 📝 `tests/e2e/helpers.ts` (+92 -14) 📝 `tests/e2e/playwright.config.ts` (+1 -0) </details> ### 📄 Description _No description provided_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 03:03:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea-mirror#2094