shepherd: read each PR in one GraphQL query, conditional REST for the rest, cache what a finished SHA can't change (Part of promoter-bot#64)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
調査の方向性
Start with tests/tools/shepherd_gh.py and trace gather() plus the reused ci_digest.py and pr_check.py reads. Compare the REST snapshot with a fake GraphQL response, then check that decide() makes the same decisions and measure REST calls and GraphQL points across the recorded PR snapshot. Done means the REST fallback and cache behavior work, the stated quota reduction is measured, and shepherd-*.yml remains unchanged.
索引モデルが issue の本文から書いたものです。
説明
Part of squid-protocol/promoter-bot#64. Owner 2026-10-24: the GitHub API quota is halting work.
Why
tests/tools/shepherd_gh.py runs on AUTOMATION_PAT, so it shares the account's 5,000/h REST quota with the agent fleet and the owner's sessions. On 2026-10-24 it failed 25 times when that quota ran out, 20 of them in two blackouts, and nothing merged meanwhile. The fleet's measured burn is ~3,400/h.
A full reconcile pass costs ~8–14 REST calls per labelled PR (~20 PRs), from gather():
pulls/Nissues/N/comments, pagedcommits/SHA/check-runs, pagedcommits/SHA/statusissues/N/events, pagedhead_pushed_at(check-suites), pagedcommits/SHAparentsactions/runs/IDattempts
gitgalaxy#6529 already memoises user and the permission reads within a pass.
Change (keep decide() and every rule unchanged)
-
GraphQL for the per-PR snapshot (separate 5,000-points/h quota). One query per PR, or per batch of PRs in a reconcile pass, gets:
- the PR's state, head SHA and labels
- comments (author login + body, for the approval markers)
- the head commit's
statusCheckRollupcontexts (check runs and statuses: name, status, conclusion, workflow run database id) - the labeled events (
timelineItems(itemTypes: [LABELED_EVENT])with actor and createdAt) - the head commit's
pushedDate, or its committedDate if that's absent
Map them into the exact dict
gather()builds today, and fall back to the REST path when GraphQL fails. -
Conditional requests for the REST reads that stay: send the cached ETag as
If-None-Match; a 304 doesn't count against the quota. Cache under the runner's flake-cache directory, or$RUNNER_TEMPwithin a pass. -
Cache what can't change:
- check runs and statuses of a SHA whose checks are all completed
- commit parents
- an
actions/runs/IDthat's completed
Cache by key within the reconcile pass, and across passes through the existing flake-cache save if it fits.
Acceptance
- A test with a fake GraphQL response checks that
gather()returns the same dict the REST path did for the same PR state, and thatdecide()makes identical decisions on it. - The PR body states the REST calls per full reconcile pass, before and after, measured with a counting fake
apiover a recorded snapshot of the ~20 labelled PRs, and the GraphQL points it adds. shepherd-*.ymlis unchanged (those still need the owner's per-PR OK).
Class / sibling gaps
ci_digest.py and pr_check.py (reused by the shepherd) make the same per-PR check-run reads. Apply the same GraphQL or cache path where the shepherd calls them.
- 主要言語
- Python
- スター
- 57
- フォーク
- 11
- 平均マージ
- 1時間 21分
- マージ済み PR(30日)
- 971
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
squid-protocol/gitgalaxy のほかの issue
-
ci-red-main claim:melek
難易度 3/5 半日 初心者へのやさしさ 15/100
squid-protocol/gitgalaxy#7568 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
squid-protocol/gitgalaxy#7536 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
squid-protocol/gitgalaxy#7535 ·
メンテナーはふだん 1 日以内に返信
-
enhancement epic roadmap
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
squid-protocol/gitgalaxy#7533 ·
メンテナーはふだん 1 日以内に返信
-
enhancement legacy-modernization
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
squid-protocol/gitgalaxy#7532 ·
メンテナーはふだん 1 日以内に返信
squid-protocol/gitgalaxy の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
521xueweihan/HelloGitHub#4237 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jejjohnson/gaussx#721 ·
メンテナーはふだん 1 日以内に返信
-
mock-core-configs/etc/mock/rocky-10-riscv64.cfg contains the wrong architecture in config_opts['root']対応中かも @jasonmontleon が 4 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
rpm-software-management/mock#1834 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
elastic/elastic-otel-python#683 ·
メンテナーはふだん 1 日以内に返信
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesオープンfollow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信