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

vincbeck 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 dca333a6484 Write doc-only marker when change classification overrides 
the answer (#72167)
dca333a6484 is described below

commit dca333a6484b1de98099c6253c171110692c0be5
Author: Niko Oliveira <[email protected]>
AuthorDate: Fri Aug 28 05:40:56 2026 -0700

    Write doc-only marker when change classification overrides the answer 
(#72167)
    
    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.
---
 .../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 ed1b1ee5f3a..4fcd4dd34c9 100644
--- a/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
+++ b/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
@@ -951,6 +951,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 555e467d825..9deb9b225cb 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
@@ -563,3 +570,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

Reply via email to