diff options
author | James E. Blair <jim@acmegating.com> | 2023-04-17 15:51:56 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2023-04-17 16:51:50 -0700 |
commit | 4e0da6221409d63124b2d8ba257df03209314a3d (patch) | |
tree | 6bd7e8abe5b9af0a56f7955df651692230cba2cf /zuul/driver | |
parent | caa6f2ba24880cf512027e7ce2e7a19213ae7db2 (diff) | |
download | zuul-4e0da6221409d63124b2d8ba257df03209314a3d.tar.gz |
Further fix getting topic changes by git needs
The test helper method that handles fake gerrit queries had a bug
which would cause the "topic:" queries to return all open changes.
When we correct that, we can see, by virtue of a newly raised
execption that there was some unexercised code in getChangesByTopic
which is now exercised. This change also corrects the exception
that is raised when mutating a set while iterating over it.
Change-Id: I1874482b2c28fd1082fcd56036afb20333232409
Diffstat (limited to 'zuul/driver')
-rw-r--r-- | zuul/driver/gerrit/gerritsource.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/zuul/driver/gerrit/gerritsource.py b/zuul/driver/gerrit/gerritsource.py index 3bf2b3a14..b0bd3c448 100644 --- a/zuul/driver/gerrit/gerritsource.py +++ b/zuul/driver/gerrit/gerritsource.py @@ -164,7 +164,9 @@ class GerritSource(BaseSource): change = self.connection._getChange(change_key) changes[change_key] = change - for change in changes.values(): + # Convert to list here because the recursive call can mutate + # the set. + for change in list(changes.values()): for git_change_ref in change.git_needs_changes: change_key = ChangeKey.fromReference(git_change_ref) if change_key in changes: |