Fail fast when gcloud setup commands error (#15)#56
Open
rahul188 wants to merge 1 commit into
Open
Conversation
The setup scripts ran gcloud enable/create calls without checking their exit status, so on a restricted account (e.g. missing serviceUsageAdmin or apiKeysAdmin) they kept going and wrote a .env with an empty/invalid MAPS_API_KEY. adk web then failed later with a confusing error. Now each gcloud call is checked and the script exits with a message naming the failed step and the IAM role likely needed. Also stop printing "Successfully created API Key" when the key couldn't be parsed. Fixes google#15
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.
Closes #15.
The
setup/setup_env.shscripts calledgcloud services enable, the MCP enable commands, and the API key creation without checking exit status. On an account with restricted IAM (e.g. missingroles/serviceusage.serviceUsageAdminorroles/serviceusage.apiKeysAdmin) the commands fail but the script keeps going and writes a.envwith an empty/invalidMAPS_API_KEY. Setup looks successful, thenadk webfails later with a confusing error.Changes
gcloud services enablecall; exit with a clear message and the IAM role likely needed.gcloud beta services mcp list/enablecalls instead of ignoring failures.The existing empty-key guard before writing
.envis kept as a final safety net.Both scripts pass
bash -n.