Opened 5 years ago

Last modified 4 years ago

#2542 new enhancement

GitPoller fails on branch not existing, but doesnt poll the other branches

Reported by: mlakewood Owned by:
Priority: major Milestone: 0.9.+
Version: 0.8.7p1 Keywords: git
Cc: underplank@…

Description

Hi,

My git poller is setup like so

GitPoller?(

'git://192.168.1.118/repo/', workdir='gitpoller-workdir', branches=['master', 'develop', 'something', 'feature'], pollinterval=30)

No If one of these branches is not available. ie someone deleted the branch on the repository that we are polling, the we get the following error:

2013-08-06 16:16:50+0800 [-] while polling for changes

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 380, in callback

self._startRunCallbacks(result)

File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 488, in _startRunCallbacks

self._runCallbacks()

File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 575, in _runCallbacks

current.result = callback(current.result, *args, kw)

File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1126, in gotResult

_inlineCallbacks(r, g, deferred)

--- <exception caught here> ---

File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1068, in _inlineCallbacks

result = result.throwExceptionIntoGenerator(g)

File "/usr/local/lib/python2.7/dist-packages/twisted/python/failure.py", line 389, in throwExceptionIntoGenerator

return g.throw(self.type, self.value, self.tb)

File "/usr/local/lib/python2.7/dist-packages/buildbot/changes/gitpoller.py", line 109, in poll

[self.repourl] + refspecs, path=self.workdir)

File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 575, in _runCallbacks

current.result = callback(current.result, *args, kw)

File "/usr/local/lib/python2.7/dist-packages/buildbot/changes/gitpoller.py", line 238, in _convert_nonzero_to_failure

% (code, stderr))

exceptions.EnvironmentError?: command failed with exit code 128: fatal: Couldn't find remote ref develop

I think its good it throws this error. The issue I have is that it stops the other polling from continuing, So if you have a few branches and you delete one of them the entire buildbot setup stops working.

What IMHO is that it loops through, fails for than branch, and continues with the others?

Change History (6)

comment:1 Changed 5 years ago by mlakewood

  • Cc underplank@… added

Sorry, What I wanted to say on the last line is

What IMHO is a better behavior is that it loops through the branches, fails for than branch, and continues with the others?

comment:2 Changed 5 years ago by dustin

  • Milestone changed from undecided to 0.8.+
  • Type changed from undecided to enhancement

We don't have a good way for GitPoller (or anything not part of a build) to report errors right now, except for logging to the master log. So, yes, I think that logging this failure and moving on to the next branch is the right thing to do. Do you want to work up a patch to do so, with tests and all that?

comment:3 Changed 5 years ago by mlakewood

Sure, i'll have a crack. Any pointers on where to start looking, im not vary familiar with where the GitPoller? tests etc are.

comment:4 Changed 5 years ago by dustin

Cool! They're in master/buildbot/changes/gitpoller.py and master/buildbot/test/unit/test_changes_gitpoller.py

comment:5 Changed 5 years ago by dustin

  • Keywords git added; GitPoller removed

comment:6 Changed 4 years ago by dustin

  • Milestone changed from 0.8.+ to 0.9.+

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.