[PR #191] [MERGED] fix(github): keep disabled repos from cleanup while skipping new imports #176

Closed
opened 2026-02-27 15:55:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/191
Author: @arunavo4
Created: 2/26/2026
Status: Merged
Merged: 2/26/2026
Merged by: @arunavo4

Base: mainHead: codex/disabled-repo-safe-handling


📝 Commits (2)

  • 3070c2d fix: preserve disabled repos while skipping new imports
  • 757902d ci: upgrade bun to 1.3.6 for test workflow

📊 Changes

9 files changed (+63 additions, -13 deletions)

View changed files

📝 .github/workflows/astro-build-test.yml (+1 -1)
📝 src/lib/github.ts (+4 -1)
src/lib/repo-eligibility.test.ts (+17 -0)
src/lib/repo-eligibility.ts (+6 -0)
📝 src/lib/repository-cleanup-service.ts (+15 -7)
📝 src/lib/scheduler-service.ts (+13 -2)
📝 src/pages/api/sync/index.ts (+4 -1)
📝 src/pages/api/sync/organization.ts (+2 -1)
📝 src/types/Repository.ts (+1 -0)

📄 Description

Summary

  • add isDisabled metadata to GitHub repo objects returned by discovery APIs
  • skip disabled repositories during new import insertion (manual sync + scheduler auto-import + org sync)
  • preserve existing mirrored repositories when GitHub marks them disabled by excluding disabled upstream repos from orphan cleanup actions
  • add unit tests for mirrorability eligibility helper

Why

  • prevents data loss for existing local mirrors after DMCA/ToS disablement
  • avoids first-time ghost repositories by not importing repos that cannot be cloned

Testing

  • bun test src/lib/repo-eligibility.test.ts src/lib/repo-utils.test.ts
  • bunx tsc --noEmit currently reports pre-existing repository-wide type errors unrelated to this PR

🔄 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/191 **Author:** [@arunavo4](https://github.com/arunavo4) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 2/26/2026 **Merged by:** [@arunavo4](https://github.com/arunavo4) **Base:** `main` ← **Head:** `codex/disabled-repo-safe-handling` --- ### 📝 Commits (2) - [`3070c2d`](https://github.com/RayLabsHQ/gitea-mirror/commit/3070c2d64d7d7b37c4b671e4d4d708e22752ff54) fix: preserve disabled repos while skipping new imports - [`757902d`](https://github.com/RayLabsHQ/gitea-mirror/commit/757902df908dc4e0c260514fdd8c5afe7d682360) ci: upgrade bun to 1.3.6 for test workflow ### 📊 Changes **9 files changed** (+63 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/astro-build-test.yml` (+1 -1) 📝 `src/lib/github.ts` (+4 -1) ➕ `src/lib/repo-eligibility.test.ts` (+17 -0) ➕ `src/lib/repo-eligibility.ts` (+6 -0) 📝 `src/lib/repository-cleanup-service.ts` (+15 -7) 📝 `src/lib/scheduler-service.ts` (+13 -2) 📝 `src/pages/api/sync/index.ts` (+4 -1) 📝 `src/pages/api/sync/organization.ts` (+2 -1) 📝 `src/types/Repository.ts` (+1 -0) </details> ### 📄 Description ## Summary - add `isDisabled` metadata to GitHub repo objects returned by discovery APIs - skip disabled repositories during new import insertion (manual sync + scheduler auto-import + org sync) - preserve existing mirrored repositories when GitHub marks them disabled by excluding disabled upstream repos from orphan cleanup actions - add unit tests for mirrorability eligibility helper ## Why - prevents data loss for existing local mirrors after DMCA/ToS disablement - avoids first-time ghost repositories by not importing repos that cannot be cloned ## Testing - bun test src/lib/repo-eligibility.test.ts src/lib/repo-utils.test.ts - bunx tsc --noEmit currently reports pre-existing repository-wide type errors unrelated to this PR --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 15:55:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/gitea-mirror#176
No description provided.