Lee-W commented on code in PR #76575:
URL: https://github.com/apache/airflow/pull/76575#discussion_r4509527068


##########
dev/registry/tests/test_fill_durable_versions.py:
##########
@@ -0,0 +1,204 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for dev/registry/fill_durable_versions.py."""

Review Comment:
   We should remove it. It doesn't really provide much value



##########
dev/breeze/src/airflow_breeze/commands/registry_commands.py:
##########
@@ -145,7 +145,28 @@ def extract_data(python: str, provider: str | None, 
allow_unreleased: bool):
         bring_compose_project_down(preserve_volumes=False, 
shell_params=shell_params)
         remove_docker_networks([f"{unique_project_name}_default"])
         fix_ownership_using_docker()
-    sys.exit(result.returncode)
+    if result.returncode:
+        sys.exit(result.returncode)
+
+    # Dating a durable module needs the providers-* tags, so it runs here 
rather than beside
+    # the module extraction in the container.
+    with ci_group("Dating durable modules"):
+        versions_result = run_command(
+            [
+                "uv",
+                "run",
+                "--project",
+                str(DEV_REGISTRY_DIR),
+                "python",
+                str(DEV_REGISTRY_DIR / "fill_durable_versions.py"),
+                "--modules",
+                str(DEV_REGISTRY_DIR / "output" / "modules.json"),

Review Comment:
   This path never exists.
   
   The extractor writes `dev/registry/modules.json`, and the CI Copy step then 
overwrites `registry/src/_data/modules.json` with that unfilled file, so the 
second target gets reset too. Point fill at `dev/registry/modules.json`.
   



##########
dev/registry/tests/test_fill_durable_versions.py:
##########
@@ -0,0 +1,204 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Unit tests for dev/registry/fill_durable_versions.py."""
+
+from __future__ import annotations
+
+import json
+from unittest import mock
+
+import pytest
+from fill_durable_versions import (
+    build_source_path,
+    durable_group,
+    find_first_releases,
+    get_released_tags,
+    main,
+)
+
+POD_PATH = 
"providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/pod.py"
+POD_CLASS = 
"airflow.providers.cncf.kubernetes.operators.pod.KubernetesPodOperator"
+
+
[email protected](autouse=True)
+def clear_tag_cache():
+    get_released_tags.cache_clear()
+    yield
+    get_released_tags.cache_clear()
+
+
+def fake_git(tags=(), matches=()):
+    """Stand in for run_git: `tag --list` returns tags, `grep` returns 
tag:path lines."""
+
+    def run(*args):
+        if args[0] == "tag":
+            return list(tags)
+        if args[0] == "grep":

Review Comment:
   `run_git` returns `[]` for every failure and for `git grep` exit 1 alike, so 
a broken checkout ends as "No providers-* tags" with exit 0. Only exit code 1 
from `git grep` is "no match"; other errors should reach stderr and make `main` 
return non-zero.
   



-- 
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