Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions dev/breeze/tests/test_release_management_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Loading