Skip to content

Testing module pull-request workflow#96

Closed
mmathieum wants to merge 4 commits intomasterfrom
mm/update-mt-sync-workflow
Closed

Testing module pull-request workflow#96
mmathieum wants to merge 4 commits intomasterfrom
mm/update-mt-sync-workflow

Conversation

@mmathieum
Copy link
Member

@mmathieum mmathieum self-assigned this Jan 30, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @mmathieum, 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 significantly enhances the MT setup GitHub Action by introducing greater flexibility and control over repository and submodule management within CI/CD workflows. It enables dynamic identification of repository types, conditional branch checkouts for pull requests in specific repository categories, and optional code synchronization, streamlining the setup process for various project structures.

Highlights

  • New Input Parameter: Introduced a new optional boolean input parameter code-sync to the MT setup action, allowing callers to control whether code synchronization from submodules should occur.
  • Dynamic Environment Variables: Added logic to dynamically set MT_IS_SUBMODULE and MT_IS_AGENCY_REPO environment variables based on the current GitHub repository, enabling more flexible conditional execution within the workflow.
  • PR Branch Checkout for Agency Repos: Implemented a new step to check out the pull request's branch for 'agency' repositories, facilitating scenarios where push commits might be required from the workflow itself.
  • Refined Submodule SHA Checkout: Updated the condition for checking out a specific build SHA for submodules, now relying on the MT_IS_SUBMODULE environment variable for more accurate targeting.
  • Conditional Code Synchronization: Added a new step MT code sync that conditionally executes ./commons/code_sync.sh based on the code-sync input parameter, providing explicit control over code synchronization.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/mt-sync-code-data.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.

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 pull request updates the setup composite action in the GitHub workflow. The changes introduce new inputs, add logic to set environment variables based on the repository context, and conditionally run steps based on these variables. The changes improve the flexibility and logging of the action. I've found a few areas for improvement regarding code clarity, maintainability, and idiomatic usage of GitHub Actions syntax. Specifically, I've suggested simplifying a long conditional, fixing a typo in a log message, and using a more concise syntax for a boolean check.

- name: MT set environement variables
shell: bash
run: |
MT_IS_SUBMODULE=${{ github.repository == 'mtransitapps/commons' || github.repository == 'mtransitapps/commons-java' || github.repository == 'mtransitapps/parser' || github.repository == 'mtransitapps/commons-android' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The condition to check if the repository is a submodule is quite long and can be hard to read and maintain. You can simplify this by using the contains and fromJSON functions available in GitHub Actions expressions. This makes the list of repositories easier to manage.

          MT_IS_SUBMODULE=${{ contains(fromJSON('["mtransitapps/commons", "mtransitapps/commons-java", "mtransitapps/parser", "mtransitapps/commons-android"]'), github.repository) }}

REPOSITORY_OWNER_AND_NAME=${{ github.repository }};
REPOSITORY_NAME=$(basename $REPOSITORY_OWNER_AND_NAME);
echo "Checking our this repo '$REPOSITORY_NAME' workflow sha '$MT_SHA':"
echo "[MT] > Checking our this repo '$REPOSITORY_NAME' workflow sha '$MT_SHA':"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's a typo in this log message. "our" should be "out".

          echo "[MT] > Checking out this repo '$REPOSITORY_NAME' workflow sha '$MT_SHA':"

@mmathieum mmathieum closed this Feb 3, 2026
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