galaxy.yml build_ignore: adds .ansible, .claude, .reuse, .venv, CLAUDE.md, HANDOFF.md, extensions, gitleaks-report.json, importer_result.json and roles/*/molecule. tests/scripts comes from main (#16), with no duplicate line here.
scripts/check_tarball.py (no shebang, not executable, because ansible-test sanity rejects one on a non-module file): allow-list check of the built archive.
top-level entries must be in ALLOWED_TOP; forbidden patterns compared case-insensitively: molecule dirs, *.pem, *.key, anything containing vault, *id_rsa*, *id_ed25519*, *.envrc, .env* variants, */.ssh and */.ssh/*, pycache, nested tarballs, importer_result.json. Widening to *vault* rejects any file name containing "vault" (none in the current build);
only regular files and directories (no symlinks, hardlinks, devices, fifos);
rejects absolute paths, empty/./.. components, backslashes, and control, zero-width, non-ASCII-space, surrogate, private-use and unassigned characters; the .git test compares after NFKC and case folding (full-width .git, .GIT);
rejects names that Windows or macOS extraction reads differently: a component ending in a space or dot, reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9, with or without extension), ::, 8.3 aliases of .git (GIT~1), components longer than 255 bytes (such names, e.g. aux.yml, would be rejected if a role ever used them);
duplicates are compared case-insensitively, a name used as both file and directory (COPYING and COPYING/x) is rejected, and normalisation strips one leading ./ and one trailing / only (a//b stays rejected);
rejects an empty archive and one lacking MANIFEST.json, FILES.json, COPYING, README.md, meta/runtime.yml or changelogs/changelog.yaml; an unreadable archive is one line, exit 1.
The docstring states that ansible-galaxy dereferences FILE symlinks, so the archive check cannot see them: the "Refuse symlinks in the source tree" step of build.yml is the only guard.
build.yml: step "Refuse symlinks in the source tree" (find prunes ./.git and ./.venv, which is only safe because both are skipped by the build: .venv is in galaxy.yml build_ignore, .git is excluded by ansible-galaxy; a comment says the two lists must stay in step) and "Check the archive contents". Both the archive check and the galaxy-importer step now fail with a clear message unless exactly one /tmp/dist/mortis-kamino-*.tar.gz matches, and pass it as one quoted argument.
lint.yml: unchanged from main; the "Test the repository scripts" step comes from #16.
tests/scripts/test_check_tarball.py: 31 tests. Added: widened forbidden names, each ambiguity rule, ordinary names still pass, normalisation, a required file present only as ./COPYING passes, a//b and ./a/b, case-insensitive duplicates, file/directory clash, test_real_build_passes (builds a real tarball with ansible-galaxy from a copy of the checkout and checks it; skipped with a message when ansible-galaxy is not on PATH) and BuildWorkflowTest (every directory build.yml prunes is in galaxy.yml build_ignore or is excluded by ansible-galaxy itself). The old test_required_set_matches_a_real_build (it only compared the set with a copy of itself) is replaced by the real-build test.
Changelog fragment minor_changes updated.
Verified
git archive of the merged head into a directory outside the clone, ansible-galaxy collection build with the clone venv: check_tarball.py passes ("27 entries, all allowed"; main's new files add one entry).
On the merged tree python3 -I -m unittest discover -s tests/scripts runs 65 tests (main's 34 plus these 31), all pass, including the real-build test (not skipped locally).
ansible-test sanity --test pep8 --test pylint --test shebang run locally on the script and the test file: clean.
CI at head ad2e4aa, steps observed: Build job success with "Refuse symlinks in the source tree", "Build the Collection", "Check the archive contents", "Run galaxy-importer" and "Run ansible-test sanity" all success; Lint job success with pre-commit, Check image pins, Check image versions were bumped, "Test the repository scripts", gitleaks scan and Conventional Commits. The Molecule job was still running when this was written.
Not verified
Whether test_real_build_passes ran or skipped in CI (the step passed; the step log was not read).
The "exactly one tarball" guard was not exercised with two tarballs in CI.
File symlinks remain guarded only by the source-tree step.
roles/*/molecule ignore against a real role (no roles exist yet); a future ansible-galaxy that renames a required member would need REQUIRED updated.
Behaviour of the name rules on an actual Windows/macOS extraction (rules follow the documented reserved names, not tested there).
Merge order
#16 is merged; #15, #17 and this PR no longer conflict with main or each other on the script-test step. This PR touches a different region of build.yml than #17.
## What changed (head ad2e4aa, main at f271730 merged in)
- galaxy.yml `build_ignore`: adds .ansible, .claude, .reuse, .venv, CLAUDE.md, HANDOFF.md, extensions, gitleaks-report.json, importer_result.json and `roles/*/molecule`. `tests/scripts` comes from main (#16), with no duplicate line here.
- `scripts/check_tarball.py` (no shebang, not executable, because `ansible-test sanity` rejects one on a non-module file): allow-list check of the built archive.
- top-level entries must be in ALLOWED_TOP; forbidden patterns compared case-insensitively: molecule dirs, `*.pem`, `*.key`, anything containing `vault`, `*id_rsa*`, `*id_ed25519*`, `*.envrc`, `.env*` variants, `*/.ssh` and `*/.ssh/*`, pycache, nested tarballs, importer_result.json. Widening to `*vault*` rejects any file name containing "vault" (none in the current build);
- only regular files and directories (no symlinks, hardlinks, devices, fifos);
- rejects absolute paths, empty/`.`/`..` components, backslashes, and control, zero-width, non-ASCII-space, surrogate, private-use and unassigned characters; the `.git` test compares after NFKC and case folding (full-width `.git`, `.GIT`);
- rejects names that Windows or macOS extraction reads differently: a component ending in a space or dot, reserved device names (CON, PRN, AUX, NUL, COM1-9, LPT1-9, with or without extension), `::`, 8.3 aliases of .git (`GIT~1`), components longer than 255 bytes (such names, e.g. `aux.yml`, would be rejected if a role ever used them);
- duplicates are compared case-insensitively, a name used as both file and directory (`COPYING` and `COPYING/x`) is rejected, and normalisation strips one leading `./` and one trailing `/` only (`a//b` stays rejected);
- rejects an empty archive and one lacking MANIFEST.json, FILES.json, COPYING, README.md, meta/runtime.yml or changelogs/changelog.yaml; an unreadable archive is one line, exit 1.
- The docstring states that ansible-galaxy dereferences FILE symlinks, so the archive check cannot see them: the "Refuse symlinks in the source tree" step of build.yml is the only guard.
- build.yml: step "Refuse symlinks in the source tree" (`find` prunes ./.git and ./.venv, which is only safe because both are skipped by the build: .venv is in galaxy.yml build_ignore, .git is excluded by ansible-galaxy; a comment says the two lists must stay in step) and "Check the archive contents". Both the archive check and the galaxy-importer step now fail with a clear message unless exactly one `/tmp/dist/mortis-kamino-*.tar.gz` matches, and pass it as one quoted argument.
- lint.yml: unchanged from main; the "Test the repository scripts" step comes from #16.
- `tests/scripts/test_check_tarball.py`: 31 tests. Added: widened forbidden names, each ambiguity rule, ordinary names still pass, normalisation, a required file present only as `./COPYING` passes, `a//b` and `./a/b`, case-insensitive duplicates, file/directory clash, `test_real_build_passes` (builds a real tarball with ansible-galaxy from a copy of the checkout and checks it; skipped with a message when ansible-galaxy is not on PATH) and `BuildWorkflowTest` (every directory `build.yml` prunes is in galaxy.yml build_ignore or is excluded by ansible-galaxy itself). The old `test_required_set_matches_a_real_build` (it only compared the set with a copy of itself) is replaced by the real-build test.
- Changelog fragment `minor_changes` updated.
## Verified
- `git archive` of the merged head into a directory outside the clone, `ansible-galaxy collection build` with the clone venv: `check_tarball.py` passes ("27 entries, all allowed"; main's new files add one entry).
- On the merged tree `python3 -I -m unittest discover -s tests/scripts` runs 65 tests (main's 34 plus these 31), all pass, including the real-build test (not skipped locally).
- `ansible-test sanity --test pep8 --test pylint --test shebang` run locally on the script and the test file: clean.
- CI at head ad2e4aa, steps observed: Build job success with "Refuse symlinks in the source tree", "Build the Collection", "Check the archive contents", "Run galaxy-importer" and "Run ansible-test sanity" all success; Lint job success with pre-commit, Check image pins, Check image versions were bumped, "Test the repository scripts", gitleaks scan and Conventional Commits. The Molecule job was still running when this was written.
## Not verified
- Whether `test_real_build_passes` ran or skipped in CI (the step passed; the step log was not read).
- The "exactly one tarball" guard was not exercised with two tarballs in CI.
- File symlinks remain guarded only by the source-tree step.
- `roles/*/molecule` ignore against a real role (no roles exist yet); a future ansible-galaxy that renames a required member would need REQUIRED updated.
- Behaviour of the name rules on an actual Windows/macOS extraction (rules follow the documented reserved names, not tested there).
## Merge order
#16 is merged; #15, #17 and this PR no longer conflict with main or each other on the script-test step. This PR touches a different region of build.yml than #17.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Extend galaxy.yml build_ignore (extensions, role molecule scenarios, CLAUDE.md, tool
directories, tests/scripts) and add scripts/check_tarball.py, an allow-list check run
by the Build workflow after the Collection build and before galaxy-importer.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
check_tarball.py now iterates the tar members instead of their names. Only regular
files and directories are allowed, so a symlink or hardlink cannot smuggle a
file in under an allowed directory. Absolute paths and paths with an empty, '.',
'..' or '.git' component are rejected, so roles/../.venv/x no longer passes the
top-level allow list. Tests build crafted tarballs and run the script on them.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
check_tarball.py now compares path components case-insensitively (.GIT,
Molecule), rejects backslashes and control or zero-width characters,
duplicate members, an empty archive and a missing REQUIRED file, and
reports an unreadable archive as one line. Drop the shebang and the
executable bit and pass check= to subprocess.run so ansible-test sanity
passes.
ansible-galaxy dereferences symlinks, which the archive check cannot see,
so the Build workflow fails when the source tree holds a symlink.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
The forbidden names widen to anything containing "vault", SSH keys, .envrc and
.env* files. Names that Windows or macOS extraction would read differently are
rejected (trailing space or dot, reserved device names, "::", 8.3 aliases of
.git, non-ASCII spaces, surrogate/private-use/unassigned characters, components
over 255 bytes), and the .git test compares after NFKC and case folding.
Duplicates are compared case-insensitively, a name that is both a file and a
directory is rejected, and only one slash is stripped. A unit test builds a real
tarball with ansible-galaxy, another asserts the directories build.yml prunes are
in galaxy.yml build_ignore, lint.yml runs tests/scripts, and the Build workflow
fails unless exactly one tarball matches. The docstring states that file
symlinks are invisible to the archive check.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What changed (head
ad2e4aa, main atf271730merged in)build_ignore: adds .ansible, .claude, .reuse, .venv, CLAUDE.md, HANDOFF.md, extensions, gitleaks-report.json, importer_result.json androles/*/molecule.tests/scriptscomes from main (#16), with no duplicate line here.scripts/check_tarball.py(no shebang, not executable, becauseansible-test sanityrejects one on a non-module file): allow-list check of the built archive.*.pem,*.key, anything containingvault,*id_rsa*,*id_ed25519*,*.envrc,.env*variants,*/.sshand*/.ssh/*, pycache, nested tarballs, importer_result.json. Widening to*vault*rejects any file name containing "vault" (none in the current build);./..components, backslashes, and control, zero-width, non-ASCII-space, surrogate, private-use and unassigned characters; the.gittest compares after NFKC and case folding (full-width.git,.GIT);::, 8.3 aliases of .git (GIT~1), components longer than 255 bytes (such names, e.g.aux.yml, would be rejected if a role ever used them);COPYINGandCOPYING/x) is rejected, and normalisation strips one leading./and one trailing/only (a//bstays rejected);findprunes ./.git and ./.venv, which is only safe because both are skipped by the build: .venv is in galaxy.yml build_ignore, .git is excluded by ansible-galaxy; a comment says the two lists must stay in step) and "Check the archive contents". Both the archive check and the galaxy-importer step now fail with a clear message unless exactly one/tmp/dist/mortis-kamino-*.tar.gzmatches, and pass it as one quoted argument.tests/scripts/test_check_tarball.py: 31 tests. Added: widened forbidden names, each ambiguity rule, ordinary names still pass, normalisation, a required file present only as./COPYINGpasses,a//band./a/b, case-insensitive duplicates, file/directory clash,test_real_build_passes(builds a real tarball with ansible-galaxy from a copy of the checkout and checks it; skipped with a message when ansible-galaxy is not on PATH) andBuildWorkflowTest(every directorybuild.ymlprunes is in galaxy.yml build_ignore or is excluded by ansible-galaxy itself). The oldtest_required_set_matches_a_real_build(it only compared the set with a copy of itself) is replaced by the real-build test.minor_changesupdated.Verified
git archiveof the merged head into a directory outside the clone,ansible-galaxy collection buildwith the clone venv:check_tarball.pypasses ("27 entries, all allowed"; main's new files add one entry).python3 -I -m unittest discover -s tests/scriptsruns 65 tests (main's 34 plus these 31), all pass, including the real-build test (not skipped locally).ansible-test sanity --test pep8 --test pylint --test shebangrun locally on the script and the test file: clean.ad2e4aa, steps observed: Build job success with "Refuse symlinks in the source tree", "Build the Collection", "Check the archive contents", "Run galaxy-importer" and "Run ansible-test sanity" all success; Lint job success with pre-commit, Check image pins, Check image versions were bumped, "Test the repository scripts", gitleaks scan and Conventional Commits. The Molecule job was still running when this was written.Not verified
test_real_build_passesran or skipped in CI (the step passed; the step log was not read).roles/*/moleculeignore against a real role (no roles exist yet); a future ansible-galaxy that renames a required member would need REQUIRED updated.Merge order
#16 is merged; #15, #17 and this PR no longer conflict with main or each other on the script-test step. This PR touches a different region of build.yml than #17.
🤖 Generated with Claude Code
Claude referenced this pull request2026-10-25 19:58:34 +00:00