[Infra] Replace Danger with Python script for changelog checks #8470
[Infra] Replace Danger with Python script for changelog checks #8470rlazo wants to merge 7 commits into
Conversation
Replace the Ruby-based Danger changelog verification setup with a custom Python script (`ci/changelog_check.py`). * Update: `.github/workflows/changelog.yml` to run `actions/setup-python` with Python 3.12 instead of Ruby setup and Bundler steps. * Grant: `pull-requests: write` and `issues: write` permissions in the GitHub Actions workflow to enable PR comment management. * Add: `ci/changelog_check.py` to check for changelog updates when SDK source files are modified, with support for PR comments via the GitHub API and skipping options (`no-changelog` label or `NO_RELEASE_CHANGE` description). * Remove: Danger files including `Dangerfile`, `Gemfile`, `Gemfile.lock`, and `setup_bundler.sh`.
Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. |
📝 PRs merging into main branchOur main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released. |
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces the Ruby-based Danger changelog check with a Python script (ci/changelog_check.py) and removes the old Ruby configuration files. The review feedback suggests several improvements: querying the GitHub API directly to avoid failures with shallow clones in GitHub Actions, removing a break statement to ensure all stale warning comments are cleaned up, and explicitly specifying 'utf-8' encoding when decoding HTTP responses.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Enhance `ci/changelog_check.py` to retrieve modified files using the GitHub API in GitHub Actions environments, avoiding shallow clone limitations. Added a fallback to `git diff` against `origin/main` or `main`. Also updated the script's comment signature and cleaned up trailing whitespace.
Remove the break statement in delete_comment_if_exists to ensure all existing bot comments are deleted rather than stopping after the first match.
Refactored `get_modified_files` in `ci/changelog_check.py` to remove an unneeded outer try block in the git diff fallback mechanism and removed a redundant error message output prior to returning an empty list.
Replace the Ruby-based Danger changelog verification setup with a custom Python script (
ci/changelog_check.py)..github/workflows/changelog.ymlto runactions/setup-pythonwith Python 3.12 instead of Ruby setup andBundler steps.
pull-requests: writeandissues: writepermissions in the GitHub Actions workflow to enable PR comment management.ci/changelog_check.pyto check for changelog updates when SDK source files are modified, with support for PR comments via the GitHub API and skipping options (no-changeloglabel orNO_RELEASE_CHANGEdescription).Dangerfile,Gemfile,Gemfile.lock, andsetup_bundler.sh.