Skip to main content

Module github_issues

Module github_issues 

Source
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§

CacheUsage
How much of a run’s GitHub input came from the cache.
IssueCache
The GitHub fetch cache shared by route and verify-decision.

Constants§

DEFAULT_CACHE_TTL
How long a fetched item is reused when GITHUB_CACHE_TTL_ENV is unset.
GITHUB_CACHE_TTL_ENV
Environment variable / settings key setting the cache lifetime in seconds. 0 disables the cache entirely (no reads, no writes).

Functions§

auth_scope
The account_scope digest of the gh login the fetches will run as.
fetch_issues
Fetches every ref, returning issues in the same order as refs.
fetch_issues_cached
fetch_issues through cache: 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 its state still matches GitHub’s (#2041): a mismatch is a miss, fetched in full.
fetch_issues_refreshed
fetch_issues, always from GitHub, writing the result through to cache.
fetch_items
Fetches a set of references that may be issues or pull requests.
fetch_items_cached
fetch_items through cache, like fetch_issues_cached. A not-found item is not cached, so it is re-queried next time. Blocking.
fetch_items_cached_current
fetch_items_cached with the state check of fetch_issues_cached_current. Blocking.
fetch_states
Fetches only the state of each reference (an issue or a pull request), one entry per refs in the same order, None for one GitHub can’t find.
fetch_updated_at
Fetches only GitHub’s updatedAt for each issue or pull request.
list_open_issue_numbers
Lists every open issue number in project, for --all-open.
needs_default_project
Whether raw names an issue only by number (#N or N), so it needs the current repository to resolve. Lets callers skip the gh repo view round-trip when every argument is already qualified.
open_cache
The cache route and verify-decision fetch through.
open_cache_blocking
open_cache on a blocking thread, shared by the two commands that fetch through the cache.
parse_issue_arg
Parses one <ISSUE> CLI argument into an ItemRef.
resolve_current_project
Resolves the owner/repo of the GitHub repository checked out at cwd, via gh repo view.