feat: github_rpm metadata-only remote (GitHub releases as a yum repo, no precache) #107
Reference in New Issue
Block a user
Delete Branch "benvin/github-rpm-remote"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Publishing RPMs to GitHub releases is common, but consuming them with
dnfrequires repodata GitHub does not provide, and mirroring every package into a local repo wastes storage and staleness-tracking on artifacts that already have a durable home. This exposes GitHub releases as a first-class RPM source that synthesizes repodata on the fly and never precaches the packages.What
Add a
github_rpmremote package type backed by a metadata-only provider.RemoteServerinterception hook (the remote-side analog ofLocalIndexer):handleProxylets a provider fully answer a request before the byte-proxy engine, passing the request-derived proxy base URL and the DB as aRemoteMetadataStore.base_url= the releases API root) for.rpmassets, filtered by the remote'spatterns(regex on asset filename), and reuse the existing local-rpm repodata generators to emitrepomd.xml/primary/filelists/other.digestwhen present, else compute it once by streaming.rpm_metadatakeyed by asset path; re-scan no more often thanmutable_ttl, pruning assets that disappear upstream.<location>as the github-relative download path so the client comes back to this remote, which 302-redirects to thereleases_remote(an existing generic github.com remote) that streams the actual bytes.Reuse the existing
releases_remotefield as the redirect target — it already carries exactly this "downloads served by remote X" semantic end to end, so no new schema/model field is needed.Extend the shared RPM metadata model with conflicts/obsoletes (JSONB columns, added idempotently) so both local and
github_rpmrepodata resolve upgrades and conflicts; the local upload path records them too.No-precache mechanics
rpm.Readstops at the payload boundary), givingdnffull resolution. Default range 1 MiB, doubling to 16 MiB.digest(no download); fall back to a one-time streamed sha256 only when absent. Header-only "minimal mode" (no deps) is rejected as a default becausednfneeds accurate provides/requires and a correct pkgid checksum to install.Tests
Header-range parsing incl. the retry loop, digest-vs-computed checksum selection, repodata synthesis with the redirect-able
<location href>, the 302 redirect path (and the guard whenreleases_remoteis unset), asset pattern filtering, and stale-asset pruning.go build/vet/testgreen; pre-commit clean.Follow-ups
github_apk/github_debmetadata-only remotes (same pattern; not in this PR).artifactapi_remote_github_rpmships as a separate PR againstterraform-provider-artifactapi(depends on this API surface).