|
62 | 62 | "vagrant.vm",
|
63 | 63 | ]
|
64 | 64 |
|
| 65 | +LABELS_TO_IGNORE = [ |
| 66 | + "class-project", |
| 67 | +] |
| 68 | + |
65 | 69 | # ==============================================
|
66 | 70 | # pr_format
|
67 | 71 | # ==============================================
|
@@ -328,6 +332,14 @@ def send_email(args, subject, contents, send_from, send_to, send_cc=[]):
|
328 | 332 | # Get labels for this PR
|
329 | 333 | issue = gh.issues.get(pr.number, user=GITHUB_USER, repo=GITHUB_REPO)
|
330 | 334 | labels = [ i.name for i in issue.labels ]
|
| 335 | + |
| 336 | + # Skip any PRs with labels we should ignore |
| 337 | + should_ignore = set(labels).intersection(set(LABELS_TO_IGNORE)) |
| 338 | + if should_ignore: |
| 339 | + LOG.debug("PR %d has labels that we need to ignore: %s" % (pr.number, list(should_ignore))) |
| 340 | + continue |
| 341 | + ## IF |
| 342 | + |
331 | 343 |
|
332 | 344 | # Get events for this PR
|
333 | 345 | #events = gh.issues.events.list_by_issue(pr.number, user='cmu-db', repo=GITHUB_REPO).all()
|
@@ -470,7 +482,7 @@ def send_email(args, subject, contents, send_from, send_to, send_cc=[]):
|
470 | 482 | send_to = args["override"]
|
471 | 483 | subject = "%s PR Status Report (%s)" % (GITHUB_REPO.title(), datetime.now().strftime("%Y-%m-%d"))
|
472 | 484 |
|
473 |
| - send_email(args, subject, contents, EMAIL_FROM, send_to) |
| 485 | + send_email(args, subject, content, EMAIL_FROM, send_to) |
474 | 486 | LOG.info("Sent status email to '%s'" % send_to)
|
475 | 487 | else:
|
476 | 488 | print content
|
@@ -498,11 +510,11 @@ def send_email(args, subject, contents, send_from, send_to, send_cc=[]):
|
498 | 510 | send_to = ",".join(user_emails[reviewer])
|
499 | 511 | send_cc = [ master_sender ]
|
500 | 512 |
|
501 |
| - contents = "Please add your review for the following PR:\n\n" + \ |
502 |
| - pr_format(open_pulls[pr_num][0]) |
| 513 | + content = "Please add your review for the following PR:\n\n" + \ |
| 514 | + pr_format(open_pulls[pr_num][0]) |
503 | 515 |
|
504 |
| - send_email(args, subject, contents, EMAIL_FROM, send_to, send_cc) |
505 |
| - LOG.debug("Sent reminder email to '%s'" % send_to) |
| 516 | + send_email(args, subject, content, EMAIL_FROM, send_to, send_cc) |
| 517 | + LOG.info("Sent reminder email to '%s'" % send_to) |
506 | 518 | ## FOR
|
507 | 519 | ## FOR
|
508 | 520 | ## IF
|
|
0 commit comments