Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix retest title change #539

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions snapshot_manager/snapshot_manager/github_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,15 @@ def initial_comment(self) -> str:
def last_updated_html(cls) -> str:
return f"<p><b>Last updated: {datetime.datetime.now().isoformat()}</b></p>"

@property
def issue_title(self) -> str:
def issue_title(self, strategy: str = None, yyyymmdd: str = None) -> str:
"""Constructs the issue title we want to use"""
strategy = self.config.build_strategy
llvm_release = util.get_release_for_yyyymmdd(self.config.yyyymmdd)
llvm_git_revision = util.get_git_revision_for_yyyymmdd(self.config.yyyymmdd)
return f"Snapshot for {self.config.yyyymmdd}, v{llvm_release}, {llvm_git_revision[:7]} ({strategy})"
if strategy is None:
strategy = self.config.build_strategy
if yyyymmdd is None:
yyyymmdd = self.config.yyyymmdd
llvm_release = util.get_release_for_yyyymmdd(yyyymmdd)
llvm_git_revision = util.get_git_revision_for_yyyymmdd(yyyymmdd)
return f"Snapshot for {yyyymmdd}, v{llvm_release}, {llvm_git_revision[:7]} ({strategy})"

def create_or_get_todays_github_issue(
self,
Expand All @@ -164,7 +166,7 @@ def create_or_get_todays_github_issue(

issue = repo.create_issue(
assignee=maintainer_handle,
title=self.issue_title,
title=self.issue_title(),
body=self.initial_comment,
)
self.create_labels_for_strategies(labels=[strategy])
Expand Down
13 changes: 9 additions & 4 deletions snapshot_manager/snapshot_manager/snapshot_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def retest(
new_comment_body = self.remove_chroot_html_comment(
comment_body=new_comment_body, chroot=chroot
)
issue.edit(body=new_comment_body, title=self.github.issue_title)
issue.edit(
body=new_comment_body,
title=self.github.issue_title(strategy=strategy, yyyymmdd=yyyymmdd),
)

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

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

logging.info("Checking if issue can be closed")
# issue.update()
Expand All @@ -407,7 +410,9 @@ def check_todays_builds(self) -> None:
logging.info(msg)
issue.create_comment(body=msg)
issue.edit(
state="closed", state_reason="completed", title=self.github.issue_title
state="closed",
state_reason="completed",
title=self.github.issue_title(),
)
# TODO(kwk): Promotion of issue goes here.
else:
Expand Down