Skip to content

Commit e71f830

Browse files
committed
fix github search_issues outcome
This is a hack: normally the `PaginagedList[Issue]` type handles this for us but without this hack no issue being found.
1 parent b37e8e6 commit e71f830

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

snapshot_manager/snapshot_manager/github_util.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,18 @@ def get_todays_github_issue(
107107
# label:broken_snapshot_detected
108108
query = f"is:issue repo:{github_repo} author:{creator} label:strategy/{strategy} {self.config.yyyymmdd} in:title"
109109
issues = self.github.search_issues(query)
110-
if issues is not None and issues.totalCount > 0:
110+
if issues is None:
111+
logging.info(f"Found no issue for today ({self.config.yyyymmdd})")
112+
return None
113+
114+
# This is a hack: normally the PaginagedList[Issue] type handles this
115+
# for us but without this hack no issue being found.
116+
issues.get_page(0)
117+
if issues.totalCount > 0:
111118
logging.info(
112119
f"Found today's ({self.config.yyyymmdd}) issue: {issues[0].html_url}"
113120
)
114121
return issues[0]
115-
logging.info(f"Found no issue for today ({self.config.yyyymmdd})")
116-
return None
117122

118123
@property
119124
def initial_comment(self) -> str:

snapshot_manager/tests/testing_farm_util_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def test_make_with_missing_compose(self):
2525
issue = gh.get_todays_github_issue(
2626
strategy="big-merge", github_repo="fedora-llvm-team/llvm-snapshots"
2727
)
28+
assert issue is not None
2829

2930
with self.assertRaises(SystemError):
3031
tf.TestingFarmRequest.make(

0 commit comments

Comments
 (0)