feat: add --batch-size flag to push refs in batches (#173)
* feat: add --batch-size flag to push refs in batches Add support for pushing refs in smaller batches to avoid server-side limits and timeouts when syncing large repositories with many tags/branches. - Add --batch-size flag (default 0 = no batching, original behavior) - Add References() method to GitRepository interface - Implement collectRefs() and pushRefsInBatches() helpers - Add MinBatchSize validation (must be 0 or >= 10) This addresses issues where repositories with 1000+ refs fail to sync to GHES with 'command error on refs/heads/<branch>: failed' errors. * test: add tests for batch-size flag and push batching functionality * fix: pin tool dependencies to versions compatible with Go 1.21 * ci: fix docker compose v2 syntax and update setup-ruby action * refactor: address PR review feedback - Remove unused RefInfo struct from git.go - Remove redundant pushedAny variable tracking in pushRefsInBatches - Remove incomplete TestPushRefsInBatches_PartialUpToDate test (already covered by existing test case) * docs: add --batch-size flag to README
This commit is contained in:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -9,8 +9,8 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Lint
|
||||
run: docker-compose run --rm lint
|
||||
run: docker compose run --rm lint
|
||||
- name: Test
|
||||
run: docker-compose run --rm test
|
||||
run: docker compose run --rm test
|
||||
- name: E2E
|
||||
run: docker-compose run --rm test-build
|
||||
run: docker compose run --rm test-build
|
||||
|
||||
2
.github/workflows/licensed.yml
vendored
2
.github/workflows/licensed.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
- run: go mod vendor
|
||||
|
||||
# Ruby is required for licensed
|
||||
- uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b
|
||||
- uses: ruby/setup-ruby@90be1154f987f4dc0fe0dd0feedac9e473aa4ba8 # v1
|
||||
with:
|
||||
ruby-version: "3.2"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user