Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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)

Aperta
#6,534 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, python
Ambito
api, devtools

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

claim:melek priority: high

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/N
  • issues/N/comments, paged
  • commits/SHA/check-runs, paged
  • commits/SHA/status
  • issues/N/events, paged
  • head_pushed_at (check-suites), paged
  • commits/SHA parents
  • actions/runs/ID attempts

gitgalaxy#6529 already memoises user and the permission reads within a pass.

Change (keep decide() and every rule unchanged)

  1. 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 statusCheckRollup contexts (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.

  2. 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_TEMP within a pass.

  3. Cache what can't change:

    • check runs and statuses of a SHA whose checks are all completed
    • commit parents
    • an actions/runs/ID that'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 that decide() makes identical decisions on it.
  • The PR body states the REST calls per full reconcile pass, before and after, measured with a counting fake api over a recorded snapshot of the ~20 labelled PRs, and the GraphQL points it adds.
  • shepherd-*.yml is 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

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 squid-protocol/gitgalaxy

Tutte le issue di squid-protocol/gitgalaxy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.