Skip to content

Commit adbc740

Browse files
authored
Merge pull request #125 from kellda/link-treeclosed
Link the "tree is currently closed" message to the treeclosed request
2 parents 091c353 + 1c79465 commit adbc740

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

homu/main.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ def change_treeclosed(self, value, src):
394394

395395
def blocked_by_closed_tree(self):
396396
treeclosed = self.repos[self.repo_label].treeclosed
397-
return treeclosed if self.priority < treeclosed else None
397+
return (treeclosed if self.priority < treeclosed else None,
398+
self.repos[self.repo_label].treeclosed_src)
398399

399400
def start_testing(self, timeout):
400401
self.test_started = time.time() # FIXME: Save in the local database
@@ -601,11 +602,11 @@ def parse_commands(body, username, user_id, repo_label, repo_cfg, state,
601602
approver=approver,
602603
bot=my_username,
603604
))
604-
treeclosed = state.blocked_by_closed_tree()
605+
treeclosed, treeclosed_src = state.blocked_by_closed_tree()
605606
if treeclosed:
606607
state.add_comment(
607-
':evergreen_tree: The tree is currently closed for pull requests below priority {}, this pull request will be tested once the tree is reopened' # noqa
608-
.format(treeclosed)
608+
':evergreen_tree: The tree is currently [closed]({}) for pull requests below priority {}, this pull request will be tested once the tree is reopened' # noqa
609+
.format(treeclosed_src, treeclosed)
609610
)
610611
state.change_labels(LabelEvent.APPROVED)
611612

0 commit comments

Comments
 (0)