feat(release): automate patch creation and release process#8202
feat(release): automate patch creation and release process#8202mattKorwel merged 17 commits intomainfrom
Conversation
This commit introduces a comprehensive automation for the patch release process. It includes: 1. A new script, `scripts/create-patch-pr.js`, to handle the git logic of cherry-picking and creating patch PRs. 2. A new GitHub workflow, `create-patch-pr.yml`, for maintainers to trigger the process. 3. A new GitHub workflow, `trigger-patch-release.yml`, to automatically release the patch upon PR merge. 4. Updated documentation in `docs/releases.md` to reflect the new, streamlined process.
This commit introduces a new GitHub Actions workflow, `patch-from-comment.yml`, which allows maintainers to trigger the patch creation process by commenting on a pull request. The documentation in `docs/releases.md` has been updated to reflect this new, convenient workflow.
This commit adds a security note to the `releases.md` file, clarifying that the `release/*` branches are protected and require a review before merging.
There was a problem hiding this comment.
Summary of Changes
Hello @mattKorwel, 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 automates the project's patch release workflow. It streamlines the process of creating and releasing critical bug fixes by introducing new scripts and GitHub Actions workflows, enhancing both efficiency and security.
Highlights
- Automated Patch PR Creation: Introduces a new script, scripts/create-patch-pr.js, and associated GitHub workflows (create-patch-pr.yml, patch-from-comment.yml) to automate the creation of patch pull requests, including branch creation, cherry-picking, and PR generation.
- Automated Patch Release: Implements a new GitHub workflow, trigger-patch-release.yml, to automatically handle the release process (build, test, publish, GitHub release) upon merging a patch PR.
- Updated Release Documentation: The docs/releases.md file has been significantly updated to reflect the new, streamlined, and automated patch release process, including instructions for triggering via GitHub comments or manual workflow runs.
- Centralized Linting Script: A new centralized, CI-aligned local linting script (scripts/lint.js) is introduced to improve code quality and developer experience.
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. ↩
|
Size Change: -2 B (0%) Total Size: 13.2 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces valuable automation for the patch release process, which will significantly improve speed and reliability. The documentation updates are clear and comprehensive. However, the core script scripts/create-patch-pr.js contains a few critical and high-severity issues related to its git logic and command-line interface that could cause it to fail in common scenarios. I've provided specific comments and suggestions to address these issues and make the automation robust.
This commit improves the security and reproducibility of the `patch-from-comment.yml` workflow by pinning the `peter-evans/slash-command-dispatch` action to a specific commit SHA (`40877f718dce0101edfc7aea2b3800cc192f9ed5`) instead of the floating `v2` tag.
This commit enhances the comment-based patch workflow by: 1. Automatically detecting the merge commit SHA from the pull request, so the user no longer needs to provide it. 2. Adding a safety check to ensure the command only runs on merged pull requests. 3. Pinning the `peter-evans/slash-command-dispatch` action to a specific commit SHA for improved security. 4. Updating the documentation to reflect the new, simpler `/patch <channel>` command.
This commit pins the external GitHub Actions used in the new patch process workflows (`create-patch-pr.yml`, `patch-from-comment.yml`, and `trigger-patch-release.yml`) to their specific commit SHAs. This improves the security and reproducibility of these workflows.
This commit adds a `--dry-run` option to the comment-based patch workflow. This allows maintainers to test the entire patch creation and release process without actually publishing any packages. The `dry-run` state is plumbed through all the relevant workflows and scripts, and the documentation has been updated to reflect the new option.
This commit addresses feedback on the `create-patch-pr.js` script by: 1. Fetching all tags and checking the remote for branch existence to improve reliability in CI. 2. Increasing the release fetch limit to 30 to ensure the latest stable tag is found. 3. Resolving the `-h` alias conflict between `channel` and `help`. 4. Correctly creating the hotfix branch from the remote release branch.
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
| dry_run: | ||
| description: 'Whether to run in dry-run mode.' | ||
| required: false | ||
| type: 'boolean' |
There was a problem hiding this comment.
Super nit (for consistency): consider updating this from 'boolean' to boolean
This PR introduces a comprehensive automation for the patch release process, making it faster, more reliable, and more secure.
Key features include:
scripts/create-patch-pr.js, to handle the git logic of cherry-picking and creating patch PRs.create-patch-pr.yml, for maintainers to trigger the process manually.patch-from-comment.yml, allowing maintainers to trigger the process from a PR comment using/patch <channel> <commit_sha>.trigger-patch-release.yml, to automatically release the patch upon PR merge.docs/releases.mdto reflect the new, streamlined process and its security features.scripts/lint.jsto improve code quality and developer experience.