Skip to content

Conversation

@kabir
Copy link
Collaborator

@kabir kabir commented Dec 23, 2025

  • Add script to update versions
  • Add checks to make sure the JBang version is in sync with pom versions
  • Add workflow to create GH release

Fixes #532 🦕

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kabir, 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 project's release management by introducing a robust, documented, and largely automated process. It includes a new script for consistent version updates across Maven POMs and JBang dependencies, a validation mechanism to prevent version mismatches, and a comprehensive RELEASE.md guide. Furthermore, it sets up automated GitHub releases, streamlining the entire deployment pipeline from version bumping to artifact publication and release note generation.

Highlights

  • Automated Version Updates: Introduced a new update-version.sh script to streamline updating project versions across pom.xml files and JBang script dependencies.
  • JBang Version Synchronization: Implemented a Groovy script (validate-jbang-versions.groovy) and integrated it into the Maven build process to ensure JBang script dependency versions are consistent with Maven POM versions.
  • Comprehensive Release Documentation: Added a detailed RELEASE.md document outlining the entire release process, including prerequisites, step-by-step instructions, CI verification, automated deployment to Maven Central, GitHub release creation, and troubleshooting.
  • GitHub Release Workflow: Established a new workflow to automatically create GitHub releases upon tagging, complete with auto-generated changelogs and links to Maven Central artifacts.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/create-github-release.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 PR does a great job of documenting the release process and adding automation to make it smoother. The RELEASE.md is very detailed and the scripts for version updates and validation are a great addition. I've found a few issues, including a bug in the argument parsing of the update-version.sh script, a minor inconsistency in the new RELEASE.md, a typo in a Javadoc, and some potentially confusing code in the groovy script and root pom.xml. Addressing these will improve the robustness and clarity of the new release tooling.

@kabir kabir force-pushed the release-process branch 3 times, most recently from e1b11ee to ad829fd Compare December 23, 2025 17:10
@kabir
Copy link
Collaborator Author

kabir commented Dec 23, 2025

/gemini review

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 introduces a comprehensive and well-documented release process, which is an excellent addition for project maintainability. The new scripts for version updates and validation are valuable. My review highlights a critical issue in pom.xml where versions were incorrectly modified, a high-severity bug in the update-version.sh script that likely caused this, and several medium-severity suggestions to enhance the robustness of the scripts and the clarity of the documentation.

@kabir kabir force-pushed the release-process branch 2 times, most recently from f785bc8 to 0bc889d Compare December 23, 2025 17:17
@kabir
Copy link
Collaborator Author

kabir commented Dec 23, 2025

/gemini review

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 introduces a comprehensive release process documentation (RELEASE.md) and supporting automation scripts. This includes a script to update versions across pom.xml and JBang files (update-version.sh), and a Groovy script to validate JBang dependency versions during the Maven build (validate-jbang-versions.groovy). The Maven configuration is updated accordingly to integrate these scripts.

The changes are well-structured and significantly improve the release workflow. The documentation is clear and detailed. I have a couple of suggestions to improve the robustness of the validation script and maintainability of the documentation.

@kabir
Copy link
Collaborator Author

kabir commented Dec 23, 2025

/gemini review

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 introduces a documented release process along with automation scripts to streamline version updates and validation. The changes are well-structured, with a new RELEASE.md file, a bash script for version bumping, and a Groovy script for validation. My review focuses on improving the robustness and maintainability of the new scripts and documentation. I've suggested making the version parsing in the Groovy script safer, improving path resolution in the POM file to be less fragile, and aligning the verification steps between the documentation and the helper script. I also pointed out a minor security concern regarding an email address in the documentation.

Comment on lines +24 to +30
def actualVersion = line.substring(lastColon + 1).trim().tokenize()[0]
if (actualVersion != expectedVersion) {
System.err.println("[ERROR] JBang Version Mismatch in " + scriptName)
System.err.println(" Expected: " + expectedVersion)
System.err.println(" Found: " + actualVersion + " in line: \"" + line.trim() + "\"")
success = false
}
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 current version parsing logic is a bit fragile. If a line ends with a colon or has only whitespace after it, tokenize()[0] will throw an ArrayIndexOutOfBoundsException, causing the build to fail with a potentially unclear stack trace. A more robust approach would handle this case gracefully and provide a more informative error message.

            def actualVersion = line.substring(lastColon + 1).trim().tokenize().find()
            if (actualVersion != expectedVersion) {
                System.err.println("[ERROR] JBang Version Mismatch in " + scriptName)
                System.err.println("  Expected: " + expectedVersion)
                System.err.println("  Found:    " + (actualVersion ?: "<missing>") + " in line: \"" + line.trim() + "\"")
                success = false
            }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gemini-code-assist this was your idea. Come up with a final solution. We should be able to extract the version no matter what!

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right, tokenize() can be a bit too broad if there are non-whitespace characters immediately following the version that aren't part of the version string itself (e.g., a comma or another delimiter). To make the version extraction truly robust and handle cases like //DEPS io.github.a2asdk:artifact-id:1.0.0, some-other-info or //DEPS io.github.a2asdk:artifact-id:1.0.0-SNAPSHOT//comment, a regular expression is a more precise tool.

This updated suggestion uses a regex to explicitly capture the version string, which typically consists of alphanumeric characters, dots, and hyphens, from the beginning of the trimmed string after the last colon. It also retains the graceful handling of missing versions by printing <missing>.

Suggested change
def actualVersion = line.substring(lastColon + 1).trim().tokenize()[0]
if (actualVersion != expectedVersion) {
System.err.println("[ERROR] JBang Version Mismatch in " + scriptName)
System.err.println(" Expected: " + expectedVersion)
System.err.println(" Found: " + actualVersion + " in line: \"" + line.trim() + "\"")
success = false
}
def versionPart = line.substring(lastColon + 1).trim()
def matcher = (versionPart =~ /^([0-9a-zA-Z.-]+)/)
def actualVersion = matcher.find() ? matcher.group(1) : null
if (actualVersion != expectedVersion) {
System.err.println("[ERROR] JBang Version Mismatch in " + scriptName)
System.err.println(" Expected: " + expectedVersion)
System.err.println(" Found: " + (actualVersion ?: "<missing>") + " in line: \"" + line.trim() + "\"")
success = false
}
Suggested change
def actualVersion = line.substring(lastColon + 1).trim().tokenize()[0]
if (actualVersion != expectedVersion) {
System.err.println("[ERROR] JBang Version Mismatch in " + scriptName)
System.err.println(" Expected: " + expectedVersion)
System.err.println(" Found: " + actualVersion + " in line: \"" + line.trim() + "\"")
success = false
}
def versionPart = line.substring(lastColon + 1).trim()
def matcher = (versionPart =~ /^([0-9a-zA-Z.-]+)/)
def actualVersion = matcher.find() ? matcher.group(1) : null
if (actualVersion != expectedVersion) {
System.err.println("[ERROR] JBang Version Mismatch in " + scriptName)
System.err.println(" Expected: " + expectedVersion)
System.err.println(" Found: " + (actualVersion ?: "<missing>") + " in line: \"" + line.trim() + "\"")
success = false
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OTOH we don't have that many JBang scripts - we should just not write confusing DEPS

- Add script to update versions
- Add checks to make sure the JBang version is in sync with pom versions
- Add workflow to create GH release
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.

[Chore:]: Document release process, and update as needed

1 participant