This is an automated email from the ASF dual-hosted git repository.

shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f8629c5929 Detect linked issues at the end of PR bodies in provider 
testing issue (#70396)
9f8629c5929 is described below

commit 9f8629c5929d0c22380e1d30e94c6711fa93003c
Author: Shahar Epstein <[email protected]>
AuthorDate: Mon Jul 27 13:58:09 2026 +0300

    Detect linked issues at the end of PR bodies in provider testing issue 
(#70396)
    
    * Detect linked issues at the end of PR bodies in provider testing issue
    
    The provider testing issue generator missed linked issues when the
    reference was the last thing in the PR body (a common shape: "Fixes
    character after the number, which does not exist at end of string, so
    the reference was silently dropped and the release manager had to add
    the issue to the testing issue by hand (e.g. #53843 for the google
    22.3.0rc1 issue). A negative lookahead matches the same references
    without needing a trailing character.
    
    * Address review: pin adjacent-reference behaviour, drop dead regex copy
    
    The old pattern consumed the separator character, so back-to-back
    references like "#111 #222" lost the second one — a test case now pins
    the fixed behaviour. The byte-identical dead copy of ISSUE_MATCH_IN_BODY
    in dev/assign_cherry_picked_prs_with_milestone.py is removed so grep
    leads only to the live definition.
    
    Generated-by: Claude Code (Fable 5)
---
 dev/assign_cherry_picked_prs_with_milestone.py          |  1 -
 .../commands/release_management_commands.py             |  2 +-
 dev/breeze/tests/test_release_management_commands.py    | 17 +++++++++++++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/dev/assign_cherry_picked_prs_with_milestone.py 
b/dev/assign_cherry_picked_prs_with_milestone.py
index fa05455dd3e..9c4280524b3 100755
--- a/dev/assign_cherry_picked_prs_with_milestone.py
+++ b/dev/assign_cherry_picked_prs_with_milestone.py
@@ -47,7 +47,6 @@ console = Console(width=400, color_system="standard")
 MY_DIR_PATH = os.path.dirname(__file__)
 SOURCE_DIR_PATH = os.path.abspath(os.path.join(MY_DIR_PATH, os.pardir))
 PR_PATTERN = re.compile(r".*\(#([0-9]+)\)")
-ISSUE_MATCH_IN_BODY = re.compile(r" #([0-9]+)[^0-9]")
 
 CHANGELOG_CHANGES_FILE = "changelog-changes.txt"
 DOC_ONLY_CHANGES_FILE = "doc-only-changes.txt"
diff --git 
a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py 
b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
index c308278d2d3..c7efa5a2fd3 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -256,7 +256,7 @@ MY_DIR_PATH = os.path.dirname(__file__)
 SOURCE_DIR_PATH = str(AIRFLOW_ROOT_PATH)
 PR_PATTERN = re.compile(r".*\(#([0-9]+)\)")
 PR_REFERENCE_PATTERN = re.compile(r"#([0-9]+)")
-ISSUE_MATCH_IN_BODY = re.compile(r" #([0-9]+)[^0-9]")
+ISSUE_MATCH_IN_BODY = re.compile(r" #([0-9]+)(?![0-9])")
 # Release-management commits (provider documentation / release preparation) 
are pure
 # release-process noise: they are not user-facing changes and existing 
providers already
 # exclude them (the release tooling parks them in the changelog's excluded 
section). Match
diff --git a/dev/breeze/tests/test_release_management_commands.py 
b/dev/breeze/tests/test_release_management_commands.py
index 6c16bfa1c83..a29519b331e 100644
--- a/dev/breeze/tests/test_release_management_commands.py
+++ b/dev/breeze/tests/test_release_management_commands.py
@@ -23,6 +23,7 @@ import pytest
 
 from airflow_breeze.commands import release_management_commands
 from airflow_breeze.commands.release_management_commands import (
+    ISSUE_MATCH_IN_BODY,
     _ensure_default_python_for_reproducible_client,
     _is_initial_provider_release,
     _should_include_provider_in_issue,
@@ -292,3 +293,19 @@ def 
test_get_package_version_possibly_from_stable_txt_for_java_sdk(
         stable_txt.parent.mkdir(parents=True)
         stable_txt.write_text(stable_txt_content)
     assert get_package_version_possibly_from_stable_txt("java-sdk") == 
expected_version
+
+
[email protected](
+    ("body", "expected"),
+    [
+        ("Some description closes: #12345 and more text", [12345]),
+        # reference at the very end of the body (e.g. "Fixes #53843" as the 
last line)
+        ("Generated-by: some agent Fixes #53843", [53843]),
+        ("related: #111, also see #222", [111, 222]),
+        ("adjacent references see #111 #222", [111, 222]),
+        ("no references here", []),
+        ("PR#123 without space is not a reference", []),
+    ],
+)
+def test_issue_match_in_body(body: str, expected: list[int]):
+    assert [int(m.group(1)) for m in ISSUE_MATCH_IN_BODY.finditer(body)] == 
expected

Reply via email to