Skip to content

tests: resolve Alpine fixture versions from the live APKINDEX#113

Merged
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:fix-fetch-fixtures-versions
Jun 28, 2026
Merged

tests: resolve Alpine fixture versions from the live APKINDEX#113
jserv merged 1 commit into
sysprog21:mainfrom
Max042004:fix-fetch-fixtures-versions

Conversation

@Max042004

@Max042004 Max042004 commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

The fixture builder pinned an exact version for every Alpine package and for the minirootfs tarball. Alpine's mirror keeps only the latest build of each package, so a pinned version 404s as soon as a newer build lands upstream — forcing a manual version bump on every refresh just to keep the test fixtures fetchable.

Resolve versions dynamically instead:

  • PKGS becomes a plain "repo:name" list; resolve_versions() downloads each repo's APKINDEX and fills PKG_VERSION[repo:name] with whatever the CDN currently serves.
  • resolve_minirootfs() picks the newest minirootfs the releases listing advertises (ALPINE_PATCH still pins one explicitly when set).
  • A versions.lock manifest records the resolved set; when it changes the staged rootfs/kernel/initramfs are rebuilt so a mirror bump actually takes effect instead of reusing stale apks.
  • Both resolvers fall back to the cache when the mirror is unreachable, preserving warm offline re-runs, and error cleanly when neither the mirror nor a cache is available.

Summary by cubic

Resolve Alpine test fixture versions from the live APKINDEX to prevent 404s from stale pins and remove manual bumps. Auto-pick the newest minirootfs and rebuild the staged tree when versions change, with offline cache fallback.

  • New Features
    • PKGS now "repo:name"; resolve_versions reads live APKINDEX, caches "name version", and fills PKG_RESOLVED as "repo:name:version".
    • resolve_minirootfs selects the newest release and writes it to ALPINE_PATCH (still honors an explicit pin).
    • versions.lock records packages + minirootfs; any diff sets REBUILD=1 to rebuild the whole staged tree (including x86_64).
    • Offline fallback reuses cached indexes/tarballs and errors cleanly if no cache is available.

Written for commit 34bf78e. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Re-trigger cubic

The fixture builder pinned an exact version for every Alpine package and
for the minirootfs tarball.  Alpine's mirror keeps only the latest build
of each package, so a pinned version 404s as soon as a newer build lands
upstream -- forcing a manual version bump on every refresh just to keep
the test fixtures fetchable (linux-virt alone churned 6.12.85 -> .91 ->
.94 across recent weeks).

Resolve versions dynamically instead, staying within the bash 3.2 subset
the harness now targets (no associative arrays):

  - PKGS becomes a plain "repo:name" list.  resolve_versions() downloads
    each repo's APKINDEX, flattens it to a cached "name version" table,
    and fills PKG_RESOLVED with "repo:name:version" tuples -- the same
    shape the staging loops and pkg_version already consume.
  - resolve_minirootfs() picks the newest point release the releases
    listing advertises and writes it back to ALPINE_PATCH so the x86_64
    path reuses the same patch.  ALPINE_PATCH still pins one when set.
  - A versions.lock manifest records the resolved set; when it changes the
    staged rootfs/kernel/initramfs (and x86_64 tree) are rebuilt so a
    mirror bump actually takes effect instead of reusing stale apks.
  - Both resolvers fall back to the cache when the mirror is unreachable,
    preserving warm offline re-runs, and error cleanly when neither the
    mirror nor a cache is available.

Verified on stock /bin/bash 3.2.57: cold build, warm idempotent re-run,
INCLUDE_X86_64=1, offline warm fallback, lockfile-driven rebuild, and the
offline+empty-cache error path.
@Max042004 Max042004 force-pushed the fix-fetch-fixtures-versions branch from bd1cd02 to 34bf78e Compare June 28, 2026 17:01
@jserv jserv merged commit 0f3717b into sysprog21:main Jun 28, 2026
4 checks passed
@jserv

jserv commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Thank @Max042004 for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants