ansreg

package
v0.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 11 Imported by: 0

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

View Source
var BaseURL = "https://galaxy.ansible.com"

BaseURL is the Galaxy API base; a var so tests can fake it.

View Source
var Enabled = true

Enabled gates the whole layer (the wasm playground turns it off: galaxy.ansible.com sends no CORS headers).

View Source
var Now = time.Now

Now is a var so tests can pin the clock.

Functions

func Annotate

func Annotate(diffs []diffx.FileDiff, freshDays int) (bool, error)

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.

func Latest

func Latest(name string) (string, error)

Latest resolves `lockvet pkg ansible:<name>`: the collection's highest_version from the v3 index, falling back to the classic role index (newest stable tag) when no collection by that name exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL