Files
computer-playbook/utils/update
kevinveenbirkenbachandClaude Opus 5 cb8707af06 feat(addons): let an addon declare the architectures it runs on
jenkins-1.1.0.tar.gz carries plugin-linux-amd64, plugin-darwin-amd64 and
plugin-windows-amd64.exe, and nothing for linux/arm64 (read from the tarball
itself). Mattermost installs and enables the plugin anyway, then logs

  jenkins: failed to apply option: backend executable not found for
  environment: linux/arm64

and drops it from the active set, so addons/mattermost-plugin-jenkins.spec.js
asserted against a plugin the server had already refused. v1.1.0 is the last
release since 2020-06-19, so there is nothing to wait for upstream.

Turning the addon off outright would lose it on amd64 too. The architecture is
knowable at deploy time - ansible.cfg gathers facts and tasks/utils/addon.yml
already resolves MATTERMOST_HOST_NODE and delegates to it, so even a mixed
swarm cluster names the node whose kernel decides - but not where the addon
declares itself: test_addon_enabled_renders_to_bool renders every `enabled`
against group_vars plus role names only, and an expression that cannot resolve
there does not fail, it coerces to False and switches the addon off in every
run. Run 34893363518 lost web-app-nextcloud that way.

So the declaration stays static and the gate moves to the task:

  meta/addons/*.yml   architectures: [amd64]      what the addon can run on
  tasks/utils/addon.yml                           skips provision, enable and
                                                  the integration hook when the
                                                  hosting node is something else
  playwright.env.j2   MATTERMOST_ARCHITECTURE     so the spec skips with it

HOST_ARCHITECTURE_BY_KERNEL maps ansible_architecture to the tokens the deploy
matrix rotates. It is deliberately not SYS_SVC_CONTAINER_DPKG_ARCH_BY_ANSIBLE_ARCH:
that table speaks dpkg (armhf, ppc64el), and an OCI/matrix token is a different
namespace that happens to agree on two entries.

The schema check rejects anything outside ARCHITECTURES rather than narrowing
silently, mirroring get_role_architectures: an unknown token matches no host
and would drop the addon from every deploy while every run stayed green.

Rendered through Templar, the gate yields a real bool in all six combinations
of {no architectures, [amd64]} x {x86_64, aarch64, armv7l}, and the six other
Mattermost addons - which declare none - stay True throughout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-12 16:07:11 +02:00
..