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)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 57
- Fork
- 11
- Merge medio
- 1h 8m
- PR unite (30g)
- 978
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di squid-protocol/gitgalaxy
-
Ports Compile: run the assess clean-install check on a PR only when packaging can changeForse già presa @squid-protocol l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
squid-protocol/gitgalaxy#6672 ·
I maintainer di solito rispondono entro 1 giorno
-
experiment
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
squid-protocol/gitgalaxy#6643 ·
I maintainer di solito rispondono entro 1 giorno
-
scope:sweep
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
squid-protocol/gitgalaxy#6572 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
claim:nyx enhancement legacy-modernization scope:core status: blocked testing
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
squid-protocol/gitgalaxy#6492 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug scope:sweep
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
squid-protocol/gitgalaxy#6454 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di squid-protocol/gitgalaxy
Issue simili
-
README.zh-CN/ja/es still hard-code 501 test counts after README.md went count-freeForse già presa @Aaqibhafeezkhan l’ha presa oggi. Apertabeginner documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BistaDinesh03/critique#164 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug IO
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
MrNeRF/LichtFeld-Studio#3824 ·
I maintainer di solito rispondono entro 1 giorno
-
bug confirmed issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
open-webui/open-webui#33200 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Lychee link check failedAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
-
The changelog workflow excludes otelbot but not dependabot, so every Dependabot pull request fails the changelog checkForse già presa @ocelotl l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
open-telemetry/opentelemetry-python#5825 ·
I maintainer di solito rispondono entro 2 giorni