ColtenOuO commented on code in PR #71836:
URL: https://github.com/apache/airflow/pull/71836#discussion_r3847443205


##########
dev/breeze/src/airflow_breeze/commands/release_management_commands.py:
##########
@@ -1051,6 +1069,10 @@ def prepare_provider_documentation(
     for provider_id in provider_distributions:
         try:
             provider_metadata = basic_provider_checks(provider_id)
+            if mark_doc_only:
+                with ci_group(f"Marking '{provider_id}' as doc-only"):
+                    drop_provider_to_doc_only(provider_id, 
base_branch=base_branch)
+                continue

Review Comment:
   ```suggestion
               if mark_doc_only:
                   with ci_group(f"Marking '{provider_id}' as doc-only"):
                       drop_provider_to_doc_only(provider_id, 
base_branch=base_branch)
   ```
   
   
   
   `drop_provider_to_doc_only` always raise 
`PrepareReleaseDocsChangesOnlyException()`, so I think we can remove the 
`continue` ? This helps prevent confusion for anyone reading or debugging the 
flow in the future.
   
   



##########
dev/breeze/src/airflow_breeze/prepare_providers/provider_documentation.py:
##########
@@ -588,6 +588,37 @@ def _mark_latest_changes_as_documentation_only(
     raise PrepareReleaseDocsChangesOnlyException()
 
 
+def drop_provider_to_doc_only(provider_id: str, base_branch: str) -> None:

Review Comment:
   Do we need to pay special attention to the case where a provider is on its 
first release? I noticed that if the provider is on its first release, it 
doesn't seem to get written to `.latest-doc-only-change.txt`, so a future 
release might pick up the previous commits again for classification, causing 
some redundant work.
   
   repo test:
   
   ```python
   
@mock.patch("airflow_breeze.prepare_providers.provider_documentation.run_command")
   
@mock.patch("airflow_breeze.prepare_providers.provider_documentation.clear_cache_for_provider_metadata")
   
@mock.patch("airflow_breeze.prepare_providers.provider_documentation.get_provider_yaml")
   
@mock.patch("airflow_breeze.prepare_providers.provider_documentation.get_provider_details")
   def 
test_drop_provider_to_doc_only_on_never_released_provider_loses_the_change(
       mock_details, mock_yaml, mock_clear_cache, mock_run, tmp_path
   ):
       docs = tmp_path / "docs"
       docs.mkdir()
       (docs / "changelog.rst").write_text("changelog")
       provider_yaml = tmp_path / "provider.yaml"
       provider_yaml.write_text("versions: [1.0.0]")
   
       mock_details.return_value = mock.MagicMock(
           versions=["1.0.0"],
           root_provider_path=tmp_path,
           possible_old_provider_paths=[],
       )
       mock_yaml.return_value = provider_yaml
   
       full_hash = "b" * 40
       git_log_line = f"{full_hash} {full_hash[:7]} 2026-01-01 Add new provider 
(#100)\n"
       mock_run.side_effect = [
           mock.MagicMock(),  # git checkout <base_branch> -- provider.yaml 
changelog.rst
           mock.MagicMock(returncode=1),  # git rev-parse <tag> -> tag does not 
exist yet
           mock.MagicMock(stdout=git_log_line),  # git log for the (only) 
version's changes
       ]
   
       with pytest.raises(PrepareReleaseDocsNoChangesException):
           drop_provider_to_doc_only("amazon", base_branch="main")
   
       assert not (docs / ".latest-doc-only-change.txt").exists()
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to