mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-30 14:56:11 +00:00
fix(env): derive the image and container names from the distro under test
A compose deploy job labelled centos or arch built its stack image from pkgmgr-debian and ran it as infinito_nexus_debian (#794). distros.sh exports INFINITO_DISTRO per iteration and sources load.sh again, but the loader returned early because INFINITO_ENV_LOADED and the .env mtime were unchanged. A full reload would not have helped either: the debian values were already exported, so the restore step kept them as caller intent. load.sh now records the distro it loaded for. Another INFINITO_DISTRO defeats the early return and drops INFINITO_CONTAINER, INFINITO_PARENT_IMAGE and INFINITO_IMAGE, the three keys the env handlers derive from the distro. When the requested distro also differs from the one .env was generated for, the loader sources a set that `python -m cli.meta.env --output` generates for it in a private temp directory and leaves .env untouched, so a local multi-distro run does not switch the checkout's distro. A caller value set for the loaded distro still wins. Verified: tests/unit/python/scripts/meta/env/test_load.py and the new distros.sh case pass. Against main's loader both fail with the symptom of the issue: INFINITO_DISTRO=centos next to infinito_nexus_debian and pkgmgr-debian:stable, and distros.sh handing debian, arch and centos the same debian parent. shellcheck is clean. Consequence: CI jobs labelled arch, ubuntu, fedora or centos now build and deploy that distro, so a failure that shows up there was masked before. feature/store-i18n carries3f973eb137, which resolves the parent image for scripts/image/push.sh on its own, and05e4dbafcb, which inserts the INFINITO_INSTANCE slot check into the block this commit restructures. The merge keeps the slot check ahead of the distro check. Closes #794 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
789c1a1b63
commit
1079f48feb
7 files changed
+211
-17
No files matched your search
@@ -76,6 +76,17 @@ class TestDistrosLoop(unittest.TestCase):
|
||||
self.assertEqual(proc.returncode, 0, proc.stderr)
|
||||
self.assertEqual(sorted(record.split()), sorted(DISTROS.split()))
|
||||
|
||||
def test_every_distro_runs_with_a_parent_image_of_its_own(self) -> None:
|
||||
proc, record = self._run(
|
||||
DISTROS,
|
||||
'echo "${INFINITO_DISTRO} ${INFINITO_PARENT_IMAGE}" >> "${RECORD}"',
|
||||
INFINITO_CI_DISTRO_BUDGET_SECONDS="600",
|
||||
)
|
||||
self.assertEqual(proc.returncode, 0, proc.stderr)
|
||||
images = dict(line.split() for line in record.splitlines())
|
||||
self.assertEqual(sorted(images), sorted(DISTROS.split()))
|
||||
self.assertEqual(len(set(images.values())), len(images), images)
|
||||
|
||||
def test_the_command_inherits_the_env_layer(self) -> None:
|
||||
proc, record = self._run(
|
||||
"debian",
|
||||
|
||||
Reference in new issue
Block a user