From cbe87055e6aca182a414ec24ceb9de619e7ac2df Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Sat, 22 Aug 2026 11:10:18 -0700 Subject: [PATCH 1/3] chore(release): remove patch release issue template Users should submit pull requests directly when requesting backports or patch releases rather than opening separate request issues. Removes the standalone patch release request template and updates documentation to point to pull requests. Clarifies the release tracking issue template so it is obvious it applies to backports as well, and updates release tooling to ignore placeholder PR numbers in backport checklists. --- .../ISSUE_TEMPLATE/patch_release_request.md | 22 ------------ .../release_tracking_template.md | 12 ++++--- docs/devguide.md | 16 ++++----- docs/support.md | 5 +-- .../private/release/release_issue_test.py | 36 +++++++++++++++++++ tools/private/release/release_issue.py | 20 +++++++++-- 6 files changed, 69 insertions(+), 42 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/patch_release_request.md diff --git a/.github/ISSUE_TEMPLATE/patch_release_request.md b/.github/ISSUE_TEMPLATE/patch_release_request.md deleted file mode 100644 index 7b38ec40df..0000000000 --- a/.github/ISSUE_TEMPLATE/patch_release_request.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: "🏗️ Patch release or backport" -about: Request a patch release or backport of a fix to a release. -title: 'Patch release: MAJOR.MINOR.PATCH' -labels: 'type: process' ---- - - - -**What version of `rules_python` do you want to patch?** - - -**What pull requests do you want to backport?** - -Please provide a list of pull request numbers. - -- # -- # diff --git a/.github/ISSUE_TEMPLATE/release_tracking_template.md b/.github/ISSUE_TEMPLATE/release_tracking_template.md index efa78a9b63..33438c7c8b 100644 --- a/.github/ISSUE_TEMPLATE/release_tracking_template.md +++ b/.github/ISSUE_TEMPLATE/release_tracking_template.md @@ -1,10 +1,12 @@ --- -name: Release Tracking Issue -about: Checklist for tracking a new release of rules_python. +name: Release or Backport Tracking Issue +about: Checklist for tracking a new release, patch release, or backport of rules_python. title: 'Release ' labels: ['type: release'] --- # Release tasks + - [ ] Prepare Release | status=awaiting-preparation - [ ] Create Release branch - [ ] Tag RC0 @@ -12,11 +14,13 @@ labels: ['type: release'] ## Backports -To request a backport, comment `/backport` on the PR, comment `/backport ` -on this issue, or add it to the checklist below. See +To request or track a backport, comment `/backport` on the PR, comment +`/backport ` on this issue, or add it to the checklist below. See [RELEASING.md: How to add backports](https://github.com/bazel-contrib/rules_python/blob/main/RELEASING.md#how-to-add-backports) for details. +- [ ] #PR_NUMBER + --- To manually control the release flow, see the diff --git a/docs/devguide.md b/docs/devguide.md index 86a9d5b542..7cc5993c7c 100644 --- a/docs/devguide.md +++ b/docs/devguide.md @@ -122,15 +122,13 @@ we prepare for releases. The steps to create a backport PR are: -1. Create an issue for the patch release; use the [patch release - template][patch-release-issue]. -2. Create a fork of `rules_python`. -3. Checkout the `release/X.Y` branch. -4. Use `git cherry-pick -x` to cherry pick the desired fixes. -5. Update the release's `CHANGELOG.md` file: +1. Create a fork of `rules_python`. +2. Checkout the `release/X.Y` branch. +3. Use `git cherry-pick -x` to cherry pick the desired fixes. +4. Update the release's `CHANGELOG.md` file: * Add a Major.Minor.Patch section if one doesn't exist * Copy the changelog text from `main` to the release's changelog. -6. Send a PR with the backport's changes. +5. Send a PR with the backport's changes. * The title should be `backport: PR#N to Major.Minor` * The body must preserve the original PR's number, commit hash, description, and authorship. @@ -145,7 +143,5 @@ The steps to create a backport PR are: ``` * If the PR contains multiple backport commits, separate each's description with `-----`. -7. Send a PR to update the `main` branch's `CHANGELOG.md` to reflect the +6. Send a PR to update the `main` branch's `CHANGELOG.md` to reflect the changes done in the patched release. - -[patch-release-issue]: https://github.com/bazelbuild/rules_python/issues/new?template=patch_release.md diff --git a/docs/support.md b/docs/support.md index 088466d1bb..ee7ecdbc98 100644 --- a/docs/support.md +++ b/docs/support.md @@ -24,12 +24,9 @@ Backports can be done to older releases, but only if newer releases also have the fix backported. For example, if the current release is 1.5, in order to patch 1.4, version 1.5 must be patched first. -Backports can be requested by [creating an issue with the patch release -template][patch-release-issue] or by sending a pull request performing the backport. +Backports can be requested by sending a pull request performing the backport. See the dev guide for [how to create a backport PR](creating-backport-prs). -[patch-release-issue]: https://github.com/bazelbuild/rules_python/issues/new?template=patch_release_request.md - ## Supported Bazel Versions The supported Bazel versions are: diff --git a/tests/tools/private/release/release_issue_test.py b/tests/tools/private/release/release_issue_test.py index b95601c541..13a543e3b1 100644 --- a/tests/tools/private/release/release_issue_test.py +++ b/tests/tools/private/release/release_issue_test.py @@ -3,6 +3,7 @@ add_sync_changelog_task_to_body, format_metadata_line, load_release_tracking_template, + parse_backports, parse_checklist_state, parse_metadata_line, ) @@ -97,6 +98,41 @@ def test_add_backports_to_body(): assert updated_body.strip() == expected_body.strip() +def test_parse_backports_ignores_placeholders(): + body = """ +## Backports +- [ ] #PR_NUMBER +- [ ] # +- [ ] #123 | status=done +""" + items = parse_backports(body) + assert len(items) == 1 + assert items[0].pr_ref == "#123" + + +def test_add_backports_to_body_removes_placeholders(): + body = """ +## Checklist +- [ ] Tag Final + +## Backports +- [ ] #PR_NUMBER +- [ ] # +- [ ] #123 | status=done +""" + items = [{"ref": "124"}] + updated_body = add_backports_to_body(body, items) + expected_body = """ +## Checklist +- [ ] Tag Final + +## Backports +- [ ] #123 | status=done +- [ ] #124 +""" + assert updated_body.strip() == expected_body.strip() + + def test_add_sync_changelog_task_to_body(): body = """ ## Checklist diff --git a/tools/private/release/release_issue.py b/tools/private/release/release_issue.py index 7a3716fab4..6bfa0f58e0 100644 --- a/tools/private/release/release_issue.py +++ b/tools/private/release/release_issue.py @@ -296,9 +296,13 @@ def parse_backports(body): for line in lines: parsed = parse_metadata_line(line) if parsed: + name = parsed["name"].strip() + # Ignore empty or placeholder checklist items (e.g. '#PR_NUMBER') + if not re.match(r"^#?\d+$", name): + continue items.append( BackportTask( - pr_ref=parsed["name"], + pr_ref=name, checked=parsed["checked"], status=parsed["metadata"].get("status", "pending"), rc=parsed["metadata"].get("rc"), @@ -326,6 +330,15 @@ def add_backports_to_body(body: str, items: list[dict[str, Any]]) -> str: section_content = match.group(2) + # Filter out empty or placeholder checklist items (e.g. "- [ ] #PR_NUMBER") + cleaned_lines = [] + for line in section_content.splitlines(): + parsed = parse_metadata_line(line) + if parsed and not re.match(r"^#?\d+$", parsed["name"].strip()): + continue + cleaned_lines.append(line) + section_content = "\n".join(cleaned_lines) + # Parse existing backports to avoid duplicates existing_items = parse_backports(body) existing_refs = {item.pr_ref for item in existing_items} @@ -348,7 +361,10 @@ def add_backports_to_body(body: str, items: list[dict[str, Any]]) -> str: ) if not new_lines: - return body + section_content_clean = section_content.rstrip("\n") + updated_section = section_content_clean + "\n\n" + start, end = match.span(2) + return body[:start] + updated_section + body[end:] # Append new lines to the section content. section_content_clean = section_content.rstrip("\n") From bf84b6f23a1e9863afadd19b8c49683094d41739 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Sat, 22 Aug 2026 11:22:53 -0700 Subject: [PATCH 2/3] docs: recommend filing backport tracking issues for automation Filing a backport tracking issue triggers automated workflows to perform the necessary backporting steps. Updates the backport documentation and developer guide with a note recommending users file an issue using the release tracking template rather than creating backport PRs manually. --- docs/devguide.md | 8 ++++++++ docs/support.md | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/devguide.md b/docs/devguide.md index 7cc5993c7c..b0ebf15980 100644 --- a/docs/devguide.md +++ b/docs/devguide.md @@ -120,6 +120,12 @@ we prepare for releases. (creating-backport-prs)= ## Creating Backport PRs +:::{note} +Prefer filing a backport issue using the [release or backport tracking +template][backport-issue], because it triggers automation to perform all +necessary backporting steps. +::: + The steps to create a backport PR are: 1. Create a fork of `rules_python`. @@ -145,3 +151,5 @@ The steps to create a backport PR are: with `-----`. 6. Send a PR to update the `main` branch's `CHANGELOG.md` to reflect the changes done in the patched release. + +[backport-issue]: https://github.com/bazel-contrib/rules_python/issues/new?template=release_tracking_template.md diff --git a/docs/support.md b/docs/support.md index ee7ecdbc98..194cd35d7e 100644 --- a/docs/support.md +++ b/docs/support.md @@ -24,8 +24,13 @@ Backports can be done to older releases, but only if newer releases also have the fix backported. For example, if the current release is 1.5, in order to patch 1.4, version 1.5 must be patched first. -Backports can be requested by sending a pull request performing the backport. -See the dev guide for [how to create a backport PR](creating-backport-prs). +Backports can be requested by [creating an issue with the release or backport +tracking template][backport-issue] or by sending a pull request performing the +backport. Creating an issue is preferred because it triggers automation to +perform all necessary backporting steps. See the dev guide for +[how to create a backport PR](creating-backport-prs). + +[backport-issue]: https://github.com/bazel-contrib/rules_python/issues/new?template=release_tracking_template.md ## Supported Bazel Versions From 3319fbbfc0dc4af0be0ed76353e9178de51eb910 Mon Sep 17 00:00:00 2001 From: Richard Levasseur Date: Sat, 22 Aug 2026 11:29:48 -0700 Subject: [PATCH 3/3] docs: document process-news command for manual backport changelogs Manual backport PR creation requires updating CHANGELOG.md and version markers on both the release branch and main. Updates the backport PR steps in the developer guide to show how to use the release tool's process-news command for both the release branch and main branch changelog updates. --- docs/devguide.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/devguide.md b/docs/devguide.md index b0ebf15980..b886e81527 100644 --- a/docs/devguide.md +++ b/docs/devguide.md @@ -131,9 +131,13 @@ The steps to create a backport PR are: 1. Create a fork of `rules_python`. 2. Checkout the `release/X.Y` branch. 3. Use `git cherry-pick -x` to cherry pick the desired fixes. -4. Update the release's `CHANGELOG.md` file: - * Add a Major.Minor.Patch section if one doesn't exist - * Copy the changelog text from `main` to the release's changelog. +4. Update the release's `CHANGELOG.md` file using the release tool's + `process-news` command: + ```shell + bazel run //tools/private/release -- process-news + ``` + This merges the PR's news entries into `CHANGELOG.md`, deletes the news + files, and updates any `VERSION_NEXT_*` markers. 5. Send a PR with the backport's changes. * The title should be `backport: PR#N to Major.Minor` * The body must preserve the original PR's number, commit hash, description, @@ -150,6 +154,11 @@ The steps to create a backport PR are: * If the PR contains multiple backport commits, separate each's description with `-----`. 6. Send a PR to update the `main` branch's `CHANGELOG.md` to reflect the - changes done in the patched release. + changes done in the patched release: + * Checkout the `main` branch. + * Run the `process-news` command as before: + ```shell + bazel run //tools/private/release -- process-news + ``` [backport-issue]: https://github.com/bazel-contrib/rules_python/issues/new?template=release_tracking_template.md