Skip to content

chore(ci): enable workflows and scripts on preview#15581

Open
noahdietz wants to merge 4 commits intogoogleapis:mainfrom
noahdietz:preview-workflows
Open

chore(ci): enable workflows and scripts on preview#15581
noahdietz wants to merge 4 commits intogoogleapis:mainfrom
noahdietz:preview-workflows

Conversation

@noahdietz
Copy link
Contributor

@noahdietz noahdietz commented Feb 18, 2026

Updates branch-based workflows to also run on pull requests against preview branch, and set the TARGET_BRANCH (derived from Context variables github.base_ref for PRs, and github.event.merge_group.base_ref for merge_group) environment variable for the testing scripts to reference in their git comparison operations.

http://b/450631301

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @noahdietz, 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 enhances the continuous integration setup by enabling workflows to run against the preview branch and introducing a dynamic TARGET_BRANCH variable. These changes improve the flexibility and accuracy of CI checks, ensuring that testing scripts correctly identify the base branch for comparison operations, thereby streamlining the development and merging process for features targeting different environments.

Highlights

  • CI Workflow Expansion: Branch-based workflows are now configured to also execute on pull requests targeting the preview branch, extending CI coverage.
  • Dynamic Target Branching: A new TARGET_BRANCH environment variable is introduced, derived from GitHub context variables (github.base_ref for PRs and github.event.merge_group.base_ref for merge groups), allowing CI scripts to dynamically reference the correct base branch for Git operations.
  • Script Modernization: The ci/run_conditional_tests.sh script has been updated to utilize the new TARGET_BRANCH variable, replacing hardcoded references to main for git diff and git fetch commands.
Changelog
  • ci/run_conditional_tests.sh
    • Introduced TARGET_BRANCH variable, defaulting to main if not set.
    • Modified GIT_DIFF_ARG for 'presubmit' builds to use origin/$TARGET_BRANCH... instead of origin/main....
    • Updated git fetch commands for both 'presubmit' and 'continuous' builds to fetch from origin $TARGET_BRANCH.
Ignored Files
  • Ignored by pattern: .github/workflows/** (3)
    • .github/workflows/docs.yml
    • .github/workflows/lint.yml
    • .github/workflows/unittest.yml
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.

@noahdietz noahdietz marked this pull request as ready for review February 18, 2026 22:34
@noahdietz noahdietz requested review from a team as code owners February 18, 2026 22:34
Copy link
Contributor

@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 PR updates the CI scripts to support running against different target branches, such as preview, by correctly parameterizing the target branch. However, it introduces a security risk due to several instances of unquoted shell variables in ci/run_conditional_tests.sh, particularly TARGET_BRANCH in git fetch commands, which could lead to command injection. Unquoted variables also make the script fragile. It is recommended to quote all shell variables for robustness and security, and use bash-specific constructs like [[ ... ]] for comparisons.

noahdietz and others added 3 commits February 18, 2026 22:41
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

1 participant

Comments