buildbot
buildbot copied to clipboard
GitPoller is silently ignored
Hi, I stumbled over a bug where GitPollers are silently ignored when two or more are configured with the same repourl.
In the following simplified example, only the second poller will "survive". The logs contain no warning or error message:
config['change_source'].append(
changes.GitPoller(
project='a',
repourl='https://github.com/buildbot/buildbot.git',
branches='3.4.x',
pollinterval=60
)
)
config['change_source'].append(
changes.GitPoller(
project='b',
repourl='https://github.com/buildbot/buildbot.git',
branches='3.6.x',
pollinterval=60
)
)
Potential explanation: If no GitPoller name is provided, it is implicitly set to the repourl in the GitPoller class. During reconfiguration the BuildbotServiceManager class converts the configuration list to a dictionary. Since dictionary elements are unique, the second GitPoller overwrites the first one.
There are two quick workarounds that came to my mind:
- explicitly setting the GitPoller name (confirmed working)
- or converting the list of GitPoller configurations to a dictionary
Ideas for potential fixes:
- append something unique to the implicit GitPoller name, e.g. the object
id() - warn the user about "duplicate" GitPollers when converting the configuration to a dictionary
Cheers, Jan