Repository navigation
fix(3-security): add --project and --prefix filtering to validation.sh - #427
Open
johnlakeee wants to merge 1 commit into
Open
johnlakeee wants to merge 1 commit into
johnlakeee wants to merge 1 commit into
Conversation
8 tasks done
aghassemlouei
requested changes
Nov 17, 2026
aghassemlouei
left a comment
Member
There was a problem hiding this comment.
Thanks for adding --project and --prefix filtering to fast/stages-aw/3-security/validation.sh. Reviewing the argument parser and filter construction surfaced two shell edge cases along with a pull request template gap:
- In
fast/stages-aw/3-security/validation.shlines 25 and 41,if [ $# -lt 2 ] || [ -z "$2" ]does not check whether$2begins with-, so runningbash validation.sh --prefix --helpsilently consumes--helpasPREFIX_FILTERinstead of reporting a missing value. Adding|| [[ "$2" == -* ]]to both--projectand--prefixchecks prevents flag values from consuming subsequent options. - In
fast/stages-aw/3-security/validation.shline 76,PROJECT_FILTER="projectId~'^${PREFIX_FILTER}-prod-iac-core-0$'"interpolatesPREFIX_FILTERdirectly into a single-quotedgcloud --filterregular expression. ValidatingPREFIX_FILTERagainst^[a-z0-9-]+$andPROJECT_OVERRIDEagainst^[a-z][a-z0-9-]{4,28}[a-z0-9]$during flag parsing prevents unexpected regex or quote characters from altering thegcloud projects listfilter. - Please also include the
## Deployment & Compliance Impactand## Checklistsections from.github/pull_request_template.mdin the pull request description.
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.
Description
fast/stages-aw/3-security/validation.shpreviously failed whenever multiple-prod-iac-core-0projects existed in the same organization (multi-tenant or multi-enclave deployments).--project PROJECT_IDand--prefix PREFIXCLI flags (preserving default discovery when omitted)gcloudshell testtests/test_validation_sh.shPart of #388 (Milestone 1 — Group A, PR 6 of 6).
Type of Change
Testing Performed
bash tests/test_validation_sh.shandbash tests/test_shell_syntax.sh(33 scripts, 0 failures)terraform fmt -check -recursive,terraform validate,tflint(155 directories, 0 failed)pytest: 131 passed