chore: Refactor release and PR workflow - #641
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @rabilrbl, 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 refactors the project's release workflow by externalizing complex shell scripting logic from the GitHub Actions YAML into dedicated, maintainable scripts. This change enhances the clarity and modularity of the CI/CD pipeline. Furthermore, it includes an update to the release action version and refines workflow triggers to improve efficiency.
Highlights
- Workflow Modularization and Refactoring: The logic for incrementing the version and building binaries has been extracted from the GitHub Actions YAML into dedicated shell scripts (
scripts/increment-version.shandscripts/build-binaries.sh). This significantly improves the modularity, readability, and maintainability of the workflow. - Release Action Version Update: The
softprops/action-gh-releaseaction has been updated fromv1tov2. Additionally, the method for passing the GitHub token has been changed from using theGITHUB_TOKENenvironment variable to thetokeninput parameter, aligning with best practices for action usage. - Workflow Trigger Optimization: The
paths-ignorefilter in the workflow has been broadened to ignore all changes within the.github/**directory. This optimization prevents unnecessary workflow runs when only changes to GitHub Actions configurations or other related files occur.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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
-
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. ↩
There was a problem hiding this comment.
Code Review
This pull request is a great step towards improving the maintainability of the CI/CD workflows by extracting complex shell logic into dedicated scripts. The new scripts are well-structured. I've provided a few suggestions to further improve them, focusing on robustness against edge cases (like missing git tags), correctness in logic (like counting commits instead of lines), and overall code clarity and efficiency by reducing repetition.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a great step towards improving the maintainability of the release workflow by extracting complex shell logic into dedicated scripts. The new scripts are well-written and clear. My review includes a few suggestions to enhance them further. The most important feedback is about enabling parallel builds for Android targets to improve performance. Other comments focus on improving script robustness, efficiency, and code style in the bash scripts.
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>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a great step towards improving the maintainability of your CI/CD workflows by extracting complex shell logic into dedicated scripts. The new scripts are well-structured. I've added a few suggestions to further enhance the scripts by reducing code duplication, improving readability, and optimizing performance. Overall, this is a solid refactoring.
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>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request does a great job of refactoring the CI/CD workflows by moving complex shell logic into dedicated scripts. This significantly improves the maintainability and readability of the GitHub Actions YAML files.
My review focuses on the new shell scripts. I've identified a critical issue in build-binaries.sh regarding error handling for parallel builds, which could cause silent failures. In increment-version.sh, I've pointed out a potential bug in how feature commits are detected, which could lead to incorrect versioning, along with some suggestions for improving script clarity and performance.
Overall, these are excellent changes that make the automation more robust and easier to manage. Addressing the feedback will further enhance the reliability of your release process.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This pull request refactors the release workflow by moving complex shell logic out of the GitHub Actions YAML and into dedicated scripts, making the workflow easier to maintain and more modular. It also updates the release action version and makes minor improvements to workflow triggers and environment variable usage.
Workflow modularization and refactoring:
scripts/increment-version.shfor maintainability and clarity. [1] [2]scripts/build-binaries.sh, simplifying the YAML and making it easier to update build logic in the future. [1] [2]Workflow improvements:
softprops/action-gh-release@v1tov2and switched from using theGITHUB_TOKENenvironment variable to thetokeninput parameter for better compatibility.paths-ignorefilter to ignore all changes under.github/**, reducing unnecessary workflow runs on irrelevant changes.