From f21538d488e76637d77974334dd892a18efc8749 Mon Sep 17 00:00:00 2001 From: Shahar Epstein <60007259+shahar1@users.noreply.github.com> Date: Fri, 24 Jul 2026 18:09:49 +0300 Subject: [PATCH 1/2] 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. --- .../commands/release_management_commands.py | 2 +- .../tests/test_release_management_commands.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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 c308278d2d3b2..c7efa5a2fd3d6 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 @@ 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 6c16bfa1c83c5..e007569bb6fb2 100644 --- a/dev/breeze/tests/test_release_management_commands.py +++ b/dev/breeze/tests/test_release_management_commands.py @@ -23,6 +23,7 @@ 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,18 @@ 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 + + +@pytest.mark.parametrize( + ("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]), + ("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 From 0dcd7d1d57e52df8111452a12dfdb76a8ffbe14b Mon Sep 17 00:00:00 2001 From: Shahar Epstein <60007259+shahar1@users.noreply.github.com> Date: Mon, 27 Jul 2026 08:09:28 +0300 Subject: [PATCH 2/2] Address review: pin adjacent-reference behaviour, drop dead regex copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 - dev/breeze/tests/test_release_management_commands.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/assign_cherry_picked_prs_with_milestone.py b/dev/assign_cherry_picked_prs_with_milestone.py index fa05455dd3e2b..9c4280524b3d3 100755 --- a/dev/assign_cherry_picked_prs_with_milestone.py +++ b/dev/assign_cherry_picked_prs_with_milestone.py @@ -47,7 +47,6 @@ 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/tests/test_release_management_commands.py b/dev/breeze/tests/test_release_management_commands.py index e007569bb6fb2..a29519b331ec1 100644 --- a/dev/breeze/tests/test_release_management_commands.py +++ b/dev/breeze/tests/test_release_management_commands.py @@ -302,6 +302,7 @@ def test_get_package_version_possibly_from_stable_txt_for_java_sdk( # 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", []), ],