This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-3-test by this push:
new ebed80a3fb0 [v3-3-test] Write doc-only marker when change
classification overrides the answer (#72167) (#72195)
ebed80a3fb0 is described below
commit ebed80a3fb09d63130cf13de8d1899566b481989
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Aug 28 16:26:55 2026 +0200
[v3-3-test] Write doc-only marker when change classification overrides the
answer (#72167) (#72195)
While preparing provider documentation the release manager is asked whether
a provider has changes beyond doc-only. Answering yes then classifies each
change individually, and that classification can conclude every change is
documentation. The provider is doc-only after all, but the
'.latest-doc-only-change.txt' marker was left untouched, so the next release
wave replays the same changes and asks about them again.
(cherry picked from commit dca333a6484b1de98099c6253c171110692c0be5)
Co-authored-by: Niko Oliveira <[email protected]>
---
.../prepare_providers/provider_documentation.py | 4 +++
dev/breeze/tests/test_provider_documentation.py | 38 ++++++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git
a/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
b/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
index 0a3053f1184..5f0fa711df7 100644
--- a/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
+++ b/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
@@ -925,6 +925,10 @@ def update_release_notes(
f"[special]{TYPE_OF_CHANGE_DESCRIPTION[type_of_change]}"
)
console_print()
+ if type_of_change == TypeOfChange.DOCUMENTATION:
+ # Classification can override the answer given above. Without
the marker the next
+ # wave replays these same changes.
+ _mark_latest_changes_as_documentation_only(provider_id,
list_of_list_of_changes)
bump = False
if type_of_change == TypeOfChange.MIN_AIRFLOW_VERSION_BUMP:
bump = True
diff --git a/dev/breeze/tests/test_provider_documentation.py
b/dev/breeze/tests/test_provider_documentation.py
index b1048452071..3d357304d03 100644
--- a/dev/breeze/tests/test_provider_documentation.py
+++ b/dev/breeze/tests/test_provider_documentation.py
@@ -19,6 +19,7 @@ from __future__ import annotations
import random
import string
from pathlib import Path
+from unittest import mock
import pytest
@@ -28,6 +29,7 @@ from airflow_breeze.prepare_providers.provider_documentation
import (
VERSION_MINOR_INDEX,
VERSION_PATCHLEVEL_INDEX,
Change,
+ PrepareReleaseDocsChangesOnlyException,
TypeOfChange,
_convert_git_changes_to_table,
_find_insertion_index_for_version,
@@ -38,7 +40,12 @@ from airflow_breeze.prepare_providers.provider_documentation
import (
classify_change_deterministically,
get_most_impactful_change,
get_version_tag,
+ update_release_notes,
)
+from airflow_breeze.utils.confirm import Answer
+from airflow_breeze.utils.packages import ProviderPackageDetails
+
+PROVIDER_DOCUMENTATION =
"airflow_breeze.prepare_providers.provider_documentation"
CHANGELOG_CONTENT = """
Changelog
@@ -532,3 +539,34 @@ def test_classify_change_deterministically(files_class,
subject, expected):
classification, reason = classify_change_deterministically("amazon",
_make_change(subject))
assert classification == expected
assert reason, "a non-empty reason must always be returned"
+
+
[email protected](f"{PROVIDER_DOCUMENTATION}.get_provider_details")
[email protected](f"{PROVIDER_DOCUMENTATION}.classify_provider_pr_files",
return_value="documentation")
[email protected](f"{PROVIDER_DOCUMENTATION}.user_confirm", return_value=Answer.YES)
[email protected](f"{PROVIDER_DOCUMENTATION}._get_all_changes_for_package")
+def test_doc_only_marker_written_when_classification_overrides_user_answer(
+ mock_get_all_changes, _mock_user_confirm, _mock_classify,
mock_get_provider_details, tmp_path
+):
+ """Every change classifying as documentation makes the provider doc-only,
whatever the release
+ manager answered."""
+ (tmp_path / "docs").mkdir()
+ marker_file = tmp_path / "docs" / ".latest-doc-only-change.txt"
+ change = _make_change("Fix a typo in the amazon docs")
+ mock_get_all_changes.return_value = (False, [[change]], "")
+ provider_details = mock.MagicMock(spec=ProviderPackageDetails)
+ provider_details.provider_id = "amazon"
+ provider_details.root_provider_path = tmp_path
+ mock_get_provider_details.return_value = provider_details
+
+ with pytest.raises(PrepareReleaseDocsChangesOnlyException):
+ update_release_notes(
+ provider_id="amazon",
+ reapply_templates_only=False,
+ base_branch="main",
+ regenerate_missing_docs=False,
+ non_interactive=False,
+ only_min_version_update=False,
+ )
+
+ assert marker_file.read_text().strip() == change.full_hash