Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 03615a2

Browse files
authored
Merge branch 'master' into non-unique-key-fix
2 parents 8a4b56f + 0251ba3 commit 03615a2

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

script/github/github-pr-status.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
"vagrant.vm",
6363
]
6464

65+
LABELS_TO_IGNORE = [
66+
"class-project",
67+
]
68+
6569
# ==============================================
6670
# pr_format
6771
# ==============================================
@@ -328,6 +332,14 @@ def send_email(args, subject, contents, send_from, send_to, send_cc=[]):
328332
# Get labels for this PR
329333
issue = gh.issues.get(pr.number, user=GITHUB_USER, repo=GITHUB_REPO)
330334
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+
331343

332344
# Get events for this PR
333345
#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=[]):
470482
send_to = args["override"]
471483
subject = "%s PR Status Report (%s)" % (GITHUB_REPO.title(), datetime.now().strftime("%Y-%m-%d"))
472484

473-
send_email(args, subject, contents, EMAIL_FROM, send_to)
485+
send_email(args, subject, content, EMAIL_FROM, send_to)
474486
LOG.info("Sent status email to '%s'" % send_to)
475487
else:
476488
print content
@@ -498,11 +510,11 @@ def send_email(args, subject, contents, send_from, send_to, send_cc=[]):
498510
send_to = ",".join(user_emails[reviewer])
499511
send_cc = [ master_sender ]
500512

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])
503515

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)
506518
## FOR
507519
## FOR
508520
## IF

0 commit comments

Comments
 (0)