chore(release): sync changelog and version markers to main during backports#3903
Conversation
…kports Collects news files and version marker diffs during backport cherry-picks, and proposes a PR to main to apply them (with auto-merge). - Add git diff/apply helpers. - Update GH helper for PR creation and auto-merge. - Update changelog utility for selective news and semver sorting. - Update process_backports to orchestrate the sync PR.
Simplifies the changelog insertion logic to always insert the new release block at the insertion point, rather than replacing the Unreleased section. This preserves any user changes to the static Unreleased text in CHANGELOG.md. Also updates the tests to match the current static Unreleased section format.
Updates _find_insertion_point to raise a ValueError if it cannot find an existing version in CHANGELOG.md that is smaller than the new version being inserted. This replaces the previous behavior of appending to the end of the file, which should not occur in practice. Also adds a test case to verify this error behavior.
There was a problem hiding this comment.
Code Review
This pull request refactors the release preparation and backport processing tools to sync changelog updates and news file deletions back to the main branch via an automated pull request. It also introduces a more robust changelog insertion mechanism based on version parsing, alongside new Git and GitHub API helper methods. Feedback on these changes includes improving the robustness of version parsing and branch checkouts, ensuring only valid news files are deleted, specifying UTF-8 encoding when writing patch files, and handling edge cases in the changelog insertion logic where no smaller version exists.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- Use is_news_file helper to avoid accidental deletion of non-news files. - Make branch checkout robust by resetting existing branch to main. - Specify UTF-8 encoding when writing patch files.
…ument - Renames the parameter to . - Requires it to be passed as a keyword argument. - Updates all callers and tests.
Add 'Sync Changelog' tasks to checklist when adding backports. Automatically mark them as done when the sync PR is merged using a new complete-sync-changelog subcommand and GitHub Actions workflow.
This PR implements the changes to sync both CHANGELOG.md and version next markers to the
mainbranch when backports are processed.Key changes:
diff,apply, andapply_checkhelpers to the release tool.changelog_news.pyto support selective news merging and correct semver-sorted insertion, while preserving the staticUnreleasedsection.process_backports.pyto collect version marker diffs during cherry-pick, check if they apply cleanly to main, apply them, and report any failures in the PR body.These changes ensure that the
mainbranch's changelog and version markers remain in sync with the release branch during the backport process.