eclipse-score / eclipse-score/tools
feat(repo-cache): sync pre-fetched repositories without listing the organization
- Dominant language
- Python
- Stars
- 1
- Forks
- 5
- Avg merge
- 13h 22m
- Merged PRs (30d)
- 23
Description
## Problem
Following #27, `repo_cache.sync_org()` correctly reports empty repositories separately from synchronization failures. However, it always lists the organization through `gh` and accepts only repository-name filters.
Consumers such as `generate-repo-overview` already fetch the complete repository set through PyGithub. They need to synchronize those same repositories, but using `sync_org()` causes a second organization listing and loses the already-fetched repository records.
## Proposed change
Add a high-level synchronization API that accepts repository records supplied by the caller, for example:
```python
sync_repositories(
*,
org: str,
repositories: Sequence[Repository],
cache_dir: Path,
workers: int = DEFAULT_SYNC_WORKERS,
progress: Callable[[str], None] | None = None,
) -> SyncReport
```
`sync_org()` should retain its current behavior and delegate to this API after listing and filtering repositories.
## Acceptance criteria
- Callers can synchronize a pre-fetched sequence of `repo_cache.Repository` records without another organization-list API request.
- The returned `SyncReport` preserves the post-#27 empty-repository and failure classification.
- Checkout paths and outcome ordering remain deterministic and compatible with `sync_org()`.
- `sync_org()` behavior remains unchanged and shares the implementation.
- The library documentation includes the pre-fetched-repository use case.
This would let downstream collectors fetch GitHub metadata once, synchronize checkouts once, and pass the resulting paths into their own processing workers.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.