Documentation
¶
Overview ¶
Package ansreg asks Ansible Galaxy what it knows about the collections and roles a requirements.yml diff touches. There is no OSV.dev ecosystem and no deps.dev system for Ansible content, so — like Packagist, hex.pm, pub.dev, CRAN, the Bazel Central Registry and Helm chart repositories before it — this package IS the metadata layer, not a fallback:
- Release ages and the ⏱ cooldown flag, from each collection version's created_at in the galaxy.ansible.com v3 index (the exact API `ansible-galaxy collection install` resolves against) and each role version's release_date in the classic v1 role index. Note: versions published before the 2023 galaxy_ng migration carry the migration date, so historical ages are upper-bounded — fine for the cooldown window, never understated.
- Deprecated collections land in the deprecation lane: Galaxy's own `deprecated` flag on the collection index.
- Registry-verified unlisted detection for collections: Galaxy keeps every published version (removal is an admin/malware action), so an incoming version the index answers 404 for — while the collection itself IS listed — is what a pulled or never-published release looks like. Absence is re-proven with an uncached fetch before it is claimed. Roles are exempt: their version list only updates when the owner re-imports, so absence there proves lag, not malice.
- The upstream source repository from the collection version's own metadata (or the role's GitHub coordinates), feeding verified compare links and -changelogs.
galaxy.ansible.com sends no CORS headers, so the browser (wasm) playground disables this layer; the CLI covers it fully.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BaseURL = "https://galaxy.ansible.com"
BaseURL is the Galaxy API base; a var so tests can fake it.
var Enabled = true
Enabled gates the whole layer (the wasm playground turns it off: galaxy.ansible.com sends no CORS headers).
var Now = time.Now
Now is a var so tests can pin the clock.
Functions ¶
func Annotate ¶
Annotate fills Ansible Galaxy metadata on the diffs; see the package comment for what it covers. The returned bool reports whether at least one collection or role was actually vetted against Galaxy. freshDays mirrors -fresh-days. Best-effort: per-package failures skip that package; only total failure returns an error.
Types ¶
This section is empty.