Skip to content

Conversation

@sambilbow
Copy link

Fixes #1020 by using latest options in documentation

@sambilbow sambilbow requested review from a team and imrannayer as code owners November 27, 2025 17:16
@gemini-code-assist
Copy link

Summary of Changes

Hello @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 gcloud CLI commands within the setup-sa.sh helper script. By updating to the recommended --no-user-output-enabled flag, the script now adheres to the latest gcloud documentation, ensuring robust and silent execution of service account and IAM related operations.

Highlights

  • Deprecated CLI Option Fix: The pull request updates the gcloud CLI option for suppressing user output from --user-output-enabled false to the currently supported --no-user-output-enabled.
  • Script Modernization: This change ensures the helpers/setup-sa.sh script remains compatible with the latest gcloud SDK, preventing potential issues or warnings related to deprecated flags.
  • Silent Command Execution: The modification affects several gcloud commands within the script, maintaining their intended silent execution for tasks like service account key creation and IAM policy bindings.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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.

  1. Granting Organization IAM roles (lines 161-215): This section contains many nearly identical gcloud organizations add-iam-policy-binding commands. 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
  2. Enabling APIs (lines 227-249): The gcloud services enable command 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}"

@sambilbow sambilbow changed the title fix/deprecated output cli option fix (helpers/setup-sa.sh) deprecated output cli option Nov 27, 2025
@sambilbow sambilbow changed the title fix (helpers/setup-sa.sh) deprecated output cli option fix (helpers/setup-sa.sh): swap deprecated output cli option Nov 27, 2025
@sambilbow sambilbow changed the title fix (helpers/setup-sa.sh): swap deprecated output cli option fix(helpers/setup-sa.sh): swap deprecated output cli option Nov 27, 2025
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.

setup-sa.sh fails due to outdated gcloud cli option

1 participant