Skip to content

Commit

Permalink
Add tree closure message
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jan 25, 2017
1 parent 0c619eb commit a9ac157
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions homu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ def fake_merge(self, repo_cfg):
def change_treeclosed(self, value):
self.repos[self.repo_label].update_treeclosed(value)

def blocked_by_closed_tree(self):
treeclosed = self.repos[self.repo_label].treeclosed
return treeclosed if self.priority < treeclosed else None


def sha_cmp(short, full):
return len(short) >= 4 and short == full[:len(short)]
Expand Down Expand Up @@ -398,6 +402,9 @@ def parse_commands(body, username, repo_cfg, state, my_username, db, states, *,
state.add_comment(':scream_cat: {} Please try again with `{:.7}`.'.format(msg, state.head_sha))
else:
state.add_comment(':pushpin: Commit {:.7} has been approved by `{}`\n\n<!-- @{} r={} {} -->'.format(state.head_sha, approver, my_username, approver, state.head_sha))
treeclosed = state.blocked_by_closed_tree()
if treeclosed:
state.add_comment(':evergreen_tree: The tree is currently closed for pull requests below priority {}, this pull request will be tested once the tree is reopened'.format(treeclosed))

elif word == 'r-':
if not verify_auth(username, repo_cfg, state, AuthState.REVIEWER, realtime, my_username):
Expand Down

0 comments on commit a9ac157

Please sign in to comment.