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

eladkal 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 8bf7986db4c Set Automatic Notice for providers CHANGELOG when there's 
a min airflow bump (#50476)
8bf7986db4c is described below

commit 8bf7986db4c8db81bc26374e56d5fa11b2793bdf
Author: Amogh Desai <[email protected]>
AuthorDate: Mon May 12 15:51:28 2025 +0530

    Set Automatic Notice for providers CHANGELOG when there's a min airflow 
bump (#50476)
    
    * Set automatic notice for providers changelog for airflow min version bump
    
    * fixing tests
---
 .../commands/release_management_commands.py            | 17 ++++++++++-------
 .../prepare_providers/provider_documentation.py        | 18 ++++++++++++++----
 .../templates/CHANGELOG_TEMPLATE.rst.jinja2            | 10 ++++++++++
 3 files changed, 34 insertions(+), 11 deletions(-)

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 f09a80f5ae0..935b8165b66 100644
--- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py
@@ -854,13 +854,15 @@ def prepare_provider_documentation(
             ):
                 if not only_min_version_update and not reapply_templates_only:
                     get_console().print("Updating documentation for the latest 
release version.")
-                    with_breaking_changes, maybe_with_new_features = 
update_release_notes(
-                        provider_id,
-                        reapply_templates_only=reapply_templates_only,
-                        base_branch=base_branch,
-                        regenerate_missing_docs=reapply_templates_only,
-                        non_interactive=non_interactive,
-                        only_min_version_update=only_min_version_update,
+                    with_breaking_changes, maybe_with_new_features, 
with_min_airflow_version_bump = (
+                        update_release_notes(
+                            provider_id,
+                            reapply_templates_only=reapply_templates_only,
+                            base_branch=base_branch,
+                            regenerate_missing_docs=reapply_templates_only,
+                            non_interactive=non_interactive,
+                            only_min_version_update=only_min_version_update,
+                        )
                     )
                 update_min_airflow_version_and_build_files(
                     provider_id=provider_id,
@@ -880,6 +882,7 @@ def prepare_provider_documentation(
                         with_breaking_changes=with_breaking_changes,
                         maybe_with_new_features=maybe_with_new_features,
                         only_min_version_update=only_min_version_update,
+                        
with_min_airflow_version_bump=with_min_airflow_version_bump,
                     )
         except PrepareReleaseDocsNoChangesException:
             no_changes_packages.append(provider_id)
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 c86fe75b867..844b3c1790f 100644
--- a/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
+++ b/dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py
@@ -722,7 +722,7 @@ def update_release_notes(
     regenerate_missing_docs: bool,
     non_interactive: bool,
     only_min_version_update: bool,
-) -> tuple[bool, bool]:
+) -> tuple[bool, bool, bool]:
     """Updates generated files.
 
     This includes the readme, changes, and provider.yaml files.
@@ -732,7 +732,7 @@ def update_release_notes(
     :param base_branch: base branch to check changes in apache remote for 
changes
     :param regenerate_missing_docs: whether to regenerate missing docs
     :param non_interactive: run in non-interactive mode (useful for CI)
-    :return: tuple of two bools: (with_breaking_change, 
maybe_with_new_features)
+    :return: tuple of three bools: (with_breaking_change, 
maybe_with_new_features, with_min_airflow_version_bump)
     """
     proceed, list_of_list_of_changes, changes_as_table = 
_get_all_changes_for_package(
         provider_id=provider_id,
@@ -744,6 +744,7 @@ def update_release_notes(
     maybe_with_new_features = False
     original_provider_yaml_content: str | None = None
     marked_for_release = False
+    with_min_airflow_version_bump = False
     if not reapply_templates_only:
         if proceed:
             if non_interactive:
@@ -770,7 +771,7 @@ def update_release_notes(
             answer = user_confirm(f"Does the provider: {provider_id} have any 
changes apart from 'doc-only'?")
             if answer == Answer.NO:
                 _mark_latest_changes_as_documentation_only(provider_id, 
list_of_list_of_changes)
-                return with_breaking_changes, maybe_with_new_features
+                return with_breaking_changes, maybe_with_new_features, False
             change_table_len = len(list_of_list_of_changes[0])
             table_iter = 0
             global SHORT_HASH_TO_TYPE_DICT
@@ -786,6 +787,10 @@ def update_release_notes(
                     f" by referring to the above table[/]"
                 )
                 type_of_change = 
_ask_the_user_for_the_type_of_changes(non_interactive=non_interactive)
+
+                if type_of_change == TypeOfChange.MIN_AIRFLOW_VERSION_BUMP:
+                    with_min_airflow_version_bump = True
+
                 change_hash = list_of_list_of_changes[0][table_iter].short_hash
                 SHORT_HASH_TO_TYPE_DICT[change_hash] = type_of_change
                 type_of_current_package_changes.append(type_of_change)
@@ -899,7 +904,7 @@ def update_release_notes(
         provider_details.documentation_provider_distribution_path,
         regenerate_missing_docs,
     )
-    return with_breaking_changes, maybe_with_new_features
+    return with_breaking_changes, maybe_with_new_features, 
with_min_airflow_version_bump
 
 
 def _find_insertion_index_for_version(content: list[str], version: str) -> 
tuple[int, bool]:
@@ -970,6 +975,7 @@ def _generate_new_changelog(
     context: dict[str, Any],
     with_breaking_changes: bool,
     maybe_with_new_features: bool,
+    with_min_airflow_version_bump: bool = False,
 ):
     latest_version = provider_details.versions[0]
     current_changelog = provider_details.changelog_path.read_text()
@@ -1012,6 +1018,7 @@ def _generate_new_changelog(
                 "version": latest_version,
                 "version_header": "." * len(latest_version),
                 "classified_changes": classified_changes,
+                "min_airflow_version_bump": with_min_airflow_version_bump,
             }
         )
         generated_new_changelog = render_template(
@@ -1082,6 +1089,7 @@ def update_changelog(
     with_breaking_changes: bool,
     maybe_with_new_features: bool,
     only_min_version_update: bool,
+    with_min_airflow_version_bump: bool,
 ):
     """Internal update changelog method.
 
@@ -1091,6 +1099,7 @@ def update_changelog(
     :param with_breaking_changes: whether there are any breaking changes
     :param maybe_with_new_features: whether there are any new features
     :param only_min_version_update: whether to only update the min version
+    :param with_min_airflow_version_bump: whether there is a min airflow 
version bump anywhere
     """
     provider_details = get_provider_details(package_id)
     jinja_context = get_provider_documentation_jinja_context(
@@ -1120,6 +1129,7 @@ def update_changelog(
             context=jinja_context,
             with_breaking_changes=with_breaking_changes,
             maybe_with_new_features=maybe_with_new_features,
+            with_min_airflow_version_bump=with_min_airflow_version_bump,
         )
     get_console().print(f"\n[info]Update index.rst for {package_id}\n")
     _update_index_rst(jinja_context, package_id, 
provider_details.documentation_provider_distribution_path)
diff --git 
a/dev/breeze/src/airflow_breeze/templates/CHANGELOG_TEMPLATE.rst.jinja2 
b/dev/breeze/src/airflow_breeze/templates/CHANGELOG_TEMPLATE.rst.jinja2
index 53e70714068..97912a1becd 100644
--- a/dev/breeze/src/airflow_breeze/templates/CHANGELOG_TEMPLATE.rst.jinja2
+++ b/dev/breeze/src/airflow_breeze/templates/CHANGELOG_TEMPLATE.rst.jinja2
@@ -20,6 +20,16 @@
 {{ version }}
 {{ version_header }}
 
+
+{%- if min_airflow_version_bump %}
+
+.. note::
+    This release of provider is only available for Airflow X.X+ as explained 
in the
+    Apache Airflow providers support policy 
<https://github.com/apache/airflow/blob/main/PROVIDERS.rst#minimum-supported-version-of-airflow-for-community-managed-providers>_.
+
+{%- endif %}
+
+
 {%- if WITH_BREAKING_CHANGES and classified_changes.breaking_changes %}
 
 Breaking changes

Reply via email to