Skip to content

Commit 0df206d

Browse files
committed
Fix retest title change
Fix #538
1 parent 4376dc8 commit 0df206d

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

snapshot_manager/snapshot_manager/github_util.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ def initial_comment(self) -> str:
137137
def last_updated_html(cls) -> str:
138138
return f"<p><b>Last updated: {datetime.datetime.now().isoformat()}</b></p>"
139139

140-
@property
141-
def issue_title(self) -> str:
140+
def issue_title(self, strategy: str = None, yyyymmdd: str = None) -> str:
142141
"""Constructs the issue title we want to use"""
143-
strategy = self.config.build_strategy
144-
llvm_release = util.get_release_for_yyyymmdd(self.config.yyyymmdd)
145-
llvm_git_revision = util.get_git_revision_for_yyyymmdd(self.config.yyyymmdd)
146-
return f"Snapshot for {self.config.yyyymmdd}, v{llvm_release}, {llvm_git_revision[:7]} ({strategy})"
142+
if strategy is None:
143+
strategy = self.config.build_strategy
144+
if yyyymmdd is None:
145+
yyyymmdd = self.config.yyyymmdd
146+
llvm_release = util.get_release_for_yyyymmdd(yyyymmdd)
147+
llvm_git_revision = util.get_git_revision_for_yyyymmdd(yyyymmdd)
148+
return f"Snapshot for {yyyymmdd}, v{llvm_release}, {llvm_git_revision[:7]} ({strategy})"
147149

148150
def create_or_get_todays_github_issue(
149151
self,
@@ -164,7 +166,7 @@ def create_or_get_todays_github_issue(
164166

165167
issue = repo.create_issue(
166168
assignee=maintainer_handle,
167-
title=self.issue_title,
169+
title=self.issue_title(),
168170
body=self.initial_comment,
169171
)
170172
self.create_labels_for_strategies(labels=[strategy])

snapshot_manager/snapshot_manager/snapshot_manager.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ def retest(
139139
new_comment_body = self.remove_chroot_html_comment(
140140
comment_body=new_comment_body, chroot=chroot
141141
)
142-
issue.edit(body=new_comment_body, title=self.github.issue_title)
142+
issue.edit(
143+
body=new_comment_body,
144+
title=self.github.issue_title(strategy=strategy, yyyymmdd=yyyymmdd),
145+
)
143146

144147
# Kick off a new workflow run and pass the exact date in YYYYMMDD
145148
# form because we don't know if the issue was for today
@@ -222,7 +225,7 @@ def check_todays_builds(self) -> None:
222225
{build_status_matrix}
223226
{tf.TestingFarmRequest.dict_to_html_comment(requests)}
224227
"""
225-
issue.edit(body=comment_body, title=self.github.issue_title)
228+
issue.edit(body=comment_body, title=self.github.issue_title())
226229

227230
logging.info("Filter testing-farm requests by chroot of interest")
228231
new_requests = dict()
@@ -388,7 +391,7 @@ def check_todays_builds(self) -> None:
388391
{build_status_matrix}
389392
{tf.TestingFarmRequest.dict_to_html_comment(requests)}
390393
"""
391-
issue.edit(body=comment_body, title=self.github.issue_title)
394+
issue.edit(body=comment_body, title=self.github.issue_title())
392395

393396
logging.info("Checking if issue can be closed")
394397
# issue.update()
@@ -407,7 +410,9 @@ def check_todays_builds(self) -> None:
407410
logging.info(msg)
408411
issue.create_comment(body=msg)
409412
issue.edit(
410-
state="closed", state_reason="completed", title=self.github.issue_title
413+
state="closed",
414+
state_reason="completed",
415+
title=self.github.issue_title(),
411416
)
412417
# TODO(kwk): Promotion of issue goes here.
413418
else:

0 commit comments

Comments
 (0)