mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-04-25 15:25:55 +03:00
[PR #15] [MERGED] Implement parallel processing #102
Labels
No labels
bug
documentation
enhancement
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/gitea-mirror#102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/15
Author: @arunavo4
Created: 5/22/2025
Status: ✅ Merged
Merged: 5/22/2025
Merged by: @arunavo4
Base:
main← Head:parallel-jobs📝 Commits (4)
f4bc28eImplement parallel processing with retry logic for repository mirroring and syncing operationsabe3113feat: enhance job resilience with new database schema and recovery mechanisms6ab7f0afix: add missing --bun flag to vitest and astro build commands894be88feat: migrate testing framework to Bun and update test configurations📊 Changes
27 files changed (+2625 additions, -172 deletions)
View changed files
📝
.github/workflows/astro-build-test.yml(+2 -2)📝
docker-entrypoint.sh(+32 -2)➕
docs/testing.md(+127 -0)📝
package.json(+7 -5)📝
scripts/manage-db.ts(+22 -0)➕
scripts/update-mirror-jobs-table.ts(+133 -0)➕
src/lib/db/index.test.ts(+42 -0)📝
src/lib/db/index.ts(+12 -0)📝
src/lib/db/schema.ts(+12 -0)➕
src/lib/gitea.test.ts(+120 -0)📝
src/lib/gitea.ts(+148 -93)📝
src/lib/helpers.ts(+205 -1)➕
src/lib/recovery.ts(+224 -0)➕
src/lib/utils.test.ts(+110 -0)➕
src/lib/utils/concurrency.test.ts(+167 -0)➕
src/lib/utils/concurrency.ts(+292 -0)➕
src/middleware.ts(+22 -0)➕
src/pages/api/gitea/test-connection.test.ts(+187 -0)➕
src/pages/api/github/test-connection.test.ts(+133 -0)➕
src/pages/api/health.test.ts(+154 -0)...and 7 more files
📄 Description
This pull request introduces significant improvements to mirroring operations between GitHub and Gitea, focusing on concurrency control, retry mechanisms, and logging enhancements. The most notable changes include the implementation of a new utility for parallel processing with retries, integration of this utility into mirroring and retry workflows, and enhanced logging for better tracking of operations.
Concurrency and Retry Utilities:
processInParallelandprocessWithRetryutilities insrc/lib/utils/concurrency.tsto enable parallel processing with configurable concurrency limits, automatic retries, and progress tracking. These utilities are used across multiple mirroring and retry workflows.Mirroring Enhancements:
mirrorGitHubOrgToGiteainsrc/lib/gitea.tsto process repositories in parallel usingprocessWithRetry, with a concurrency limit of 3 and retry functionality. Added logs for progress, retries, and completion. [1] [2]mirrorGitRepoIssuesToGiteainsrc/lib/gitea.tsto filter out pull requests, process issues and comments in parallel, and log progress and retries. Concurrency limits for issues and comments are set to 3 and 5, respectively. [1] [2] [3]API Workflow Updates:
POSThandlers insrc/pages/api/job/mirror-org.ts,src/pages/api/job/mirror-repo.ts, andsrc/pages/api/job/retry-repo.tsto useprocessWithRetryfor parallel processing of organizations and repositories. Added concurrency limits, retry mechanisms, and detailed logging for mirroring and retry operations. [1] [2] [3] [4] [5] [6]Logging Improvements:
These changes collectively improve the scalability, resilience, and observability of the mirroring system.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.