[Buildbot-devel] buildbot/github post-receive URL timestamp problem
Matthew Morse
matt at apple.com
Tue Jul 12 19:02:02 UTC 2011
Hi,
I'm trying to trigger a buildbot run whenever there's a change to a github repo. I've added a post-receive URL service hook to the repo, and verified that the POST is making it back to my buildmaster. However, an exception is raised when that POST is processed:
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] Attempting to load module buildbot.status.web.hooks.github
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] in process_change
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:Encountered an exception:
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:Traceback (most recent call last):
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py", line 100, in getChanges
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] changes = process_change(payload, user, repo, repo_url, project)
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py", line 139, in process_change
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] when = convertTime( commit['timestamp'])
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:File "/Library/Python/2.6/site-packages/buildbot/status/web/hooks/github.py", line 63, in convertTime
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] result.groups()
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] ERROR:root:AttributeError: 'NoneType' object has no attribute 'groups'
2011-07-12 11:32:18-0700 [HTTPChannel,0,17.226.192.60] Got the following changes None
>From what I can determine, the problem is that the timestamp coming from the github repo looks like this:
"timestamp":"2011-07-12T18:32:05Z"
...but module buildbot.status.web.hooks.github is looking for something in the format:
"timestamp":"1970-01-01T00:00:00+00:00"
Here's the code (http://buildbot.net/buildbot/docs/0.8.3/reference/buildbot.status.web.hooks.github-pysrc.html):
59 def convertTime(myTestTimestamp):
60 #"1970-01-01T00:00:00+00:00"
61 matcher = re.compile(r'(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)([-+])(\d\d):(\d\d)')
62 result = matcher.match(myTestTimestamp)
63 (year, month, day, hour, minute, second, offsetsign, houroffset, minoffset) = \
64 result.groups()
Any suggestions?
Thanks,
- Matt
More information about the devel
mailing list