-
Notifications
You must be signed in to change notification settings - Fork 574
fix(helpers/setup-sa.sh): swap deprecated output cli option #1021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(helpers/setup-sa.sh): swap deprecated output cli option #1021
Conversation
Summary of ChangesHello @sambilbow, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue where a deprecated output suppression flag was being used in the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly updates gcloud commands in helpers/setup-sa.sh by replacing the deprecated --user-output-enabled false flag with the current --no-user-output-enabled. The changes are accurate and address the issue.
While the changes are correct, I've identified opportunities to improve the script's maintainability by reducing significant code duplication. I recommend addressing these in a follow-up pull request.
-
Granting Organization IAM roles (lines 161-215): This section contains many nearly identical
gcloud organizations add-iam-policy-bindingcommands. This can be refactored into a loop over an array of roles to make it more concise and easier to manage:ORG_ROLES=( "roles/resourcemanager.organizationViewer" "roles/resourcemanager.projectCreator" "roles/billing.user" "roles/billing.viewer" "roles/compute.xpnAdmin" "roles/compute.networkAdmin" "roles/iam.serviceAccountAdmin" ) for role in "${ORG_ROLES[@]}"; do echo "Adding role ${role} to organization..." gcloud organizations add-iam-policy-binding \ "${ORG_ID}" \ --member="serviceAccount:${SA_ID}" \ --role="${role}" \ --no-user-output-enabled done
-
Enabling APIs (lines 227-249): The
gcloud services enablecommand is called multiple times. It can accept a list of services, which simplifies this section significantly:gcloud services enable \ cloudresourcemanager.googleapis.com \ cloudbilling.googleapis.com \ billingbudgets.googleapis.com \ iam.googleapis.com \ admin.googleapis.com \ appengine.googleapis.com \ --project "${SEED_PROJECT}"
Fixes #1020 by using latest options in documentation