Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Contributors: historical backfill command (Phase 5.2)

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

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
csharp, github, postgresql
领域
api, backend, databases

调研方向

先阅读现有的 backfill-activations 命令及其 host 接线,然后检查模块自有的 GitHub 接口,以及 #6 中的实体和 unique 约束。完成的标准是覆盖 Makefile 目标和 env.example 条目,fake-client 测试覆盖分页、幂等性和 rate-limit backoff,并且命令记录扫描的仓库、找到的 PR、已插入的条目和已跳过的条目。

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

描述

contributors

Scope

dotnet run -- backfill-contributions host command that pages the GitHub REST API across all org repos and records every historically merged PR as a ContributionEvent.

Mechanics

  • GET /orgs/{org}/repos then GET /repos/{owner}/{repo}/pulls?state=closed&per_page=100 per repo, filtering merged_at != null.
  • Honor rate limits: conditional requests where possible, respect Retry-After / X-RateLimit-Remaining, back off rather than fail.
  • Idempotent: reuses the (Repo, PrNumber) unique constraint from #6 — safe to re-run any time (plan: run once at launch, webhooks keep it current; re-run right before launch to catch stragglers).
  • Follow the existing backfill-activations command as the structural reference (host command wiring, Makefile target make backfill-contributions, logging summary at the end: repos scanned, PRs found, inserted, skipped).
  • GitHub calls go behind the module-owned interface (no direct HttpClient in the command).

Dependencies

Blocked by #6 (entity + constraints).

Acceptance criteria

  • Re-running produces zero duplicates
  • Rate-limit responses back off instead of throwing
  • Pagination exercised in tests via a fake GitHub client
  • Makefile target + env.example entry for the org token if a separate one is needed
Conventions (project-wide, non-negotiable)
  • .NET 9, records for immutable shapes, file-scoped namespaces, primary constructors where they read well. Minimal-API endpoints grouped per module via IEndpointModule.MapEndpoints.
  • Result<T> (SharedKernel) instead of exception-driven control flow. Endpoint results map failures to ProblemDetails with the stable error codes listed above — the frontend keys off them.
  • Module owns its EF Core DbContext mapped to its own Postgres schema. Modules never reference each other's internals — cross-module needs go through a public contract interface or an in-process domain event (IEventPublisher).
  • All external calls (GitHub, Stripe, Brevo, Cloudinary, Meilisearch) behind interfaces owned by the consuming module.
  • Every list endpoint paginated (offset is fine). xUnit tests in tests/CommunityPro.Tests/<Module>/ following the existing harness patterns (see Members/MembersTestHarness.cs).
主要语言
C#
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

环境准备

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

从这里开始

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

CommunityPro/community-pro-api 的其他 Issue

查看 CommunityPro/community-pro-api 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

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