From 4f636acfaaeb37d061e6afe561e41e84c03d8b9e Mon Sep 17 00:00:00 2001 From: Joseph Mearman Date: Sun, 4 Oct 2026 09:40:54 +0100 Subject: [PATCH] fix(release): commit the cluster role's stamped version with the release The release stamped github_runner_cluster_collection_version into the build but committed only the ARC defaults, so the tag the fleet installs from kept the placeholder and every node's deployed version read as unset. A test requires every stamped file to be among the release's commit assets. --- .releaserc.json | 2 +- tests/unit/test_stamp_version.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.releaserc.json b/.releaserc.json index 2c15d0e..1b7f1ee 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -38,7 +38,7 @@ [ "@semantic-release/git", { - "assets": ["CHANGELOG.md", "galaxy.yml", "roles/github_runner_arc/defaults/main.yml"], + "assets": ["CHANGELOG.md", "galaxy.yml", "roles/github_runner_arc/defaults/main.yml", "roles/github_runner_cluster/defaults/main.yml"], "message": "chore(release): ${nextRelease.version} [skip ci]" } ], diff --git a/tests/unit/test_stamp_version.py b/tests/unit/test_stamp_version.py index 6b537ce..fb1e8ac 100644 --- a/tests/unit/test_stamp_version.py +++ b/tests/unit/test_stamp_version.py @@ -3,6 +3,7 @@ from __future__ import annotations import importlib.util +import json import re import shutil import tempfile @@ -44,6 +45,17 @@ def test_stamping_a_copy_of_the_repository_files_changes_every_version_variable( for defaults, var_name in module.VERSION_VARS: self.assertRegex(defaults.read_text(), rf'(?m)^{var_name}: "{re.escape(VERSION)}"$') + def test_every_file_the_script_stamps_is_committed_by_the_release(self) -> None: + """A stamped file missing from the git plugin's assets is stamped in the release build but never reaches the tag the fleet installs from.""" + spec = importlib.util.spec_from_file_location("stamp_version", SCRIPT) + assert spec is not None and spec.loader is not None + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + config = json.loads((REPO_ROOT / ".releaserc.json").read_text()) + assets = next(plugin[1]["assets"] for plugin in config["plugins"] if isinstance(plugin, list) and plugin[0] == "@semantic-release/git") + stamped = {path.relative_to(REPO_ROOT).as_posix() for path in (module.GALAXY_YML, module.ARC_DEFAULTS, module.CLUSTER_DEFAULTS)} + self.assertLessEqual(stamped, set(assets)) + if __name__ == "__main__": unittest.main()