summaryrefslogtreecommitdiff
path: root/zuul/manager/__init__.py
diff options
context:
space:
mode:
authorDong Zhang <dong.zhang@bmw.de>2023-02-22 14:44:28 +0100
committerDong Zhang <dong.zhang@bmw.de>2023-02-23 16:20:10 +0100
commitd74d40be5302d710410cc9fd8fdaaad352f3ebe6 (patch)
treefb3af98336909dd2d12de378c92bcca2203bd960 /zuul/manager/__init__.py
parent48ad958bb4e37e165b422daaaefb59d0ab708306 (diff)
downloadzuul-d74d40be5302d710410cc9fd8fdaaad352f3ebe6.tar.gz
extra-config-files/dirs in items of a bundle should be loaded
In case of a bundle, zuul should load extra-config-paths not only from items ahead, but should from all items in that bundle. Otherwise it might throw a "invalid config" error, because the required zuul items in extra-config-paths are not found. Change-Id: I5c14bcb14b7f5c627fd9bd49f887dcd55803c6a1
Diffstat (limited to 'zuul/manager/__init__.py')
-rw-r--r--zuul/manager/__init__.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/zuul/manager/__init__.py b/zuul/manager/__init__.py
index 36361df11..104ded38a 100644
--- a/zuul/manager/__init__.py
+++ b/zuul/manager/__init__.py
@@ -1448,16 +1448,25 @@ class PipelineManager(metaclass=ABCMeta):
item.bundle and
item.bundle.updatesConfig(tenant) and tpc is not None
):
- extra_config_files = set(tpc.extra_config_files)
- extra_config_dirs = set(tpc.extra_config_dirs)
+ # Here we can not use build_set.merger_items because it does
+ # not contain the project canonical_name
+ merger_items = {item}
+ merger_items.update(item.items_ahead)
+ if item.bundle:
+ merger_items.update(item.bundle.items)
+
# Merge extra_config_files and extra_config_dirs of the
# dependent change
- for item_ahead in item.items_ahead:
- tpc_ahead = tenant.project_configs.get(
- item_ahead.change.project.canonical_name)
- if tpc_ahead:
- extra_config_files.update(tpc_ahead.extra_config_files)
- extra_config_dirs.update(tpc_ahead.extra_config_dirs)
+ extra_config_files = set()
+ extra_config_dirs = set()
+ for merger_item in merger_items:
+ merger_item_tpc = tenant.project_configs.get(
+ merger_item.change.project.canonical_name)
+ if merger_item_tpc:
+ extra_config_files.update(
+ merger_item_tpc.extra_config_files)
+ extra_config_dirs.update(
+ merger_item_tpc.extra_config_dirs)
ready = self.scheduleMerge(
item,