feat(repo-cache): sync pre-fetched repositories without listing the organization

Aperta
#28 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
tooling

Direzione di ricerca

Inizia leggendo repo_cache.sync_org() e la gestione di SyncReport successiva a #27, quindi esamina come generate-repo-overview ottiene i record dei repository da PyGithub. Aggiungi il punto di ingresso per la sincronizzazione dei repository pre-scaricati, mantenendo sync_org() come wrapper delegante. Il lavoro è completato quando percorsi e risultati sono deterministici, la classificazione dei casi vuoti e di errore è preservata, non viene effettuata una seconda enumerazione dell'organizzazione e la documentazione della libreria è aggiornata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

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.

Lingua principale
Python
Stelle
1
Fork
5
Merge medio
23h 38m
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-score/tools

Tutte le issue di eclipse-score/tools

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.