From 782be9a9902046c7c0d282b78d7786a3cbb5b905 Mon Sep 17 00:00:00 2001 From: Simon Westphahl Date: Mon, 13 Mar 2023 12:41:19 +0100 Subject: Set cache ltime when branch protection changed When we detect newly protected branche we also need to set the branch cache ltime accordingly. Otherwise we might end up with schedulers using an outdated branch cache during reconfig and layout update which can result in config not being loaded. Change-Id: Ie18ef0ce9664e58d25f34018f8eb4513bc8b559a --- zuul/driver/github/githubconnection.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py index cffbd6769..738862974 100644 --- a/zuul/driver/github/githubconnection.py +++ b/zuul/driver/github/githubconnection.py @@ -679,6 +679,11 @@ class GithubEventProcessor(object): branch, project_name) events.append( self._branch_protection_rule_to_event(project_name, branch)) + + for event in events: + # Make sure every event has a branch cache ltime + self.connection.clearConnectionCacheOnBranchEvent(event) + return events def _branch_protection_rule_to_event(self, project_name, branch): -- cgit v1.2.1