Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
}
],
Expand Down
12 changes: 12 additions & 0 deletions tests/unit/test_stamp_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import importlib.util
import json
import re
import shutil
import tempfile
Expand Down Expand Up @@ -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()
Loading