diff options
author | Buildbot system user <buildbot@medusa> | 2020-03-20 13:12:51 +0000 |
---|---|---|
committer | Buildbot system user <buildbot@medusa> | 2020-03-20 13:12:51 +0000 |
commit | 6aa84f52f206a42a0869aeb92bdcb0662dfe555b (patch) | |
tree | b4abe0e5968a0303227a7ea88d89e92c5bac41f9 | |
parent | bb3b836984adf1171a53577831e4601ba54030a9 (diff) |
More update
-rw-r--r-- | gitmaildirsource.py | 53 | ||||
-rwxr-xr-x | master.cfg | 3 |
2 files changed, 2 insertions, 54 deletions
diff --git a/gitmaildirsource.py b/gitmaildirsource.py index 0ba5a75..752f6cc 100644 --- a/gitmaildirsource.py +++ b/gitmaildirsource.py @@ -29,15 +29,6 @@ class GitMaildirSource(MaildirSource): logger('Processing git mail') - # Initialize variables. We need this to verify that all the necessary - # values were obtained from the email. - author = "" - revision = "" - comments = "" - files = [] - repository = "" - branch = "" - list = m["list-id"] logger("list '%s'" % list) @@ -103,50 +94,6 @@ class GitMaildirSource(MaildirSource): repository = repobaseurl + repository logger("repo URL '%s'" % repository) - # Iterate over all the lines in the message - for line in m.get_payload(decode=True).decode(m.get_content_charset()).splitlines(): -# logger("%s " % line) - - # Mails sent by post-receive-email hook may contain more than - # one commit, meaning that there may be several authors. After - # the email has gone through a mailing list server (e.g. - # lists.sourceforge.net) it's difficult to parse the committer - # from the email. Therefore here we simply use the last author - # as the author of this Change object. - if line.startswith("Author: "): - author = line[8:].strip() - logger("author '%s'" % author) - - if line.startswith("Commit: "): - revision = line[8:].strip() - logger("revision '%s'" % revision) - - match = re.search(r"^commit ([0-9a-fA-f]*)$", line) - if match: - revision = match.group(1) - logger("revision '%s'" % revision) - - match = re.search(r" (\S*) +\| +\d* [-+]*", line) - if match: - file = match.group(1) - logger("file '%s'" % file) - files.append(file) - - # Check that none of the required variables is empty - if author == "": - logger("Couldn't find author in mail") - return None - - if len(revision) != 40: - logger("Revision is unusual length") - - # Get current time and use it as the commit time - when = util.now() - -# return ('git', dict(author=author, files=files, comments=comments, -# revision=revision, when=when, branch=branch, -# repository=repository)) - # trigger a poll of the git repository using a webstatus change hook # this gives a much more accurate result than trying to parse the email # (note the curl must be run asynchronously, as the HTTP POST can't be processed by this thread until after we return from here) @@ -65,7 +65,8 @@ c['builders'].extend(BuilderList(['allegra'])) c['www'] = { 'port': 8010, 'plugins': {'console_view': True}, - 'allowed_origins': ['http://medusa:8010'], + 'allowed_origins': ['http://medusa:8010', 'http://dronecode.duckdns.org:8010'], + 'change_hook_dialects': {'poller' : True}, } ####### REPORTERS |