samraj2k commented on code in PR #73217:
URL: https://github.com/apache/airflow/pull/73217#discussion_r4023350381


##########
airflow-core/src/airflow/dag_processing/bundles/provider.py:
##########
@@ -0,0 +1,266 @@
+# 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.
+from __future__ import annotations
+
+import importlib
+import logging
+import os
+from abc import ABC, abstractmethod
+from dataclasses import dataclass
+from typing import TYPE_CHECKING, Any
+
+from pydantic import BaseModel, ValidationError
+
+from airflow._shared.module_loading import import_string
+from airflow.configuration import conf
+from airflow.dag_processing.bundles.base import BaseDagBundle  # noqa: TC001
+from airflow.exceptions import AirflowConfigException
+from airflow.providers_manager import ProvidersManager
+
+if TYPE_CHECKING:
+    from collections.abc import Sequence
+
+log = logging.getLogger(__name__)
+
+_example_dag_bundle_name = "example_dags"
+
+
+@dataclass(frozen=True)
+class DagBundleConfiguration:
+    """Configuration used by Airflow to manage a Dag bundle."""
+
+    name: str
+    team_name: str | None = None
+
+
+class DagBundleProvider(ABC):
+    """
+    Provide Dag bundle configurations and construct Dag bundles.
+
+    The configuration list is the complete set of active bundles. A bundle name
+    may remain resolvable through ``get_bundle`` after it leaves that list 
because
+    retained Dag runs can still need an older version. A name must continue to
+    identify the same bundle construction settings. Use a new name when 
settings
+    such as the bundle class, repository, branch, connection, or refresh 
interval change.
+    """
+
+    @property
+    def provides_complete_configuration(self) -> bool:
+        """Return whether each provider instance sees the complete active 
bundle list."""
+        return True
+
+    @abstractmethod
+    def get_all_bundle_configurations(self) -> 
Sequence[DagBundleConfiguration]:
+        """
+        Return the complete set of active Dag bundle configurations.
+
+        Return an empty sequence only when no bundles are active. Raise an 
exception
+        when the current configuration cannot be read so Airflow keeps the 
last valid list.
+        """
+
+    @abstractmethod
+    def get_bundle(
+        self,
+        name: str,
+        version: str | None = None,
+        version_data: dict[str, Any] | None = None,
+    ) -> BaseDagBundle:
+        """Construct a Dag bundle by name and optional version information."""
+
+
+class _ExternalBundleConfig(BaseModel):

Review Comment:
   Note to reviewers: Below methods are moved from `manager.py`



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