NAME

Amazon::API::BuildInfo - build-time version and provenance metadata for Amazon::API

SYNOPSIS

use Amazon::API::BuildInfo;

my $info = Amazon::API::BuildInfo->version;

$info->{version};                     # Amazon::API version, e.g. '2.6.0'
$info->{commit};                      # the Amazon::API git commit it was built from
$info->{dirty};                       # commit, with a '-dirty' suffix if the tree was dirty
$info->{botocore_version}{version};   # the pinned botocore tag,    e.g. '1.43.74'
$info->{botocore_version}{commit};    # the pinned botocore commit

my ( $bc_version, $bc_commit ) = Amazon::API::BuildInfo->botocore_version;

DESCRIPTION

Amazon::API::BuildInfo records the identity of an Amazon::API build: its released version, the git commit it was built from (and whether that tree was dirty), and the botocore release the shipped service metadata was generated against.

The Amazon::API version and git identity are baked into the module at build time. The botocore pin is read at run time from the botocore-version.json that ships in the distribution's share directory (so it always reflects the botocore snapshot this Amazon::API was built against).

Downstream tooling relies on this as the single source of truth for "which versions produced this build" - the API build factory resolves the botocore tag to pin its platform image from ->version->{botocore_version}{version}, and the provenance records attest builds against it. The dirty field supports a build-hygiene check: a clean build has dirty equal to commit, so $info->{dirty} ne $info->{commit} detects a build made from an uncommitted working tree.

METHODS AND SUBROUTINES

version

my $info = Amazon::API::BuildInfo->version;

Returns a hash reference describing the build:

version

The Amazon::API release version (e.g. 2.6.0).

commit

The git commit Amazon::API was built from.

dirty

The same commit, suffixed with -dirty when the working tree was dirty at build time; equal to commit otherwise.

botocore_version

A hash reference { version => $tag, commit => $sha } naming the botocore release the shipped metadata was generated against, read from botocore-version.json.

Croaks if botocore-version.json cannot be located.

botocore_version

my ( $version, $commit ) = Amazon::API::BuildInfo->botocore_version;

Convenience accessor returning the pinned botocore release as a two-element list - the version (tag) and commit - equivalent to @{ Amazon::API::BuildInfo->version->{botocore_version} }{qw(version commit)}. Note that it returns a list, not a hash reference.

SEE ALSO

Amazon::API, Amazon::API::Provenance

AUTHOR

Rob Lauer - <rlauer@treasurersbriefcase.com>