Skip to content

Conversation

@vgpopov
Copy link
Contributor

@vgpopov vgpopov commented Oct 9, 2025

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Oct 9, 2025

⚠️ No Changeset found

Latest commit: dde5068

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@notion-workspace
Copy link

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vgpopov, 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 introduces a powerful new set of shell scripts aimed at significantly enhancing the automation of common development tasks across multiple Git repositories. The primary objective is to provide a robust command-line tool for managing repository cloning and updates, applying consistent changes (like dependency bumps or code refactors), and automating the creation of commits and pull requests. This toolset is designed to improve efficiency and consistency when working with a large number of interconnected projects.

Highlights

  • New Batch Operations Tool: Introduced a new suite of shell scripts under tools/batch-blocks-deps-update/ designed to automate various batch operations across multiple Git repositories.
  • Repository Management: Added clone-milab-open.sh to clone or update repositories from a GitHub organization, intelligently stashing local changes before pulling, and restore-stash.sh to pop these stashes later.
  • Automated Change Application: Implemented manage-repo.sh to prepare branches, commit changes, push to remote, and create GitHub Pull Requests across multiple repositories, including auto-generating changesets if a .changeset directory exists.
  • Dependency Update Workflow: Created update-deps.sh to streamline the process of updating specified npm packages to their latest versions across all target repositories, handling version replacement, pnpm install, and PR creation.
  • Search and Replace Utility: Included replace_deps.sh, a utility script for interactively or forcefully searching and replacing text within files across repositories using ripgrep and sd.
  • Centralized CLI: The main.sh script acts as a central command-line interface (mil) to orchestrate all these new functionalities, providing a unified entry point for batch operations.
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.

@gemini-code-assist
Copy link
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.


For installation:
```sh
curl
Copy link
Member

Choose a reason for hiding this comment

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

?

Comment on lines +4 to +15
resolve_script_dir() {
local source="${BASH_SOURCE[0]}"
while [ -h "$source" ]; do
local dir
dir="$(cd -P "$(dirname "$source")" && pwd)"
source="$(readlink "$source")"
[[ "$source" != /* ]] && source="$dir/$source"
done
cd -P "$(dirname "$source")" && pwd
}

SCRIPT_DIR="$(resolve_script_dir)"
Copy link
Member

Choose a reason for hiding this comment

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

Never saw this magic wand before. :)

Could you explain what is the difference of your solution to simple one-liner?

SCRIPT_DIR="$(cd -P "$(dirname "$source")" && pwd)"

Or, if you want path without symlinks, then

SCRIPT_DIR="$(realpath "$(dirname "$source")")"

BTW: regular cd in bash has no '-P' option. It seems to be an option of cd command embedded into dash which is used as default bash alternative on Macs.

Comment on lines +36 to +43
help [command] Show general help or help for a command
start Clone/update repos (see: main.sh help clone)
finish Restore stashed changes from clone updates
changes-prepare Prepare changes (see: main.sh help manage)
changes-apply Apply changes and open PRs (see: main.sh help manage)
replace Search & replace (see: main.sh help replace)
update-deps Update package versions across repos interactively
install [--dest DIR] Install commands to a bin directory (symlinks by default)
Copy link
Member

Choose a reason for hiding this comment

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

None of help commands worked on my side.
Also, it looks strange to look help for start command with help clone as message suggests.

Comment on lines +126 to +130
*)
msg_error "Unknown option: $1"
usage
exit 1
;;
Copy link
Member

Choose a reason for hiding this comment

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

This makes script to exit if I try to use it in 'command only' mode (without --* options.

I know two ways of fixing this:
Use getopts embedded into bash:

while getopts ":dh" opt; do
	case $opt in
	d)
		DEST_DIR="${OPTARG}"
		;;
	h)
		help
		exit
		;;
	\:)
		error 64 "Option -${OPTARG} requires an argument"
		;;
	\?)
		help
		exit 64
		;;
	esac
done
shift $(($OPTIND - 1))

and using separate getopt command

args="$(getopt -l  dest,help $0 -- "$@")"
set -- $args

while :; do
   // your code from above with shifts
  --)
    shift; break;
    ;;
  esac
done

PACKAGES_ARG="" # values for -p/--package (can be repeated or comma/space/newline separated)

# Parse flags
while [[ $# -gt 0 ]]; do
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
while [[ $# -gt 0 ]]; do
if [ "$CMD" == "help" ]; then
while [[ $# -gt 0 ]]; do
...
fi

@DenKoren
Copy link
Member

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.

4 participants