Skip to content

chore(guards): image pinning check as a pytest guard, allowlist for scripts/ - #235

Merged
amenegola merged 1 commit into
mainfrom
chore/image-pinning-guard
Nov 17, 2026
Merged

amenegola merged 1 commit into
mainfrom
chore/image-pinning-guard

Conversation

@amenegola

Copy link
Copy Markdown
Collaborator
  • Move scripts/check_image_pinning.sh to tests/guards/test_image_pinning.py. Same rule (Layer 5 workloads must not set image / image_uri from a variable), same files, same message. make test-terraform runs the test instead of the script, so make test-all and the agent build prerequisites still enforce it; make test-guards now runs it too. Delete the script.
  • Add tests/guards/test_scripts_dir.py:
    • every file in scripts/ must be on an allowlist with a reason (new logic goes into the esmeralda CLI, static checks into tests/guards/);
    • the Makefile, git hooks and CLI may only call allowlisted scripts that exist;
    • scripts/README.md must list exactly the scripts.
  • scripts/README.md: drop the check_image_pinning.sh row and point to the new guards.

No behavior change for deploys: the same static check, run by pytest. No dev test needed: no deploy, verify, build or release path is touched.

Checks: make test, make test-guards, make test-terraform, make docs-build (strict), esmeralda guard --diff origin/main...HEAD.

…cripts/

Move scripts/check_image_pinning.sh to tests/guards/test_image_pinning.py (same rule and message: Layer 5 workloads must not set image or image_uri from a variable). make test-terraform runs that test instead of the script, and make test-guards now runs it too. Add tests/guards/test_scripts_dir.py: every file in scripts/ is on an allowlist with a reason, the Makefile, git hooks and CLI only call allowlisted scripts that exist, and scripts/README.md (when present) lists exactly the scripts. No behavior change for deploys.
@amenegola
amenegola merged commit bc1e3cc into main Nov 17, 2026
10 checks passed
@amenegola
amenegola deleted the chore/image-pinning-guard branch November 17, 2026 01:38
@amenegola amenegola mentioned this pull request Nov 17, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant