mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 22:37:29 +00:00
fix(packages): keep Blender off centos arm64 only, arm64 elsewhere
PR #1424's Blender#0 batch (run 42540252191) died on centos aarch64
with "community.general.flatpak: Nothing matches org.blender.Blender in
remote flathub": centos installs Blender from Flathub, which publishes
it for x86_64 only, and CentOS Stream 10 has no other source (no EPEL 10
package, official tarballs linux-x64 only). Debian, Ubuntu, Fedora and
Manjaro ARM ship aarch64 Blender, so a role-wide amd64 pin would drop
arm64 coverage there for nothing.
- meta/packages.yml: blender.centos declares architectures: [amd64];
utils/packages/schema.py validates the key, rejects unknown entry
keys, and registry.py rejects an entry key at id level, so a typo
cannot silently drop the narrowing.
- CI matrix (utils/github/variant/pins.py, axes.py,
cli/meta/ci/validate.py): rows keep their distro and architecture
rotation; only a (distro, arch) pair whose packages are not published
moves, a pinned %centos:arm64 is refused with one line, and a broken
registry is refused instead of raising a traceback.
- ci trigger --failed (cli/administration/deploy/ci/selections.py)
replays such a failed job with its distro and without the refused
architecture, warning about it, instead of aborting the dispatch.
- package_install refuses before any module runs on a host whose
architecture the entry does not publish, reading
HOST_ARCHITECTURE_BY_KERNEL from group_vars; removal is not refused.
- Docs: .github/workflows/README.md and ADR 0002 describe the
per-(distro, arch) narrowing.
Accepted MEDUSA finding: MEDUSA-FTSCAN-231 (critical, SQL injection
signature) on plugins/action/package_install.py, the unchanged failure
message "could not gather facts from the delegation target"; present on
origin/main 63e933e413 at line 250, the plugin has no SQL or database
sink, reviewed with kvb-think-criticize as a false positive.
🎯 Fix: 90 %
💥 Break: 4 %
💸 Cost: –
⏱️ Time: –
🛡️ Security: 100 %
🏆 Score: 86
🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 %
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
63e933e413
commit
0273618c32
18 files changed
+724
-21
No files matched your search
@@ -2,8 +2,10 @@ from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
import unittest.mock as mock
|
||||
from typing import ClassVar
|
||||
|
||||
from utils.github.variant import axes, network, pins, pools
|
||||
from utils.packages.schema import PackagesShapeError
|
||||
from utils.roles.display import display_names
|
||||
from utils.roles.mapping import (
|
||||
ROLE_FILE_META_DOMAINS,
|
||||
@@ -1022,6 +1024,98 @@ class TestArchitectureAxis(unittest.TestCase):
|
||||
):
|
||||
_assign(rows, sweep=0, network_input="auto", variants_per_app=_VARIANTS)
|
||||
|
||||
_CENTOS_AMD64_ONLY: ClassVar[dict] = {"web-app-b": {"centos": frozenset({"amd64"})}}
|
||||
|
||||
def _pairs(self, rows, published, sweeps=range(1)) -> set[tuple[str, str]]:
|
||||
with mock.patch.object(pins, "published_architectures", return_value=published):
|
||||
return {
|
||||
(entry["distro"], entry["architecture"])
|
||||
for sweep in sweeps
|
||||
for entry in _assign(
|
||||
rows,
|
||||
sweep=sweep,
|
||||
network_input="clearnet",
|
||||
variants_per_app=_VARIANTS,
|
||||
)
|
||||
}
|
||||
|
||||
def test_an_unpublished_pair_is_never_planned_and_every_other_is(self) -> None:
|
||||
rows = [_row("web-app-b", index, ("compose",)) for index in range(10)]
|
||||
drawn = self._pairs(rows, self._CENTOS_AMD64_ONLY, sweeps=range(4))
|
||||
self.assertNotIn(("centos", "arm64"), drawn)
|
||||
self.assertEqual(
|
||||
drawn,
|
||||
{
|
||||
(distro, architecture)
|
||||
for distro in pools.DISTROS
|
||||
for architecture in pools.ARCHITECTURES
|
||||
}
|
||||
- {("centos", "arm64")},
|
||||
)
|
||||
|
||||
def test_a_service_package_narrows_the_row_like_its_own(self) -> None:
|
||||
rows = [
|
||||
{**_row("web-app-c", index, ("compose",)), "services": ["web-app-b"]}
|
||||
for index in range(10)
|
||||
]
|
||||
self.assertNotIn(
|
||||
("centos", "arm64"),
|
||||
self._pairs(rows, self._CENTOS_AMD64_ONLY, sweeps=range(4)),
|
||||
)
|
||||
|
||||
def test_a_published_everywhere_row_draws_what_it_drew_before(self) -> None:
|
||||
rows = [_row("web-app-b", index, ("compose",)) for index in range(10)]
|
||||
entries = _assign(
|
||||
rows, sweep=3, network_input="clearnet", variants_per_app=_VARIANTS
|
||||
)
|
||||
self.assertEqual(
|
||||
[(entry["distro"], entry["architecture"]) for entry in entries],
|
||||
[
|
||||
(
|
||||
pools.rotate(pools.DISTROS, index, 3),
|
||||
pools.rotate(pools.ARCHITECTURES, index, 3),
|
||||
)
|
||||
for index in range(10)
|
||||
],
|
||||
)
|
||||
|
||||
def test_a_pinned_distro_keeps_the_architecture_it_is_published_for(self) -> None:
|
||||
rows = [
|
||||
_row("web-app-b", index, ("compose",), pin_distro="centos")
|
||||
for index in range(4)
|
||||
]
|
||||
self.assertEqual(
|
||||
self._pairs(rows, self._CENTOS_AMD64_ONLY), {("centos", "amd64")}
|
||||
)
|
||||
|
||||
def test_a_pinned_unpublished_pair_aborts_the_matrix(self) -> None:
|
||||
rows = [
|
||||
_row(
|
||||
"web-app-b",
|
||||
0,
|
||||
("compose",),
|
||||
pin_distro="centos",
|
||||
pin_architecture="arm64",
|
||||
)
|
||||
]
|
||||
with self.assertRaises(SystemExit) as caught:
|
||||
self._pairs(rows, self._CENTOS_AMD64_ONLY)
|
||||
self.assertIn("not published", str(caught.exception))
|
||||
|
||||
def test_an_unparsable_registry_refuses_in_one_line(self) -> None:
|
||||
with (
|
||||
mock.patch.object(
|
||||
pins,
|
||||
"published_architectures",
|
||||
side_effect=PackagesShapeError("meta/packages.yml: app.centos bad"),
|
||||
),
|
||||
self.assertRaises(SystemExit) as caught,
|
||||
):
|
||||
pins.row_pairs("web-app-b", pools.DISTROS, pools.ARCHITECTURES)
|
||||
self.assertEqual(
|
||||
str(caught.exception), "web-app-b: meta/packages.yml: app.centos bad"
|
||||
)
|
||||
|
||||
def test_the_architecture_survives_the_label_round_trip(self) -> None:
|
||||
entry = _assign(
|
||||
[_row("web-app-a", 0, ("swarm",))],
|
||||
|
||||
Reference in new issue
Block a user