Skip to content

Replace cat with jq in publish_release.sh#5342

Merged
aslam-quad merged 1 commit into
GoogleCloudPlatform:developfrom
aslam-quad:publish_release_tag
Mar 13, 2026
Merged

Replace cat with jq in publish_release.sh#5342
aslam-quad merged 1 commit into
GoogleCloudPlatform:developfrom
aslam-quad:publish_release_tag

Conversation

@aslam-quad

@aslam-quad aslam-quad commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Replace cat with jq for safe JSON generation in publish_release.sh file

Submission Checklist

NOTE: Community submissions can take up to 2 weeks to be reviewed.

Please take the following actions before submitting this pull request.

  • Fork your PR branch from the Toolkit "develop" branch (not main)
  • Test all changes with pre-commit in a local branch #
  • Confirm that "make tests" passes all tests
  • Add or modify unit tests to cover code changes
  • Ensure that unit test coverage remains above 80%
  • Update all applicable documentation
  • Follow Cluster Toolkit Contribution guidelines #

@github-actions github-actions Bot added the external PR from external contributor label Mar 12, 2026
@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 refactors the publish_release.sh script to enhance the reliability and safety of release manifest generation. By replacing a basic cat heredoc with jq, the script now creates JSON manifests more robustly. Additionally, it introduces a prerequisite check for jq and provides a more informative success message upon completion.

Highlights

  • JSON Generation Method: Switched from using cat with a heredoc to jq for generating the release manifest JSON, improving safety and robustness.
  • jq Dependency Check: Implemented a check to ensure jq is installed on the system before script execution, providing a clear error message if it's missing.
  • Enhanced Success Message: Modified the final success message to include the specific release tag, offering more context upon completion.
Changelog
  • tools/publish_release.sh
    • Replaced the cat command with jq for generating the release manifest JSON.
    • Added a check to verify if jq is installed, exiting with an error if not found.
    • Updated the final success message to display the RELEASE_TAG.
Activity
  • No specific activity (comments, reviews, progress) was provided in the context.
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 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 is a great improvement, replacing a fragile cat heredoc with a robust jq command to generate the release manifest JSON. This correctly handles potential special characters in release names and tags. The added check for the jq dependency is also a solid addition to prevent script failures. I have one minor suggestion to improve the clarity of the jq command.

Comment thread tools/publish_release.sh Outdated
@aslam-quad aslam-quad force-pushed the publish_release_tag branch from fb53a54 to c3a9d4d Compare March 12, 2026 07:01
@aslam-quad aslam-quad added the release-chore To not include into release notes label Mar 12, 2026
@aslam-quad aslam-quad changed the title Replace cat with jq for safe JSON generation Replace cat with jq in publish_release.sh Mar 12, 2026
@aslam-quad aslam-quad marked this pull request as ready for review March 12, 2026 11:32
@aslam-quad aslam-quad requested review from a team and samskillman as code owners March 12, 2026 11:32
@aslam-quad aslam-quad requested a review from kadupoornima March 12, 2026 11:42
@aslam-quad aslam-quad merged commit 369215d into GoogleCloudPlatform:develop Mar 13, 2026
18 of 88 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PR from external contributor release-chore To not include into release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants