Skip to content

fix: version sync workspace - #615

Merged
jpoehnelt merged 1 commit into
mainfrom
fix/version-sync-workspace
Mar 24, 2026
Merged

fix: version sync workspace#615
jpoehnelt merged 1 commit into
mainfrom
fix/version-sync-workspace

Conversation

@jpoehnelt

Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot

changeset-bot Bot commented Mar 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b4654d0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

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

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses a critical issue in the version synchronization process, ensuring that the google-workspace-cli crate's version is correctly updated across its manifest and lock files. The changes rectify a script that was misconfigured after a workspace refactor, preventing proper version management for the CLI tool.

Highlights

  • Version Sync Script Fix: The version-sync.sh script was updated to correctly target the Cargo.toml file within the crates/google-workspace-cli directory, resolving an issue where it was attempting to modify the root Cargo.toml which no longer contains a [package] section after a workspace refactor.
  • CLI Crate Version Bump: The google-workspace-cli crate version has been explicitly updated to 0.21.0 in both Cargo.toml and Cargo.lock to synchronize with the package.json version.
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.

Footnotes

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

@googleworkspace-bot googleworkspace-bot added cla: yes This human has signed the Contributor License Agreement. area: skills labels Mar 24, 2026
@googleworkspace-bot

Copy link
Copy Markdown
Collaborator

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 fixes the version-sync.sh script to correctly update the Cargo.toml file for the google-workspace-cli crate, bumping its version to 0.21.0. The review highlights a potential race condition in the script due to the use of a hardcoded temporary file name, suggesting mktemp for a more robust solution.

Comment thread scripts/version-sync.sh Outdated
@googleworkspace-bot

Copy link
Copy Markdown
Collaborator

/gemini review

@github-actions github-actions Bot added the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 24, 2026
@jpoehnelt
jpoehnelt force-pushed the fix/version-sync-workspace branch from 94a6e08 to b4654d0 Compare March 24, 2026 20:53
@github-actions github-actions Bot removed the gemini: reviewed Gemini Code Assist has reviewed the latest changes label Mar 24, 2026
@googleworkspace-bot googleworkspace-bot added gemini: reviewed Gemini Code Assist has reviewed the latest changes and removed area: skills labels Mar 24, 2026
@jpoehnelt
jpoehnelt merged commit ea0849a into main Mar 24, 2026
11 checks passed
@jpoehnelt
jpoehnelt deleted the fix/version-sync-workspace branch March 24, 2026 20:53
@googleworkspace-bot

Copy link
Copy Markdown
Collaborator

/gemini review

@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.06%. Comparing base (029e5de) to head (b4654d0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #615   +/-   ##
=======================================
  Coverage   71.06%   71.06%           
=======================================
  Files          44       44           
  Lines       20334    20334           
=======================================
  Hits        14450    14450           
  Misses       5884     5884           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 addresses an issue with the version-sync.sh script, updating it to correctly target the Cargo.toml file for the google-workspace-cli crate. This change ensures that the CLI crate and all associated skill metadata versions are consistently bumped from 0.20.1 to 0.21.0. A review comment suggests improving the robustness of the awk script's version pattern matching to account for variable whitespace, preventing potential failures during the versioning process.

Comment thread scripts/version-sync.sh
tmp=$(mktemp)
awk -v ver="$VERSION" '
/^\[package\]/ { in_pkg=1 }
/^\[/ && !/^\[package\]/ { in_pkg=0 }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The current awk script is brittle as it assumes a specific formatting for the version key in Cargo.toml (version = ...). TOML allows for different spacing, such as version=... or version = .... The script will fail to update the version if the spacing is different, which could lead to an inconsistent state in the repository during the release process. It's better to make the pattern matching more flexible to handle optional whitespace.

Suggested change
/^\[/ && !/^\[package\]/ { in_pkg=0 }
in_pkg && /^version[[:space:]]*=/ { $0 = "version = \"" ver "\"" }

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 version-sync.sh script to correctly synchronize versions across all workspace Cargo.toml files (for google-workspace and google-workspace-cli) and Cargo.lock, aligning them with the version in package.json. The script now iterates through crates/*/Cargo.toml and uses mktemp for temporary file operations. A review comment suggests adding a trap for proper cleanup of temporary files created by mktemp in scripts/version-sync.sh to prevent potential clutter and disk space issues.

Comment thread scripts/version-sync.sh
Comment on lines +15 to +23
for cargo_toml in crates/*/Cargo.toml; do
tmp=$(mktemp)
awk -v ver="$VERSION" '
/^\[package\]/ { in_pkg=1 }
/^\[/ && !/^\[package\]/ { in_pkg=0 }
in_pkg && /^version = / { $0 = "version = \"" ver "\"" }
{ print }
' "$cargo_toml" > "$tmp" && mv "$tmp" "$cargo_toml"
done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The use of mktemp without proper cleanup can lead to temporary files being left behind, especially if the script exits unexpectedly (e.g., if the awk command fails). This can clutter the temporary directory and potentially fill up disk space over time in a CI environment.

To ensure temporary files are always cleaned up, it's best practice to wrap the file modification logic in a subshell with a trap for the EXIT signal. This guarantees that the temporary file is removed when the subshell exits, regardless of whether it's due to success or failure.

Suggested change
for cargo_toml in crates/*/Cargo.toml; do
tmp=$(mktemp)
awk -v ver="$VERSION" '
/^\[package\]/ { in_pkg=1 }
/^\[/ && !/^\[package\]/ { in_pkg=0 }
in_pkg && /^version = / { $0 = "version = \"" ver "\"" }
{ print }
' "$cargo_toml" > "$tmp" && mv "$tmp" "$cargo_toml"
done
for cargo_toml in crates/*/Cargo.toml; do
( # Run in a subshell to scope the trap and ensure cleanup
set -e # It's good practice to be explicit in subshells
tmp=$(mktemp)
trap "rm -f '$tmp'" EXIT
awk -v ver="$VERSION" '
/^\[package\]/ { in_pkg=1 }
/^\[/ && !/^\[package\]/ { in_pkg=0 }
in_pkg && /^version = / { $0 = "version = \"" ver "\"" }
{ print }
' "$cargo_toml" > "$tmp" && mv "$tmp" "$cargo_toml"
)
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: distribution cla: yes This human has signed the Contributor License Agreement. crate: google-workspace gemini: reviewed Gemini Code Assist has reviewed the latest changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants