Expand description
GitHub issue fetching for ai jev route (#1779).
Mirrors crate::pr_status’s shape: shell out to gh (ADR-0003 — the
GitHub token never enters our process), build one aliased gh api graphql query per batch of issues grouped by repository (free aliasing —
repository(owner:,name:) and issue(number:) take no first:/last:,
so neither is a connection and neither contributes to the query’s point
cost — see pr_status’s module docs for the measured numbers), and reuse
crate::pr_status::run_gh_graphql rather than writing a second
subprocess wrapper.
Every call funnels through crate::github_metrics::run_gh (or
run_gh_graphql, which already does), so it is counted and logged like
every other gh invocation (#1387).
Structs§
- Cache
Usage - How much of a run’s GitHub input came from the cache.
- Issue
Cache - The GitHub fetch cache shared by
routeandverify-decision.
Constants§
- DEFAULT_
CACHE_ TTL - How long a fetched item is reused when
GITHUB_CACHE_TTL_ENVis unset. - GITHUB_
CACHE_ TTL_ ENV - Environment variable / settings key setting the cache lifetime in
seconds.
0disables the cache entirely (no reads, no writes).
Functions§
- auth_
scope - The
account_scopedigest of theghlogin the fetches will run as. - fetch_
issues - Fetches every ref, returning issues in the same order as
refs. - fetch_
issues_ cached fetch_issuesthroughcache: serves fresh cached issues from disk, fetches only the rest, and caches what it fetched (#1858).- fetch_
issues_ cached_ current fetch_issues_cached, but a cached issue is served only if itsstatestill matches GitHub’s (#2041): a mismatch is a miss, fetched in full.- fetch_
issues_ refreshed fetch_issues, always from GitHub, writing the result through tocache.- fetch_
items - Fetches a set of references that may be issues or pull requests.
- fetch_
items_ cached fetch_itemsthroughcache, likefetch_issues_cached. A not-found item is not cached, so it is re-queried next time. Blocking.- fetch_
items_ cached_ current fetch_items_cachedwith thestatecheck offetch_issues_cached_current. Blocking.- fetch_
states - Fetches only the
stateof each reference (an issue or a pull request), one entry perrefsin the same order,Nonefor one GitHub can’t find. - fetch_
updated_ at - Fetches only GitHub’s
updatedAtfor each issue or pull request. - list_
open_ issue_ numbers - Lists every open issue number in
project, for--all-open. - needs_
default_ project - Whether
rawnames an issue only by number (#NorN), so it needs the current repository to resolve. Lets callers skip thegh repo viewround-trip when every argument is already qualified. - open_
cache - The cache
routeandverify-decisionfetch through. - open_
cache_ blocking open_cacheon a blocking thread, shared by the two commands that fetch through the cache.- parse_
issue_ arg - Parses one
<ISSUE>CLI argument into anItemRef. - resolve_
current_ project - Resolves the
owner/repoof the GitHub repository checked out atcwd, viagh repo view.