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

未关闭
#28 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
tooling

调研方向

先阅读 repo_cache.sync_org() 和 #27 之后的 SyncReport 处理逻辑,然后检查 generate-repo-overview 如何获取 PyGithub 仓库记录。添加用于同步预先获取的仓库的入口点,同时保留 sync_org() 作为委托 wrapper。完成的标准是路径和结果具有确定性,保留空结果/失败分类,不进行第二次组织列表获取,并更新库文档。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
1
派生
5
平均合并
23 小时 38 分钟
30 天内合并 PR
13

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-score/tools 的其他 Issue

查看 eclipse-score/tools 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。