Skip to main content

Module github

Module github 

Source
Expand description

Shared GitHub tags-API client, used by every ecosystem that resolves package versions from GitHub repository tags rather than a dedicated package registry (deps-swift, deps-github-actions).

Each ecosystem crate layers its own extras on top of GithubTagsClientdeps-swift adds GitHub Releases publish-date enrichment, deps-github-actions adds a rate-limit cooldown gate, in-flight request coalescing, and a tag<->SHA cross-reference. Only the pieces that were byte-for-byte identical between the two — constants, owner/repo validation, auth-header setup, the tags-pagination loop, and page parsing — live here, so the two crates cannot silently diverge on this shared behavior (#472).

Re-exports§

pub use crate::pagination::page_has_more;

Structs§

GithubTag
GitHub tags API response item.
GithubTagCommit
The commit object nested in a GithubTag.
GithubTagsClient
Shared cache, auth-header, and API-base state for a GitHub-tags-backed registry client.
ReleaseDatesCache
Memoized, best-effort GitHub Releases publish-date cache.

Constants§

GITHUB_API
Base URL for the GitHub REST API.
MAX_TAG_PAGES
Maximum number of tags pages fetched per repository (100 tags/page).

Functions§

github_rate_limit_error
The actionable error returned when a request hits GitHub’s unauthenticated rate limit (60 req/h per IP, vs 5000 req/h with a token).
is_valid_github_identity
Whether name matches the owner/repo GitHub identifier shape every GitHub-tags-backed ecosystem accepts.
normalize_tag
Strips a leading v/V tag prefix.
paginate_tags
Drives the GitHub tags pagination loop: page 1 alone, then subsequent pages in batches of up to CONCURRENCY pages.
parse_tags_page
Parses a single GitHub tags API response page into raw tag entries.
validate_owner_repo
Validates that name is a valid owner/repo GitHub identifier before it reaches a {api_base}/repos/{name}/... fetch as a bare path segment.
warn_if_pagination_truncated
Logs a warning when tag pagination for name stops at MAX_TAG_PAGES while GitHub still had more pages available (page_has_more(page_len)).