Repository navigation
chore(guards): image pinning check as a pytest guard, allowlist for scripts/ - #235
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/check_image_pinning.shtotests/guards/test_image_pinning.py. Same rule (Layer 5 workloads must not setimage/image_urifrom a variable), same files, same message.make test-terraformruns the test instead of the script, somake test-alland the agent build prerequisites still enforce it;make test-guardsnow runs it too. Delete the script.tests/guards/test_scripts_dir.py:scripts/must be on an allowlist with a reason (new logic goes into theesmeraldaCLI, static checks intotests/guards/);scripts/README.mdmust list exactly the scripts.scripts/README.md: drop thecheck_image_pinning.shrow 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.