Skip to content
Merged
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
1 change: 0 additions & 1 deletion dev/assign_cherry_picked_prs_with_milestone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
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])")
Comment thread
shahar1 marked this conversation as resolved.
# 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
17 changes: 17 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,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


@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]),
Comment thread
shahar1 marked this conversation as resolved.
("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