vincbeck commented on code in PR #73222:
URL: https://github.com/apache/airflow/pull/73222#discussion_r4038866078
##########
airflow-core/src/airflow/dag_processing/bundles/manager.py:
##########
@@ -130,6 +130,32 @@ def _parse_bundle_config(config_list) ->
list[_ExternalBundleConfig]:
return list(bundles.values())
+def _read_bundle_config_list() -> list[_ExternalBundleConfig]:
+ config_list = conf.getjson("dag_processor", "dag_bundle_config_list")
+ if not config_list:
+ return []
+ if not isinstance(config_list, list):
+ raise AirflowConfigException(
+ "Section `dag_processor` key `dag_bundle_config_list` "
+ f"must be list but got {config_list.__class__}"
+ )
+ return _parse_bundle_config(config_list)
+
+
+def get_configured_bundle_team_names() -> dict[str, str | None]:
+ """
+ Get the team owning each explicitly configured Dag bundle.
+
+ This reads the config rather than going through ``DagBundlesManager`` so
that callers who only
+ need the declared bundle partition neither import every bundle class nor
see the example-Dag
+ bundles that ``DagBundlesManager.parse_config`` injects when ``[core]
load_examples`` is set --
+ those are added by Airflow, not declared by the deployment.
+
+ :return: mapping of bundle name to team name, ``None`` for bundles that
are not team scoped.
+ """
+ return {cfg.name: cfg.team_name for cfg in _read_bundle_config_list()}
Review Comment:
`None` is a scope in its own right rather than "no team", so skipping it
would be wrong under multi-team: `Trigger.ids_for_triggerer` filters `team_name
IS NULL` for a triggerer started without `--team-name`, so triggers from
unscoped bundles are only ever picked up by an unscoped triggerer. Dropping
None from the expected set would report healthy for a deployment where those
triggers have nobody serving them.
On the short circuit: it is already in `_triggerer_detailed_status`, which
returns early on if not `conf.getboolean("core", "multi_team")` and never looks
at the team values in that mode.
I added a comment at the expected line spelling out why None stays in the
set.
--
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]