diff options
author | Simon Westphahl <simon.westphahl@bmw.de> | 2022-11-25 13:19:24 +0100 |
---|---|---|
committer | Simon Westphahl <simon.westphahl@bmw.de> | 2022-11-30 07:11:10 +0100 |
commit | cb3cc6bd4b8a7f33bde81e8fb3088279afc03dfa (patch) | |
tree | 32cfabf6a01e7f05488ba80f5a9ac413681f71bb /zuul/driver | |
parent | 5443a0f51bbd9060bf36ac37fd3f08d237adc04b (diff) | |
download | zuul-cb3cc6bd4b8a7f33bde81e8fb3088279afc03dfa.tar.gz |
Consider queue settings for topic dependencies
Most of a change's attributes are tenant-independent. This however is
different for topic dependencies, which should only be considered in
tenants where the dependencies-by-topic feature is enabled.
This is mainly a problem when a project is part of multiple tenants as
the dependencies-by-topic setting might be different for each tenant. To
fix this we will only return the topic dependencies for a change in
tenants where the feature has been activated.
Since the `needs_changes` property is now a method called
`getNeedsChanges()`, we also changed `needed_by_changes` to
`getNeededByChanges()` so they match.
Change-Id: I343306db0abbe2fbf98ddb3f81b6d509eaf4a2bf
Diffstat (limited to 'zuul/driver')
-rw-r--r-- | zuul/driver/zuul/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/zuul/driver/zuul/__init__.py b/zuul/driver/zuul/__init__.py index 6dd6ff1b9..5051f99e5 100644 --- a/zuul/driver/zuul/__init__.py +++ b/zuul/driver/zuul/__init__.py @@ -23,6 +23,7 @@ from zuul.driver.zuul.zuulmodel import ZuulTriggerEvent from zuul.driver.zuul import zuulmodel from zuul.driver.zuul import zuultrigger from zuul.lib.logutil import get_annotated_logger +from zuul.model import Change PARENT_CHANGE_ENQUEUED = 'parent-change-enqueued' PROJECT_CHANGE_MERGED = 'project-change-merged' @@ -121,7 +122,7 @@ class ZuulDriver(Driver, TriggerInterface): log = get_annotated_logger(self.log, event) log.debug("Checking for changes needing %s:" % change) - if not hasattr(change, 'needed_by_changes'): + if not isinstance(change, Change): log.debug(" %s does not support dependencies" % type(change)) return @@ -129,7 +130,8 @@ class ZuulDriver(Driver, TriggerInterface): # numbers of github installations. This can be improved later # with persistent storage of dependency information. needed_by_changes = set( - pipeline.manager.resolveChangeReferences(change.needed_by_changes)) + pipeline.manager.resolveChangeReferences( + change.getNeededByChanges())) for source in self.sched.connections.getSources(): log.debug(" Checking source: %s", source.connection.connection_name) |