コード例 #1
0
def send_mail(cur, old, original):

    t = buildfarm.trees[cur.tree]
    diff = BuildDiff(t, old, cur)

    recipients = set()
    change_log = ""

    for rev in diff.revisions():
        recipients.add(rev.author)
        recipients.add(rev.committer)
        change_log += """
revision: %s
author: %s
committer: %s
message:
    %s
""" % (rev.revision, rev.author, rev.committer, rev.message)

    body = """
Broken build for tree %(tree)s on host %(host)s with compiler %(compiler)s

Tree %(tree)s is %(scm)s branch %(branch)s.

Build status for new revision %(cur_rev)s is %(cur_status)s
Build status for old revision %(old_rev)s was %(old_status)s

See %(build_link)s

The build may have been broken by one of the following commits:

%(change_log)s
    """ % {
        "tree": cur.tree, "host": cur.host, "compiler": cur.compiler,
        "change_log": change_log,
        "scm": t.scm,
        "branch": t.branch,
        "cur_rev": diff.new_rev,
        "old_rev": diff.old_rev,
        "cur_status": diff.new_status,
        "old_status": diff.old_status,
        "build_link": build_uri("http://build.samba.org/build.cgi", cur)
        }

    if original:
        body += "The failures are continued till this build %s. ", build_uri("http://build.samba.org/build.cgi", original)

    msg = MIMEText(body)
    msg["Subject"] = "BUILD of %s:%s BROKEN on %s with %s AT REVISION %s" % (cur.tree, t.branch, cur.host, cur.compiler, diff.new_rev)
    msg["From"] = "\"Build Farm\" <*****@*****.**>"
    msg["To"] = ",".join(recipients)

    if not opts.dry_run:
        smtp.sendmail(msg["From"], [msg["To"]], msg.as_string())
    else:
        print msg.as_string()
コード例 #2
0
def check_and_send_mails(cur, old):

    if cur.tree is "waf":
        # no point sending emails, as the email addresses are invalid
        return

    if cur.tree is "samba_3_waf":
        # no emails for this until it stabilises a bit
        return

    t = buildfarm.trees[cur.tree]
    diff = BuildDiff(t, old, cur)

    if not diff.is_regression():
        if opts.verbose >= 3:
            print "... hasn't regressed since %s: %s" % (diff.old_rev,
                                                         diff.old_status)
        return

    recipients = set()
    change_log = ""

    for rev in diff.revisions():
        recipients.add(rev.author)
        recipients.add(rev.committer)
        change_log += """
revision: %s
author: %s
committer: %s
message:
    %s
""" % (rev.revision, rev.author, rev.committer, rev.message)

    body = """
Broken build for tree %(tree)s on host %(host)s with compiler %(compiler)s

Tree %(tree)s is %(scm)s branch %(branch)s.

Build status for new revision %(cur_rev)s is %(cur_status)s
Build status for old revision %(old_rev)s was %(old_status)s

See %(build_link)s

The build may have been broken by one of the following commits:

%(change_log)s
    """ % {
        "tree": cur.tree,
        "host": cur.host,
        "compiler": cur.compiler,
        "change_log": change_log,
        "scm": t.scm,
        "branch": t.branch,
        "cur_rev": diff.new_rev,
        "old_rev": diff.old_rev,
        "cur_status": diff.new_status,
        "old_status": diff.old_status,
        "build_link": build_uri("https://build.samba.org/build.cgi", cur)
    }

    msg = MIMEText(body)
    msg["Subject"] = "BUILD of %s:%s BROKEN on %s with %s AT REVISION %s" % (
        cur.tree, t.branch, cur.host, cur.compiler, diff.new_rev)
    msg["From"] = "\"Build Farm\" <*****@*****.**>"
    msg["To"] = ",".join(recipients)
    if not opts.dry_run:
        smtp.sendmail(msg["From"], [msg["To"]], msg.as_string())
    else:
        print msg.as_string()
コード例 #3
0
def check_and_send_mails(cur, old):

    if cur.tree is "waf":
        # no point sending emails, as the email addresses are invalid
        return

    if cur.tree is "samba_3_waf":
        # no emails for this until it stabilises a bit
        return

    t = buildfarm.trees[cur.tree]
    diff = BuildDiff(t, old, cur)

    if not diff.is_regression():
        if opts.verbose >= 3:
            print "... hasn't regressed since %s: %s" % (diff.old_rev, diff.old_status)
        return

    recipients = set()
    change_log = ""

    for rev in diff.revisions():
        recipients.add(rev.author)
        recipients.add(rev.committer)
        change_log += """
revision: %s
author: %s
committer: %s
message:
    %s
""" % (rev.revision, rev.author, rev.committer, rev.message)

    body = """
Broken build for tree %(tree)s on host %(host)s with compiler %(compiler)s

Tree %(tree)s is %(scm)s branch %(branch)s.

Build status for new revision %(cur_rev)s is %(cur_status)s
Build status for old revision %(old_rev)s was %(old_status)s

See %(build_link)s

The build may have been broken by one of the following commits:

%(change_log)s
    """ % {
        "tree": cur.tree, "host": cur.host, "compiler": cur.compiler,
        "change_log": change_log,
        "scm": t.scm,
        "branch": t.branch,
        "cur_rev": diff.new_rev,
        "old_rev": diff.old_rev,
        "cur_status": diff.new_status,
        "old_status": diff.old_status,
        "build_link": build_uri("https://build.samba.org/build.cgi", cur)
        }

    msg = MIMEText(body)
    msg["Subject"] = "BUILD of %s:%s BROKEN on %s with %s AT REVISION %s" % (cur.tree, t.branch, cur.host, cur.compiler, diff.new_rev)
    msg["From"] = "\"Build Farm\" <*****@*****.**>"
    msg["To"] = ",".join(recipients)
    if not opts.dry_run:
        smtp.sendmail(msg["From"], [msg["To"]], msg.as_string())
    else:
        print msg.as_string()