Skip to content

Script Update: Fetch upstream remote for each submodule#5964

Merged
juliawu merged 4 commits intodatacommonsorg:masterfrom
juliawu:submodule-update
Feb 5, 2026
Merged

Script Update: Fetch upstream remote for each submodule#5964
juliawu merged 4 commits intodatacommonsorg:masterfrom
juliawu:submodule-update

Conversation

@juliawu
Copy link
Contributor

@juliawu juliawu commented Feb 4, 2026

As a followup to #5953, this PR further refines the update_git_submodules.sh script.

Currently, the script assumes the name of the upstream remote is the same across all submodules, and matches the name used in the website repo. This breaks for when the names don't match. For example, the upstream for the website repo is a fork named 'dc' while the submodules use 'origin' pointing directly to datacommonsorg repos directly. In this case, the script will throw an error that 'dc' can't be found in the submodules.

This PR updates the script logic to search for the remote that matches datacommonsorg in the URL for each submodule to update.

@juliawu juliawu requested a review from dwnoble February 4, 2026 22:19
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @juliawu, 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 update_git_submodules.sh script to ensure reliable synchronization of all git submodules with their respective datacommonsorg upstream repositories. This improvement addresses a limitation where the script previously failed if the upstream remote name for the main repository differed from those used by individual submodules, making the submodule update process more resilient and accurate across varied repository configurations.

Highlights

  • Dynamic Upstream Remote Identification for Submodules: The update_git_submodules.sh script now dynamically determines the correct upstream remote for each individual submodule by searching for remotes with 'datacommonsorg' in their URL. This resolves issues where the script previously failed due to differing remote names between the main repository and its submodules.
  • Script Refactoring for Modularity: The logic for finding and pulling from the upstream master branch has been encapsulated into a new shell function pull_upstream_master. This function is then executed for each submodule using git submodule foreach, improving the script's modularity and robustness.
Changelog
  • scripts/update_git_submodules.sh
    • The script's logic for identifying the upstream remote has been moved into a new shell function pull_upstream_master.
    • The pull_upstream_master function is now executed for each submodule using git submodule foreach 'bash -c pull_upstream_master', allowing each submodule to determine its own datacommonsorg remote.
    • The initial global upstream_remote variable declaration and usage have been removed.
    • A comment has been added to clarify the script's purpose: "This will sync each submodule with the latest master branch from datacommonsorg".
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
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 refactors the submodule update script to correctly identify the upstream remote for each submodule independently. The overall approach is sound and correctly solves the issue described. I've provided a few suggestions to improve the script's robustness and clarity, including updating a misleading comment and simplifying a command pipeline.

juliawu and others added 2 commits February 4, 2026 14:24
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>
@juliawu juliawu merged commit a70a927 into datacommonsorg:master Feb 5, 2026
9 of 10 checks passed
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.

2 participants